(svn r4201) - Codechange: Do for _engine_info[] what we do for _*_vehicle_info[]; create and use a function to retrieve data, and ensure constness.

This commit is contained in:
peter1138
2006-03-31 12:59:43 +00:00
parent 859fc1d7f0
commit cd0a67dc65
5 changed files with 14 additions and 8 deletions

View File

@@ -694,7 +694,7 @@ bool CanFillVehicle(Vehicle *v)
bool CanRefitTo(EngineID engine_type, CargoID cid_to)
{
CargoID cid = _global_cargo_id[_opt_ptr->landscape][cid_to];
return HASBIT(_engine_info[engine_type].refit_mask, cid);
return HASBIT(EngInfo(engine_type)->refit_mask, cid);
}
static void DoDrawVehicle(const Vehicle *v)
@@ -2061,7 +2061,7 @@ static PalSpriteID GetEngineColourMap(EngineID engine_type, PlayerID player)
byte colour = _player_colors[player];
/* XXX Magic 0x307 is the first company colour remap sprite */
map = HASBIT(_engine_info[engine_type].misc_flags, EF_USES_2CC) ?
map = HASBIT(EngInfo(engine_type)->misc_flags, EF_USES_2CC) ?
(SPR_2CCMAP_BASE + colour + colour * 16) : (PALETTE_RECOLOR_START + colour);
return SPRITE_PALETTE(map << PALETTE_SPRITE_START);