OpenTTD Source: src/table/newgrf_debug_data.h Source File

OpenTTD Source 13.1

newgrf_debug_data.h
Go to the documentation of this file.
1 /*
2 * This file is part of OpenTTD.
3 * 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.
4 * 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.
5 * 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/>.
6 */
7
10 #include "../newgrf_house.h"
11 #include "../newgrf_engine.h"
12 #include "../newgrf_roadtype.h"
13
14 /* Helper for filling property tables */
15 #define NIP(prop, base, variable, type, name) { name, [] (const void *b) -> const void * { return std::addressof(static_cast<const base *>(b)->variable); }, cpp_sizeof(base, variable), prop, type }
16 #define NIP_END() { nullptr, 0, 0, 0, 0 }
17
18 /* Helper for filling callback tables */
19 #define NIC(cb_id, base, variable, bit) { #cb_id, [] (const void *b) -> const void * { return std::addressof(static_cast<const base *>(b)->variable); }, cpp_sizeof(base, variable), bit, cb_id }
20 #define NIC_END() { nullptr, 0, 0, 0, 0 }
21
22 /* Helper for filling variable tables */
23 #define NIV(var, name) { name, var }
24 #define NIV_END() { nullptr, 0 }
25
26
27 /*** NewGRF Vehicles ***/
28
29 #define NICV(cb_id, bit) NIC(cb_id, Engine, info.callback_mask, bit)
30 static const NICallback _nic_vehicles[] = {
31 NICV(CBID_VEHICLE_VISUAL_EFFECT, CBM_VEHICLE_VISUAL_EFFECT),
32 NICV(CBID_VEHICLE_LENGTH, CBM_VEHICLE_LENGTH),
33 NICV(CBID_VEHICLE_LOAD_AMOUNT, CBM_VEHICLE_LOAD_AMOUNT),
34 NICV(CBID_VEHICLE_REFIT_CAPACITY, CBM_VEHICLE_REFIT_CAPACITY),
35 NICV(CBID_VEHICLE_ARTIC_ENGINE, CBM_VEHICLE_ARTIC_ENGINE),
36 NICV(CBID_VEHICLE_CARGO_SUFFIX, CBM_VEHICLE_CARGO_SUFFIX),
37 NICV(CBID_TRAIN_ALLOW_WAGON_ATTACH, CBM_NO_BIT),
38 NICV(CBID_VEHICLE_ADDITIONAL_TEXT, CBM_NO_BIT),
39 NICV(CBID_VEHICLE_COLOUR_MAPPING, CBM_VEHICLE_COLOUR_REMAP),
40 NICV(CBID_VEHICLE_START_STOP_CHECK, CBM_NO_BIT),
41 NICV(CBID_VEHICLE_32DAY_CALLBACK, CBM_NO_BIT),
42 NICV(CBID_VEHICLE_SOUND_EFFECT, CBM_VEHICLE_SOUND_EFFECT),
43 NICV(CBID_VEHICLE_AUTOREPLACE_SELECTION, CBM_NO_BIT),
44 NICV(CBID_VEHICLE_MODIFY_PROPERTY, CBM_NO_BIT),
45 NICV(CBID_VEHICLE_NAME, CBM_VEHICLE_NAME),
46 NIC_END()
47 };
48
49
50 static const NIVariable _niv_vehicles[] = {
51 NIV(0x40, "position in consist and length"),
52 NIV(0x41, "position and length of chain of same vehicles"),
53 NIV(0x42, "transported cargo types"),
54 NIV(0x43, "player info"),
55 NIV(0x44, "aircraft info"),
56 NIV(0x45, "curvature info"),
57 NIV(0x46, "motion counter"),
58 NIV(0x47, "vehicle cargo info"),
59 NIV(0x48, "vehicle type info"),
60 NIV(0x49, "year of construction"),
61 NIV(0x4A, "current rail/road type info"),
62 NIV(0x4B, "long date of last service"),
63 NIV(0x4C, "current max speed"),
64 NIV(0x4D, "position in articulated vehicle"),
65 NIV(0x60, "count vehicle id occurrences"),
66 // 0x61 not useful, since it requires register 0x10F
67 NIV(0x62, "curvature/position difference to other vehicle"),
68 NIV(0x63, "tile compatibility wrt. track-type"),
69 NIV_END()
70 };
71
72 class NIHVehicle : public NIHelper {
73 bool IsInspectable(uint index) const override { return Vehicle::Get(index)->GetGRF() != nullptr; }
74 uint GetParent(uint index) const override { const Vehicle *first = Vehicle::Get(index)->First(); return GetInspectWindowNumber(GetGrfSpecFeature(first->type), first->index); }
75 const void *GetInstance(uint index)const override { return Vehicle::Get(index); }
76 const void *GetSpec(uint index) const override { return Vehicle::Get(index)->GetEngine(); }
77 void SetStringParameters(uint index) const override { this->SetSimpleStringParameters(STR_VEHICLE_NAME, index); }
78 uint32 GetGRFID(uint index) const override { return Vehicle::Get(index)->GetGRFID(); }
79
80 uint Resolve(uint index, uint var, uint param, bool *avail) const override
81 {
82 Vehicle *v = Vehicle::Get(index);
83 VehicleResolverObject ro(v->engine_type, v, VehicleResolverObject::WO_CACHED);
84 return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
85 }
86 };
87
88 static const NIFeature _nif_vehicle = {
89 nullptr,
90 _nic_vehicles,
91 _niv_vehicles,
92 new NIHVehicle(),
93 };
94
95
96 /*** NewGRF station (tiles) ***/
97
98 #define NICS(cb_id, bit) NIC(cb_id, StationSpec, callback_mask, bit)
99 static const NICallback _nic_stations[] = {
100 NICS(CBID_STATION_AVAILABILITY, CBM_STATION_AVAIL),
101 NICS(CBID_STATION_SPRITE_LAYOUT, CBM_STATION_SPRITE_LAYOUT),
102 NICS(CBID_STATION_TILE_LAYOUT, CBM_NO_BIT),
103 NICS(CBID_STATION_ANIM_START_STOP, CBM_NO_BIT),
104 NICS(CBID_STATION_ANIM_NEXT_FRAME, CBM_STATION_ANIMATION_NEXT_FRAME),
105 NICS(CBID_STATION_ANIMATION_SPEED, CBM_STATION_ANIMATION_SPEED),
106 NICS(CBID_STATION_LAND_SLOPE_CHECK, CBM_STATION_SLOPE_CHECK),
107 NIC_END()
108 };
109
110 static const NIVariable _niv_stations[] = {
111 NIV(0x40, "platform info and relative position"),
112 NIV(0x41, "platform info and relative position for individually built sections"),
113 NIV(0x42, "terrain and track type"),
114 NIV(0x43, "player info"),
115 NIV(0x44, "path signalling info"),
116 NIV(0x45, "rail continuation info"),
117 NIV(0x46, "platform info and relative position from middle"),
118 NIV(0x47, "platform info and relative position from middle for individually built sections"),
119 NIV(0x48, "bitmask of accepted cargoes"),
120 NIV(0x49, "platform info and relative position of same-direction section"),
121 NIV(0x4A, "current animation frame"),
122 NIV(0x60, "amount of cargo waiting"),
123 NIV(0x61, "time since last cargo pickup"),
124 NIV(0x62, "rating of cargo"),
125 NIV(0x63, "time spent on route"),
126 NIV(0x64, "information about last vehicle picking cargo up"),
127 NIV(0x65, "amount of cargo acceptance"),
128 NIV(0x66, "animation frame of nearby tile"),
129 NIV(0x67, "land info of nearby tiles"),
130 NIV(0x68, "station info of nearby tiles"),
131 NIV(0x69, "information about cargo accepted in the past"),
132 NIV(0x6A, "GRFID of nearby station tiles"),
133 NIV_END()
134 };
135
136 class NIHStation : public NIHelper {
137 bool IsInspectable(uint index) const override { return GetStationSpec(index) != nullptr; }
138 uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Station::GetByTile(index)->town->index); }
139 const void *GetInstance(uint index)const override { return nullptr; }
140 const void *GetSpec(uint index) const override { return GetStationSpec(index); }
141 void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_STATION_NAME, GetStationIndex(index), index); }
142 uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetStationSpec(index)->grf_prop.grffile->grfid : 0; }
143
144 uint Resolve(uint index, uint var, uint param, bool *avail) const override
145 {
146 StationResolverObject ro(GetStationSpec(index), Station::GetByTile(index), index);
147 return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
148 }
149 };
150
151 static const NIFeature _nif_station = {
152 nullptr,
153 _nic_stations,
154 _niv_stations,
155 new NIHStation(),
156 };
157
158
159 /*** NewGRF house tiles ***/
160
161 #define NICH(cb_id, bit) NIC(cb_id, HouseSpec, callback_mask, bit)
162 static const NICallback _nic_house[] = {
163 NICH(CBID_HOUSE_ALLOW_CONSTRUCTION, CBM_HOUSE_ALLOW_CONSTRUCTION),
164 NICH(CBID_HOUSE_ANIMATION_NEXT_FRAME, CBM_HOUSE_ANIMATION_NEXT_FRAME),
165 NICH(CBID_HOUSE_ANIMATION_START_STOP, CBM_HOUSE_ANIMATION_START_STOP),
166 NICH(CBID_HOUSE_CONSTRUCTION_STATE_CHANGE, CBM_HOUSE_CONSTRUCTION_STATE_CHANGE),
167 NICH(CBID_HOUSE_COLOUR, CBM_HOUSE_COLOUR),
168 NICH(CBID_HOUSE_CARGO_ACCEPTANCE, CBM_HOUSE_CARGO_ACCEPTANCE),
169 NICH(CBID_HOUSE_ANIMATION_SPEED, CBM_HOUSE_ANIMATION_SPEED),
170 NICH(CBID_HOUSE_DESTRUCTION, CBM_HOUSE_DESTRUCTION),
171 NICH(CBID_HOUSE_ACCEPT_CARGO, CBM_HOUSE_ACCEPT_CARGO),
172 NICH(CBID_HOUSE_PRODUCE_CARGO, CBM_HOUSE_PRODUCE_CARGO),
173 NICH(CBID_HOUSE_DENY_DESTRUCTION, CBM_HOUSE_DENY_DESTRUCTION),
174 NICH(CBID_HOUSE_WATCHED_CARGO_ACCEPTED, CBM_NO_BIT),
175 NICH(CBID_HOUSE_CUSTOM_NAME, CBM_NO_BIT),
176 NICH(CBID_HOUSE_DRAW_FOUNDATIONS, CBM_HOUSE_DRAW_FOUNDATIONS),
177 NICH(CBID_HOUSE_AUTOSLOPE, CBM_HOUSE_AUTOSLOPE),
178 NIC_END()
179 };
180
181 static const NIVariable _niv_house[] = {
182 NIV(0x40, "construction state of tile and pseudo-random value"),
183 NIV(0x41, "age of building in years"),
184 NIV(0x42, "town zone"),
185 NIV(0x43, "terrain type"),
186 NIV(0x44, "building counts"),
187 NIV(0x45, "town expansion bits"),
188 NIV(0x46, "current animation frame"),
189 NIV(0x47, "xy coordinate of the building"),
190 NIV(0x60, "other building counts (old house type)"),
191 NIV(0x61, "other building counts (new house type)"),
192 NIV(0x62, "land info of nearby tiles"),
193 NIV(0x63, "current animation frame of nearby house tile"),
194 NIV(0x64, "cargo acceptance history of nearby stations"),
195 NIV(0x65, "distance of nearest house matching a given criterion"),
196 NIV(0x66, "class and ID of nearby house tile"),
197 NIV(0x67, "GRFID of nearby house tile"),
198 NIV_END()
199 };
200
201 class NIHHouse : public NIHelper {
202 bool IsInspectable(uint index) const override { return HouseSpec::Get(GetHouseType(index))->grf_prop.grffile != nullptr; }
203 uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, GetTownIndex(index)); }
204 const void *GetInstance(uint index)const override { return nullptr; }
205 const void *GetSpec(uint index) const override { return HouseSpec::Get(GetHouseType(index)); }
206 void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_TOWN_NAME, GetTownIndex(index), index); }
207 uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? HouseSpec::Get(GetHouseType(index))->grf_prop.grffile->grfid : 0; }
208
209 uint Resolve(uint index, uint var, uint param, bool *avail) const override
210 {
211 HouseResolverObject ro(GetHouseType(index), index, Town::GetByTile(index));
212 return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
213 }
214 };
215
216 static const NIFeature _nif_house = {
217 nullptr,
218 _nic_house,
219 _niv_house,
220 new NIHHouse(),
221 };
222
223
224 /*** NewGRF industry tiles ***/
225
226 #define NICIT(cb_id, bit) NIC(cb_id, IndustryTileSpec, callback_mask, bit)
227 static const NICallback _nic_industrytiles[] = {
228 NICIT(CBID_INDTILE_ANIM_START_STOP, CBM_NO_BIT),
229 NICIT(CBID_INDTILE_ANIM_NEXT_FRAME, CBM_INDT_ANIM_NEXT_FRAME),
230 NICIT(CBID_INDTILE_ANIMATION_SPEED, CBM_INDT_ANIM_SPEED),
231 NICIT(CBID_INDTILE_CARGO_ACCEPTANCE, CBM_INDT_CARGO_ACCEPTANCE),
232 NICIT(CBID_INDTILE_ACCEPT_CARGO, CBM_INDT_ACCEPT_CARGO),
233 NICIT(CBID_INDTILE_SHAPE_CHECK, CBM_INDT_SHAPE_CHECK),
234 NICIT(CBID_INDTILE_DRAW_FOUNDATIONS, CBM_INDT_DRAW_FOUNDATIONS),
235 NICIT(CBID_INDTILE_AUTOSLOPE, CBM_INDT_AUTOSLOPE),
236 NIC_END()
237 };
238
239 static const NIVariable _niv_industrytiles[] = {
240 NIV(0x40, "construction state of tile"),
241 NIV(0x41, "ground type"),
242 NIV(0x42, "current town zone in nearest town"),
243 NIV(0x43, "relative position"),
244 NIV(0x44, "animation frame"),
245 NIV(0x60, "land info of nearby tiles"),
246 NIV(0x61, "animation stage of nearby tiles"),
247 NIV(0x62, "get industry or airport tile ID at offset"),
248 NIV_END()
249 };
250
251 class NIHIndustryTile : public NIHelper {
252 bool IsInspectable(uint index) const override { return GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.grffile != nullptr; }
253 uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_INDUSTRIES, GetIndustryIndex(index)); }
254 const void *GetInstance(uint index)const override { return nullptr; }
255 const void *GetSpec(uint index) const override { return GetIndustryTileSpec(GetIndustryGfx(index)); }
256 void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_INDUSTRY_NAME, GetIndustryIndex(index), index); }
257 uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.grffile->grfid : 0; }
258
259 uint Resolve(uint index, uint var, uint param, bool *avail) const override
260 {
261 IndustryTileResolverObject ro(GetIndustryGfx(index), index, Industry::GetByTile(index));
262 return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
263 }
264 };
265
266 static const NIFeature _nif_industrytile = {
267 nullptr,
268 _nic_industrytiles,
269 _niv_industrytiles,
270 new NIHIndustryTile(),
271 };
272
273
274 /*** NewGRF industries ***/
275
276 static const NIProperty _nip_industries[] = {
277 NIP(0x25, Industry, produced_cargo[ 0], NIT_CARGO, "produced cargo 0"),
278 NIP(0x25, Industry, produced_cargo[ 1], NIT_CARGO, "produced cargo 1"),
279 NIP(0x25, Industry, produced_cargo[ 2], NIT_CARGO, "produced cargo 2"),
280 NIP(0x25, Industry, produced_cargo[ 3], NIT_CARGO, "produced cargo 3"),
281 NIP(0x25, Industry, produced_cargo[ 4], NIT_CARGO, "produced cargo 4"),
282 NIP(0x25, Industry, produced_cargo[ 5], NIT_CARGO, "produced cargo 5"),
283 NIP(0x25, Industry, produced_cargo[ 6], NIT_CARGO, "produced cargo 6"),
284 NIP(0x25, Industry, produced_cargo[ 7], NIT_CARGO, "produced cargo 7"),
285 NIP(0x25, Industry, produced_cargo[ 8], NIT_CARGO, "produced cargo 8"),
286 NIP(0x25, Industry, produced_cargo[ 9], NIT_CARGO, "produced cargo 9"),
287 NIP(0x25, Industry, produced_cargo[10], NIT_CARGO, "produced cargo 10"),
288 NIP(0x25, Industry, produced_cargo[11], NIT_CARGO, "produced cargo 11"),
289 NIP(0x25, Industry, produced_cargo[12], NIT_CARGO, "produced cargo 12"),
290 NIP(0x25, Industry, produced_cargo[13], NIT_CARGO, "produced cargo 13"),
291 NIP(0x25, Industry, produced_cargo[14], NIT_CARGO, "produced cargo 14"),
292 NIP(0x25, Industry, produced_cargo[15], NIT_CARGO, "produced cargo 15"),
293 NIP(0x26, Industry, accepts_cargo[ 0], NIT_CARGO, "accepted cargo 0"),
294 NIP(0x26, Industry, accepts_cargo[ 1], NIT_CARGO, "accepted cargo 1"),
295 NIP(0x26, Industry, accepts_cargo[ 2], NIT_CARGO, "accepted cargo 2"),
296 NIP(0x26, Industry, accepts_cargo[ 3], NIT_CARGO, "accepted cargo 3"),
297 NIP(0x26, Industry, accepts_cargo[ 4], NIT_CARGO, "accepted cargo 4"),
298 NIP(0x26, Industry, accepts_cargo[ 5], NIT_CARGO, "accepted cargo 5"),
299 NIP(0x26, Industry, accepts_cargo[ 6], NIT_CARGO, "accepted cargo 6"),
300 NIP(0x26, Industry, accepts_cargo[ 7], NIT_CARGO, "accepted cargo 7"),
301 NIP(0x26, Industry, accepts_cargo[ 8], NIT_CARGO, "accepted cargo 8"),
302 NIP(0x26, Industry, accepts_cargo[ 9], NIT_CARGO, "accepted cargo 9"),
303 NIP(0x26, Industry, accepts_cargo[10], NIT_CARGO, "accepted cargo 10"),
304 NIP(0x26, Industry, accepts_cargo[11], NIT_CARGO, "accepted cargo 11"),
305 NIP(0x26, Industry, accepts_cargo[12], NIT_CARGO, "accepted cargo 12"),
306 NIP(0x26, Industry, accepts_cargo[13], NIT_CARGO, "accepted cargo 13"),
307 NIP(0x26, Industry, accepts_cargo[14], NIT_CARGO, "accepted cargo 14"),
308 NIP(0x26, Industry, accepts_cargo[15], NIT_CARGO, "accepted cargo 15"),
309 NIP_END()
310 };
311
312 #define NICI(cb_id, bit) NIC(cb_id, IndustrySpec, callback_mask, bit)
313 static const NICallback _nic_industries[] = {
314 NICI(CBID_INDUSTRY_PROBABILITY, CBM_IND_PROBABILITY),
315 NICI(CBID_INDUSTRY_LOCATION, CBM_IND_LOCATION),
316 NICI(CBID_INDUSTRY_PRODUCTION_CHANGE, CBM_IND_PRODUCTION_CHANGE),
317 NICI(CBID_INDUSTRY_MONTHLYPROD_CHANGE, CBM_IND_MONTHLYPROD_CHANGE),
318 NICI(CBID_INDUSTRY_CARGO_SUFFIX, CBM_IND_CARGO_SUFFIX),
319 NICI(CBID_INDUSTRY_FUND_MORE_TEXT, CBM_IND_FUND_MORE_TEXT),
320 NICI(CBID_INDUSTRY_WINDOW_MORE_TEXT, CBM_IND_WINDOW_MORE_TEXT),
321 NICI(CBID_INDUSTRY_SPECIAL_EFFECT, CBM_IND_SPECIAL_EFFECT),
322 NICI(CBID_INDUSTRY_REFUSE_CARGO, CBM_IND_REFUSE_CARGO),
323 NICI(CBID_INDUSTRY_DECIDE_COLOUR, CBM_IND_DECIDE_COLOUR),
324 NICI(CBID_INDUSTRY_INPUT_CARGO_TYPES, CBM_IND_INPUT_CARGO_TYPES),
325 NICI(CBID_INDUSTRY_OUTPUT_CARGO_TYPES, CBM_IND_OUTPUT_CARGO_TYPES),
326 NICI(CBID_INDUSTRY_PROD_CHANGE_BUILD, CBM_IND_PROD_CHANGE_BUILD),
327 NIC_END()
328 };
329
330 static const NIVariable _niv_industries[] = {
331 NIV(0x40, "waiting cargo 0"),
332 NIV(0x41, "waiting cargo 1"),
333 NIV(0x42, "waiting cargo 2"),
334 NIV(0x43, "distance to closest dry/land tile"),
335 NIV(0x44, "layout number"),
336 NIV(0x45, "player info"),
337 NIV(0x46, "industry construction date"),
338 NIV(0x60, "get industry tile ID at offset"),
339 NIV(0x61, "get random tile bits at offset"),
340 NIV(0x62, "land info of nearby tiles"),
341 NIV(0x63, "animation stage of nearby tiles"),
342 NIV(0x64, "distance on nearest industry with given type"),
343 NIV(0x65, "get town zone and Manhattan distance of closest town"),
344 NIV(0x66, "get square of Euclidean distance of closes town"),
345 NIV(0x67, "count of industry and distance of closest instance"),
346 NIV(0x68, "count of industry and distance of closest instance with layout filter"),
347 NIV(0x69, "produced cargo waiting"),
348 NIV(0x6A, "cargo produced this month"),
349 NIV(0x6B, "cargo transported this month"),
350 NIV(0x6C, "cargo produced last month"),
351 NIV(0x6D, "cargo transported last month"),
352 NIV(0x6E, "date since cargo was delivered"),
353 NIV(0x6F, "waiting input cargo"),
354 NIV(0x70, "production rate"),
355 NIV(0x71, "percentage of cargo transported last month"),
356 NIV_END()
357 };
358
359 class NIHIndustry : public NIHelper {
360 bool IsInspectable(uint index) const override { return GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile != nullptr; }
361 uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Industry::Get(index)->town->index); }
362 const void *GetInstance(uint index)const override { return Industry::Get(index); }
363 const void *GetSpec(uint index) const override { return GetIndustrySpec(Industry::Get(index)->type); }
364 void SetStringParameters(uint index) const override { this->SetSimpleStringParameters(STR_INDUSTRY_NAME, index); }
365 uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile->grfid : 0; }
366
367 uint Resolve(uint index, uint var, uint param, bool *avail) const override
368 {
369 Industry *i = Industry::Get(index);
370 IndustriesResolverObject ro(i->location.tile, i, i->type);
371 return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
372 }
373
374 uint GetPSASize(uint index, uint32 grfid) const override { return cpp_lengthof(PersistentStorage, storage); }
375
376 const int32 *GetPSAFirstPosition(uint index, uint32 grfid) const override
377 {
378 const Industry *i = (const Industry *)this->GetInstance(index);
379 if (i->psa == nullptr) return nullptr;
380 return (int32 *)(&i->psa->storage);
381 }
382 };
383
384 static const NIFeature _nif_industry = {
385 _nip_industries,
386 _nic_industries,
387 _niv_industries,
388 new NIHIndustry(),
389 };
390
391
392 /*** NewGRF objects ***/
393
394 #define NICO(cb_id, bit) NIC(cb_id, ObjectSpec, callback_mask, bit)
395 static const NICallback _nic_objects[] = {
396 NICO(CBID_OBJECT_LAND_SLOPE_CHECK, CBM_OBJ_SLOPE_CHECK),
397 NICO(CBID_OBJECT_ANIMATION_NEXT_FRAME, CBM_OBJ_ANIMATION_NEXT_FRAME),
398 NICO(CBID_OBJECT_ANIMATION_START_STOP, CBM_NO_BIT),
399 NICO(CBID_OBJECT_ANIMATION_SPEED, CBM_OBJ_ANIMATION_SPEED),
400 NICO(CBID_OBJECT_COLOUR, CBM_OBJ_COLOUR),
401 NICO(CBID_OBJECT_FUND_MORE_TEXT, CBM_OBJ_FUND_MORE_TEXT),
402 NICO(CBID_OBJECT_AUTOSLOPE, CBM_OBJ_AUTOSLOPE),
403 NIC_END()
404 };
405
406 static const NIVariable _niv_objects[] = {
407 NIV(0x40, "relative position"),
408 NIV(0x41, "tile information"),
409 NIV(0x42, "construction date"),
410 NIV(0x43, "animation counter"),
411 NIV(0x44, "object founder"),
412 NIV(0x45, "get town zone and Manhattan distance of closest town"),
413 NIV(0x46, "get square of Euclidean distance of closes town"),
414 NIV(0x47, "colour"),
415 NIV(0x48, "view"),
416 NIV(0x60, "get object ID at offset"),
417 NIV(0x61, "get random tile bits at offset"),
418 NIV(0x62, "land info of nearby tiles"),
419 NIV(0x63, "animation stage of nearby tiles"),
420 NIV(0x64, "distance on nearest object with given type"),
421 NIV_END()
422 };
423
424 class NIHObject : public NIHelper {
425 bool IsInspectable(uint index) const override { return ObjectSpec::GetByTile(index)->grf_prop.grffile != nullptr; }
426 uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Object::GetByTile(index)->town->index); }
427 const void *GetInstance(uint index)const override { return Object::GetByTile(index); }
428 const void *GetSpec(uint index) const override { return ObjectSpec::GetByTile(index); }
429 void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_OBJECT, INVALID_STRING_ID, index); }
430 uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? ObjectSpec::GetByTile(index)->grf_prop.grffile->grfid : 0; }
431
432 uint Resolve(uint index, uint var, uint param, bool *avail) const override
433 {
434 ObjectResolverObject ro(ObjectSpec::GetByTile(index), Object::GetByTile(index), index);
435 return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
436 }
437 };
438
439 static const NIFeature _nif_object = {
440 nullptr,
441 _nic_objects,
442 _niv_objects,
443 new NIHObject(),
444 };
445
446
447 /*** NewGRF rail types ***/
448
449 static const NIVariable _niv_railtypes[] = {
450 NIV(0x40, "terrain type"),
451 NIV(0x41, "enhanced tunnels"),
452 NIV(0x42, "level crossing status"),
453 NIV(0x43, "construction date"),
454 NIV(0x44, "town zone"),
455 NIV_END()
456 };
457
458 class NIHRailType : public NIHelper {
459 bool IsInspectable(uint index) const override { return true; }
460 uint GetParent(uint index) const override { return UINT32_MAX; }
461 const void *GetInstance(uint index)const override { return nullptr; }
462 const void *GetSpec(uint index) const override { return nullptr; }
463 void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_RAIL_TYPE, INVALID_STRING_ID, index); }
464 uint32 GetGRFID(uint index) const override { return 0; }
465
466 uint Resolve(uint index, uint var, uint param, bool *avail) const override
467 {
468 /* There is no unique GRFFile for the tile. Multiple GRFs can define different parts of the railtype.
469 * However, currently the NewGRF Debug GUI does not display variables depending on the GRF (like 0x7F) anyway. */
470 RailTypeResolverObject ro(nullptr, index, TCX_NORMAL, RTSG_END);
471 return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
472 }
473 };
474
475 static const NIFeature _nif_railtype = {
476 nullptr,
477 nullptr,
478 _niv_railtypes,
479 new NIHRailType(),
480 };
481
482
483 /*** NewGRF airport tiles ***/
484
485 #define NICAT(cb_id, bit) NIC(cb_id, AirportTileSpec, callback_mask, bit)
486 static const NICallback _nic_airporttiles[] = {
487 NICAT(CBID_AIRPTILE_DRAW_FOUNDATIONS, CBM_AIRT_DRAW_FOUNDATIONS),
488 NICAT(CBID_AIRPTILE_ANIM_START_STOP, CBM_NO_BIT),
489 NICAT(CBID_AIRPTILE_ANIM_NEXT_FRAME, CBM_AIRT_ANIM_NEXT_FRAME),
490 NICAT(CBID_AIRPTILE_ANIMATION_SPEED, CBM_AIRT_ANIM_SPEED),
491 NIC_END()
492 };
493
494 class NIHAirportTile : public NIHelper {
495 bool IsInspectable(uint index) const override { return AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.grffile != nullptr; }
496 uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Station::GetByTile(index)->town->index); }
497 const void *GetInstance(uint index)const override { return nullptr; }
498 const void *GetSpec(uint index) const override { return AirportTileSpec::Get(GetAirportGfx(index)); }
499 void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_STATION_NAME, GetStationIndex(index), index); }
500 uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.grffile->grfid : 0; }
501
502 uint Resolve(uint index, uint var, uint param, bool *avail) const override
503 {
504 AirportTileResolverObject ro(AirportTileSpec::GetByTile(index), index, Station::GetByTile(index));
505 return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
506 }
507 };
508
509 static const NIFeature _nif_airporttile = {
510 nullptr,
511 _nic_airporttiles,
512 _niv_industrytiles, // Yes, they share this (at least now)
513 new NIHAirportTile(),
514 };
515
516
517 /*** NewGRF towns ***/
518
519 static const NIVariable _niv_towns[] = {
520 NIV(0x40, "larger town effect on this town"),
521 NIV(0x41, "town index"),
522 NIV(0x82, "population"),
523 NIV(0x94, "zone radius 0"),
524 NIV(0x96, "zone radius 1"),
525 NIV(0x98, "zone radius 2"),
526 NIV(0x9A, "zone radius 3"),
527 NIV(0x9C, "zone radius 4"),
528 NIV(0xB6, "number of buildings"),
529 NIV_END()
530 };
531
532 class NIHTown : public NIHelper {
533 bool IsInspectable(uint index) const override { return Town::IsValidID(index); }
534 uint GetParent(uint index) const override { return UINT32_MAX; }
535 const void *GetInstance(uint index)const override { return Town::Get(index); }
536 const void *GetSpec(uint index) const override { return nullptr; }
537 void SetStringParameters(uint index) const override { this->SetSimpleStringParameters(STR_TOWN_NAME, index); }
538 uint32 GetGRFID(uint index) const override { return 0; }
539 bool PSAWithParameter() const override { return true; }
540 uint GetPSASize(uint index, uint32 grfid) const override { return cpp_lengthof(PersistentStorage, storage); }
541
542 uint Resolve(uint index, uint var, uint param, bool *avail) const override
543 {
544 TownResolverObject ro(nullptr, Town::Get(index), true);
545 return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
546 }
547
548 const int32 *GetPSAFirstPosition(uint index, uint32 grfid) const override
549 {
550 Town *t = Town::Get(index);
551
552 std::list<PersistentStorage *>::iterator iter;
553 for (iter = t->psa_list.begin(); iter != t->psa_list.end(); iter++) {
554 if ((*iter)->grfid == grfid) return (int32 *)(&(*iter)->storage[0]);
555 }
556
557 return nullptr;
558 }
559 };
560
561 static const NIFeature _nif_town = {
562 nullptr,
563 nullptr,
564 _niv_towns,
565 new NIHTown(),
566 };
567
568 /*** NewGRF road types ***/
569
570 static const NIVariable _niv_roadtypes[] = {
571 NIV(0x40, "terrain type"),
572 NIV(0x41, "enhanced tunnels"),
573 NIV(0x42, "level crossing status"),
574 NIV(0x43, "construction date"),
575 NIV(0x44, "town zone"),
576 NIV_END()
577 };
578
579 class NIHRoadType : public NIHelper {
580 bool IsInspectable(uint index) const override { return true; }
581 uint GetParent(uint index) const override { return UINT32_MAX; }
582 const void *GetInstance(uint index) const override { return nullptr; }
583 const void *GetSpec(uint index) const override { return nullptr; }
584 void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_RAIL_TYPE, INVALID_STRING_ID, index); }
585 uint32 GetGRFID(uint index) const override { return 0; }
586
587 uint Resolve(uint index, uint var, uint param, bool *avail) const override
588 {
589 /* There is no unique GRFFile for the tile. Multiple GRFs can define different parts of the railtype.
590 * However, currently the NewGRF Debug GUI does not display variables depending on the GRF (like 0x7F) anyway. */
591 RoadTypeResolverObject ro(nullptr, index, TCX_NORMAL, ROTSG_END);
592 return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
593 }
594 };
595
596 static const NIFeature _nif_roadtype = {
597 nullptr,
598 nullptr,
599 _niv_roadtypes,
600 new NIHRoadType(),
601 };
602
603 static const NIFeature _nif_tramtype = {
604 nullptr,
605 nullptr,
606 _niv_roadtypes,
607 new NIHRoadType(),
608 };
609
611 static const NIFeature * const _nifeatures[] = {
612 &_nif_vehicle, // GSF_TRAINS
613 &_nif_vehicle, // GSF_ROADVEHICLES
614 &_nif_vehicle, // GSF_SHIPS
615 &_nif_vehicle, // GSF_AIRCRAFT
616 &_nif_station, // GSF_STATIONS
617 nullptr, // GSF_CANALS (no callbacks/action2 implemented)
618 nullptr, // GSF_BRIDGES (no callbacks/action2)
619 &_nif_house, // GSF_HOUSES
620 nullptr, // GSF_GLOBALVAR (has no "physical" objects)
621 &_nif_industrytile, // GSF_INDUSTRYTILES
622 &_nif_industry, // GSF_INDUSTRIES
623 nullptr, // GSF_CARGOES (has no "physical" objects)
624 nullptr, // GSF_SOUNDFX (has no "physical" objects)
625 nullptr, // GSF_AIRPORTS (feature not implemented)
626 nullptr, // GSF_SIGNALS (feature not implemented)
627 &_nif_object, // GSF_OBJECTS
628 &_nif_railtype, // GSF_RAILTYPES
629 &_nif_airporttile, // GSF_AIRPORTTILES
630 &_nif_roadtype, // GSF_ROADTYPES
631 &_nif_tramtype, // GSF_TRAMTYPES
632 &_nif_town, // GSF_FAKE_TOWNS
633 };
634 static_assert(lengthof(_nifeatures) == GSF_FAKE_END);
NIHHouse::IsInspectable
bool IsInspectable(uint index) const override
Is the item with the given index inspectable?
Definition: newgrf_debug_data.h:202
ObjectResolverObject
A resolver object to be used with feature 0F spritegroups.
Definition: newgrf_object.h:125
CBID_OBJECT_COLOUR
@ CBID_OBJECT_COLOUR
Called to determine the colour of a town building.
Definition: newgrf_callbacks.h:266
VehicleResolverObject::WO_CACHED
@ WO_CACHED
Resolve wagon overrides using TrainCache::cached_override.
Definition: newgrf_engine.h:52
CBM_OBJ_ANIMATION_SPEED
@ CBM_OBJ_ANIMATION_SPEED
decides animation speed
Definition: newgrf_callbacks.h:388
IndustryTileResolverObject::GetScope
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0) override
Get a resolver for the scope.
Definition: newgrf_industrytiles.h:47
NIHTown::GetPSAFirstPosition
const int32 * GetPSAFirstPosition(uint index, uint32 grfid) const override
Gets the first position of the array containing the persistent storage.
Definition: newgrf_debug_data.h:548
NIHRailType::GetInstance
const void * GetInstance(uint index) const override
Get the instance given an index.
Definition: newgrf_debug_data.h:461
CBM_IND_CARGO_SUFFIX
@ CBM_IND_CARGO_SUFFIX
cargo sub-type display
Definition: newgrf_callbacks.h:358
Pool::PoolItem<&_vehicle_pool >::Get
static Titem * Get(size_t index)
Returns Titem with given index.
Definition: pool_type.hpp:337
CBM_AIRT_ANIM_NEXT_FRAME
@ CBM_AIRT_ANIM_NEXT_FRAME
decides next animation frame
Definition: newgrf_callbacks.h:398
CBID_OBJECT_LAND_SLOPE_CHECK
@ CBID_OBJECT_LAND_SLOPE_CHECK
Callback done for each tile of an object to check the slope.
Definition: newgrf_callbacks.h:254
NIHTown::GetSpec
const void * GetSpec(uint index) const override
Get (NewGRF) specs given an index.
Definition: newgrf_debug_data.h:536
CBID_OBJECT_ANIMATION_NEXT_FRAME
@ CBID_OBJECT_ANIMATION_NEXT_FRAME
Determine the next animation frame for a house.
Definition: newgrf_callbacks.h:257
NIHHouse
Definition: newgrf_debug_data.h:201
NIHHouse::GetParent
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
Definition: newgrf_debug_data.h:203
GetIndustryGfx
static IndustryGfx GetIndustryGfx(TileIndex t)
Get the industry graphics ID for the given industry tile.
Definition: industry_map.h:137
CBM_HOUSE_CARGO_ACCEPTANCE
@ CBM_HOUSE_CARGO_ACCEPTANCE
decides amount of cargo acceptance
Definition: newgrf_callbacks.h:323
RailTypeResolverObject::GetScope
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0) override
Get a resolver for the scope.
Definition: newgrf_railtype.h:44
NIHAirportTile::Resolve
uint Resolve(uint index, uint var, uint param, bool *avail) const override
Resolve (action2) variable for a given index.
Definition: newgrf_debug_data.h:502
CBID_VEHICLE_START_STOP_CHECK
@ CBID_VEHICLE_START_STOP_CHECK
Called when the company (or AI) tries to start or stop a vehicle.
Definition: newgrf_callbacks.h:141
NIHObject::Resolve
uint Resolve(uint index, uint var, uint param, bool *avail) const override
Resolve (action2) variable for a given index.
Definition: newgrf_debug_data.h:432
ObjectSpec::grf_prop
GRFFilePropsBase< 2 > grf_prop
Properties related the the grf file.
Definition: newgrf_object.h:62
NIHIndustryTile::GetGRFID
uint32 GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
Definition: newgrf_debug_data.h:257
NIHIndustryTile::Resolve
uint Resolve(uint index, uint var, uint param, bool *avail) const override
Resolve (action2) variable for a given index.
Definition: newgrf_debug_data.h:259
CBM_NO_BIT
static const int CBM_NO_BIT
Mask to show no bit needs to be enabled for the callback.
Definition: newgrf_debug_gui.cpp:106
ObjectResolverObject::GetScope
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0) override
Get a resolver for the scope.
Definition: newgrf_object.h:133
CBID_VEHICLE_VISUAL_EFFECT
@ CBID_VEHICLE_VISUAL_EFFECT
Visual effects and wagon power.
Definition: newgrf_callbacks.h:30
NIHIndustry::GetSpec
const void * GetSpec(uint index) const override
Get (NewGRF) specs given an index.
Definition: newgrf_debug_data.h:363
NIHAirportTile
Definition: newgrf_debug_data.h:494
CBID_VEHICLE_ARTIC_ENGINE
@ CBID_VEHICLE_ARTIC_ENGINE
Builds articulated engines for trains and RVs.
Definition: newgrf_callbacks.h:51
CBID_HOUSE_ANIMATION_SPEED
@ CBID_HOUSE_ANIMATION_SPEED
Called to indicate how long the current animation frame should last.
Definition: newgrf_callbacks.h:81
CBID_VEHICLE_CARGO_SUFFIX
@ CBID_VEHICLE_CARGO_SUFFIX
Determine the cargo "suffixes" for each refit possibility of a cargo.
Definition: newgrf_callbacks.h:60
CBM_OBJ_ANIMATION_NEXT_FRAME
@ CBM_OBJ_ANIMATION_NEXT_FRAME
decides next animation frame
Definition: newgrf_callbacks.h:387
CBID_INDUSTRY_PRODUCTION_CHANGE
@ CBID_INDUSTRY_PRODUCTION_CHANGE
Called on production changes, so it can be adjusted.
Definition: newgrf_callbacks.h:111
CBID_STATION_AVAILABILITY
@ CBID_STATION_AVAILABILITY
Determine whether a newstation should be made available to build.
Definition: newgrf_callbacks.h:39
CBID_VEHICLE_MODIFY_PROPERTY
@ CBID_VEHICLE_MODIFY_PROPERTY
Called to modify various vehicle properties.
Definition: newgrf_callbacks.h:159
CBID_INDTILE_CARGO_ACCEPTANCE
@ CBID_INDTILE_CARGO_ACCEPTANCE
Called to query the cargo acceptance of the industry tile.
Definition: newgrf_callbacks.h:117
NIHIndustry::GetGRFID
uint32 GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
Definition: newgrf_debug_data.h:365
NICallback
Representation of the available callbacks with information on when they actually apply.
Definition: newgrf_debug_gui.cpp:98
CBM_INDT_SHAPE_CHECK
@ CBM_INDT_SHAPE_CHECK
decides slope suitability
Definition: newgrf_callbacks.h:377
NIHVehicle::Resolve
uint Resolve(uint index, uint var, uint param, bool *avail) const override
Resolve (action2) variable for a given index.
Definition: newgrf_debug_data.h:80
Pool::PoolItem::index
Tindex index
Index of this pool item.
Definition: pool_type.hpp:235
NIHRoadType::GetGRFID
uint32 GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
Definition: newgrf_debug_data.h:585
Object::GetByTile
static Object * GetByTile(TileIndex tile)
Get the object associated with a tile.
Definition: object_cmd.cpp:53
HouseResolverObject
Resolver object to be used for houses (feature 07 spritegroups).
Definition: newgrf_house.h:51
NIHRoadType::GetInstance
const void * GetInstance(uint index) const override
Get the instance given an index.
Definition: newgrf_debug_data.h:582
CBM_VEHICLE_SOUND_EFFECT
@ CBM_VEHICLE_SOUND_EFFECT
Vehicle uses custom sound effects.
Definition: newgrf_callbacks.h:299
NIHObject
Definition: newgrf_debug_data.h:424
CBID_HOUSE_WATCHED_CARGO_ACCEPTED
@ CBID_HOUSE_WATCHED_CARGO_ACCEPTED
Called when a cargo type specified in property 20 is accepted.
Definition: newgrf_callbacks.h:209
StationResolverObject::GetScope
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0) override
Get a resolver for the scope.
Definition: newgrf_station.h:60
NIHVehicle::GetGRFID
uint32 GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
Definition: newgrf_debug_data.h:78
CBID_INDUSTRY_PROBABILITY
@ CBID_INDUSTRY_PROBABILITY
Called to determine if the given industry type is available.
Definition: newgrf_callbacks.h:87
CBM_STATION_SLOPE_CHECK
@ CBM_STATION_SLOPE_CHECK
Check slope of new station tiles.
Definition: newgrf_callbacks.h:311
CBID_HOUSE_CUSTOM_NAME
@ CBID_HOUSE_CUSTOM_NAME
Called on the Get Tile Description for an house tile.
Definition: newgrf_callbacks.h:224
NIHRoadType::IsInspectable
bool IsInspectable(uint index) const override
Is the item with the given index inspectable?
Definition: newgrf_debug_data.h:580
CBM_INDT_ACCEPT_CARGO
@ CBM_INDT_ACCEPT_CARGO
decides accepted types
Definition: newgrf_callbacks.h:376
NIHAirportTile::GetInstance
const void * GetInstance(uint index) const override
Get the instance given an index.
Definition: newgrf_debug_data.h:497
CBM_STATION_ANIMATION_NEXT_FRAME
@ CBM_STATION_ANIMATION_NEXT_FRAME
Use a custom next frame callback.
Definition: newgrf_callbacks.h:309
CBID_INDTILE_ANIM_START_STOP
@ CBID_INDTILE_ANIM_START_STOP
Called for periodically starting or stopping the animation.
Definition: newgrf_callbacks.h:99
NIHIndustry::SetStringParameters
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
Definition: newgrf_debug_data.h:364
CBID_INDTILE_DRAW_FOUNDATIONS
@ CBID_INDTILE_DRAW_FOUNDATIONS
Called to determine the type (if any) of foundation to draw for industry tile.
Definition: newgrf_callbacks.h:135
NIHAirportTile::IsInspectable
bool IsInspectable(uint index) const override
Is the item with the given index inspectable?
Definition: newgrf_debug_data.h:495
CBM_HOUSE_DESTRUCTION
@ CBM_HOUSE_DESTRUCTION
trigger destruction of building
Definition: newgrf_callbacks.h:325
CBM_VEHICLE_CARGO_SUFFIX
@ CBM_VEHICLE_CARGO_SUFFIX
Show suffix after cargo name.
Definition: newgrf_callbacks.h:297
Vehicle
Vehicle data structure.
Definition: vehicle_base.h:224
Industry
Defines the internal data of a functional industry.
Definition: industry.h:66
NIHIndustryTile::IsInspectable
bool IsInspectable(uint index) const override
Is the item with the given index inspectable?
Definition: newgrf_debug_data.h:252
NIHStation::SetStringParameters
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
Definition: newgrf_debug_data.h:141
CBID_HOUSE_DRAW_FOUNDATIONS
@ CBID_HOUSE_DRAW_FOUNDATIONS
Called to determine the type (if any) of foundation to draw for house tile.
Definition: newgrf_callbacks.h:227
CBID_INDUSTRY_OUTPUT_CARGO_TYPES
@ CBID_INDUSTRY_OUTPUT_CARGO_TYPES
Customize the output cargo types of a newly build industry.
Definition: newgrf_callbacks.h:221
CBID_INDTILE_ACCEPT_CARGO
@ CBID_INDTILE_ACCEPT_CARGO
Called to determine which cargoes an industry should accept.
Definition: newgrf_callbacks.h:120
NIHRailType::GetSpec
const void * GetSpec(uint index) const override
Get (NewGRF) specs given an index.
Definition: newgrf_debug_data.h:462
CBM_VEHICLE_ARTIC_ENGINE
@ CBM_VEHICLE_ARTIC_ENGINE
Add articulated engines (trains and road vehicles)
Definition: newgrf_callbacks.h:296
NIHelper
Helper class to wrap some functionality/queries in.
Definition: newgrf_debug_gui.cpp:115
CBID_INDUSTRY_SPECIAL_EFFECT
@ CBID_INDUSTRY_SPECIAL_EFFECT
Called to determine industry special effects.
Definition: newgrf_callbacks.h:174
NIHTown::GetParent
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
Definition: newgrf_debug_data.h:534
CBM_INDT_AUTOSLOPE
@ CBM_INDT_AUTOSLOPE
decides allowance of autosloping
Definition: newgrf_callbacks.h:379
CBM_HOUSE_PRODUCE_CARGO
@ CBM_HOUSE_PRODUCE_CARGO
custom cargo production
Definition: newgrf_callbacks.h:327
GetTownIndex
static TownID GetTownIndex(TileIndex t)
Get the index of which town this house/street is attached to.
Definition: town_map.h:22
CBM_IND_FUND_MORE_TEXT
@ CBM_IND_FUND_MORE_TEXT
additional text in fund window
Definition: newgrf_callbacks.h:359
NIProperty
Representation of the data from a NewGRF property.
Definition: newgrf_debug_gui.cpp:85
CBM_HOUSE_CONSTRUCTION_STATE_CHANGE
@ CBM_HOUSE_CONSTRUCTION_STATE_CHANGE
change animation when construction state changes
Definition: newgrf_callbacks.h:321
NIHTown::PSAWithParameter
bool PSAWithParameter() const override
Used to decide if the PSA needs a parameter or not.
Definition: newgrf_debug_data.h:539
NIHRailType::GetParent
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
Definition: newgrf_debug_data.h:460
VSG_SCOPE_SELF
@ VSG_SCOPE_SELF
Resolved object itself.
Definition: newgrf_spritegroup.h:100
NIHObject::IsInspectable
bool IsInspectable(uint index) const override
Is the item with the given index inspectable?
Definition: newgrf_debug_data.h:425
NIHHouse::GetSpec
const void * GetSpec(uint index) const override
Get (NewGRF) specs given an index.
Definition: newgrf_debug_data.h:205
CBID_INDUSTRY_FUND_MORE_TEXT
@ CBID_INDUSTRY_FUND_MORE_TEXT
Called to determine more text in the fund industry window.
Definition: newgrf_callbacks.h:165
RoadTypeResolverObject::GetScope
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0) override
Get a resolver for the scope.
Definition: newgrf_roadtype.h:45
NIHTown::SetStringParameters
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
Definition: newgrf_debug_data.h:537
NIHObject::GetInstance
const void * GetInstance(uint index) const override
Get the instance given an index.
Definition: newgrf_debug_data.h:427
CBM_IND_PROBABILITY
@ CBM_IND_PROBABILITY
industry availability/probability callback
Definition: newgrf_callbacks.h:352
CBID_VEHICLE_ADDITIONAL_TEXT
@ CBID_VEHICLE_ADDITIONAL_TEXT
This callback is called from vehicle purchase lists.
Definition: newgrf_callbacks.h:93
NIHObject::GetParent
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
Definition: newgrf_debug_data.h:426
NIHRoadType::GetSpec
const void * GetSpec(uint index) const override
Get (NewGRF) specs given an index.
Definition: newgrf_debug_data.h:583
CBM_VEHICLE_NAME
@ CBM_VEHICLE_NAME
Engine name.
Definition: newgrf_callbacks.h:300
CBM_VEHICLE_LENGTH
@ CBM_VEHICLE_LENGTH
Vehicle length (trains and road vehicles)
Definition: newgrf_callbacks.h:293
GetGrfSpecFeature
GrfSpecFeature GetGrfSpecFeature(TileIndex tile)
Get the GrfSpecFeature associated with the tile.
Definition: newgrf_debug_gui.cpp:764
GetHouseType
static HouseID GetHouseType(TileIndex t)
Get the type of this house, which is an index into the house spec array.
Definition: town_map.h:59
NIHRailType
Definition: newgrf_debug_data.h:458
CBID_INDUSTRY_LOCATION
@ CBID_INDUSTRY_LOCATION
Called to determine if the given industry can be built on specific area.
Definition: newgrf_callbacks.h:108
CBM_HOUSE_ANIMATION_NEXT_FRAME
@ CBM_HOUSE_ANIMATION_NEXT_FRAME
decides next animation frame
Definition: newgrf_callbacks.h:319
CBM_OBJ_FUND_MORE_TEXT
@ CBM_OBJ_FUND_MORE_TEXT
additional text in fund window
Definition: newgrf_callbacks.h:390
CBID_HOUSE_COLOUR
@ CBID_HOUSE_COLOUR
Called to determine the colour of a town building.
Definition: newgrf_callbacks.h:75
CBID_HOUSE_DESTRUCTION
@ CBID_HOUSE_DESTRUCTION
Called periodically to determine if a house should be destroyed.
Definition: newgrf_callbacks.h:84
NIHVehicle
Definition: newgrf_debug_data.h:72
CBM_VEHICLE_LOAD_AMOUNT
@ CBM_VEHICLE_LOAD_AMOUNT
Load amount.
Definition: newgrf_callbacks.h:294
GetAirportGfx
static StationGfx GetAirportGfx(TileIndex t)
Get the station graphics of this airport tile.
Definition: station_map.h:244
NIHIndustry::IsInspectable
bool IsInspectable(uint index) const override
Is the item with the given index inspectable?
Definition: newgrf_debug_data.h:360
Industry::location
TileArea location
Location of the industry.
Definition: industry.h:67
CBID_STATION_LAND_SLOPE_CHECK
@ CBID_STATION_LAND_SLOPE_CHECK
Callback done for each tile of a station to check the slope.
Definition: newgrf_callbacks.h:212
NIHHouse::GetGRFID
uint32 GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
Definition: newgrf_debug_data.h:207
TownResolverObject::GetScope
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0) override
Get a resolver for the scope.
Definition: newgrf_town.h:47
NIHRailType::Resolve
uint Resolve(uint index, uint var, uint param, bool *avail) const override
Resolve (action2) variable for a given index.
Definition: newgrf_debug_data.h:466
Industry::GetByTile
static Industry * GetByTile(TileIndex tile)
Get the industry of the given tile.
Definition: industry.h:144
GSF_FAKE_TOWNS
@ GSF_FAKE_TOWNS
Fake town GrfSpecFeature for NewGRF debugging (parent scope)
Definition: newgrf.h:89
NIHRoadType::GetParent
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
Definition: newgrf_debug_data.h:581
NIHIndustry::Resolve
uint Resolve(uint index, uint var, uint param, bool *avail) const override
Resolve (action2) variable for a given index.
Definition: newgrf_debug_data.h:367
CBM_STATION_ANIMATION_SPEED
@ CBM_STATION_ANIMATION_SPEED
Customize the animation speed of the station.
Definition: newgrf_callbacks.h:310
CBID_AIRPTILE_ANIM_NEXT_FRAME
@ CBID_AIRPTILE_ANIM_NEXT_FRAME
Called to determine airport tile next animation frame.
Definition: newgrf_callbacks.h:239
Industry::type
IndustryType type
type of industry.
Definition: industry.h:83
CBID_VEHICLE_SOUND_EFFECT
@ CBID_VEHICLE_SOUND_EFFECT
Called to play a special sound effect.
Definition: newgrf_callbacks.h:147
IndustryTileResolverObject
Resolver for industry tiles.
Definition: newgrf_industrytiles.h:39
CBID_VEHICLE_AUTOREPLACE_SELECTION
@ CBID_VEHICLE_AUTOREPLACE_SELECTION
Return the vehicles this given vehicle can be "upgraded" to.
Definition: newgrf_callbacks.h:150
IndustriesResolverObject
Resolver for industries.
Definition: newgrf_industries.h:42
CBM_IND_PRODUCTION_CHANGE
@ CBM_IND_PRODUCTION_CHANGE
controls random production change
Definition: newgrf_callbacks.h:356
Vehicle::engine_type
EngineID engine_type
The type of engine used for this vehicle.
Definition: vehicle_base.h:302
_nifeatures
static const NIFeature *const _nifeatures[]
Table with all NIFeatures.
Definition: newgrf_debug_data.h:611
TownResolverObject
Resolver of town properties.
Definition: newgrf_town.h:42
NIT_CARGO
@ NIT_CARGO
The property is a cargo.
Definition: newgrf_debug_gui.cpp:79
CBID_HOUSE_ALLOW_CONSTRUCTION
@ CBID_HOUSE_ALLOW_CONSTRUCTION
Determine whether the house can be built on the specified tile.
Definition: newgrf_callbacks.h:54
CBM_HOUSE_ACCEPT_CARGO
@ CBM_HOUSE_ACCEPT_CARGO
decides accepted types
Definition: newgrf_callbacks.h:326
CBID_INDUSTRY_MONTHLYPROD_CHANGE
@ CBID_INDUSTRY_MONTHLYPROD_CHANGE
Called monthly on production changes, so it can be adjusted more frequently.
Definition: newgrf_callbacks.h:153
PersistentStorage
Class for pooled persistent storage of data.
Definition: newgrf_storage.h:221
NIHAirportTile::GetSpec
const void * GetSpec(uint index) const override
Get (NewGRF) specs given an index.
Definition: newgrf_debug_data.h:498
CBID_HOUSE_CONSTRUCTION_STATE_CHANGE
@ CBID_HOUSE_CONSTRUCTION_STATE_CHANGE
Called whenever the construction state of a house changes.
Definition: newgrf_callbacks.h:69
CBM_INDT_DRAW_FOUNDATIONS
@ CBM_INDT_DRAW_FOUNDATIONS
decides if default foundations need to be drawn
Definition: newgrf_callbacks.h:378
CBM_IND_LOCATION
@ CBM_IND_LOCATION
check industry construction on given area
Definition: newgrf_callbacks.h:355
CBM_IND_INPUT_CARGO_TYPES
@ CBM_IND_INPUT_CARGO_TYPES
customize the cargoes the industry requires
Definition: newgrf_callbacks.h:364
GSF_FAKE_END
@ GSF_FAKE_END
End of the fake features.
Definition: newgrf.h:90
CBID_INDUSTRY_INPUT_CARGO_TYPES
@ CBID_INDUSTRY_INPUT_CARGO_TYPES
Customize the input cargo types of a newly build industry.
Definition: newgrf_callbacks.h:218
AirportTileSpec::GetByTile
static const AirportTileSpec * GetByTile(TileIndex tile)
Retrieve airport tile spec for the given airport tile.
Definition: newgrf_airporttiles.cpp:49
NIHVehicle::GetSpec
const void * GetSpec(uint index) const override
Get (NewGRF) specs given an index.
Definition: newgrf_debug_data.h:76
CBM_OBJ_COLOUR
@ CBM_OBJ_COLOUR
decide the colour of the building
Definition: newgrf_callbacks.h:389
CBM_HOUSE_COLOUR
@ CBM_HOUSE_COLOUR
decide the colour of the building
Definition: newgrf_callbacks.h:322
CBM_HOUSE_ANIMATION_SPEED
@ CBM_HOUSE_ANIMATION_SPEED
decides animation speed
Definition: newgrf_callbacks.h:324
NIHRailType::GetGRFID
uint32 GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
Definition: newgrf_debug_data.h:464
NIFeature
Container for all information for a given feature.
Definition: newgrf_debug_gui.cpp:232
TCX_NORMAL
@ TCX_NORMAL
Nothing special.
Definition: newgrf_commons.h:25
NIHObject::SetStringParameters
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
Definition: newgrf_debug_data.h:429
NIHTown::Resolve
uint Resolve(uint index, uint var, uint param, bool *avail) const override
Resolve (action2) variable for a given index.
Definition: newgrf_debug_data.h:542
CBID_HOUSE_ANIMATION_START_STOP
@ CBID_HOUSE_ANIMATION_START_STOP
Called for periodically starting or stopping the animation.
Definition: newgrf_callbacks.h:66
PersistentStorageArray::storage
TYPE storage[SIZE]
Memory to for the storage array.
Definition: newgrf_storage.h:67
CBM_IND_SPECIAL_EFFECT
@ CBM_IND_SPECIAL_EFFECT
control special effects
Definition: newgrf_callbacks.h:361
CBID_INDUSTRY_CARGO_SUFFIX
@ CBID_INDUSTRY_CARGO_SUFFIX
Called to determine text to display after cargo name.
Definition: newgrf_callbacks.h:162
NIHVehicle::SetStringParameters
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
Definition: newgrf_debug_data.h:77
NIHIndustryTile::GetSpec
const void * GetSpec(uint index) const override
Get (NewGRF) specs given an index.
Definition: newgrf_debug_data.h:255
CBM_STATION_AVAIL
@ CBM_STATION_AVAIL
Availability of station in construction window.
Definition: newgrf_callbacks.h:307
CBID_STATION_ANIM_NEXT_FRAME
@ CBID_STATION_ANIM_NEXT_FRAME
Called to determine station tile next animation frame.
Definition: newgrf_callbacks.h:188
CBID_HOUSE_CARGO_ACCEPTANCE
@ CBID_HOUSE_CARGO_ACCEPTANCE
Called to decide how much cargo a town building can accept.
Definition: newgrf_callbacks.h:78
CBID_STATION_TILE_LAYOUT
@ CBID_STATION_TILE_LAYOUT
Called when building a station to customize the tile layout.
Definition: newgrf_callbacks.h:96
NIHObject::GetGRFID
uint32 GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
Definition: newgrf_debug_data.h:430
NIHAirportTile::SetStringParameters
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
Definition: newgrf_debug_data.h:499
NIHStation
Definition: newgrf_debug_data.h:136
IndustryTileSpec::grf_prop
GRFFileProps grf_prop
properties related to the grf file
Definition: industrytype.h:172
GetInspectWindowNumber
static uint GetInspectWindowNumber(GrfSpecFeature feature, uint index)
Get the window number for the inspect window given a feature and index.
Definition: newgrf_debug_gui.cpp:67
CBM_HOUSE_ANIMATION_START_STOP
@ CBM_HOUSE_ANIMATION_START_STOP
periodically start/stop the animation
Definition: newgrf_callbacks.h:320
NIHelper::SetObjectAtStringParameters
void SetObjectAtStringParameters(StringID string, uint32 index, TileIndex tile) const
Helper to make setting the strings easier for objects at a specific tile.
Definition: newgrf_debug_gui.cpp:221
CBM_VEHICLE_REFIT_CAPACITY
@ CBM_VEHICLE_REFIT_CAPACITY
Cargo capacity after refit.
Definition: newgrf_callbacks.h:295
CBM_INDT_ANIM_NEXT_FRAME
@ CBM_INDT_ANIM_NEXT_FRAME
decides next animation frame
Definition: newgrf_callbacks.h:373
NIHStation::GetSpec
const void * GetSpec(uint index) const override
Get (NewGRF) specs given an index.
Definition: newgrf_debug_data.h:140
CBID_OBJECT_AUTOSLOPE
@ CBID_OBJECT_AUTOSLOPE
Called to determine if one can alter the ground below an object tile.
Definition: newgrf_callbacks.h:272
NIHRailType::SetStringParameters
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
Definition: newgrf_debug_data.h:463
HouseResolverObject::GetScope
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0) override
Get a resolver for the scope.
Definition: newgrf_house.h:59
NIHIndustry
Definition: newgrf_debug_data.h:359
NIHIndustryTile::SetStringParameters
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
Definition: newgrf_debug_data.h:256
NIHAirportTile::GetGRFID
uint32 GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
Definition: newgrf_debug_data.h:500
CBM_INDT_ANIM_SPEED
@ CBM_INDT_ANIM_SPEED
decides animation speed
Definition: newgrf_callbacks.h:374
NIHHouse::SetStringParameters
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
Definition: newgrf_debug_data.h:206
NIHIndustryTile
Definition: newgrf_debug_data.h:251
CBID_INDTILE_ANIM_NEXT_FRAME
@ CBID_INDTILE_ANIM_NEXT_FRAME
Called to determine industry tile next animation frame.
Definition: newgrf_callbacks.h:102
CBID_VEHICLE_COLOUR_MAPPING
@ CBID_VEHICLE_COLOUR_MAPPING
Called to determine if a specific colour map should be used for a vehicle instead of the default live...
Definition: newgrf_callbacks.h:126
CBM_IND_MONTHLYPROD_CHANGE
@ CBM_IND_MONTHLYPROD_CHANGE
controls monthly random production change
Definition: newgrf_callbacks.h:357
CBID_INDUSTRY_PROD_CHANGE_BUILD
@ CBID_INDUSTRY_PROD_CHANGE_BUILD
Called when industry is built to set initial production level.
Definition: newgrf_callbacks.h:278
NIHStation::GetParent
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
Definition: newgrf_debug_data.h:138
NIHIndustry::GetParent
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
Definition: newgrf_debug_data.h:361
RoadTypeResolverObject
Resolver object for road types.
Definition: newgrf_roadtype.h:40
CBID_INDUSTRY_REFUSE_CARGO
@ CBID_INDUSTRY_REFUSE_CARGO
Called to determine if the industry can still accept or refuse more cargo arrival.
Definition: newgrf_callbacks.h:180
CBM_OBJ_SLOPE_CHECK
@ CBM_OBJ_SLOPE_CHECK
decides slope suitability
Definition: newgrf_callbacks.h:386
CBM_AIRT_DRAW_FOUNDATIONS
@ CBM_AIRT_DRAW_FOUNDATIONS
decides if default foundations need to be drawn
Definition: newgrf_callbacks.h:401
CBID_AIRPTILE_ANIM_START_STOP
@ CBID_AIRPTILE_ANIM_START_STOP
Called for periodically starting or stopping the animation.
Definition: newgrf_callbacks.h:236
NIHTown::GetInstance
const void * GetInstance(uint index) const override
Get the instance given an index.
Definition: newgrf_debug_data.h:535
NIHIndustry::GetPSAFirstPosition
const int32 * GetPSAFirstPosition(uint index, uint32 grfid) const override
Gets the first position of the array containing the persistent storage.
Definition: newgrf_debug_data.h:376
NIHHouse::Resolve
uint Resolve(uint index, uint var, uint param, bool *avail) const override
Resolve (action2) variable for a given index.
Definition: newgrf_debug_data.h:209
CBID_AIRPTILE_DRAW_FOUNDATIONS
@ CBID_AIRPTILE_DRAW_FOUNDATIONS
Called to determine the type (if any) of foundation to draw for an airport tile.
Definition: newgrf_callbacks.h:233
CBM_VEHICLE_VISUAL_EFFECT
@ CBM_VEHICLE_VISUAL_EFFECT
Visual effects and wagon power (trains, road vehicles and ships)
Definition: newgrf_callbacks.h:292
NIHIndustry::GetPSASize
uint GetPSASize(uint index, uint32 grfid) const override
Allows to know the size of the persistent storage.
Definition: newgrf_debug_data.h:374
NIHIndustry::GetInstance
const void * GetInstance(uint index) const override
Get the instance given an index.
Definition: newgrf_debug_data.h:362
CBID_STATION_ANIM_START_STOP
@ CBID_STATION_ANIM_START_STOP
Called for periodically starting or stopping the animation.
Definition: newgrf_callbacks.h:185
GetIndustryTileSpec
const IndustryTileSpec * GetIndustryTileSpec(IndustryGfx gfx)
Accessor for array _industry_tile_specs.
Definition: industry_cmd.cpp:137
OrthogonalTileArea::tile
TileIndex tile
The base tile of the area.
Definition: tilearea_type.h:19
NIHVehicle::GetParent
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
Definition: newgrf_debug_data.h:74
CBM_INDT_CARGO_ACCEPTANCE
@ CBM_INDT_CARGO_ACCEPTANCE
decides amount of cargo acceptance
Definition: newgrf_callbacks.h:375
CBM_OBJ_AUTOSLOPE
@ CBM_OBJ_AUTOSLOPE
decides allowance of autosloping
Definition: newgrf_callbacks.h:391
NIHStation::GetGRFID
uint32 GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
Definition: newgrf_debug_data.h:142
GetIndustryIndex
static IndustryID GetIndustryIndex(TileIndex t)
Get the industry ID of the given tile.
Definition: industry_map.h:63
CBM_HOUSE_DENY_DESTRUCTION
@ CBM_HOUSE_DENY_DESTRUCTION
conditional protection
Definition: newgrf_callbacks.h:328
ObjectSpec::GetByTile
static const ObjectSpec * GetByTile(TileIndex tile)
Get the specification associated with a tile.
Definition: newgrf_object.cpp:50
CBM_IND_REFUSE_CARGO
@ CBM_IND_REFUSE_CARGO
option out of accepting cargo
Definition: newgrf_callbacks.h:362
NIHHouse::GetInstance
const void * GetInstance(uint index) const override
Get the instance given an index.
Definition: newgrf_debug_data.h:204
IndustrySpec::grf_prop
GRFFileProps grf_prop
properties related to the grf file
Definition: industrytype.h:141
CBID_OBJECT_ANIMATION_START_STOP
@ CBID_OBJECT_ANIMATION_START_STOP
Called for periodically starting or stopping the animation.
Definition: newgrf_callbacks.h:260
GetStationIndex
static StationID GetStationIndex(TileIndex t)
Get StationID from a tile.
Definition: station_map.h:28
SpecializedStation< Station, false >::GetByTile
static Station * GetByTile(TileIndex tile)
Get the station belonging to a specific tile.
Definition: base_station_base.h:237
NIHRoadType::Resolve
uint Resolve(uint index, uint var, uint param, bool *avail) const override
Resolve (action2) variable for a given index.
Definition: newgrf_debug_data.h:587
CBID_INDTILE_AUTOSLOPE
@ CBID_INDTILE_AUTOSLOPE
Called to determine if industry can alter the ground below industry tile.
Definition: newgrf_callbacks.h:177
NIHVehicle::GetInstance
const void * GetInstance(uint index) const override
Get the instance given an index.
Definition: newgrf_debug_data.h:75
VehicleResolverObject
Resolver for a vehicle (chain)
Definition: newgrf_engine.h:47
CBID_STATION_ANIMATION_SPEED
@ CBID_STATION_ANIMATION_SPEED
Called to indicate how long the current animation frame should last.
Definition: newgrf_callbacks.h:191
CBM_IND_WINDOW_MORE_TEXT
@ CBM_IND_WINDOW_MORE_TEXT
additional text in industry window
Definition: newgrf_callbacks.h:360
ScopeResolver::GetVariable
virtual uint32 GetVariable(byte variable, uint32 parameter, bool *available) const
Get a variable value.
Definition: newgrf_spritegroup.cpp:106
NIHIndustryTile::GetParent
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
Definition: newgrf_debug_data.h:253
CBID_OBJECT_ANIMATION_SPEED
@ CBID_OBJECT_ANIMATION_SPEED
Called to indicate how long the current animation frame should last.
Definition: newgrf_callbacks.h:263
NIHTown::GetGRFID
uint32 GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
Definition: newgrf_debug_data.h:538
CBID_HOUSE_PRODUCE_CARGO
@ CBID_HOUSE_PRODUCE_CARGO
Called to determine how much cargo a town building produces.
Definition: newgrf_callbacks.h:129
lengthof
#define lengthof(x)
Return the length of an fixed size array.
Definition: stdafx.h:386
Town
Town data structure.
Definition: town.h:50
StationSpec::grf_prop
GRFFilePropsBase< NUM_CARGO+3 > grf_prop
Properties related the the grf file.
Definition: newgrf_station.h:125
CBID_VEHICLE_REFIT_CAPACITY
@ CBID_VEHICLE_REFIT_CAPACITY
Refit capacity, the passed vehicle needs to have its ->cargo_type set to the cargo we are refitting t...
Definition: newgrf_callbacks.h:48
CBID_INDUSTRY_DECIDE_COLOUR
@ CBID_INDUSTRY_DECIDE_COLOUR
Called to determine the colour of an industry.
Definition: newgrf_callbacks.h:215
IndustriesResolverObject::GetScope
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0) override
Get a resolver for the scope.
Definition: newgrf_industries.h:52
NIVariable
Representation on the NewGRF variables.
Definition: newgrf_debug_gui.cpp:109
NIHRoadType::SetStringParameters
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
Definition: newgrf_debug_data.h:584
NIHVehicle::IsInspectable
bool IsInspectable(uint index) const override
Is the item with the given index inspectable?
Definition: newgrf_debug_data.h:73
NIHRailType::IsInspectable
bool IsInspectable(uint index) const override
Is the item with the given index inspectable?
Definition: newgrf_debug_data.h:459
CBID_VEHICLE_32DAY_CALLBACK
@ CBID_VEHICLE_32DAY_CALLBACK
Called for every vehicle every 32 days (not all on same date though).
Definition: newgrf_callbacks.h:144
CBM_HOUSE_AUTOSLOPE
@ CBM_HOUSE_AUTOSLOPE
decides allowance of autosloping
Definition: newgrf_callbacks.h:330
CBID_INDUSTRY_WINDOW_MORE_TEXT
@ CBID_INDUSTRY_WINDOW_MORE_TEXT
Called to determine more text in the industry window.
Definition: newgrf_callbacks.h:171
CBM_IND_DECIDE_COLOUR
@ CBM_IND_DECIDE_COLOUR
give a custom colour to newly build industries
Definition: newgrf_callbacks.h:363
CBID_VEHICLE_LOAD_AMOUNT
@ CBID_VEHICLE_LOAD_AMOUNT
Determine the amount of cargo to load per unit of time when using gradual loading.
Definition: newgrf_callbacks.h:36
StationResolverObject
Station resolver.
Definition: newgrf_station.h:50
CBID_VEHICLE_LENGTH
@ CBID_VEHICLE_LENGTH
Vehicle length, returns the amount of 1/8's the vehicle is shorter for trains and RVs.
Definition: newgrf_callbacks.h:33
AirportTileResolverObject::GetScope
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0) override
Get a resolver for the scope.
Definition: newgrf_airporttiles.h:51
GetIndustrySpec
const IndustrySpec * GetIndustrySpec(IndustryType thistype)
Accessor for array _industry_specs.
Definition: industry_cmd.cpp:123
CBM_IND_PROD_CHANGE_BUILD
@ CBM_IND_PROD_CHANGE_BUILD
initialise production level on construction
Definition: newgrf_callbacks.h:366
AirportTileResolverObject
Resolver for tiles of an airport.
Definition: newgrf_airporttiles.h:45
RailTypeResolverObject
Resolver object for rail types.
Definition: newgrf_railtype.h:39
CBM_VEHICLE_COLOUR_REMAP
@ CBM_VEHICLE_COLOUR_REMAP
Change colour mapping of vehicle.
Definition: newgrf_callbacks.h:298
NIHObject::GetSpec
const void * GetSpec(uint index) const override
Get (NewGRF) specs given an index.
Definition: newgrf_debug_data.h:428
Pool::PoolItem<&_town_pool >::IsValidID
static bool IsValidID(size_t index)
Tests whether given index can be used to get valid (non-nullptr) Titem.
Definition: pool_type.hpp:326
NIHTown::GetPSASize
uint GetPSASize(uint index, uint32 grfid) const override
Allows to know the size of the persistent storage.
Definition: newgrf_debug_data.h:540
CBM_HOUSE_DRAW_FOUNDATIONS
@ CBM_HOUSE_DRAW_FOUNDATIONS
decides if default foundations need to be drawn
Definition: newgrf_callbacks.h:329
NIHTown
Definition: newgrf_debug_data.h:532
BaseVehicle::type
VehicleType type
Type of vehicle.
Definition: vehicle_type.h:52
GRFFilePropsBase::grffile
const struct GRFFile * grffile
grf file that introduced this entity
Definition: newgrf_commons.h:320
CBM_STATION_SPRITE_LAYOUT
@ CBM_STATION_SPRITE_LAYOUT
Use callback to select a sprite layout to use.
Definition: newgrf_callbacks.h:308
CBID_AIRPTILE_ANIMATION_SPEED
@ CBID_AIRPTILE_ANIMATION_SPEED
Called to indicate how long the current animation frame should last.
Definition: newgrf_callbacks.h:242
Industry::psa
PersistentStorage * psa
Persistent storage for NewGRF industries.
Definition: industry.h:105
CBID_INDTILE_ANIMATION_SPEED
@ CBID_INDTILE_ANIMATION_SPEED
Called to indicate how long the current animation frame should last.
Definition: newgrf_callbacks.h:105
AirportTileSpec::Get
static const AirportTileSpec * Get(StationGfx gfx)
Retrieve airport tile spec for the given airport tile.
Definition: newgrf_airporttiles.cpp:36
CBM_HOUSE_ALLOW_CONSTRUCTION
@ CBM_HOUSE_ALLOW_CONSTRUCTION
decide whether the house can be built on a given tile
Definition: newgrf_callbacks.h:318
AirportTileSpec::grf_prop
GRFFileProps grf_prop
properties related the the grf file
Definition: newgrf_airporttiles.h:72
NIHelper::SetSimpleStringParameters
void SetSimpleStringParameters(StringID string, uint32 index) const
Helper to make setting the strings easier.
Definition: newgrf_debug_gui.cpp:208
CBID_STATION_SPRITE_LAYOUT
@ CBID_STATION_SPRITE_LAYOUT
Choose a sprite layout to draw, instead of the standard 0-7 range.
Definition: newgrf_callbacks.h:42
CBID_HOUSE_DENY_DESTRUCTION
@ CBID_HOUSE_DENY_DESTRUCTION
Called to determine whether a town building can be destroyed.
Definition: newgrf_callbacks.h:194
CBID_HOUSE_ACCEPT_CARGO
@ CBID_HOUSE_ACCEPT_CARGO
Called to determine which cargoes a town building should accept.
Definition: newgrf_callbacks.h:114
cpp_lengthof
#define cpp_lengthof(base, variable)
Gets the length of an array variable within a class.
Definition: stdafx.h:418
VehicleResolverObject::GetScope
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0) override
Get a resolver for the scope.
Definition: newgrf_engine.cpp:317
NIHStation::GetInstance
const void * GetInstance(uint index) const override
Get the instance given an index.
Definition: newgrf_debug_data.h:139
HouseSpec::grf_prop
GRFFileProps grf_prop
Properties related the the grf file.
Definition: house.h:114
CBID_VEHICLE_NAME
@ CBID_VEHICLE_NAME
Called to determine the engine name to show.
Definition: newgrf_callbacks.h:284
CBID_HOUSE_ANIMATION_NEXT_FRAME
@ CBID_HOUSE_ANIMATION_NEXT_FRAME
Determine the next animation frame for a house.
Definition: newgrf_callbacks.h:63
NIHIndustryTile::GetInstance
const void * GetInstance(uint index) const override
Get the instance given an index.
Definition: newgrf_debug_data.h:254
CBM_IND_OUTPUT_CARGO_TYPES
@ CBM_IND_OUTPUT_CARGO_TYPES
customize the cargoes the industry produces
Definition: newgrf_callbacks.h:365
NIHAirportTile::GetParent
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
Definition: newgrf_debug_data.h:496
CBID_HOUSE_AUTOSLOPE
@ CBID_HOUSE_AUTOSLOPE
Called to determine if one can alter the ground below a house tile.
Definition: newgrf_callbacks.h:230
NIHStation::IsInspectable
bool IsInspectable(uint index) const override
Is the item with the given index inspectable?
Definition: newgrf_debug_data.h:137
NIHTown::IsInspectable
bool IsInspectable(uint index) const override
Is the item with the given index inspectable?
Definition: newgrf_debug_data.h:533
INVALID_STRING_ID
static const StringID INVALID_STRING_ID
Constant representing an invalid string (16bit in case it is used in savegames)
Definition: strings_type.h:17
NIHStation::Resolve
uint Resolve(uint index, uint var, uint param, bool *avail) const override
Resolve (action2) variable for a given index.
Definition: newgrf_debug_data.h:144
CBID_INDTILE_SHAPE_CHECK
@ CBID_INDTILE_SHAPE_CHECK
Called to determine if the given industry tile can be built on specific tile.
Definition: newgrf_callbacks.h:132
CBID_TRAIN_ALLOW_WAGON_ATTACH
@ CBID_TRAIN_ALLOW_WAGON_ATTACH
Determine whether a wagon can be attached to an already existing train.
Definition: newgrf_callbacks.h:72
CBID_OBJECT_FUND_MORE_TEXT
@ CBID_OBJECT_FUND_MORE_TEXT
Called to determine more text in the fund object window.
Definition: newgrf_callbacks.h:269
NIHRoadType
Definition: newgrf_debug_data.h:579
CBM_AIRT_ANIM_SPEED
@ CBM_AIRT_ANIM_SPEED
decides animation speed
Definition: newgrf_callbacks.h:399