FS#1724 - Unmovables on correct ground sprites

Attached to Project: OpenTTD
Opened by Gonozal_VIII (Gonozal_VIII) - Tuesday, 29 January 2008, 22:49 GMT
Last edited by Remko Bijker (Rubidium) - Saturday, 20 November 2010, 12:57 GMT
Type Patch
Category Core
Status Closed
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


I didn't like the fact that player owned land has bare land drawn under it, so i looked for a way to solve that... as a byproduct all other unmovables are now drawn on the correct ground. also the transparency switch for signs hides the player owned land sings now
This task depends upon

Closed by  Remko Bijker (Rubidium)
Saturday, 20 November 2010, 12:57 GMT
Reason for closing:  Won't implement
Additional comments about closing:  Use NewGRF objects for this.
Comment by Gonozal_VIII (Gonozal_VIII) - Tuesday, 29 January 2008, 23:00 GMT
added some assertions to be on the safe side :-)
Comment by Zdeněk Sojka (SmatZ) - Tuesday, 29 January 2008, 23:12 GMT
Will it work with unmovables on foundations?
Transmitters and lighthouses could be placed on foundation in the scenario editor before r12014. It wouldn't be nice to assert for old savegames.
Comment by Gonozal_VIII (Gonozal_VIII) - Tuesday, 29 January 2008, 23:20 GMT
good point smatz... removed assertions and put foundation code back
Comment by Gonozal_VIII (Gonozal_VIII) - Wednesday, 30 January 2008, 14:11 GMT
i found the nice function GetTropicZone that helped a lot with simplifying the patch and now it works with half desert tiles too :-)
Comment by frosch (frosch) - Wednesday, 30 January 2008, 17:02 GMT
+ if (!IsTransparencySet(TO_SIGNS)) {
This is most likely not what you want to do. This hides the owner-land-sign completely, if the background of signs (station names etc) is set to transparent.

About the GetUnmovableGround(): This should be done like everywhere else (clear_ground, trees, etc). I.e. inside TileLoop and with a ground type and density in the map array (try to use the same bits as for clear_ground or trees). Your current approach causes glitches, when only parts of the unmovable are redrawn. Furthermore:
+ switch(GetTileZ(tile) + 8 - GetSnowLine()) {
+ case 0: return SPR_FLAT_1_QUART_SNOWY_TILE; break;
+ case 8: return SPR_FLAT_2_QUART_SNOWY_TILE; break;
+ case 16: return SPR_FLAT_3_QUART_SNOWY_TILE; break;
+ default: return SPR_FLAT_SNOWY_TILE; break;
+ }
Either do that the same way as for clear_ground / trees, or better: Add a function that can be used in all three cases (maybe there are more).
Comment by Gonozal_VIII (Gonozal_VIII) - Tuesday, 05 February 2008, 19:40 GMT
updated and changed transparency to transparent instead of invisible... i can't do that map array changing stuff, that's too complicated for my knowledge.