git » fp-git.git » commit d81c228

fixedimg renamed to image. state renamed to object. coded duration for objects. added new resources and improved presentation.

author ecalot
2005-01-11 23:25:53 UTC
committer ecalot
2005-01-11 23:25:53 UTC
parent f5a9ab1ed91724d4e72c545f32e6558f46c510b7

fixedimg renamed to image. state renamed to object. coded duration for objects. added new resources and improved presentation.

FP/src/conf/anims.conf +71 -12
FP/src/conf/resources.conf +5 -1
FP/src/conf/states/titles.conf +10 -9
FP/src/include/anims.h +9 -8
FP/src/ker/kernel.c +1 -1
FP/src/res/anims.c +3 -3

diff --git a/FP/src/conf/anims.conf b/FP/src/conf/anims.conf
index 2d5dd53..af79086 100644
--- a/FP/src/conf/anims.conf
+++ b/FP/src/conf/anims.conf
@@ -1,18 +1,77 @@
 
+#   Princed V3 - Prince of Persia Level Editor for PC Version
+#   Copyright (C) 2003 Princed Development Team
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#   The authors of this program may be contacted at http://forum.princed.com.ar
 
-#Note that fixedimg with layer bottom means that state animations will be
-#drawn over them leaving the fixedimage as a background. Layer top will
-#be drawn over the state animation.
+# anims.conf: FreePrince : Animations
+# \xaf\xaf\xaf\xaf\xaf\xaf\xaf\xaf\xaf\xaf\xaf
+# Copyright 2004, 2003 Princed Development Team
+#  Created: 11 Jan 2005
+#
+#  Author: Enrique Calot <ecalot.cod@princed.com.ar>
+#
+# Note:
+#  DO NOT remove this copyright notice
+#
+
+#Note that "image"'s with layer "bottom" means that alive objects will be
+#drawn over them as if they where a background; however the layer "top"
+#will be drawn over the object animations.
+
+#Syntax:
+#for static images:
+# (number 0 to 65535) frame
+# (IMAGE|OBJECT|MIDI|WAV|SPEAKER) type
+# (string) res
+# if type is IMAGE:
+#  (number 1 to 65535|INFINITE) duration
+#  (TOP|BOTTOM) layer
+#  (number 0 to 65535|LEFT|RIGHT) x
+#  (number 0 to 65535|TOP|BOTTOM) y
+# if type is OBJECT:
+#  (number 1 to 65535|INFINITE|UNTILEXIT) duration
+#  (string) initial state
+#  (number -32768 to 32767) location
+#  (UP|MIDDLE|CENTER|DOWN|number 0 to 255) floor
+#  (YES|NO) cache mirrored images
 
 ANIMATION presentation 1000
-	#frame type     res                 Duration Layer  x    y
-	0      FIXEDIMG img_main_background 30       bottom left bottom
-	10     FIXEDIMG img_main_copyright  10       bottom 50   190
-	30     FIXEDIMG img_princess_room   infinite bottom left bottom #princess room
-	30     FIXEDIMG img_princess_bed    infinite bottom left 183    #bed
-	30     FIXEDIMG img_princess_pillar infinite top    188  124    #pillar
-	#frame type     res                 state    Location Floor   Mirror
-	40     STATE    img_jaffar          jaffar   100      center  yes
+	#titles
+	#frame type     res                 duration layer  x    y
+	0      IMAGE    img_main_background 30       bottom left bottom
+	2      IMAGE    img_main_presents   6        bottom 60   150
+	10     IMAGE    img_main_author     4        bottom 50   190
+	15     IMAGE    img_main_game_name  8        bottom 40   100
+	24     IMAGE    img_main_copyright  6        bottom 50   190
+	#text 1
+	30     IMAGE    img_text_background 10       bottom left bottom
+	30     IMAGE    img_text_in_the_absense|res_mods_bw 10 top 20 170
+	#story animation
+	40     IMAGE    img_princess_room   30       bottom left bottom #princess room
+	40     IMAGE    img_princess_bed    30       bottom left 183    #bed
+	40     IMAGE    img_princess_pillar 30       top    188  124    #pillar
+	#frame type     res                duration  initState Location Floor   Mirror
+	40     OBJECT   anim_torch         30        torch     101      up      no
+	40     OBJECT   anim_torch         30        torch     217      up      no
+	45     OBJECT   img_jaffar         untilExit jaffar    100      center  yes
+	#text 2
+	70     IMAGE    img_text_background infinite bottom left bottom
+	70     IMAGE    img_text_marry_jaffar|res_mods_bw infinite top 20 170 
 	#frame type     res
 	#0     MIDI     
 	#0     WAV      
@@ -21,5 +80,5 @@ ANIMATION presentation 1000
 
 	
 ANIMATION level1 200
-	0      STATE    img_jaffar          jaffar   100      center  no
+	0      OBJECT   img_jaffar          infinite jaffar   100      center  no
 
