git » fp-git.git » commit 161194b

added offset support in flags

author ecalot
2005-01-27 18:58:57 UTC
committer ecalot
2005-01-27 18:58:57 UTC
parent 6a4c1a5aa1ea7992773cc86792096297843c8b42

added offset support in flags

FP/src/conf/awk/states_conf_static.awk +12 -9

diff --git a/FP/src/conf/awk/states_conf_static.awk b/FP/src/conf/awk/states_conf_static.awk
index 2a73e6b..53f75f8 100644
--- a/FP/src/conf/awk/states_conf_static.awk
+++ b/FP/src/conf/awk/states_conf_static.awk
@@ -104,14 +104,14 @@ BEGIN {
 			split($1,a,"-")
 			for (g=a[1];g<=a[2];g++) {
 				arrayAnimation[currentAnimation,"frame"]=g
-				arrayAnimation[currentAnimation,"flags"]=$2
-				arrayAnimation[currentAnimation,"steps"]=$2+$3
+				$1=""
+				arrayAnimation[currentAnimation,"flags"]=$0
 				currentAnimation++
 			}
 		} else {
 			arrayAnimation[currentAnimation,"frame"]=$1
-			arrayAnimation[currentAnimation,"flags"]=$2
-			arrayAnimation[currentAnimation,"steps"]=$2+$3
+			$1=""
+			arrayAnimation[currentAnimation,"flags"]=$0
 			currentAnimation++
 		}
 # level option
@@ -259,13 +259,16 @@ END {
 	coma=""
 	for (i=0;i<currentAnimation;i++) {
 		flags=arrayAnimation[i,"flags"]
-		steps=arrayAnimation[i,"steps"]
-		if (flags ~ /[a-z]+/) {
+		match(flags,/([^0-9 +-])/,a)
+		match(flags,/\+[ ]*([^0-9]+)/,b)
+		match(flags,/\-[ ]*([^0-9]+)/,c)
+		steps=b[1]/1
+		offxs=c[1]/1
+		if (a[1]) {
 			coma2=""
 			flagmask=""
-			for (j=1;j<=length(flags);j++) {
-				c=substr(flags,j,1)
-				flagmask=sprintf("%s%sSTATES_FLAG_%s",flagmask,coma2,toupper(c))
+			for (j=1;a[j];j++) {
+				flagmask=sprintf("%s%sSTATES_FLAG_%s",flagmask,coma2,toupper(a[j]))
 				coma2="|"
 			}
 		} else {