git » fp-git.git » commit 0d0f647

coded the notPressed parameter. Deprecated statesproperties configuration.

author ecalot
2005-02-28 16:34:43 UTC
committer ecalot
2005-02-28 16:34:43 UTC
parent fa32b5a1a1f32de1c6e2416ec19f43ab462f34c6

coded the notPressed parameter. Deprecated statesproperties configuration.

FP/src/Makefile +5 -5
FP/src/conf/awk/states_conf_static.awk +5 -5
FP/src/include/.cvsignore +0 -1
FP/src/include/res_conf.h +2 -2
FP/src/include/states.h +3 -0
FP/src/include/states_conf.h +3 -3
FP/src/include/tiles_conf.h +2 -2
FP/src/ker/states.c +5 -6

diff --git a/FP/src/Makefile b/FP/src/Makefile
index 288db6a..4d6e737 100644
--- a/FP/src/Makefile
+++ b/FP/src/Makefile
@@ -63,9 +63,9 @@ EXEFILE       = bin/freeprince
 GENERATEDRESHEADERS = include/res_conf_parts.h include/res_conf_files.h\
                       include/res_conf_types.h include/res_conf_mods.h\
                       include/res_conf_resources.h
-GENERATEDSTAHEADERS = include/states_conf_static.h include/states_conf_properties.h\
+GENERATEDSTAHEADERS = include/states_conf_static.h \
                       include/states_conf_flags.h
-
+#include/states_conf_properties.h
 GENERATEDTILHEADERS = include/tiles_conf_types.h include/tiles_conf_groups.h
 
 GENERATEDOTHHEADERS = include/walls_conf.h include/anims_conf.h include/text_conf.h
@@ -265,9 +265,9 @@ include/states_conf_static.h: conf/awk/states_conf_static.awk conf/states/*.conf
 	$(INFO) Creating states list configuration file...
 	$(AWK) -f conf/awk/states_conf_static.awk conf/states/*.conf>include/states_conf_static.h
 
-include/states_conf_properties.h: conf/statesproperties.conf conf/awk/states_conf_properties.awk
-	$(INFO) Creating states condition properties configuration file...
-	$(AWK) -f conf/awk/states_conf_properties.awk conf/statesproperties.conf>include/states_conf_properties.h
+#include/states_conf_properties.h: conf/statesproperties.conf conf/awk/states_conf_properties.awk
+#	$(INFO) Creating states condition properties configuration file...
+#	$(AWK) -f conf/awk/states_conf_properties.awk conf/statesproperties.conf>include/states_conf_properties.h
 
 include/states_conf_flags.h: conf/flags.conf conf/awk/states_conf_flags.awk
 	$(INFO) Creating states frame flags configuration file...
diff --git a/FP/src/conf/awk/states_conf_static.awk b/FP/src/conf/awk/states_conf_static.awk
index 36c0d00..eed0fea 100644
--- a/FP/src/conf/awk/states_conf_static.awk
+++ b/FP/src/conf/awk/states_conf_static.awk
@@ -101,12 +101,12 @@ function addExit (name) {
 			#if (1) {      #defines[$2]) {
 				if ($1~/^Map/) {
 					result=sprintf("TILES_%s",toupper($2))
+				} else if ($1~/Looking/) {
+					result=sprintf("DIR_%s",toupper($2))
+				} else if ($1~/Key/) {
+					result=sprintf("STATES_KEY_%s",toupper($2))
 				} else {
-					if ($1~/Looking/) {
-						result=sprintf("DIR_%s",toupper($2))
-					} else {
-						result=sprintf("STATES_COND_%s",toupper($2))
-					}
+					result=sprintf("STATES_COND_%s",toupper($2))
 				}
 			#} else {
 			#
diff --git a/FP/src/include/.cvsignore b/FP/src/include/.cvsignore
index 7ee3db6..6c80020 100644
--- a/FP/src/include/.cvsignore
+++ b/FP/src/include/.cvsignore
@@ -4,7 +4,6 @@ res_conf_types.h
 res_conf_mods.h
 res_conf_resources.h
 states_conf_static.h
-states_conf_properties.h
 states_conf_flags.h
 tiles_conf_types.h
 tiles_conf_groups.h
diff --git a/FP/src/include/res_conf.h b/FP/src/include/res_conf.h
index a56cc5e..556e705 100644
--- a/FP/src/include/res_conf.h
+++ b/FP/src/include/res_conf.h
@@ -4,8 +4,8 @@
  */
 
 