diff --git a/FP/src/conf/resources.conf b/FP/src/conf/resources.conf
index c551b9a..54ea493 100644
--- a/FP/src/conf/resources.conf
+++ b/FP/src/conf/resources.conf
@@ -63,7 +63,11 @@ IMG_MAIN_PRESENTS    IMG TITLES  50 52
 IMG_MAIN_AUTHOR      IMG TITLES  50 53 
 IMG_MAIN_GAME_NAME   IMG TITLES  50 54 
 IMG_MAIN_COPYRIGHT   IMG TITLES  50 55 
-IMG_TEXT_BACKGROUND  IMG TITLES  40-45
+IMG_TEXT_BACKGROUND  IMG TITLES  40-41
+IMG_TEXT_IN_THE_ABSENSE IMG TITLES  42
+IMG_TEXT_MARRY_JAFFAR   IMG TITLES  43
+IMG_TEXT_THE_TYRANT     IMG TITLES  44
+IMG_TEXT_CREDITS        IMG TITLES  45
 
 #our kid
 IMG_ALL_KID          IMG KID     400-619
diff --git a/FP/src/conf/states/titles.conf b/FP/src/conf/states/titles.conf
index df0a65e..e22436e 100644
--- a/FP/src/conf/states/titles.conf
+++ b/FP/src/conf/states/titles.conf
@@ -32,21 +32,17 @@
 #title animations
 walkingjaffar:
 	action                      Jaffar sais hi to the princess
-		conditions
-			none
 		next
 			conjuring
 		animation
 			1-19
 		steps
-			relative  5
+			relative 15
 		mark
 			jaffar
 
 conjuring:
 	action                      Jaffar conjuring
-		conditions
-			none
 		next
 			exit jaffar
 		animation
@@ -54,10 +50,17 @@ conjuring:
 		steps
 			relative 0
 
+torch:
+	action                      Lighting
+		next
+			torch
+		animation
+			1-9
+		mark
+			torch
+
 stars:
 	action                      Stars blinking
-		conditions
-			none
 		next
 			stars
 		animation
@@ -67,8 +70,6 @@ stars:
 			2
 			2
 			2
-		steps
-			relative 0
 		mark
 			stars
 			
diff --git a/FP/src/include/anims.h b/FP/src/include/anims.h
index 7a9f0f1..ea37851 100644
--- a/FP/src/include/anims.h
+++ b/FP/src/include/anims.h
@@ -40,21 +40,22 @@ anims.h: FreePrince : Animation functions
 /* table types */
 typedef struct {
 	unsigned short frame;
-	unsigned long res;
+	unsigned long  res;
 	unsigned short duration;
-	unsigned char layer;
+	unsigned char  layer;
 	unsigned short x;
 	unsigned short y;
-} animFixedimg;
+} animImage;
 
 typedef struct {
 	unsigned short frame;
-	unsigned long res;
+	unsigned long  res;
+	unsigned short duration;
 	unsigned short state;
 	unsigned short location;
-	unsigned char floor;
-	unsigned char cacheMirror;
-} animState;
+	unsigned char  floor;
+	unsigned char  cacheMirror;
+} animObject;
 
 typedef struct {
 	unsigned short frame;
@@ -63,7 +64,7 @@ typedef struct {
 } animSound;
 
 void animStart(int animId,int *qt,int *qf,int *qo);
-int animGetFrame(int* qf,int* qt,int* qo, animFixedimg** f,animState** t, animSound** o);
+int animGetFrame(int* qf,int* qt,int* qo, animImage** f,animObject** t, animSound** o);
 
 #endif
 
diff --git a/FP/src/ker/kernel.c b/FP/src/ker/kernel.c
index 82aae69..ff3d7be 100644
--- a/FP/src/ker/kernel.c
+++ b/FP/src/ker/kernel.c
@@ -196,7 +196,7 @@ int kernel(int optionflag,int level) {
 		}
 	} while(!quit);
 
-	objectFree(kid);
+	objectFree(kid); /*TODO: exiting from the story will cause a game crash because this object wasn't allocated*/
 	inputStopTimer();
 	outputStop();
 	return 0;
diff --git a/FP/src/res/anims.c b/FP/src/res/anims.c
index 42f3224..3da6ebd 100644
--- a/FP/src/res/anims.c
+++ b/FP/src/res/anims.c
@@ -46,8 +46,8 @@ typedef struct {
 	unsigned short animSize;
 } animTable;
 
-static animFixedimg fixedimg[]=ANIMS_FIXEDIMG;
-static animState state[]=ANIMS_STATE;
+static animImage fixedimg[]=ANIMS_IMAGE;
+static animObject state[]=ANIMS_OBJECT;
 static animSound sound[]=ANIMS_SOUND;
 static animTable table[]=ANIMS_TABLE;
 
@@ -62,7 +62,7 @@ void animStart(int animId,int *qf,int *qt,int *qo) {
 	*qo=rec.soundSize;
 }
 
-int animGetFrame(int* qf,int* qt,int* qo, animFixedimg** f,animState** t, animSound** o) {
+int animGetFrame(int* qf,int* qt,int* qo, animImage** f,animObject** t, animSound** o) {
 	*qf=0;
 	*qt=0;
 	*qo=0;