jackdw wrote:it is going to set the same sprites on both calls?
Am I reading this right?
Yes, NewGRF are loaded in multiple stages to resolve dependencies between NewGRF.
This involves quite some magic (
https://newgrf-specs.tt-wiki.net/wiki/GrfLoadingStages), but usually you do not need to know the details.
In this case the first call is likely the reservation stage, which is essentially a test-run.
The second call is the activation stage, where stuff is done for real.
jackdw wrote:Won't the call to ObjectClass::Reset add in the cls_ids for the two objects, and then ResetObjects will just memcpy over it?
Hmm, yes, looks weird. Possibly the ObjectSpec->Class mapping is not used for the default objects, so noone noticed.
Would you like to submit a fix via
https://github.com/OpenTTD/OpenTTD/pulls ?
Eddi wrote:I haven't looked at the code, but i'm assuming it's calling once for the 8bpp and once for the 32bpp sprites, as they are defined in separate places in the GRF
Nope. 8bpp/32bpp sprites may be defined in different places in NML, but they are in the same spot in the compiled NewGRF.