]> git.jsancho.org Git - lugaru.git/blobdiff - Source/OpenGL_Windows.cpp
Got rid of unused "osx" global var
[lugaru.git] / Source / OpenGL_Windows.cpp
index 18f7d25bec4198ef7c5b99a160e6901dc1f6b674..d66fb7290cd1d0b351f0e7f5388dd0395095d4fc 100644 (file)
@@ -17,10 +17,16 @@ You should have received a copy of the GNU General Public License
 along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-
-#ifdef WIN32
-#include <windows.h>
-#endif
+#include <math.h>
+#include <stdio.h>
+#include <string.h>
+#include <fstream>
+#include <iostream>
+#include <zlib.h>
+#include <set>
+#include "gamegl.h"
+#include "MacCompatibility.h"
+#include "Settings.h"
 
 #include "Game.h"
 
@@ -28,6 +34,12 @@ using namespace Game;
 
 #include "openal_wrapper.h"
 
+#ifdef WIN32
+#include <windows.h>
+#include <shellapi.h>
+#include "win-res/resource.h"
+#endif
+
 extern float multiplier;
 extern float sps;
 extern float realmultiplier;
@@ -35,46 +47,20 @@ extern int slomo;
 extern bool cellophane;
 extern float texdetail;
 
-extern bool osx;
 extern bool freeze;
 extern bool stillloading;
 extern int mainmenu;
-/*extern*/
-bool gameFocused;
 
 extern float slomospeed;
 extern float slomofreq;
 extern bool visibleloading;
 
-
-
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
-#include <fstream>
-#include <iostream>
-#include <zlib.h>
-#include <set>
-#include "gamegl.h"
-#include "MacCompatibility.h"
-#include "Settings.h"
-
-#ifdef WIN32
-#include <shellapi.h>
-#include "win-res/resource.h"
-#endif
-
 extern SDL_Window *sdlwindow;
 
 using namespace std;
 
 set<pair<int,int>> resolutions;
 
-bool SetUp ();
-void DoUpdate ();
-
-void CleanUp (void);
-
 // statics/globals (internal only) ------------------------------------------
 
 #ifdef _MSC_VER
@@ -135,8 +121,6 @@ static void GLAPIENTRY glDeleteTextures_doNothing(GLsizei n, const GLuint *textu
 int kContextWidth;
 int kContextHeight;
 
-bool gDone = false;
-
 static int _argc = 0;
 static char **_argv = NULL;
 
@@ -260,7 +244,6 @@ bool SetUp ()
 {
     LOGFUNC;
 
-    osx = 0;
     cellophane = 0;
     texdetail = 4;
     slomospeed = 0.25;
@@ -684,15 +667,13 @@ int main(int argc, char **argv)
         {
             newGame();
 
-            //ofstream os("error.txt");
-            //os.close();
-            //ofstream os("log.txt");
-            //os.close();
-
             if (!SetUp ())
                 return 42;
 
-            while (!gDone && !tryquit) {
+            bool gameDone = false;
+            bool gameFocused = true;
+
+            while (!gameDone && !tryquit) {
                 if (IsFocused()) {
                     gameFocused = true;
 
@@ -705,7 +686,7 @@ int main(int argc, char **argv)
                         // message pump
                         while ( SDL_PollEvent( &e ) ) {
                             if (!sdlEventProc(e)) {
-                                gDone = true;
+                                gameDone = true;
                                 break;
                             }
                         }
@@ -740,9 +721,7 @@ int main(int argc, char **argv)
         LOG(e);
 
         MessageBox(g_windowHandle, error.what(), "ERROR", MB_OK | MB_ICONEXCLAMATION);
-    }
 
-    CleanUp();
-
-    return -1;
+        return -1;
+    }
 }