Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/main.cc')
-rw-r--r--src/client/main.cc59
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();
}