author | ecalot
<ecalot> 2004-08-22 23:53:16 UTC |
committer | ecalot
<ecalot> 2004-08-22 23:53:16 UTC |
parent | ae2c6ac251ff21a5fb2e6db178d8f7383b7cd16e |
FP/src/include/input.h | +1 | -1 |
FP/src/include/maps.h | +3 | -1 |
FP/src/ker/kernel.c | +2 | -2 |
FP/src/res/maps.c | +3 | -2 |
diff --git a/FP/src/include/input.h b/FP/src/include/input.h index ce962b8..e4e68ac 100644 --- a/FP/src/include/input.h +++ b/FP/src/include/input.h @@ -33,7 +33,7 @@ input.h: Free Prince : Input devices handling #ifndef _INPUT_H_ #define _INPUT_H_ -typedef enum {none=0,quit,load,reload,passLevel,showUp,showLeft,showRight,showDown,showScreens,showMoreScreens,showVersion,showTime,addTime,takeTime,addLive,addHitPoint,gotoTitles,kill,resurrect,joystick,keyboard,featherWeight,addHitpoint,invert,blind,other}tAction; +typedef enum {none=0,quit,load,reload,passLevel,showUp,showLeft,showRight,showDown,showScreens,showMoreScreens,showVersion,showTime,addTime,takeTime,addLive,addHitPoint,gotoTitles,kill,resurrect,joystick,keyboard,featherWeight,addHitpoint,invert,blind,other,save}tAction; /*#define inputIgnoreCtrl(a) (a&( ~(1<<1) ))*/ /* TODO: use inputIgnore* for each Set* */ diff --git a/FP/src/include/maps.h b/FP/src/include/maps.h index 5848fe3..3e429d4 100644 --- a/FP/src/include/maps.h +++ b/FP/src/include/maps.h @@ -38,6 +38,8 @@ maps.c: Freeprince : Map handling library #include "resources.h" /* tMemory */ #include "kid.h" /* tKid */ +#define MAP_ENVIRONMENTS {0,0,0,0,1,1,1,0,0,0,1,1,0,0,1,0} + typedef struct { tRoomId links[4*24]; unsigned char fore [24*30]; @@ -57,7 +59,7 @@ void mapDestroy(tData* map); /* called from the kernel */ tRoom mapGetRoom(tData* map, tRoomId roomId); -void mapStart(tData* map, tKid* kid, tRoomId* roomId); +void mapStart(tData* map, tKid* kid, tRoomId* roomId, int level); /* events */ void mapPressedTile(tData* map, tTile tile); diff --git a/FP/src/ker/kernel.c b/FP/src/ker/kernel.c index 3e59df7..4565af1 100644 --- a/FP/src/ker/kernel.c +++ b/FP/src/ker/kernel.c @@ -57,7 +57,7 @@ int playgame(int optionflag,int level) { /* Game loop here */ /* Initialize kid and room in the map */ - mapStart(map,&kid,&roomId); + mapStart(map,&kid,&roomId,level); room=mapGetRoom(map,roomId); /* Level loop here */ @@ -110,7 +110,7 @@ int playgame(int optionflag,int level) { level++; level%=16; map=resLoad(RES_MAP|level); - mapStart(map,&kid,&roomId); + mapStart(map,&kid,&roomId,level); room=mapGetRoom(map,roomId); printf("Kernel/playgame: cheat: Pass to level %d\n",level); break; diff --git a/FP/src/res/maps.c b/FP/src/res/maps.c index 59d43fe..098b5a8 100644 --- a/FP/src/res/maps.c +++ b/FP/src/res/maps.c @@ -220,10 +220,11 @@ tRoom mapGetRoom(tData* map, tRoomId roomAux) { return result; } -void mapStart(tData* map, tKid* kid, tRoomId *roomId) { +void mapStart(tData* map, tKid* kid, tRoomId *roomId, int level) { /* kid->x,y */ + static char environments[]=MAP_ENVIRONMENTS; *roomId=slevel(start)[0]; - printf("mapStart: binding kid to map in room %d\n",*roomId); + printf("mapStart: binding kid to map in room %d using the %d environment\n",*roomId,environments[level]); roomLoadGfx(RES_IMG_ENV_DUNGEON); }