(svn r11352) -Codechange: cache callback 2D result (vehicle color mapping) instead calling it every time the vehicle is drawn

This commit is contained in:
glx
2007-10-28 15:40:18 +00:00
parent e6116d11b8
commit 6120d02751
4 changed files with 26 additions and 2 deletions

View File

@@ -340,6 +340,8 @@ public:
uint32 current_order_time; ///< How many ticks have passed since this order started.
int32 lateness_counter; ///< How many ticks late (or early if negative) this vehicle is.
SpriteID colormap; // NOSAVE: cached color mapping
union {
VehicleRail rail;
VehicleAir air;
@@ -588,6 +590,7 @@ uint8 CalcPercentVehicleFilled(Vehicle *v, StringID *color);
void InitializeTrains();
byte VehicleRandomBits();
void ResetVehiclePosHash();
void ResetVehicleColorMap();
bool CanRefitTo(EngineID engine_type, CargoID cid_to);
CargoID FindFirstRefittableCargo(EngineID engine_type);