]> git.jsancho.org Git - lugaru.git/commitdiff
merge & removing debug printf. (in Settings.cpp, by myself, useless)
authorCôme BERNIGAUD <come.bernigaud@gmail.com>
Thu, 3 Jun 2010 17:56:13 +0000 (19:56 +0200)
committerCôme BERNIGAUD <come.bernigaud@gmail.com>
Thu, 3 Jun 2010 17:56:13 +0000 (19:56 +0200)
Source/GameTick.cpp
Source/OpenGL_Windows.cpp
Source/Settings.cpp
Source/WinInput.cpp

index e5e619a6e95a1a3ca4a223ddbb978d8f7f233231..dca83bc0ea4997b738e8afe592c339e307a9428b 100644 (file)
@@ -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;
index 8cfe83618deecc6249254410a40a5c01367d4f4b..16b8c82357047a24df357e809ada131ea82f87fc 100644 (file)
@@ -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;
                                }
                        }
 
index 2ee6ad19f00d4ae74764f74ceabe15ad95663082..9642cb941d04195695d466060758539295249af9 100644 (file)
@@ -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
index 8129225b4d3bf6969faab37c7ffd5c407e55c5dd..c5a59c349e653415d097c32f10bbb512c52aa602 100644 (file)
@@ -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 <string.h>
 #else
 #include <stdio.h>
 #include <stdlib.h>