diff --git a/cm_changelog.txt b/cm_changelog.txt index 075569b29c..d769cfc105 100644 --- a/cm_changelog.txt +++ b/cm_changelog.txt @@ -94,6 +94,10 @@ This is usable for any OpenTTD servers - Fix town HR couter. - Allow spectators to open industry funding window from the menu. - Fix graphical glitches after switching to location with hotkey. +- Make new tint highlights work with 32bpp sprites. +- Show preview when building a rail depot. +- Fix: sprite preview in sprite aligner is too small with scaled UI. +- Slightly improve funding highlight update. *** 1.10.2 (5 Jun 2020) *** - Add new minimap mode showing industries, height and farms at the same time. diff --git a/src/citymania/cm_highlight.cpp b/src/citymania/cm_highlight.cpp index c95e299fce..0e5b477f9a 100644 --- a/src/citymania/cm_highlight.cpp +++ b/src/citymania/cm_highlight.cpp @@ -35,6 +35,7 @@ extern bool IsInsideSelectedRectangle(int x, int y); extern RailType _cur_railtype; RoadBits FindRailsToConnect(TileIndex tile); extern DiagDirection _build_depot_direction; ///< Currently selected depot direction +extern uint32 _realtime_tick; namespace citymania { @@ -46,7 +47,8 @@ struct TileZoning { uint8 town_zone : 3; uint8 industry_fund_result : 2; uint8 advertisement_zone : 2; - IndustryType industry_fund_type; + // IndustryType industry_fund_type; + uint8 industry_fund_update; }; static TileZoning *_mz = nullptr; @@ -243,9 +245,12 @@ std::pair CalcTileBorders(TileIndex tile, F getter) { bool CanBuildIndustryOnTileCached(IndustryType type, TileIndex tile) { - if (_mz[tile].industry_fund_type != type || !_mz[tile].industry_fund_result) { + // if (_mz[tile].industry_fund_type != type || !_mz[tile].industry_fund_result) { + uint8 tick_hash = (_realtime_tick & 255); + if (_mz[tile].industry_fund_update != tick_hash || !_mz[tile].industry_fund_result) { bool res = CanBuildIndustryOnTile(type, tile); - _mz[tile].industry_fund_type = type; + // _mz[tile].industry_fund_type = type; + _mz[tile].industry_fund_update = tick_hash; _mz[tile].industry_fund_result = res ? 2 : 1; return res; }