git » fp-git.git » commit 82a4bfd

bugfixes and new configuration

author ecalot
2005-01-08 18:27:41 UTC
committer ecalot
2005-01-08 18:27:41 UTC
parent f45c89864ff88abe10c839ac2db19bdfb7785583

bugfixes and new configuration

FP/src/conf/anims.conf +11 -11
FP/src/conf/awk/anims_conf.awk +9 -11
FP/src/conf/awk/res_conf_resources.awk +2 -2
FP/src/conf/resources.conf +9 -1
FP/src/include/anims.h +2 -4

diff --git a/FP/src/conf/anims.conf b/FP/src/conf/anims.conf
index 30ee550..8f65c33 100644
--- a/FP/src/conf/anims.conf
+++ b/FP/src/conf/anims.conf
@@ -5,17 +5,17 @@
 #be drawn over the state animation.
 
 ANIMATION presentation 1000
-	#frame type     file   pal resId Layer  x  y
-	0      FIXEDIMG PALACE 200 201   bottom        #princess room
-	0      FIXEDIMG PALACE 240 241   bottom 98 124 #bed
-	0      FIXEDIMG PALACE 240 241   top    98 124 #pillar
-	#frame type     file   state
-	0      STATE    PV     jaffar
-	#frame type     file     id
-	#0     MIDI     MIDISND1 100
-	#0     WAV      DIGISND1 100
-	#0     SPEAKER  IBM_SND1 100
-	0      SPEAKER  PCSOUND  100
+	#frame type     res                 Layer  x  y
+	0      FIXEDIMG img_princess_room   bottom        #princess room
+	0      FIXEDIMG img_princess_bed    bottom 98 124 #bed
+	0      FIXEDIMG img_princess_pillar top    98 124 #pillar
+	#frame type     res                 state
+	0      STATE    img_jaffar          jaffar
+	#frame type     res
+	#0     MIDI     
+	#0     WAV      
+	#0     SPEAKER  
+	0      SPEAKER  SND_MIDI_TITLES 
 
 	
 ANIMATION level1 200
