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/base | |
| 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/base')
| -rw-r--r-- | src/base/arena.c | 20 | ||||
| -rw-r--r-- | src/base/arena.h | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/base/arena.c b/src/base/arena.c index 3a72eba..bab0ad3 100644 --- a/src/base/arena.c +++ b/src/base/arena.c @@ -11,6 +11,7 @@ #include "item.h" #include "myTimer.h" #include "modules.h" +#include "hotKey.h" #ifndef PUBLIC_SERVER #include "screen_world.h" @@ -30,6 +31,18 @@ arena_t* getCurrentArena() return currentArena; } +void hotkey_splitArena() +{ + if( splitType == SCREEN_SPLIT_VERTICAL ) + { + splitType = SCREEN_SPLIT_HORIZONTAL; + } + else + { + splitType = SCREEN_SPLIT_VERTICAL; + } +} + void initArena() { splitType = SCREEN_SPLIT_VERTICAL; @@ -45,6 +58,13 @@ void initArena() splitType = SCREEN_SPLIT_HORIZONTAL; printf("SCREEN_SPLIT_HORIZONTAL\n"); } + + registerHotKey(SDLK_F3, hotkey_splitArena); +} + +void quitArena() +{ + unregisterHotKey(SDLK_F3); } arena_t* newArena(int w, int h) diff --git a/src/base/arena.h b/src/base/arena.h index 1a326c3..5730bea 100644 --- a/src/base/arena.h +++ b/src/base/arena.h @@ -42,6 +42,7 @@ typedef struct arena_struct extern void setCurrentArena(arena_t *p); extern arena_t* getCurrentArena(); extern void initArena(); +extern void quitArena(); extern arena_t* newArena(int w, int h); extern int conflictSpace(int x1,int y1,int w1,int h1,int x2,int y2,int w2,int h2); extern int isFreeSpace(arena_t *arena, int x, int y, int w, int h); |