git » fp-git.git » commit d4afce8

added the sword drawing

author ecalot
2005-02-22 10:34:33 UTC
committer ecalot
2005-02-22 10:34:33 UTC
parent f8d976bb5c539b60fc4f71cda510182f07e02589

added the sword drawing

FP/src/conf/resources.conf +1 -0
FP/src/ker/room.c +6 -0

diff --git a/FP/src/conf/resources.conf b/FP/src/conf/resources.conf
index a067820..ef347f1 100644
--- a/FP/src/conf/resources.conf
+++ b/FP/src/conf/resources.conf
@@ -76,6 +76,7 @@ IMG_ALL_KID          IMG KID     400-619
 ANIM_TORCH           IMG PRINCE  150-159
 ANIM_POTION          IMG PRINCE  166-172
 IMGS_POTION_BASE     IMG PRINCE  150 162 163
+IMGS_SWORD           IMG PRINCE  150 160 161
 
 #dungeon environment
 
diff --git a/FP/src/ker/room.c b/FP/src/ker/room.c
index c4b21a3..8b54aa1 100644
--- a/FP/src/ker/room.c
+++ b/FP/src/ker/room.c
@@ -48,6 +48,7 @@ static struct {
 	tData* potionAnimGreen;
 	tData* potionAnimBlue;
 	tData* potionBase;
+	tData* sword;
 } roomGfx;
 
 void roomLoadGfx(long environment) {
@@ -64,6 +65,7 @@ void roomLoadGfx(long environment) {
 		roomGfx.potionAnimGreen=resLoad(RES_ANIM_POTION|RES_MODS_BW|RES_MODS_GREEN);
 		roomGfx.potionAnimBlue=resLoad(RES_ANIM_POTION|RES_MODS_BW|RES_MODS_BLUE);
 		roomGfx.potionBase=resLoad(RES_IMGS_POTION_BASE);
+		roomGfx.sword=resLoad(RES_IMGS_SWORD);
 	}
 }
 
@@ -75,6 +77,7 @@ void roomFree() {
 		resFree(roomGfx.potionAnimGreen);
 		resFree(roomGfx.potionAnimBlue);
 		resFree(roomGfx.potionBase);
+		resFree(roomGfx.sword);
 	}
 	roomGfx.torch=(roomGfx.environment=NULL);
 }
@@ -375,6 +378,9 @@ void drawBackPanel(tRoom* room,int x, int y) {
 	/* skeleton/this */
 	if (isIn(tile,TILES_SKELETON)) 
 		e(80,(x-1)*TILE_W+0,y*TILE_H+0);
+	/* sword/left */
+	if (isIn(left,TILES_SWORD)) 
+		outputDrawBitmap(roomGfx.sword->pFrames[(room->level->time%20)==0],(x-1)*TILE_W-15,y*TILE_H-4);
 	/* potion base/left */
 	if (isIn(left,TILES_SMALLPOTION))
 		outputDrawBitmap(roomGfx.potionBase->pFrames[0],(x-1)*TILE_W-15,y*TILE_H-4);