diff options
| author | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-03-15 18:35:48 +0000 |
|---|---|---|
| committer | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-03-15 18:35:48 +0000 |
| commit | b84b59153c587248ca8a6a94a6d93977e851233f (patch) | |
| tree | e13b33f09ee6ac130bb6045626618b1c5fc4d787 /src/tux.c | |
| parent | 6038f9434f1eb40caf7992ece9a3972e95a9fc11 (diff) | |
- moznost skompilovat public server bez GUI ( pomocou Makefile-publicServer )
port sa nastavuje ako ./publicserver --port <port>
- jeto iba prvotna verzia treba to este odladit a zostabilnit
git-svn-id: http://opensvn.csie.org/tuxanci_ng@18 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/tux.c')
| -rw-r--r-- | src/tux.c | 43 |
1 files changed, 37 insertions, 6 deletions
@@ -6,10 +6,6 @@ #include "main.h" #include "tux.h" -#include "image.h" -#include "sound.h" -#include "layer.h" -#include "screen_world.h" #include "shot.h" #include "gun.h" #include "wall.h" @@ -22,12 +18,27 @@ #include "dynamicInt.h" #include "proto.h" +#ifndef BUBLIC_SERVER +#include "image.h" +#include "sound.h" +#include "layer.h" +#include "screen_world.h" +#endif + +#ifdef BUBLIC_SERVER +#include "publicServer.h" +#endif + +#ifndef BUBLIC_SERVER + static SDL_Surface *g_tux_up; static SDL_Surface *g_tux_right; static SDL_Surface *g_tux_left; static SDL_Surface *g_tux_down; static SDL_Surface *g_cross; +#endif + static bool_t isTuxInit = FALSE; bool_t isTuxInicialized() @@ -37,13 +48,17 @@ bool_t isTuxInicialized() void initTux() { +#ifndef BUBLIC_SERVER assert( isImageInicialized() == TRUE ); +#endif +#ifndef BUBLIC_SERVER g_tux_up = addImageData("tux8.png", IMAGE_ALPHA, "tux8", IMAGE_GROUP_BASE); g_tux_right = addImageData("tux6.png", IMAGE_ALPHA, "tux6", IMAGE_GROUP_BASE); g_tux_left = addImageData("tux4.png", IMAGE_ALPHA, "tux4", IMAGE_GROUP_BASE); g_tux_down = addImageData("tux2.png", IMAGE_ALPHA, "tux2", IMAGE_GROUP_BASE); g_cross = addImageData("cross.png", IMAGE_ALPHA, "cross", IMAGE_GROUP_BASE); +#endif isTuxInit = TRUE; } @@ -131,6 +146,8 @@ void getCourse(int n, int *x, int *y) } } +#ifndef BUBLIC_SERVER + void drawTux(tux_t *tux) { SDL_Surface *g_image = NULL; @@ -202,6 +219,8 @@ void drawListTux(list_t *listTux) } } +#endif + tux_t* getTuxID(list_t *listTux, int id) { tux_t *thisTux; @@ -346,7 +365,9 @@ void eventTuxIsDead(tux_t *tux) return; } - playSound("dead", SOUND_GROUP_BASE); +#ifndef BUBLIC_SERVER + playSound("dead", SOUND_GROUP_BASE); +#endif printf("tux id %d is dead\n", tux->id); tux->status = TUX_STATUS_DEAD; @@ -389,7 +410,9 @@ void tuxTeleport(tux_t *tux) { int x, y; +#ifndef BUBLIC_SERVER playSound("teleport", SOUND_GROUP_BASE); +#endif printf("tux id %d teleporting\n", tux->id); if( getNetTypeGame() != NET_GAME_TYPE_CLIENT ) @@ -551,8 +574,9 @@ void switchTuxGun(tux_t *tux) return; } +#ifndef BUBLIC_SERVER playSound("switch_gun", SOUND_GROUP_BASE); - +#endif for( i = tux->gun+1 ; i < GUN_COUNT ; i++ ) { if( tux->shot[i] > 0 ) @@ -599,6 +623,11 @@ void shotTux(tux_t *tux) void actionTux(tux_t *tux, int action) { + if( tux->status != TUX_STATUS_ALIVE ) + { + return; + } + switch( action ) { case TUX_UP : @@ -678,7 +707,9 @@ void eventListTux(list_t *listTux) thisTux = (tux_t *)listTux->list[i]; assert( thisTux != NULL ); +#ifndef BUBLIC_SERVER tuxControl(thisTux); +#endif pickUpGun(thisTux); eventBonus(thisTux); eventGiveTuxItem(thisTux, getWorldArena()->listItem); |