Cache tunnel info in viewport map mode, to prevent render flicker.
If we see a tunnel during the usual tile scan, keep it in the cache until it is explicitly evicted by a clear tunnel tile action, or the cache is cleared at game init/load/shutdown. Select colours at the drawing rather than the cache-building stage. Bridges and tunnels are now stored/handled separately. The process for bridges is mostly unchanged.
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
#include "object_base.h"
|
||||
#include "water.h"
|
||||
#include "company_gui.h"
|
||||
#include "viewport_func.h"
|
||||
|
||||
#include "table/strings.h"
|
||||
#include "table/bridge_land.h"
|
||||
@@ -866,6 +867,8 @@ static CommandCost DoClearTunnel(TileIndex tile, DoCommandFlag flags)
|
||||
DoClearSquare(tile);
|
||||
DoClearSquare(endtile);
|
||||
}
|
||||
ViewportMapInvalidateTunnelCacheByTile(tile);
|
||||
ViewportMapInvalidateTunnelCacheByTile(endtile);
|
||||
}
|
||||
return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_CLEAR_TUNNEL] * len);
|
||||
}
|
||||
|
Reference in New Issue
Block a user