Difference between revisions of "GrfLoadingStages"
m (Bot: Automated text replacement (--= +==)) |
(version tags) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 18: | Line 18: | ||
|- |
|- |
||
− | |Reserve||Called just before activation, to reserve GRM IDs. Also applies action 0 for cargos to make cargo labels valid to check in action 7/9 independent of order of .grf files. Ignores all actions except action 0 (for cargos), 6, 7, 8, 9, B, D and E. |
+ | |Reserve||{{ottdp|0.6|2.5}} Called just before activation, to reserve GRM IDs. Also applies action 0 for cargos to make cargo labels valid to check in action 7/9 independent of order of .grf files. Ignores all actions except action 0 (for cargos), 6, 7, 8, 9, B, D and E. |
|- |
|- |
||
Line 24: | Line 24: | ||
|- |
|- |
||
− | |Test||Called when user clicks to enable/disable file in the GRF Status Window to check which other files react to the change. Ignores all actions except 6, 7, 8, 9, B, D and E. |
+ | |Test||{{ottdp|no|2.5}} Called when user clicks to enable/disable file in the GRF Status Window to check which other files react to the change. Ignores all actions except 6, 7, 8, 9, B, D and E. |
|} |
|} |
||
Line 35: | Line 35: | ||
|- |
|- |
||
− | |0|| ||<center>X</center>||<center>X |
+ | |0|| ||<center>X</center>||<center>X<ref>During reservation stage especially cargo- and railtypes are reserved, so their existence can be tested by all GRFs in activation stage independent of loading order.</ref></center>||<center>X</center>|| || |
|- |
|- |
||
Line 53: | Line 53: | ||
|- |
|- |
||
− | |6|| ||<center>X</center>||<center>X</center>||<center>X |
+ | |6|| ||<center>X</center>||<center>X</center>||<center>X<ref>{{ottdp|0.6|2.5|ttdprev=2.0.1 alpha 51}} Processed during activation in TTDPatch 2.0.1 alpha 51 and later.</ref></center>||<center>X</center>|| |
|- |
|- |
||
Line 68: | Line 68: | ||
|- |
|- |
||
− | |B|| ||<center>X |
+ | |B|| ||<center>X<ref>Processed during initialization only if bit 7 of severity is set.</ref></center>||<center>X</center>||<center>X</center>||<center>X</center>|| |
|- |
|- |
||
Line 97: | Line 97: | ||
|14|| || || || || || Processed by OpenTTD only when scanning for files. Not processed during the normal loading/activation. |
|14|| || || || || || Processed by OpenTTD only when scanning for files. Not processed during the normal loading/activation. |
||
|} |
|} |
||
+ | <references/> |
Latest revision as of 14:26, 23 July 2011
Introduction
The stages of loading a grf file
Processing of .grf files is done in several passes, most of which happen repeatedly, once per activations, which is whenever a game is started/loaded or the "Apply" button in the GRF Status Window is pressed. Each pass processes all files in the order they appear in the GRF Status Window.
Essentially, initialization is a two-pass system (first resolve jump targets, then initialize everything) that happens only once, activation is a two-pass system (first define cargos and reserve GRM IDs, then activate) that happens multiple times, and testing is a one-pass system run per click on a red/green flag in the GRF Status Window.
A .grf file is activated only if it was active when the game was started. If a game is loaded, only its active .grfs will be reactivated. A .grf file is considered active if its action 8 has been processed, i.e. its action 8 hasn't been skipped using an action 7.
The following table shows exactly which actions are excuted in which passes (X=action executed, I=action initialized, empty=action ignored).
Action | Load | Init | Res | Act | Test | Notes |
---|---|---|---|---|---|---|
0 | ||||||
1 | ||||||
2 | ||||||
3 | ||||||
4 | ||||||
5 | ||||||
6 | ||||||
7 | ||||||
8 | When executed for an inactive file, skips remainder of file. | |||||
9 | ||||||
A | ||||||
B | ||||||
C | ||||||
D | ||||||
E | ||||||
F | ||||||
10 | ||||||
11 | ||||||
12 | If TTDPatch encounters any Action12 during any stage (including "Load"), Unicode handling is enabled. | |||||
13 | ||||||
14 | Processed by OpenTTD only when scanning for files. Not processed during the normal loading/activation. |
- ↑ During reservation stage especially cargo- and railtypes are reserved, so their existence can be tested by all GRFs in activation stage independent of loading order.
- ↑ 0.6 2.5 Processed during activation in TTDPatch 2.0.1 alpha 51 and later.
- ↑ Processed during initialization only if bit 7 of severity is set.