TBTR: Fix palette recolouring of templates

Fix group overrides affecting template image when cloning vehicle
Update template when changing company colours

Update template images on demand instead of at load
This commit is contained in:
Jonathan G Rennison
2020-12-26 09:37:26 +00:00
parent 369c98e3e0
commit 78b06ddc40
13 changed files with 98 additions and 44 deletions

View File

@@ -42,6 +42,8 @@ static const uint16 CONSIST_TAIL = 0xffff;
typedef Pool<TemplateVehicle, TemplateID, 512, 64000> TemplatePool;
extern TemplatePool _template_pool;
extern bool _template_vehicle_images_valid;
/// listing/sorting templates
typedef GUIList<const TemplateVehicle*> GUITemplateList;
@@ -107,6 +109,7 @@ public:
VehicleSpriteSeq sprite_seq; ///< NOSAVE: Vehicle appearance.
TemplateVehicleImageDimensions image_dimensions; ///< NOSAVE: image dimensions
SpriteID colourmap; ///< NOSAVE: cached colour mapping
TemplateVehicle(VehicleType type = VEH_INVALID, EngineID e = INVALID_ENGINE, byte B = 0, Owner = _local_company);
TemplateVehicle(EngineID, RailVehicleInfo*);