diff options
| author | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-08-23 11:44:09 +0000 |
|---|---|---|
| committer | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-08-23 11:44:09 +0000 |
| commit | c30b18c500bd0abb3362df66448febda36ff80d0 (patch) | |
| tree | 10d762326878e5991eac9d7c788cde2f3b0d0fd2 /src/screen/screen_world.c | |
| parent | 9c72004fada0af13e4c9b4682c733056a777dc59 (diff) | |
- hotKey API
- screen-split sa da prepinat klavesou [F3]
- TCP pouziva v setsockopt parameter SO_REUSEADDR
git-svn-id: http://opensvn.csie.org/tuxanci_ng@243 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/screen/screen_world.c')
| -rw-r--r-- | src/screen/screen_world.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/screen/screen_world.c b/src/screen/screen_world.c index cbfca38..8019c86 100644 --- a/src/screen/screen_world.c +++ b/src/screen/screen_world.c @@ -22,6 +22,8 @@ #include "layer.h" #include "image.h" #include "font.h" + +#include "hotKey.h" #include "panel.h" #include "radar.h" #include "chat.h" @@ -371,18 +373,6 @@ static void control_keyboard_left(tux_t *tux) } } -static void eventEsc() -{ - Uint8 *mapa; - mapa = SDL_GetKeyState(NULL); - - if( mapa[(SDLKey)SDLK_ESCAPE] == SDL_PRESSED ) - { - setWorldEnd(); - return; - } -} - static void eventEnd() { if( isEndWorld == TRUE ) @@ -459,7 +449,6 @@ void eventWorld() { eventNetMultiplayer(); eventEnd(); - eventEsc(); return; } @@ -494,7 +483,11 @@ void eventWorld() eventTerm(); eventSaveDialog(); - eventEsc(); +} + +static void hotkey_escape() +{ + setWorldEnd(); } void startWorld() @@ -502,6 +495,8 @@ void startWorld() arena = NULL; isEndWorld = FALSE; + registerHotKey(SDLK_ESCAPE, hotkey_escape); + initArena(); initListID(); initRadar(); initPauza(); @@ -560,6 +555,9 @@ void stoptWorld() setAnalyze(); } + unregisterHotKey(SDLK_ESCAPE); + quitArena(); + quitNetMultiplayer(); if( arena != NULL ) |