git » fp-git.git » commit 06e9e7e

Fixed awk bugs

author ecalot
2004-10-16 04:30:32 UTC
committer ecalot
2004-10-16 04:30:32 UTC
parent 90aa4428a7962b3571536186770ec98b1f2472d0

Fixed awk bugs

FP/src/Makefile +1 -1
FP/src/conf/awk/states_conf_static.awk +3 -7
stuff/FP-Attic/states_conf_properties.awk +1 -1
stuff/FP-Attic/statesproperties.conf +7 -2

diff --git a/FP/src/Makefile b/FP/src/Makefile
index 6a09cef..d4c0eac 100644
--- a/FP/src/Makefile
+++ b/FP/src/Makefile
@@ -183,5 +183,5 @@ include/states_conf_static.h: conf/states.conf conf/awk/states_conf_static.awk
 
 include/states_conf_properties.h: conf/statesproperties.conf conf/awk/states_conf_properties.awk
 	$(INFO) Creating states condition properties configuration file...
-	$(GREP) conf/statesproperties.conf|$(AWK) -f conf/awk/states_conf_properties.awk >include/states_conf_properties.h:
+	$(GREP) conf/statesproperties.conf|$(AWK) -f conf/awk/states_conf_properties.awk >include/states_conf_properties.h
 
diff --git a/FP/src/conf/awk/states_conf_static.awk b/FP/src/conf/awk/states_conf_static.awk
index 96e8b27..729b97f 100644
--- a/FP/src/conf/awk/states_conf_static.awk
+++ b/FP/src/conf/awk/states_conf_static.awk
@@ -1,4 +1,3 @@
-
 BEGIN {
 	currentCondition=-1
 	currentAction=0
@@ -17,7 +16,6 @@ BEGIN {
 	currentAnimation=0
 }
 
-
 function addLine(coma) {
 				stateArray[currentAction]=sprintf(\
 					"\t/* %sAction: %s, Animations: start=%d total=%d */ \\\n\t\t{/*initial condition*/ %d, /*next state*/ **replace*%s**, /*steps*/ %d}%s\\\n",\
@@ -30,12 +28,8 @@ function addLine(coma) {
 					linkedState,\
 					coma\
 				)
-
-
 }
 
-
-
 {
 	if ( $1 == "-" ) {
 		if ($2=="-") {
@@ -52,7 +46,7 @@ function addLine(coma) {
 						conditions=currentCondition+1
 					}
 					currentCondition++;
-					if (sprintf("%d",$5)) {
+					if ($5!=sprintf("%d",$5)) {
 						if (defines[$5]) {
 							result=sprintf("STATES_COND_%s /* %d */",$5,defines[$5])
 						} else {
@@ -62,6 +56,8 @@ function addLine(coma) {
 							}
 							result=0
 						}
+					} else {
+						result=$5
 					}
 					printf("\t{es%s,%s}, /* condition number %d */\\\n",$4,result,currentCondition)
 				} else if (listType == "animation") {
diff --git a/stuff/FP-Attic/states_conf_properties.awk b/stuff/FP-Attic/states_conf_properties.awk
index ad41198..57eb3cc 100644
--- a/stuff/FP-Attic/states_conf_properties.awk
+++ b/stuff/FP-Attic/states_conf_properties.awk
@@ -1,4 +1,4 @@
 {
-	printf("STATES_COND_%s %d",$2,$1)
+	printf("#define STATES_COND_%s %d\n",$1,$2)
 }
 
diff --git a/stuff/FP-Attic/statesproperties.conf b/stuff/FP-Attic/statesproperties.conf
index 763856c..5748cb9 100644
--- a/stuff/FP-Attic/statesproperties.conf
+++ b/stuff/FP-Attic/statesproperties.conf
@@ -1,2 +1,7 @@
-pressed	1
-notPressed	0
+#Key types
+pressed     1
+notPressed  0
+#Tile types
+careful     0
+walkable    1
+empty       2