summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-05-02 16:57:36 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-05-02 16:57:36 +0000
commit9058b5c0bfc9a05c9004cfbbcdd3bb85d80ed6fc (patch)
treeacf351bdd648594639005f71e7e7d8921bb70fcb /src/main.c
parent29173b3199ea526b6f9de13ee9255db3900f3f42 (diff)
- o obsluhu odstaneni streli pri vybuchu sa stara server
- server sa _nemusi_ restartovat kazdych 49 dni - uptime sa rata v sekundach, v statuse je aj nazov areny - drobne upravy v kode ( vymazanie mensej duplicity kodu ) git-svn-id: http://opensvn.csie.org/tuxanci_ng@49 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c109
1 files changed, 9 insertions, 100 deletions
diff --git a/src/main.c b/src/main.c
index c1c3371..4b14c63 100644
--- a/src/main.c
+++ b/src/main.c
@@ -10,108 +10,17 @@
#include "main.h"
#include "tux.h"
+#include "game.h"
-#ifndef PUBLIC_SERVER
+#ifdef PUBLIC_SERVER
-#include "font.h"
-#include "keytable.h"
-#include "language.h"
-#include "image.h"
-#include "layer.h"
-#include "interface.h"
-#include "screen.h"
-#include "screen_world.h"
-#include "screen_mainMenu.h"
-#include "screen_analyze.h"
-#include "screen_setting.h"
-#include "screen_gameType.h"
-#include "screen_choiceArena.h"
-#include "screen_table.h"
-#include "screen_credits.h"
-#include "homeDirector.h"
-#include "item.h"
-#include "shot.h"
-#include "arenaFile.h"
-#include "panel.h"
-#include "audio.h"
-#include "sound.h"
-#include "music.h"
+#include "publicServer.h"
#endif
static int my_argc;
static char **my_argv;
-#ifndef PUBLIC_SERVER
-
-static void init()
-{
- createHomeDirector();
-
- if( initLanguage() == -1 )
- {
- printf("fatal error !\n");
- exit(-1);
- }
-
- initSDL();
-
- initLayer();
- initFont(getLanguageFont(), getLanguageSize());
- initKeyTable();
- initImageData();
- initAudio();
- initSound();
- initMusic();
- initScreen();
- initArenaFile();
- initTux();
- initItem();
- initShot();
- initPanel();
- initWorld();
- initScreenMainMenu();
- initScreenAnalyze();
- initScreenSetting();
- initScreenGameType();
- initScreenChoiceArena();
- initScreenCredits();
- initScreenTable();
-}
-
-void quit()
-{
- quitSDL();
- quitLayer();
- quitFont();
- quitKeyTable();
- quitLanguage();
- quitScreen();
- quitArenaFile();
- quitItem();
- quitTux();
- quitShot();
- quitPanel();
- quitWorld();
- quitImageData();
- quitSound();
- quitMusic();
- quitAudio();
- quitScreenMainMenu();
- quitScreenAnalyze();
- quitScreenSetting();
- quitScreenGameType();
- quitScreenChoiceArena();
- quitScreenCredits();
- quitScreenTable();
-
- printf("quit..\n");
-
- exit(0);
-}
-
-#endif
-
char* getParam(char *s)
{
int i;
@@ -137,7 +46,6 @@ char* getParam(char *s)
return NULL;
}
-
char* getParamElse(char *s1, char *s2)
{
char *ret;
@@ -189,12 +97,13 @@ int main(int argc, char *argv[])
my_argc = argc;
my_argv = argv;
- init();
-
- setScreen("mainMenu");
+#ifndef PUBLIC_SERVER
+ startGame();
+#endif
- eventSDL();
- quit();
+#ifdef PUBLIC_SERVER
+ startPublicServer();
+#endif
return 0;
}