diff options
| author | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-05-26 12:45:53 +0000 |
|---|---|---|
| committer | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-05-26 12:45:53 +0000 |
| commit | c94fd664bba352732bf0e5c9a77e709b49f1aa4f (patch) | |
| tree | 70936acfc33b46792ce1e3170de6a82f86edfe68 /modules | |
| parent | a1e9bc7430ca827808a502f455b20a23ba15e31a (diff) | |
- mensie upravy v kode
- navod na zostavovanie projektu
- da sa to skompilovat :D
- PS: este to nie je odladene, a musim sa ucit na prijmacky na FEI
git-svn-id: http://opensvn.csie.org/tuxanci_ng@54 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'modules')
| -rwxr-xr-x | modules/modPipe.c | 30 | ||||
| -rwxr-xr-x | modules/modTeleport.c | 29 | ||||
| -rwxr-xr-x | modules/modWall.c | 16 |
3 files changed, 45 insertions, 30 deletions
diff --git a/modules/modPipe.c b/modules/modPipe.c index fa5f99e..6f000d8 100755 --- a/modules/modPipe.c +++ b/modules/modPipe.c @@ -83,16 +83,16 @@ static void drawPipe(pipe_t *p) #endif -static pipe_t* isConflictWithListPipe(list_t *listPipe, int x, int y, int w, int h) +static pipe_t* isConflictWithListPipe(list_t *list, int x, int y, int w, int h) { pipe_t *thisPipe; int i; - assert( listPipe != NULL ); + assert( list != NULL ); - for( i = 0 ; i < listPipe->count ; i++ ) + for( i = 0 ; i < list->count ; i++ ) { - thisPipe = (pipe_t *)listPipe->list[i]; + thisPipe = (pipe_t *)list->list[i]; assert( thisPipe != NULL ); if( export_fce->fce_conflictSpace(x, y, w, h, @@ -248,15 +248,15 @@ static void moveShot(shot_t *shot, int position, int src_x, int src_y, } -static pipe_t* getPipeId(list_t *listPipe, int id) +static pipe_t* getPipeId(list_t *list, int id) { int i; - for( i = 0 ; i < listPipe->count ; i++ ) + for( i = 0 ; i < list->count ; i++ ) { pipe_t *thisPipe; - thisPipe = (pipe_t *) listPipe->list[i]; + thisPipe = (pipe_t *) list->list[i]; if( thisPipe->id == id ) { @@ -267,11 +267,11 @@ static pipe_t* getPipeId(list_t *listPipe, int id) return NULL; } -static void moveShotFromPipe(shot_t *shot, pipe_t *pipe, list_t *listPipe) +static void moveShotFromPipe(shot_t *shot, pipe_t *pipe, list_t *list) { pipe_t *distPipe; - distPipe = getPipeId(listPipe, pipe->id_out); + distPipe = getPipeId(list, pipe->id_out); if( distPipe == NULL ) { @@ -339,7 +339,12 @@ int event() pipe_t *thisPipe; arena_t *arena; int i; - +/* + if( export_fce->fce_getNetTypeGame() == NET_GAME_TYPE_CLIENT ) + { + return; + } +*/ arena = export_fce->fce_getCurrentArena(); for( i = 0 ; i < arena->listShot->count ; i++ ) @@ -365,6 +370,8 @@ int event() if( negPosition( thisShot->position ) == thisPipe->position ) { + //moveShotFromPipe(thisShot, thisPipe, listPipe); + if( export_fce->fce_getNetTypeGame() == NET_GAME_TYPE_CLIENT ) { if( thisShot->gun != GUN_BOMBBALL ) @@ -377,11 +384,12 @@ int event() { moveShotFromPipe(thisShot, thisPipe, listPipe); } + } else { if( thisShot->gun == GUN_BOMBBALL && - export_fce->fce_getNetTypeGame() != NET_GAME_TYPE_CLIENT ) + export_fce->fce_getNetTypeGame() != NET_GAME_TYPE_CLIENT ) { export_fce->fce_boundBombBall(thisShot); continue; diff --git a/modules/modTeleport.c b/modules/modTeleport.c index fb59470..0f0d41b 100755 --- a/modules/modTeleport.c +++ b/modules/modTeleport.c @@ -62,7 +62,6 @@ teleport_t* newTeleport(int x, int y, int w, int h, int layer) new->img = img; #endif - printf("new teleport\n"); return new; } @@ -77,16 +76,16 @@ static void drawTeleport(teleport_t *p) #endif -static teleport_t* isConflictWithListTeleport(list_t *listTeleport, int x, int y, int w, int h) +static teleport_t* isConflictWithListTeleport(list_t *list, int x, int y, int w, int h) { teleport_t *thisTeleport; int i; - assert( listTeleport != NULL ); + assert( list != NULL ); - for( i = 0 ; i < listTeleport->count ; i++ ) + for( i = 0 ; i < list->count ; i++ ) { - thisTeleport = (teleport_t *)listTeleport->list[i]; + thisTeleport = (teleport_t *)list->list[i]; assert( thisTeleport != NULL ); if( export_fce->fce_conflictSpace(x, y, w, h, @@ -138,15 +137,15 @@ static void cmd_teleport(char *line) addList(listTeleport, new); } -static teleport_t* getRandomTeleportBut(list_t *listTeleport, teleport_t *teleport) +static teleport_t* getRandomTeleportBut(list_t *list, teleport_t *teleport) { int x; do{ - x = random() % listTeleport->count; - }while( listTeleport->list[x] == teleport ); + x = random() % list->count; + }while( list->list[x] == teleport ); - return (teleport_t *) listTeleport->list[x]; + return (teleport_t *) list->list[x]; } static int getRandomPosition() @@ -353,11 +352,11 @@ static void moveShot(shot_t *shot, int position, int src_x, int src_y, } -static void moveShotFromTeleport(shot_t *shot, teleport_t *teleport, list_t *listTeleport) +static void moveShotFromTeleport(shot_t *shot, teleport_t *teleport, list_t *list) { teleport_t *distTeleport; - distTeleport = getRandomTeleportBut(listTeleport, teleport); + distTeleport = getRandomTeleportBut(list, teleport); moveShot(shot, getRandomPosition(), teleport->x, teleport->y, distTeleport->x, distTeleport->y, distTeleport->w, distTeleport->h); @@ -397,6 +396,11 @@ int event() arena_t *arena; int i; + if( export_fce->fce_getNetTypeGame() == NET_GAME_TYPE_CLIENT ) + { + return 0; + } + arena = export_fce->fce_getCurrentArena(); for( i = 0 ; i < arena->listTux->count ; i++ ) @@ -439,6 +443,8 @@ int event() continue; } + moveShotFromTeleport(thisShot, thisTeleport, listTeleport); +/* if( export_fce->fce_getNetTypeGame() == NET_GAME_TYPE_CLIENT ) { delListItem(arena->listShot, i, export_fce->fce_destroyShot); @@ -448,6 +454,7 @@ int event() { moveShotFromTeleport(thisShot, thisTeleport, listTeleport); } +*/ } } diff --git a/modules/modWall.c b/modules/modWall.c index 50756e8..d435613 100755 --- a/modules/modWall.c +++ b/modules/modWall.c @@ -80,16 +80,16 @@ void drawWall(wall_t *p) export_fce->fce_addLayer(p->img, p->img_x, p->img_y, 0, 0, p->img->w, p->img->h, p->layer); } -void drawListWall(list_t *listWall) +void drawListWall(list_t *list) { wall_t *thisWall; int i; - assert( listWall != NULL ); + assert( list != NULL ); - for( i = 0 ; i < listWall->count ; i++ ) + for( i = 0 ; i < list->count ; i++ ) { - thisWall = (wall_t *)listWall->list[i]; + thisWall = (wall_t *)list->list[i]; assert( thisWall != NULL ); drawWall(thisWall); } @@ -97,16 +97,16 @@ void drawListWall(list_t *listWall) #endif -wall_t* isConflictWithListWall(list_t *listWall, int x, int y, int w, int h) +wall_t* isConflictWithListWall(list_t *list, int x, int y, int w, int h) { wall_t *thisWall; int i; - assert( listWall != NULL ); + assert( list != NULL ); - for( i = 0 ; i < listWall->count ; i++ ) + for( i = 0 ; i < list->count ; i++ ) { - thisWall = (wall_t *)listWall->list[i]; + thisWall = (wall_t *)list->list[i]; assert( thisWall != NULL ); if( export_fce->fce_conflictSpace(x, y, w, h, |