From c2ed8840123cc81f58b3db8d6341b22349b4ac78 Mon Sep 17 00:00:00 2001 From: yexo Date: Fri, 31 Jul 2009 19:50:01 +0000 Subject: (svn r17005) -Add [NoAI]: AIAbstractList::SORT_ASCENDING / SORT_DESCENDING --- src/ai/api/squirrel_export.awk | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/ai/api/squirrel_export.awk') diff --git a/src/ai/api/squirrel_export.awk b/src/ai/api/squirrel_export.awk index 930de32dd..eb829a510 100644 --- a/src/ai/api/squirrel_export.awk +++ b/src/ai/api/squirrel_export.awk @@ -34,6 +34,7 @@ BEGIN { enum_value_size = 0 enum_string_to_error_size = 0 enum_error_to_string_size = 0 + const_size = 0 struct_size = 0 method_size = 0 static_method_size = 0 @@ -217,6 +218,17 @@ BEGIN { } if (enum_value_size != 0) print "" + # Const values + mlen = 0 + for (i = 1; i <= const_size; i++) { + if (mlen <= length(const_value[i])) mlen = length(const_value[i]) + } + for (i = 1; i <= const_size; i++) { + print " SQ" cls ".DefSQConst(engine, " cls "::" const_value[i] ", " substr(spaces, 1, mlen - length(const_value[i])) "\"" const_value[i] "\");" + delete const_value[i] + } + if (const_size != 0) print "" + # Mapping of OTTD strings to errors mlen = 0 for (i = 1; i <= enum_string_to_error_size; i++) { @@ -320,6 +332,13 @@ BEGIN { } } +# Add a const (non-enum) value +/^[ ]*static const \w+ \w+ = \w+;$/ { + const_size++ + const_value[const_size] = $4 + next +} + # Add a method to the list /^.*\(.*\).*$/ { if (cls_level != 1) next -- cgit v1.2.3-54-g00ecf