mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-01-22 23:26:34 +00:00
(svn r4629) - NewGRF: constify more code that deals with sprite groups, now that ref counting is gone.
This commit is contained in:
parent
8faf1838e6
commit
771b9fc75b
@ -18,7 +18,7 @@
|
||||
typedef struct WagonOverride {
|
||||
byte *train_id;
|
||||
int trains;
|
||||
SpriteGroup *group;
|
||||
const SpriteGroup *group;
|
||||
} WagonOverride;
|
||||
|
||||
typedef struct WagonOverrides {
|
||||
@ -28,8 +28,7 @@ typedef struct WagonOverrides {
|
||||
|
||||
static WagonOverrides _engine_wagon_overrides[TOTAL_NUM_ENGINES];
|
||||
|
||||
void SetWagonOverrideSprites(EngineID engine, SpriteGroup *group, byte *train_id,
|
||||
int trains)
|
||||
void SetWagonOverrideSprites(EngineID engine, const SpriteGroup *group, byte *train_id, int trains)
|
||||
{
|
||||
WagonOverrides *wos;
|
||||
WagonOverride *wo;
|
||||
@ -98,10 +97,10 @@ void UnloadWagonOverrides(void)
|
||||
// (It isn't and shouldn't be like this in the GRF files since new cargo types
|
||||
// may appear in future - however it's more convenient to store it like this in
|
||||
// memory. --pasky)
|
||||
static SpriteGroup *engine_custom_sprites[TOTAL_NUM_ENGINES][NUM_GLOBAL_CID];
|
||||
static const SpriteGroup *engine_custom_sprites[TOTAL_NUM_ENGINES][NUM_GLOBAL_CID];
|
||||
static uint32 _engine_grf[TOTAL_NUM_ENGINES];
|
||||
|
||||
void SetCustomEngineSprites(EngineID engine, byte cargo, SpriteGroup *group)
|
||||
void SetCustomEngineSprites(EngineID engine, byte cargo, const SpriteGroup *group)
|
||||
{
|
||||
assert(engine < TOTAL_NUM_ENGINES);
|
||||
if (engine_custom_sprites[engine][cargo] != NULL) {
|
||||
|
@ -14,9 +14,8 @@ VARDEF const uint32 _landscape_global_cargo_mask[NUM_LANDSCAPE];
|
||||
VARDEF const CargoID _local_cargo_id_ctype[NUM_GLOBAL_CID];
|
||||
VARDEF const uint32 cargo_classes[16];
|
||||
|
||||
void SetWagonOverrideSprites(EngineID engine, struct SpriteGroup *group, byte *train_id, int trains);
|
||||
void SetCustomEngineSprites(EngineID engine, byte cargo, struct SpriteGroup *group);
|
||||
// loaded is in percents, overriding_engine 0xffff is none
|
||||
void SetWagonOverrideSprites(EngineID engine, const struct SpriteGroup *group, byte *train_id, int trains);
|
||||
void SetCustomEngineSprites(EngineID engine, byte cargo, const struct SpriteGroup *group);
|
||||
SpriteID GetCustomEngineSprite(EngineID engine, const Vehicle* v, Direction direction);
|
||||
|
||||
void SetEngineGRF(EngineID engine, uint32 grfid);
|
||||
|
Loading…
Reference in New Issue
Block a user