Add several NewGRF variables to vehicle image callback whitelist

Add vehicle flags to control cached image invalidation

Various refactorings
This commit is contained in:
Jonathan G Rennison
2020-08-25 01:26:44 +01:00
parent c82d372d54
commit 810bfd276e
45 changed files with 325 additions and 161 deletions

View File

@@ -1832,7 +1832,7 @@ static void SwapTrainFlags(uint16 *swap_flag1, uint16 *swap_flag2)
*/
static void UpdateStatusAfterSwap(Train *v)
{
v->cur_image_valid_dir = INVALID_DIR;
v->InvalidateImageCache();
/* Reverse the direction. */
if (v->track != TRACK_BIT_DEPOT) v->direction = ReverseDir(v->direction);
@@ -3418,7 +3418,7 @@ void Train::MarkDirty()
Train *v = this;
do {
v->colourmap = PAL_NONE;
v->cur_image_valid_dir = INVALID_DIR;
v->InvalidateImageCache();
v->UpdateViewport(true, false);
} while ((v = v->Next()) != nullptr);