OpenTTD
control_codes.h
Go to the documentation of this file.
1 /* $Id$ */
2 
3 /*
4  * This file is part of OpenTTD.
5  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8  */
9 
12 #ifndef CONTROL_CODES_H
13 #define CONTROL_CODES_H
14 
20  SCC_CONTROL_START = 0xE000,
21  SCC_CONTROL_END = 0xE1FF,
22 
23  SCC_SPRITE_START = 0xE200,
24  SCC_SPRITE_END = SCC_SPRITE_START + 0xFF,
25 
26  /* This must be the first entry. It's encoded in strings that are saved. */
27  SCC_ENCODED = SCC_CONTROL_START,
28 
29  /* Font selection codes, must be in same order as FontSize enum */
30  SCC_FIRST_FONT,
31  SCC_NORMALFONT = SCC_FIRST_FONT,
35  SCC_LAST_FONT = SCC_MONOFONT,
36 
37  /* Formatting control codes */
38  SCC_REVISION,
39  SCC_COMPANY_NUM,
40  SCC_STATION_FEATURES,
41  SCC_INDUSTRY_NAME,
42  SCC_WAYPOINT_NAME,
43  SCC_STATION_NAME,
44  SCC_DEPOT_NAME,
45  SCC_TOWN_NAME,
46  SCC_GROUP_NAME,
47  SCC_VEHICLE_NAME,
48  SCC_SIGN_NAME,
49  SCC_COMPANY_NAME,
50  SCC_PRESIDENT_NAME,
51  SCC_ENGINE_NAME,
52 
53  SCC_CURRENCY_SHORT,
54  SCC_CURRENCY_LONG,
55 
56  SCC_CARGO_LONG,
57  SCC_CARGO_SHORT,
58  SCC_CARGO_TINY,
59  SCC_CARGO_LIST,
60  SCC_POWER,
61  SCC_VOLUME_LONG,
62  SCC_VOLUME_SHORT,
63  SCC_WEIGHT_LONG,
64  SCC_WEIGHT_SHORT,
65  SCC_FORCE,
66  SCC_VELOCITY,
67  SCC_HEIGHT,
68 
69  SCC_DATE_TINY,
70  SCC_DATE_SHORT,
71  SCC_DATE_LONG,
72  SCC_DATE_ISO,
73 
74  /* Must be consecutive */
75  SCC_STRING1,
76  SCC_STRING2,
77  SCC_STRING3,
78  SCC_STRING4,
79  SCC_STRING5,
80  SCC_STRING6,
81  SCC_STRING7,
82 
83 
84  SCC_STRING,
85  SCC_COMMA,
86  SCC_DECIMAL,
87  SCC_NUM,
88  SCC_ZEROFILL_NUM,
89  SCC_HEX,
90  SCC_BYTES,
91 
92  SCC_RAW_STRING_POINTER,
93  SCC_PLURAL_LIST,
94  SCC_GENDER_LIST,
95  SCC_GENDER_INDEX,
96  SCC_ARG_INDEX,
97  SCC_SET_CASE,
98  SCC_SWITCH_CASE,
99 
100  /* Colour codes */
101  SCC_BLUE,
102  SCC_SILVER,
103  SCC_GOLD,
104  SCC_RED,
105  SCC_PURPLE,
106  SCC_LTBROWN,
107  SCC_ORANGE,
108  SCC_GREEN,
109  SCC_YELLOW,
110  SCC_DKGREEN,
111  SCC_CREAM,
112  SCC_BROWN,
113  SCC_WHITE,
114  SCC_LTBLUE,
115  SCC_GRAY,
116  SCC_DKBLUE,
117  SCC_BLACK,
118  SCC_PUSH_COLOUR,
119  SCC_POP_COLOUR,
120 
156  SCC_NEWGRF_LAST = SCC_NEWGRF_ROTATE_TOP_4_WORDS,
157 
159 
160  /* Special printable symbols.
161  * These are mapped to the original glyphs */
162  SCC_LESS_THAN = SCC_SPRITE_START + 0x3C,
163  SCC_GREATER_THAN = SCC_SPRITE_START + 0x3E,
164  SCC_UP_ARROW = SCC_SPRITE_START + 0xA0,
165  SCC_DOWN_ARROW = SCC_SPRITE_START + 0xAA,
166  SCC_CHECKMARK = SCC_SPRITE_START + 0xAC,
167  SCC_CROSS = SCC_SPRITE_START + 0xAD,
168  SCC_RIGHT_ARROW = SCC_SPRITE_START + 0xAF,
169  SCC_TRAIN = SCC_SPRITE_START + 0xB4,
170  SCC_LORRY = SCC_SPRITE_START + 0xB5,
171  SCC_BUS = SCC_SPRITE_START + 0xB6,
172  SCC_PLANE = SCC_SPRITE_START + 0xB7,
173  SCC_SHIP = SCC_SPRITE_START + 0xB8,
174  SCC_SUPERSCRIPT_M1 = SCC_SPRITE_START + 0xB9,
175  SCC_SMALL_UP_ARROW = SCC_SPRITE_START + 0xBC,
176  SCC_SMALL_DOWN_ARROW = SCC_SPRITE_START + 0xBD,
177 };
178 
179 #endif /* CONTROL_CODES_H */
9A 17: Read 4 bytes from the stack as base 0 date
9A 03: Pushes 2 bytes onto the stack
Inline another string at the current position, StringID is encoded in the string. ...
StringControlCode
List of string control codes used for string formatting, displaying, and by strgen to generate the la...
Definition: control_codes.h:19
83: Read 2 bytes from the stack as base 1920 date
86: Rotate the top 4 words of the stack (W4 W1 W2 W3)
Switch to large font.
Definition: control_codes.h:33
82: Read 2 bytes from the stack as base 1920 date
9A 1C: Read 2 + 2 bytes from the stack as cargo type (translated) and unsigned cargo amount ...
9A 04: "Unprints" the given number of bytes from the string
The next variables are part of a NewGRF subsystem for creating text strings.
9A 0C: Read 2 bytes from the stack as station name
9A 07: Read 2 bytes from the stack and print it as hex
Switch to monospaced font.
Definition: control_codes.h:34
9A 1B: Read 2 + 2 bytes from the stack as cargo type (translated) and unsigned cargo amount ...
9A 18: Read 2 bytes from the stack as unsigned power
9A 1A: Read 2 bytes from the stack as short unsigned weight
81: Read 2 bytes from the stack as String ID
87: Read 2 bytes from the stack as long signed volume
9A 08: Read 4 bytes from the stack and print it as hex
9A 0B: Read 8 bytes from the stack and print it as hex
9A 1E: Read 2 bytes from the stack as cargo name
7C: Read 2 bytes from the stack as signed value
85: Discard the next two bytes
9A 16: Read 4 bytes from the stack as base 0 date
7D: Read 1 byte from the stack as signed value
7B: Read 4 bytes from the stack
Switch to normal size font.
Definition: control_codes.h:31
8F: Read 4 bytes from the stack as currency
9A 01: Read 8 bytes from the stack as currency
84: Read 2 bytes from the stack as signed speed
9A 0D: Read 2 bytes from the stack as long unsigned weight
9A 06: Read 1 byte from the stack and print it as hex
7E: Read 2 bytes from the stack as unsigned value
9A 19: Read 2 bytes from the stack as short signed volume
Switch to small font.
Definition: control_codes.h:32
9A 1D: Read 2 + 2 bytes from the stack as cargo type (translated) and unsigned cargo amount ...