X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FOpenGL_Windows.cpp;h=de18d4a945646cd476fb0fb550f6799ced6ef663;hb=250a16d5fa14b462b44b1e698372164ac33aa721;hp=475cd99bf1632e6a85f0a5f752b1cf8d691bf384;hpb=97989f58ab13c64fbe05e629d2b2a024a2c3cfa4;p=lugaru.git
diff --git a/Source/OpenGL_Windows.cpp b/Source/OpenGL_Windows.cpp
index 475cd99..de18d4a 100644
--- a/Source/OpenGL_Windows.cpp
+++ b/Source/OpenGL_Windows.cpp
@@ -1,5 +1,6 @@
/*
Copyright (C) 2003, 2010 - Wolfire Games
+Copyright (C) 2010-2016 - Lugaru contributors (see AUTHORS file)
This file is part of Lugaru.
@@ -17,10 +18,16 @@ You should have received a copy of the GNU General Public License
along with Lugaru. If not, see .
*/
-
-#ifdef WIN32
-#include
-#endif
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "gamegl.h"
+#include "MacCompatibility.h"
+#include "Settings.h"
#include "Game.h"
@@ -28,6 +35,12 @@ using namespace Game;
#include "openal_wrapper.h"
+#ifdef WIN32
+#include
+#include
+#include "win-res/resource.h"
+#endif
+
extern float multiplier;
extern float sps;
extern float realmultiplier;
@@ -35,46 +48,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
-#include
-#include
-#include
-#include
-#include
-#include
-#include "gamegl.h"
-#include "MacCompatibility.h"
-#include "Settings.h"
-
-#ifdef WIN32
-#include
-#include "win-res/resource.h"
-#endif
-
extern SDL_Window *sdlwindow;
using namespace std;
set> resolutions;
-Boolean SetUp ();
-void DoUpdate ();
-
-void CleanUp (void);
-
// statics/globals (internal only) ------------------------------------------
#ifdef _MSC_VER
@@ -135,8 +122,6 @@ static void GLAPIENTRY glDeleteTextures_doNothing(GLsizei n, const GLuint *textu
int kContextWidth;
int kContextHeight;
-Boolean gDone = false;
-
static int _argc = 0;
static char **_argv = NULL;
@@ -256,11 +241,10 @@ static SDL_bool sdlEventProc(const SDL_Event &e)
static Point gMidPoint;
-Boolean SetUp ()
+bool SetUp ()
{
LOGFUNC;
- osx = 0;
cellophane = 0;
texdetail = 4;
slomospeed = 0.25;
@@ -684,15 +668,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 +687,7 @@ int main(int argc, char **argv)
// message pump
while ( SDL_PollEvent( &e ) ) {
if (!sdlEventProc(e)) {
- gDone = true;
+ gameDone = true;
break;
}
}
@@ -740,9 +722,7 @@ int main(int argc, char **argv)
LOG(e);
MessageBox(g_windowHandle, error.what(), "ERROR", MB_OK | MB_ICONEXCLAMATION);
- }
- CleanUp();
-
- return -1;
+ return -1;
+ }
}