Add several NewGRF variables to vehicle image callback whitelist
Add vehicle flags to control cached image invalidation Various refactorings
This commit is contained in:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user