From 6fdbdea4e65b75ac9ebda91320deb656655d3af5 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Wed, 1 Jun 2011 19:31:19 +0200 Subject: A bunch of network-related changes. --- main.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index be24747..f30f67a 100644 --- a/main.cpp +++ b/main.cpp @@ -1,9 +1,10 @@ #include "video.h" -#include "scene.h" +#include "game.h" #include "gl.h" #include +#include bool init_sdl_image() { int real_flags = IMG_Init(IMG_INIT_PNG | IMG_INIT_JPG); @@ -15,6 +16,11 @@ bool init_sdl_image() { } int main(int argc, char **argv) { + if(argc != 3) { + std::cout << (boost::format("Usage: %s HOST PORT") % argv[0]).str() << std::endl; + return 1; + } + if(!init_sdl_image()) return 1; @@ -26,22 +32,13 @@ int main(int argc, char **argv) { win32_gl_init(); #endif - Scene *scene = new Scene(); - SDL_ShowCursor(SDL_DISABLE); SDL_EnableUNICODE(1); - SDL_WarpMouse(video::width/2, video::height/2); - scene->last_time = SDL_GetTicks(); - scene->update(); - while(scene->running) { - scene->events(); - scene->render(); + Game& game = Game::get_instance(); - SDL_Delay(1); - } + game.run(argv[1], argv[2]); - delete scene; video::free(); return 0; -- cgit v1.2.3