1) Renamed game_manager to main_loop.

2) Cleaned up some include files.
3) Fixed compilation of optimised version on VS.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2271 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2008-09-15 04:34:46 +00:00
parent f941785f35
commit 803f188895
9 changed files with 41 additions and 40 deletions

View File

@ -85,7 +85,7 @@ supertuxkart_SOURCES = main.cpp \
skid_mark.cpp skid_mark.hpp \
shadow.cpp shadow.hpp \
particle_system.cpp particle_system.hpp \
game_manager.cpp game_manager.hpp \
main_loop.cpp main_loop.hpp \
camera.cpp camera.hpp \
sdldrv.cpp sdldrv.hpp \
moveable.cpp moveable.hpp \

View File

@ -29,7 +29,6 @@
#include "unlock_manager.hpp"
#include "widget_manager.hpp"
#include "race_manager.hpp"
#include "game_manager.hpp"
#include "user_config.hpp"
#include "menu_manager.hpp"
#include "kart_properties.hpp"

View File

@ -39,7 +39,7 @@
#include "race_results_gui.hpp"
#include "grand_prix_ending.hpp"
#include "race_manager.hpp"
#include "game_manager.hpp"
#include "main_loop.hpp"
#include "race_menu.hpp"
#include "help_page_one.hpp"
#include "help_page_two.hpp"
@ -200,7 +200,7 @@ void MenuManager::update()
break;
case MENUID_EXITGAME:
m_menu_stack.clear();
game_manager->abort();
main_loop->abort();
break;
case MENUID_CONFIG_CONTROLS:

View File

@ -604,7 +604,7 @@
<Tool
Name="VCCLCompilerTool"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../../src;../../../src/bullet/src;&quot;$(STK_INCLUDE)&quot;"
AdditionalIncludeDirectories="../../../src;../../../src/bullet/src;&quot;$(STK_INCLUDE)&quot;;../../../src/enet/include"
PreprocessorDefinitions="HAVE_OPENAL;HAVE_OGGVORBIS;NDEBUG;_CONSOLE;WIN32;NOMINMAX;VERSION=\&quot;SVN\&quot;;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;BT_NO_PROFILE;PACKAGE=\&quot;supertuxkart\&quot;;HAS_GETTEXT;HAVE_ENET"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
@ -623,7 +623,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="opengl32.lib user32.lib gdi32.lib winmm.lib advapi32.lib SDL.lib SDLmain.lib OpenAL32.lib libogg.lib libvorbis.lib libvorbisfile.lib sg.lib ssg.lib ul.lib ssgAux.lib fnt.lib intl.lib"
AdditionalDependencies="opengl32.lib user32.lib gdi32.lib winmm.lib advapi32.lib SDL.lib SDLmain.lib OpenAL32.lib libogg.lib libvorbis.lib libvorbisfile.lib sg.lib ssg.lib ul.lib ssgAux.lib fnt.lib intl.lib ws2_32.lib"
OutputFile="./../../../$(ProjectName)_bullet.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="&quot;$(STK_LIB)&quot;"
@ -711,10 +711,6 @@
RelativePath="..\..\flyable.cpp"
>
</File>
<File
RelativePath="../../../src\game_manager.cpp"
>
</File>
<File
RelativePath="..\..\grand_prix_data.cpp"
>
@ -771,6 +767,10 @@
RelativePath="../../../src\main.cpp"
>
</File>
<File
RelativePath="..\..\main_loop.cpp"
>
</File>
<File
RelativePath="../../../src\material.cpp"
>
@ -1193,10 +1193,6 @@
RelativePath="..\..\flyable.hpp"
>
</File>
<File
RelativePath="../../../src\game_manager.hpp"
>
</File>
<File
RelativePath="..\..\grand_prix_data.hpp"
>
@ -1265,6 +1261,10 @@
RelativePath="..\..\loader.hpp"
>
</File>
<File
RelativePath="..\..\main_loop.hpp"
>
</File>
<File
RelativePath="../../../src\material.hpp"
>

View File

