(svn r9630) [NoAI] -Codechange: remove now useless define. noai
authorrubidium
Sat, 14 Apr 2007 22:16:11 +0000
branchnoai
changeset 9597 db3908cf597a
parent 9596 8af5a1399842
child 9598 b73018a5ffc0
(svn r9630) [NoAI] -Codechange: remove now useless define.
src/ai/ai_squirrel.cpp
src/ai/api/squirrel_export.sh
--- a/src/ai/ai_squirrel.cpp	Sat Apr 14 21:57:44 2007 +0000
+++ b/src/ai/ai_squirrel.cpp	Sat Apr 14 22:16:11 2007 +0000
@@ -19,8 +19,8 @@
 #include "ai_factory.hpp"
 #include "ai_squirrel.hpp"
 
-/* Convert all AI related classes to Squirrel data */
-#define DEFINE_SQUIRREL_CLASS
+/* Convert all AI related classes to Squirrel data.
+ * Note: this line a marker in squirrel_export.sh. Do not change! */
 #include "api/ai_abstractlist.hpp.sq"
 #include "api/ai_accounting.hpp.sq"
 #include "api/ai_base.hpp.sq"
@@ -43,7 +43,6 @@
 #include "api/ai_townlist_valuator.hpp.sq"
 #include "api/ai_transactionmode.hpp.sq"
 #include "api/ai_vehicle.hpp.sq"
-#undef DEFINE_SQUIRREL_CLASS
 
 static FSquirrel iFSquirrel; ///< Tell the AI-core that we have an AI with which we like to play.
 
--- a/src/ai/api/squirrel_export.sh	Sat Apr 14 21:57:44 2007 +0000
+++ b/src/ai/api/squirrel_export.sh	Sat Apr 14 22:16:11 2007 +0000
@@ -40,26 +40,23 @@
 
 echo "
 { }
-/#define DEFINE_SQUIRREL_CLASS/ {
-	squirrel_stuff = \"true\";
-	print \"#define DEFINE_SQUIRREL_CLASS\"
+/.hpp.sq/ { next }
+/squirrel_register_std/ { next }
+/SQAI.*Register/ { next }
+
+/Note: this line a marker in squirrel_export.sh. Do not change!/ {
+	print \$0
 	split(\"`grep '^void SQAI.*Register(Squirrel \*engine) {$' *.hpp.sq | sed 's/:.*$//' | sort | uniq | tr -d '\r' | tr '\n' ' '`\", files, \" \")
 
 	for (i = 1; files[i] != \"\"; i++) {
 		print \"#include \\\"api/\" files[i] \"\\\"\"
 	}
 
-	print \"#undef DEFINE_SQUIRREL_CLASS\"
-
 	next;
 }
-/^#undef DEFINE_SQUIRREL_CLASS/ { if (squirrel_stuff == \"true\") { squirrel_stuff = \"false\"; next; } }
-/^$/ { if (squirrel_stuff == \"true\") { squirrel_stuff = \"false\"; } }
-{ if (squirrel_stuff == \"true\") next; }
 
 /\/\* Register all classes \*\// {
-	squirrel_stuff = \"true\";
-	print \"	/* Register all classes */\"
+	print \$0
 	print \"	squirrel_register_std(this->engine);\"
 	split(\"`grep '^void SQAI.*Register(Squirrel \*engine) {$' *.hpp.sq | sed 's/^.*void //;s/Squirrel \*/this->/;s/ {/;/' | sort  | tr -d '\r' | tr '\n' ' '`\", regs, \" \")