1
0
forked from 0ad/0ad

quick fix - gui doesn't compile in vc6 => remove from project

This was SVN commit r41.
This commit is contained in:
janwas 2003-11-06 19:32:45 +00:00
parent a4e9a0d374
commit 071dca65cc
3 changed files with 47 additions and 23 deletions

View File

@ -15,9 +15,9 @@
#include "vfs.h" #include "vfs.h"
#include "ia32.h" #include "ia32.h"
///// janwas I added this #ifndef NO_GUI
#include "gui/GUI.h" #include "gui/GUI.h"
///// #endif
u32 game_ticks; u32 game_ticks;
@ -118,6 +118,8 @@ static int set_vmode(int w, int h, int bpp)
} }
// break out of main loop
static bool quit = false;
static bool handler(const SDL_Event& ev) static bool handler(const SDL_Event& ev)
{ {
@ -131,7 +133,8 @@ static bool handler(const SDL_Event& ev)
switch(c) switch(c)
{ {
case SDLK_ESCAPE: case SDLK_ESCAPE:
exit(0); quit = true;
break;
} }
break; break;
@ -200,10 +203,10 @@ const float x = 600.0f, y = 512.0f;
glprintf("%d FPS", fps); glprintf("%d FPS", fps);
////// janwas #ifndef NO_GUI
glLoadIdentity(); glLoadIdentity();
g_GUI.Draw(); g_GUI.Draw();
////// #endif
// restore // restore
@ -230,13 +233,6 @@ int main(int argc, char* argv[])
detect(); detect();
///// janwas: place this wherever
new CGUI; // we should have a place for all singleton news
g_GUI.Initialize();
g_GUI.LoadXMLFile("hello.xml");
//g_GUI.LoadXMLFile("sprite1.xml");
/////
// init SDL // init SDL
if(SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_NOPARACHUTE) < 0) if(SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_NOPARACHUTE) < 0)
{ {
@ -273,11 +269,27 @@ glEnable (GL_DEPTH_TEST);
glEnable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_2D);
// TODO: all loading should go through the VFS; for now, we allow normal access
// this has to come before VFS init, as it changes the current dir
#ifndef NO_GUI
new CGUI; // we should have a place for all singleton news
g_GUI.Initialize();
g_GUI.LoadXMLFile("hello.xml");
//g_GUI.LoadXMLFile("sprite1.xml");
#endif
vfs_set_root(argv[0], "data"); vfs_set_root(argv[0], "data");
// tex = tex_load("0adlogo2.bmp"); // tex = tex_load("0adlogo2.bmp");
// tex_upload(tex); // tex_upload(tex);
font = font_load("verdana.fnt"); font = font_load("verdana.fnt");
terr_init(); terr_init();
in_add_handler(handler); in_add_handler(handler);
@ -287,7 +299,7 @@ in_add_handler(terr_handler);
const double TICK_TIME = 30e-3; // [s] const double TICK_TIME = 30e-3; // [s]
double time0 = get_time(); double time0 = get_time();
for(;;) while(!quit)
{ {
// TODO: limiter in case simulation can't keep up? // TODO: limiter in case simulation can't keep up?
double time1 = get_time(); double time1 = get_time();
@ -305,10 +317,10 @@ in_add_handler(terr_handler);
calc_fps(); calc_fps();
} }
///// Janwas place this wherever #ifndef NO_GUI
g_GUI.Destroy(); g_GUI.Destroy();
delete CGUI::GetSingletonPtr(); // again, we should have all singleton deletes somewhere delete CGUI::GetSingletonPtr(); // again, we should have all singleton deletes somewhere
///// #endif
return 0; return 0;
} }

View File

@ -235,15 +235,23 @@ SOURCE=..\gui\CGUISprite.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\gui\GUI.cpp
# End Source File
# Begin Source File
SOURCE=..\gui\GUI.h SOURCE=..\gui\GUI.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\gui\guimain.cpp SOURCE=..\gui\GUIbase.cpp
# End Source File
# Begin Source File
SOURCE=..\gui\GUIbase.h
# End Source File
# Begin Source File
SOURCE=..\gui\GUIutil.cpp
# End Source File
# Begin Source File
SOURCE=..\gui\GUIutil.h
# End Source File # End Source File
# Begin Source File # Begin Source File

View File

@ -204,12 +204,16 @@
RelativePath="..\gui\CGUISprite.cpp"/> RelativePath="..\gui\CGUISprite.cpp"/>
<File <File
RelativePath="..\gui\CGUISprite.h"/> RelativePath="..\gui\CGUISprite.h"/>
<File
RelativePath="..\gui\GUI.cpp"/>
<File <File
RelativePath="..\gui\GUI.h"/> RelativePath="..\gui\GUI.h"/>
<File <File
RelativePath="..\gui\guimain.cpp"/> RelativePath="..\gui\GUIbase.cpp"/>
<File
RelativePath="..\gui\GUIbase.h"/>
<File
RelativePath="..\gui\GUIutil.cpp"/>
<File
RelativePath="..\gui\GUIutil.h"/>
<File <File
RelativePath="..\gui\XercesErrorHandler.cpp"/> RelativePath="..\gui\XercesErrorHandler.cpp"/>
<File <File