@ -54,7 +54,7 @@
#include "race_manager.hpp"
#include "file_manager.hpp"
#include "loader.hpp"
#include "game_manager.hpp"
#include "main_loop.hpp"
#include "gui/widget_manager.hpp"
#include "material_manager.hpp"
#include "sdldrv.hpp"
@ -491,7 +491,7 @@ int main(int argc, char *argv[] )
inputDriver = new SDLDriver ();
ssgInit () ;
game_manager = new GameManager ();
main_loop = new MainLoop();
// loadMaterials needs ssgLoadTextures (internally), which can
// only be called after ssgInit (since this adds the actual file_manager)
// so this next call can't be in InitTuxkart. And InitPlib needs
@ -520,7 +520,7 @@ int main(int argc, char *argv[] )
// This will setup the race manager etc.
history->Load();
race_manager->startNew();
game_manager->run();
main_loop->run();
// well, actually run() will never return, since
// it exits after replaying history (see history::GetNextDT()).
// So the next line is just to make this obvious here!
@ -564,7 +564,7 @@ int main(int argc, char *argv[] )
race_manager->setDifficulty(RaceManager::RD_HARD);
race_manager->startNew();
}
game_manager->run();
main_loop->run();
} // try
catch (std::exception &e)

View File

@ -1,4 +1,4 @@
// $Id: screen_manager.cpp 855 2006-11-17 01:50:37Z coz $
// $Id: main_loop.cpp 855 2006-11-17 01:50:37Z coz $
//
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2004 Ingo Ruhnke <grumbel@gmx.de>
@ -17,7 +17,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//#include <cstdlib>
#include "main_loop.hpp"
#ifdef __APPLE__
# include <OpenGL/gl.h>
@ -31,7 +31,6 @@
#include <SDL/SDL.h>
#include <assert.h>
#include "sdldrv.hpp"
#include "game_manager.hpp"
#include "gui/menu_manager.hpp"
#include "sound_manager.hpp"
#include "material_manager.hpp"
@ -42,23 +41,25 @@
#include "history.hpp"
#include "network/network_manager.hpp"
GameManager* game_manager = 0;
MainLoop* main_loop = 0;
GameManager::GameManager() :
MainLoop::MainLoop() :
m_abort(false),
m_frame_count(0),
m_curr_time(m_prev_time),
m_prev_time(SDL_GetTicks())
{
} // GameManager
} // MainLoop
//-----------------------------------------------------------------------------
GameManager::~GameManager()
MainLoop::~MainLoop()
{
} // ~GameManager
} // ~MainLoop
//-----------------------------------------------------------------------------
void GameManager::run()
/** Run the actual main loop.
*/
void MainLoop::run()
{
const GLuint TITLE_SCREEN_TEXTURE =
material_manager->getMaterial("st_title_screen.rgb")->getState()->getTextureHandle();
@ -192,9 +193,11 @@ void GameManager::run()
} // run
//-----------------------------------------------------------------------------
void GameManager::abort()
/** Set the abort flag, causing the mainloop to be left.
*/
void MainLoop::abort()
{
m_abort = true;
}
} // abort
/* EOF */

View File

@ -1,4 +1,4 @@
// $Id: screen_manager.hpp 855 2006-11-17 01:50:37Z coz $
// $Id: main_loop.hpp 855 2006-11-17 01:50:37Z coz $
//
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2004 Ingo Ruhnke <grumbel@gmx.de>
@ -17,13 +17,13 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef HEADER_SCREENMANAGER_H
#define HEADER_SCREENMANAGER_H
#ifndef HEADER_MAIN_LOOP_HPP
#define HEADER_MAIN_LOOP_HPP
#include <SDL/SDL_types.h>
/** Management class for the whole gameflow, this is where the
main-loop is */
class GameManager
class MainLoop
{
private:
bool m_abort;
@ -33,13 +33,13 @@ private:
Uint32 m_prev_time;
public:
GameManager();
~GameManager();
MainLoop();
~MainLoop();
void run();
void abort();
};
}; // MainLoop
extern GameManager* game_manager;
extern MainLoop* main_loop;
#endif

View File

@ -22,7 +22,6 @@
#include <iostream>
#include "track_manager.hpp"
#include "game_manager.hpp"
#include "kart_properties_manager.hpp"
#include "unlock_manager.hpp"
#include "gui/menu_manager.hpp"

View File

@ -31,7 +31,7 @@
#include "sdldrv.hpp"
#include "material_manager.hpp"
#include "kart_properties_manager.hpp"
#include "game_manager.hpp"
#include "main_loop.hpp"
#include "herring_manager.hpp"
#include "collectable_manager.hpp"
#include "attachment_manager.hpp"
@ -387,7 +387,7 @@ SDLDriver::input()
switch(ev.type)
{
case SDL_QUIT:
game_manager->abort();
main_loop->abort();
break;
case SDL_KEYUP: