diff options
| author | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-05-28 19:25:15 +0000 |
|---|---|---|
| committer | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-05-28 19:25:15 +0000 |
| commit | e5120505b21ff38dc25efcad129a440bbfa9996d (patch) | |
| tree | 583e0683fb1f71f65bb81b0fcdf2e71587e1fe46 /src/shot.c | |
| parent | c94fd664bba352732bf0e5c9a77e709b49f1aa4f (diff) | |
- zrychlenie hry, bez toho aby sa menila rychlost hlavneho casovaca
- oprava chyby v ID managery
- ID manager spravuje ID-y pre vsetky objekty
git-svn-id: http://opensvn.csie.org/tuxanci_ng@55 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/shot.c')
| -rw-r--r-- | src/shot.c | 34 |
1 files changed, 26 insertions, 8 deletions
@@ -30,7 +30,6 @@ static SDL_Surface *g_shot_bombball; #endif static bool_t isShotInit = FALSE; -static list_t *listID; bool_t isShotInicialized() { @@ -52,8 +51,6 @@ void initShot() #endif - listID = newListID(); - isShotInit = TRUE; } @@ -65,7 +62,7 @@ shot_t* newShot(int x,int y, int px, int py, int gun, int author_id) new = malloc( sizeof(shot_t) ); memset(new, 0, sizeof(shot_t) ); - new->id = getNewID(listID); + new->id = getNewID(); new->x = x; new->y = y; new->px = px; @@ -156,7 +153,7 @@ shot_t* getShotID(list_t *listShot, int id) void replaceShotID(shot_t *shot, int id) { - replaceID(listID, shot->id, id); + replaceID(shot->id, id); shot->id = id; } @@ -247,6 +244,29 @@ void boundBombBall(shot_t *shot) } } +void transformOnlyLasser(shot_t *shot) +{ + switch( shot->position ) + { + case TUX_RIGHT : + case TUX_LEFT : + shot->w = GUN_LASSER_HORIZONTAL; + shot->h = GUN_SHOT_VERTICAL; +#ifndef PUBLIC_SERVER + shot->img = g_shot_lasserX; +#endif + break; + case TUX_UP : + case TUX_DOWN : + shot->w = GUN_SHOT_VERTICAL; + shot->h = GUN_LASSER_HORIZONTAL; +#ifndef PUBLIC_SERVER + shot->img = g_shot_lasserY; +#endif + break; + } +} + void eventMoveListShot(list_t *listShot) { shot_t *thisShot; @@ -411,13 +431,11 @@ void moveShot(shot_t *shot, int position, int src_x, int src_y, void destroyShot(shot_t *p) { assert( p != NULL ); - delID(listID, p->id); + delID(p->id); free(p); } void quitShot() { - destroyListID(listID); isShotInit = FALSE; } - |