git » fp-git.git » commit 728f6ae

if the function is the same, the same number will be used

author ecalot
2005-01-27 00:22:48 UTC
committer ecalot
2005-01-27 00:22:48 UTC
parent 41f1226b72d54fdd54273cdde21a51396fc325bf

if the function is the same, the same number will be used

FP/src/conf/awk/tiles_conf_groups.awk +14 -4

diff --git a/FP/src/conf/awk/tiles_conf_groups.awk b/FP/src/conf/awk/tiles_conf_groups.awk
index d148eb5..7d29251 100644
--- a/FP/src/conf/awk/tiles_conf_groups.awk
+++ b/FP/src/conf/awk/tiles_conf_groups.awk
@@ -75,10 +75,20 @@ END {
 				printf "%s(unsigned char)(%s+129),%d",coma,groups[group,i],backs[group,i]-1
 				offset+=2
 			} else if (infos[group,i]) { #if there is info selected add them
-				infocount++
-				printf "%s(unsigned char)(%s+65),%d",coma,groups[group,i],infocount
-				arrinfos[infocount]=infos[group,i]
-				arrinfo2s[infocount]=info2s[group,i]
+				in1=infos[group,i]
+				in2=info2s[group,i]
+				if (findInfo[in1,in2]) { #if there is another pair of info and info2
+				                         #equal, use this number
+					result=findInfo[in1,in2]
+				} else { #if not, add it
+					infocount++
+					result=infocount
+					arrinfos[result]=in1
+					arrinfo2s[result]=in2
+					findInfo[in1,in2]=result
+				}
+
+				printf "%s(unsigned char)(%s+65),%d",coma,groups[group,i],result
 				offset+=2
 			} else {
 				printf "%s%s+1",coma,groups[group,i]