diff options
author | Stijn Buys <ingar@osirion.org> | 2007-10-21 23:54:57 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2007-10-21 23:54:57 +0000 |
commit | f8e9eab39a5e96d478762d06e27ec38f80128435 (patch) | |
tree | bf55c75dbedb1212f3effa23aa6df94932edf22d /src/client/main.cc | |
parent | 621f4ad1d509665e19738525c80e104b80fb7b26 (diff) |
namespace and class cleanups
Diffstat (limited to 'src/client/main.cc')
-rw-r--r-- | src/client/main.cc | 59 |
1 files changed, 3 insertions, 56 deletions
diff --git a/src/client/main.cc b/src/client/main.cc index 76f7277..e8486ca 100644 --- a/src/client/main.cc +++ b/src/client/main.cc @@ -3,63 +3,10 @@ the terms and conditions of the GNU General Public License version 2 */ -// SDL headers -#include <SDL/SDL.h> - -// C++ headers -#include <iostream> - -// project headers -#include "osirion.h" -#include "game/game.h" - -#include "input.h" -#include "video.h" - -void quit(int status) -{ - SDL_Quit(); - exit(status); -} +#include "client.h" int main( int argc, char *argv[] ) { - std::cout << "Project::OSiRiON " << OSIRION_VERSION << std::endl; - - // Initialize the video subsystem - client::Video::init(); - if (!client::Video::initialized) { - quit(1); - } - - // initialize input - client::Input::init(); - - // initialize game - game::init(); - - Uint32 startup = SDL_GetTicks(); - while(game::initialized) { - Uint32 chrono = SDL_GetTicks(); - - // overflow protection ~49 days - if (chrono < startup) { - startup = chrono; - } - - // update the game chronometers - float elapsed = (float) ( chrono - startup) / 1000.0f; - game::update(elapsed); - - // update the video chronometers and draw - client::Video::draw(elapsed); - startup = chrono; - - // process input - client::Input::process(); - } - - client::Video::shutdown(); - - quit(0); + client::init(); + client::run(); } |