summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-04-17 18:21:43 +0000
committerfrosch <frosch@openttd.org>2013-04-17 18:21:43 +0000
commitb09bf0804440b71ef12b5e3c1e7151dfe2acdce1 (patch)
tree567f7c03b92991c315f3cf13e078c7bf2f7ec3c5 /src
parente4c3528a78a0349a51e1b82b0ee0a5d28c7b876e (diff)
downloadopenttd-b09bf0804440b71ef12b5e3c1e7151dfe2acdce1.tar.xz
(svn r25191) -Codechange/Fix: [strgen] Make -export-commands use the actual command classification from strgen_tables.h instead of using something incompletely duplicated.
Diffstat (limited to 'src')
-rw-r--r--src/strgen/strgen.cpp26
1 files changed, 8 insertions, 18 deletions
diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp
index 8e5ee4df5..909427b56 100644
--- a/src/strgen/strgen.cpp
+++ b/src/strgen/strgen.cpp
@@ -434,24 +434,14 @@ int CDECL main(int argc, char *argv[])
printf("args\tflags\tcommand\treplacement\n");
for (const CmdStruct *cs = _cmd_structs; cs < endof(_cmd_structs); cs++) {
char flags;
- switch (cs->value) {
- case 0x200E: case 0x200F: // Implicit BIDI controls
- case 0x202A: case 0x202B: case 0x202C: case 0x202D: case 0x202E: // Explicit BIDI controls
- case 0xA0: // Non breaking space
- case '\n': // Newlines may be added too
- case '{': // This special
- /* This command may be in the translation when it is not in base */
- flags = 'i';
- break;
-
- default:
- if (cs->proc == EmitGender) {
- flags = 'g'; // Command needs number of parameters defined by number of genders
- } else if (cs->proc == EmitPlural) {
- flags = 'p'; // Command needs number of parameters defined by plural value
- } else {
- flags = '0'; // Command needs no parameters
- }
+ if (cs->proc == EmitGender) {
+ flags = 'g'; // Command needs number of parameters defined by number of genders
+ } else if (cs->proc == EmitPlural) {
+ flags = 'p'; // Command needs number of parameters defined by plural value
+ } else if (cs->flags & C_DONTCOUNT) {
+ flags = 'i'; // Command may be in the translation when it is not in base
+ } else {
+ flags = '0'; // Command needs no parameters
}
printf("%i\t%c\t\"%s\"\t\"%s\"\n", cs->consumes, flags, cs->cmd, strstr(cs->cmd, "STRING") ? "STRING" : cs->cmd);
}