-#ifndef _RES_CONF_
-#define _RES_CONF_
+#ifndef _RES_CONF_H_
+#define _RES_CONF_H_
 
 /* parts */
 #include "res_conf_parts.h"
diff --git a/FP/src/include/states.h b/FP/src/include/states.h
index 6d05ed2..7c50b3b 100644
--- a/FP/src/include/states.h
+++ b/FP/src/include/states.h
@@ -6,6 +6,9 @@
 #include "types.h" /* tMap */
 #include "input.h" /* tKey */
 
+#define STATES_KEY_PRESSED 1
+#define STATES_KEY_NOTPRESSED 0
+
 typedef enum {esLast=0,esKeyUp,esKeyDown,esKeyForward,esKeyBack,esKeyShift,esMapUp,esMapUpForward,esMapDown,esMapForward,esMapBack,esMapOn,esForwardTileNearerThan,esForwardTileFartherThan,esScreenUp,esScreenDown,esScreenLeft,esScreenRight,esInScreen,esInLevel,esForwardChangeToScreen,esInFloorTop,esInfloorMiddle,esInfloorBottom,esMapNotOn,esMapNotBack,esMapDownBack,esMapNotDownBack,esMapNotForward,esKidLooking}tsConditionType;
 
 								
diff --git a/FP/src/include/states_conf.h b/FP/src/include/states_conf.h
index c62042c..3b4c14b 100644
--- a/FP/src/include/states_conf.h
+++ b/FP/src/include/states_conf.h
@@ -4,13 +4,13 @@
  */
 
 
-#ifndef _STATES_CONF_
-#define _STATES_CONF_
+#ifndef _STATES_CONF_H_
+#define _STATES_CONF_H_
 
 /* animation frame flag options */
 #include "states_conf_flags.h"
 /* condition properties */
-#include "states_conf_properties.h"
+/*#include "states_conf_properties.h" DEPRECATED */
 /* state/action, animation and condition lists */
 #include "states_conf_static.h"
 
diff --git a/FP/src/include/tiles_conf.h b/FP/src/include/tiles_conf.h
index a7e735c..53b9a58 100644
--- a/FP/src/include/tiles_conf.h
+++ b/FP/src/include/tiles_conf.h
@@ -4,8 +4,8 @@
  */
 
 
-#ifndef _TILES_CONF_
-#define _TILES_CONF_
+#ifndef _TILES_CONF_H_
+#define _TILES_CONF_H_
 
 /* tile types */
 #include "tiles_conf_types.h"
diff --git a/FP/src/ker/states.c b/FP/src/ker/states.c
index 057f01a..38758ce 100644
--- a/FP/src/ker/states.c
+++ b/FP/src/ker/states.c
@@ -69,10 +69,10 @@ void state_GetAnimation(int action,tState *state/*short *frames,short** flags,fl
 #endif
 	state->step=(float)(totaloffset)/(float)(i); /* this is the full step to be used in case a non step walk is set TODO: delete this system */
 	while (i--) {
-		(state->animation)[i] = *(j++); /* the first short is the frame */
-		(state->flags)[i]     = *(j++); /* the second short is the flag */
-		(state->steps)[i]     = *(j++); /* the third short is the frame step */
-		(state->offsx)[i]     = *(j++); /* the fourth short is the height */
+		state->animation[i] = *(j++); /* the first short is the frame */
+		state->flags[i]     = *(j++); /* the second short is the flag */
+		state->steps[i]     = *(j++); /* the third short is the frame step */
+		state->offsx[i]     = *(j++); /* the fourth short is the height */
 	}
 }
 
@@ -126,8 +126,7 @@ int evaluateCondition(int condition,tKey* key, tObject* kid, tRoom* room) {
 	switch(c.type) {
 	case esKeyUp:
 		DefaultFalse(key);
-		statesCondRet(inputGetUp(key->status));
-		/* TODO: argument notPressed isn't supported */
+		statesCondRet(c.argument^(!inputGetUp(key->status)));
 	case esKeyDown:
 		DefaultFalse(key);
 		statesCondRet(inputGetDown(key->status));