diff options
| author | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-08-14 14:47:44 +0000 |
|---|---|---|
| committer | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-08-14 14:47:44 +0000 |
| commit | 50ba3d5e1e9f9eeda049a348efa4645af07610bc (patch) | |
| tree | 3a41428f4ce755e596a4d5c2c69668515935e5b0 /src/screen/screen_world.c | |
| parent | 5b67651831ad9b160b41990288c938c7a05c1db1 (diff) | |
- novy widget widget_choicegroup
- moznost ukladat a nacitavat rozohranu hru
( uklada sa pomocou F2)
( neda sa ulozit sietovy multiplayer, a este
nie je dokonce ulozenie hranie s AI )
git-svn-id: http://opensvn.csie.org/tuxanci_ng@195 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/screen/screen_world.c')
| -rw-r--r-- | src/screen/screen_world.c | 43 |
1 files changed, 31 insertions, 12 deletions
diff --git a/src/screen/screen_world.c b/src/screen/screen_world.c index 12da3a1..e619bbb 100644 --- a/src/screen/screen_world.c +++ b/src/screen/screen_world.c @@ -27,6 +27,8 @@ #include "chat.h" #include "pauza.h" #include "term.h" +#include "saveDialog.h" +#include "saveLoad.h" #ifndef NO_SOUND #include "music.h" @@ -43,8 +45,6 @@ static arena_t *arena; -static int count; -static int max_count; static bool_t isScreenWorldInit = FALSE; static bool_t isEndWorld; @@ -80,7 +80,12 @@ void setWorldArena(int id) void setMaxCountRound(int n) { - max_count = n; + arena->max_countRound = n; +} + +int getMaxCountRound() +{ + return arena->max_countRound; } void setWorldEnd() @@ -99,16 +104,16 @@ static void timer_endArena() void countRoundInc() { - if( count == WORLD_COUNT_ROUND_UNLIMITED || - count >= max_count ) + if( arena->max_countRound == WORLD_COUNT_ROUND_UNLIMITED || + arena->countRound >= arena->max_countRound ) { return; } - count++; + arena->countRound++; //printf("count %d/%d\n", count, max_count); - if( count >= max_count ) + if( arena->countRound >= arena->max_countRound ) { //printf("count %d ending\n", count); #ifndef NO_SOUND @@ -128,12 +133,18 @@ void prepareArena() tuxWithControlRightKeyboard = NULL; tuxWithControlLeftKeyboard = NULL; + if( getGemeTypeLoadSession() != NULL ) + { + loadArena(getGemeTypeLoadSession()); + return; + } + switch( getNetTypeGame() ) { case NET_GAME_TYPE_NONE : setWorldArena( getChoiceArenaId() ); addNewItem(arena->spaceItem, ID_UNKNOWN); - getSettingCountRound(&max_count); + getSettingCountRound(&arena->max_countRound); tux = newTux(); tux->control = TUX_CONTROL_KEYBOARD_RIGHT; @@ -156,12 +167,15 @@ void prepareArena() tux->control = TUX_CONTROL_AI; } } + + //printf("getGemeTypeLoadSession = %s\n", getGemeTypeLoadSession()); + break; case NET_GAME_TYPE_SERVER : setWorldArena( getChoiceArenaId() ); addNewItem(arena->spaceItem, ID_UNKNOWN); - getSettingCountRound(&max_count); + getSettingCountRound(&arena->max_countRound); tux = newTux(); tux->control = TUX_CONTROL_KEYBOARD_RIGHT; @@ -192,6 +206,7 @@ void drawWorld() drawChat(); drawPauza(); drawTerm(); + drawSaveDialog(); } static void netAction(tux_t *tux, int action) @@ -460,7 +475,7 @@ void eventWorld() eventNetMultiplayer(); - if( isPauzeActive() == FALSE ) + if( isPauzeActive() == FALSE && isSaveDialogActive() == FALSE ) { eventArena(arena); //eventModule(); @@ -487,6 +502,8 @@ void eventWorld() eventChat(); eventPauza(); eventTerm(); + eventSaveDialog(); + eventEsc(); } @@ -495,12 +512,12 @@ void startWorld() arena = NULL; isEndWorld = FALSE; - count = 0; - initListID(); initRadar(); initPauza(); initTerm(); + initSaveDialog(); + initModule(); setGameType(); initChat(); @@ -563,6 +580,8 @@ void stoptWorld() quitRadar(); quitPauza(); quitTerm(); + quitSaveDialog(); + #ifndef NO_SOUND stopMusic(); |