author | ecalot
<ecalot> 2005-01-27 16:35:24 UTC |
committer | ecalot
<ecalot> 2005-01-27 16:35:24 UTC |
parent | 211689a32bd688546fcb424542735f551cfd35ea |
FP/src/ker/room.c | +2 | -0 |
FP/src/ker/titles.c | +0 | -66 |
FP/src/res/maps.c | +11 | -2 |
FP/src/res/resources.c | +2 | -0 |
diff --git a/FP/src/ker/room.c b/FP/src/ker/room.c index c4818a8..1052903 100644 --- a/FP/src/ker/room.c +++ b/FP/src/ker/room.c @@ -555,7 +555,9 @@ void roomKidChangedFloor(tRoom* room, tObject* kid) { tTile aux; int i,j; +#ifdef ROOMDEBUG printf("kid had changed the floor. Guards and choppers may be allerted.\n"); +#endif for (j=1;j<4;j++) { for (i=1;i<10;i++) { if (isIn((aux=roomGetTile(room,i,j)),TILE_CHOPPER)) { diff --git a/FP/src/ker/titles.c b/FP/src/ker/titles.c index f5e26ae..cc62934 100644 --- a/FP/src/ker/titles.c +++ b/FP/src/ker/titles.c @@ -90,7 +90,6 @@ tMenuOption playAnimation(int id) { while(reprocessInput) { if (!inputGetEvent(&key)) { /* key pressed */ - printf("key pressed\n"); /* if there is an action and the action wasn't control key */ if (key.actionPerformed!=none && !(inputGetCtrl(key.status)&&key.actionPerformed==other)) return getAction(key); @@ -202,77 +201,12 @@ tMenuOption sleep(int ticks) { return menuNone; } -#define goodBye {resFree(main_title);return result;} - tMenuOption showTitles() { /* Show the titles animation * returns 0 if the user has finished the animations with quit * returns 1 if the user has selected to load a saved game * returns 2 if the user has selected to start the game */ -#define testing -#ifdef testing - printf("Starting animation testing\n"); - return playAnimation(ANIMS_ID_PRESENTATION); -#else - tData *main_title; - /*tData *main_text;*/ - tMenuOption result; - - main_title = resLoad(RES_IMG_MAIN_BACKGROUND); - if (! main_title) { - printf("The resource couldn't be loaded!\n"); - return menuQuit; - } - outputClearScreen(); - /* The main background */ - outputDrawBitmap(main_title->pFrames[0], 0, 200); - outputUpdateScreen(); - result=sleep(12); - if (result!=menuNone) goodBye; - /* The presents */ - outputDrawBitmap(main_title->pFrames[1], 100, 100); - outputUpdateScreen(); - result=sleep(12); - if (result!=menuNone) goodBye; - /* The author*/ - outputClearScreen(); - outputDrawBitmap(main_title->pFrames[0], 0, 200); - outputDrawBitmap(main_title->pFrames[2], 100, 100); - outputUpdateScreen(); - result=sleep(12); - if (result!=menuNone) goodBye; - /* The game name*/ - outputClearScreen(); - outputDrawBitmap(main_title->pFrames[0], 0, 200); - outputDrawBitmap(main_title->pFrames[3], 30, 70); - outputDrawBitmap(main_title->pFrames[4], 30, 190); - outputUpdateScreen(); - /*SDL_Delay(1050);*/ - result=sleep(12); - if (result!=menuNone) goodBye; - - /* - * The outputDraw doesn't support the text files yet - * - main_text = resLoad(RES_IMG_TEXT_BACKGROUND); - if (! main_text) { - printf("The resource couldn't be loaded!\n"); - return menuQuit; - } - */ - /* The presents */ - /* - outputDrawBitmap(main_text->pFrames[0], 0, 0); - outputDrawBitmap(main_text->pFrames[1], 0, 0); - outputUpdateScreen(); - */ - do { - result=sleep(1000); - } while (result==menuNone); - - goodBye; -#endif } diff --git a/FP/src/res/maps.c b/FP/src/res/maps.c index d9914c9..e132bf6 100644 --- a/FP/src/res/maps.c +++ b/FP/src/res/maps.c @@ -40,6 +40,8 @@ maps.c: Freeprince : Map handling library #define slevel(field) (map->field) +/* #define DEBUGMAPS */ + void* mapLoadLevel(tMemory level) { tMap* map=(tMap*)malloc(sizeof(tMap)); int i,j; @@ -113,7 +115,9 @@ void* mapLoadLevel(tMemory level) { map->back[i*30+j]=gateInRoom; map->screenGates[i][gateInRoom]=map->gates+gates; auxGates[i*30+j]=map->gates+gates; +#ifdef DEBUGMAPS fprintf(stderr,"mapLoadLevel: Loading gate: indexed=%d gate pointer=%p\n",i,(void*)auxGates[i*30+j]); +#endif map->gates[gates++]=newGate; gateInRoom++; /*} else if (((map->fore[i*30+j]&0x1f)==TILE_BTN_RAISE)||((map->fore[i*30+j]&0x1f)==TILE_BTN_DROP)) {*/ @@ -124,7 +128,9 @@ void* mapLoadLevel(tMemory level) { newPressable.type=((map->fore[i*30+j]&0x1f)==TILE_BTN_RAISE)?eRaise:eDrop; map->back[i*30+j]=pressableInRoom; map->screenPressables[i][pressableInRoom]=map->pressables+pressables; +#ifdef DEBUGMAPS fprintf(stderr,"mapLoadLevel: Creating button: indexed=%d,%d btn pointer=%p\n",i,pressableInRoom,(void*)(map->pressables+pressables)); +#endif map->pressables[pressables++]=newPressable; pressableInRoom++; } else if (isInGroup(map->fore[i*30+j],0,TILES_CHOPPER_SPIKE)) { @@ -135,7 +141,9 @@ void* mapLoadLevel(tMemory level) { newDanger.action=((map->fore[i*30+j]&0x1f)==TILE_CHOPPER)?eChoInactive:eSpiDown; map->back[i*30+j]=dangerInRoom; map->screenDangers[i][dangerInRoom]=map->dangers+dangers; +#ifdef DEBUGMAPS fprintf(stderr,"mapLoadLevel: Creating danger tile: indexed=%d,%d btn pointer=%p\n",i,dangerInRoom,(void*)(map->dangers+dangers)); +#endif map->dangers[dangers++]=newDanger; dangerInRoom++; } @@ -147,7 +155,6 @@ void* mapLoadLevel(tMemory level) { pressableInRoom=0; dangerInRoom=0; } -printf("Map in memory\n"); /* read event list from file and convert it into the event array in memory */ for (i=0;i<256;i++) { @@ -161,7 +168,7 @@ printf("Map in memory\n"); map->events[i].gate=auxGates[(S-1)*30+L]; /* in case of error null is assigned */ } free(auxGates); -printf("Map loaded\n"); + return (void*)map; } @@ -313,7 +320,9 @@ void mapStart(tMap* map, tObject* kid, tRoomId *roomId, int level) { /* kid->x,y */ static char environments[]=MAP_ENVIRONMENTS; *roomId=slevel(start)[0]; +#if defined DEBUGMAPS || 1 printf("mapStart: binding kid to map in room %d using the %d environment\n",*roomId,environments[level]); +#endif slevel(time)=0; roomLoadGfx(/*environments[level]?RES_IMG_ENV_PALACE:*/RES_IMG_ENV_DUNGEON); } diff --git a/FP/src/res/resources.c b/FP/src/res/resources.c index 98fe3af..773b3c3 100644 --- a/FP/src/res/resources.c +++ b/FP/src/res/resources.c @@ -244,7 +244,9 @@ void resFree(tData* res) { } else if (res->type==eLevels) { mapFreeLevel((tMap*)(res->pFrames)); /* free the map */ } +#ifdef RESOURCESDEBUG fprintf(stderr,"ResFree activated\n"); +#endif free(res); /* free the resource structure */ }