From: Côme BERNIGAUD Date: Thu, 3 Jun 2010 17:56:13 +0000 (+0200) Subject: merge & removing debug printf. (in Settings.cpp, by myself, useless) X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=326621743b8eea53a3a040f657ad77e9f19fc7da;hp=5e808c58a6397c2cb1ae08293d2ba1fc91b15a0a;p=lugaru.git merge & removing debug printf. (in Settings.cpp, by myself, useless) --- diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index e5e619a..dca83bc 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -35,6 +35,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. using namespace std; +// Added more evilness needed for MSVC +#ifdef _MSC_VER + #define strncasecmp(s1, s2, n) _strnicmp(s1, s2, n) + #define snprintf(buf, size, format, ...) _sprintf_p(buf, size, format) +#endif + + extern float multiplier; extern XYZ viewer; extern int environment; diff --git a/Source/OpenGL_Windows.cpp b/Source/OpenGL_Windows.cpp index 8cfe836..16b8c82 100644 --- a/Source/OpenGL_Windows.cpp +++ b/Source/OpenGL_Windows.cpp @@ -899,7 +899,12 @@ int main(int argc, char **argv) } // game is not in focus, give CPU time to other apps by waiting for messages instead of 'peeking' - STUBBED("give up CPU but sniff the event queue"); + SDL_ActiveEvent evt; + SDL_WaitEvent((SDL_Event*)&evt); + if (evt.type == SDL_ACTIVEEVENT && evt.gain == 1) + gameFocused = true; + else if (evt.type == SDL_QUIT) + gDone = true; } } diff --git a/Source/Settings.cpp b/Source/Settings.cpp index 2ee6ad1..9642cb9 100644 --- a/Source/Settings.cpp +++ b/Source/Settings.cpp @@ -141,7 +141,6 @@ bool LoadSettings(Game &game) { printf("Loading config\n"); while(!ipstream.eof()) { ipstream.getline( setting, sizeof(setting) ); - printf("setting : %s\n",setting); // skip blank lines // assume lines starting with spaces are all blank diff --git a/Source/WinInput.cpp b/Source/WinInput.cpp index 8129225..c5a59c3 100644 --- a/Source/WinInput.cpp +++ b/Source/WinInput.cpp @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "SDL.h" #ifdef WIN32 -#include "String.h" +#include #else #include #include