diff --git a/FP/src/conf/awk/anims_conf.awk b/FP/src/conf/awk/anims_conf.awk
index b6a5c8f..4289dbb 100644
--- a/FP/src/conf/awk/anims_conf.awk
+++ b/FP/src/conf/awk/anims_conf.awk
@@ -58,12 +58,10 @@ BEGIN {
 /^[[:space:]]*[[:digit:]]+[[:space:]]+FIXEDIMG[[:space:]]/ {
 	totalfixedimg++
 	f["frame" totalfixedimg]=$1/1
-	f["file" totalfixedimg]=toupper($3)
-	f["pal" totalfixedimg]=$4/1
-	f["res" totalfixedimg]=$5/1
-	f["layer" totalfixedimg]=toupper($6)
-	f["x" totalfixedimg]=$7/1
-	f["y" totalfixedimg]=$8/1
+	f["res" totalfixedimg]=toupper($3)
+	f["layer" totalfixedimg]=toupper($4)
+	f["x" totalfixedimg]=$5/1
+	f["y" totalfixedimg]=$6/1
 	animation["sizef" animcount]++
 	halt
 }
@@ -72,7 +70,7 @@ BEGIN {
 /^[[:space:]]*[[:digit:]]+[[:space:]]+STATE[[:space:]]/ {
 	totalstate++
 	t["frame" totalstate]=$1/1
-	t["file" totalstate]=toupper($3)
+	t["res" totalstate]=toupper($3)
 	t["state" totalstate]=toupper($4)
 	animation["sizet" animcount]++
 	halt
@@ -82,7 +80,7 @@ BEGIN {
 /^[[:space:]]*[[:digit:]]+[[:space:]]+(MIDI|WAV|SPEAKER)[[:space:]]/ {
 	totalsound++
 	o["frame" totalsound]=$1/1
-	o["file" totalsound]=toupper($3)
+	o["res" totalsound]=toupper($3)
 	o["type" totalsound]=tolower($2)
 	animation["sizeo" animcount]++
 	halt
@@ -117,7 +115,7 @@ END {
 	coma=""
 	printf("#define ANIMS_FIXEDIMG {")
 	for (i=1;i<=totalfixedimg;i++) {
-		printf("%s\\\n\t{/*frame*/ %d,/*file*/ RES_FILE_%s, /*pal*/ %d, /*res*/ %d, /*layer*/ ANIMS_LAYERTYPE_%s, /*x,y*/ %d,%d}",coma,f["frame" i],f["file" i],f["pal" i],f["res" i],f["layer" i],f["x" i],f["y" i])
+		printf("%s\\\n\t{/*frame*/ (unsigned short)%d,/*res*/ (unsigned short)RES_%s, /*layer*/ (unsigned char)ANIMS_LAYERTYPE_%s, /*x,y*/ (unsigned short)%d,(unsigned short)%d}",coma,f["frame" i],f["res" i],f["layer" i],f["x" i],f["y" i])
 		coma=","
 	}
 	printf("\\\n}\n\n")
@@ -126,7 +124,7 @@ END {
 	coma=""
 	printf("#define ANIMS_STATE {")
 	for (i=1;i<=totalstate;i++) {
-		printf("%s\\\n\t{/*frame*/ %d,/*file*/ RES_FILE_%s, /*state*/ STATE_MARKS_%s}",coma,t["frame" i],t["file" i],t["state" i])
+		printf("%s\\\n\t{/*frame*/ %d,/*res*/ RES_%s, /*state*/ STATE_MARKS_%s}",coma,t["frame" i],t["res" i],t["state" i])
 		coma=","
 	}
 	printf("\\\n}\n\n")
@@ -135,7 +133,7 @@ END {
 	coma=""
 	printf("#define ANIMS_SOUND {")
 	for (i=1;i<=totalsound;i++) {
-		printf("%s\\\n\t{/*frame*/ %d,/*file*/ RES_FILE_%s, /*type*/ anims_enum_%s}",coma,o["frame" i],o["file" i],o["type" i])
+		printf("%s\\\n\t{/*frame*/ %d,/*res*/ RES_%s, /*type*/ anims_enum_%s}",coma,o["frame" i],o["res" i],o["type" i])
 		coma=","
 	}
 	printf("\\\n}\n\n")
diff --git a/FP/src/conf/awk/res_conf_resources.awk b/FP/src/conf/awk/res_conf_resources.awk
index d1c3044..37ddb48 100644
--- a/FP/src/conf/awk/res_conf_resources.awk
+++ b/FP/src/conf/awk/res_conf_resources.awk
@@ -52,12 +52,12 @@ BEGIN {
 			two=$inc
 			inc++
 			res++
-			filelist=(filelist coma "(short)" ((two+64)*256+(one+64)) )
+			filelist=(filelist coma "(unsigned short)" ((two+64)*256+(one+64)) )
 			coma=","
 		}
 	} else {
 		for (i=3;i<=NF;i++) {
-			if (match($i,/^[A-Z]*$/)) {
+			if (match($i,/^[A-Z]+(\+[0-9]+)?$/)) {
 				filelist=(filelist coma "RES_FILE_" $i)
 				res++
 			} else if (match($i,/^[0-9]+-[0-9]*$/)) {
diff --git a/FP/src/conf/resources.conf b/FP/src/conf/resources.conf
index 076e1e5..a083262 100644
--- a/FP/src/conf/resources.conf
+++ b/FP/src/conf/resources.conf
@@ -51,8 +51,13 @@ ANIM_RUN_TURN        IMG KID     400 465-477
 ANIM_TURNING         IMG KID     400 445-451
 ANIM_WALKING         IMG KID     400 534-544 
 GUARD_1              IMG PRINCE  GUARD 100 101
-IMG_BACKGROUND       IMG PV      950 951
 
+#titles
+IMG_PRINCESS_ROOM    IMG PV      950 951
+IMG_PRINCESS_PILLAR  IMG PV      950 952
+IMG_PRINCESS_CLOCK   IMG PV      950 953-962
+IMG_PRINCESS_BED     IMG PV      980 981
+IMG_JAFFAR           IMG PV      850-888
 #our kid
 IMG_ALL_KID          IMG KID     400-619
 
@@ -73,3 +78,6 @@ IMG_ENV_PALACE      IMG PALACE 200 232 233 234 235 236 237 238 239 240 241 242 2
 IMG_MAIN_BACKGROUND  IMG TITLES  50-55 
 IMG_TEXT_BACKGROUND  IMG TITLES  40-45
 
+#sounds
+
+SND_MIDI_TITLES      SND PCSOUND+1 1
diff --git a/FP/src/include/anims.h b/FP/src/include/anims.h
index 2d6562c..321a134 100644
--- a/FP/src/include/anims.h
+++ b/FP/src/include/anims.h
@@ -40,8 +40,6 @@ anims.h: FreePrince : Animation functions
 /* table types */
 typedef struct {
 	unsigned short frame;
-	unsigned char file;
-	unsigned short pal;
 	unsigned short res;
 	unsigned char layer;
 	unsigned short x;
@@ -50,13 +48,13 @@ typedef struct {
 
 typedef struct {
 	unsigned short frame;
-	unsigned char file;
+	unsigned short res;
 	unsigned short state;
 } animState;
 
 typedef struct {
 	unsigned short frame;
-	unsigned char file;
+	unsigned short res;
 	enum {anims_enum_midi,anims_enum_wav,anims_enum_speaker} type;
 } animSound;