Difference between revisions of "Callback: Decide drawing default foundations"

From GRFSpecs
Jump to navigationJump to search
m (Create a separate page for each callback)
 
(use new grf templates)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
== Decide drawing default foundations (30/14E/150) ==
 
== Decide drawing default foundations (30/14E/150) ==
   
This callback is called when TTD starts drawing the industry/house/airport tile on sloped land. It should return zero to disable the
+
This callback is called when TTD starts drawing the industry/house/airport tile on sloped land. It should return 0 to disable the
default slope graphics and any other value to enable them.
+
default slope graphics and 1 to enable them.
   
 
If you chose to disable the foundation, you can draw your own by specifying
 
If you chose to disable the foundation, you can draw your own by specifying
Line 21: Line 21:
 
01 00 00 80 00 00 08 10 10 10 // building
 
01 00 00 80 00 00 08 10 10 10 // building
   
Please note that TTD doesn't have suitable foundation graphics for steep slopes. In any way, variable 60 comes in handy when
+
{{ttdp|}} Please note that TTDPatch and OpenTTD up to 0.7 do not have suitable foundation graphics for steep slopes. In any way, variable 60 comes in handy when selecting the correct foundation to draw.
  +
selecting the correct foundation to draw.
 
  +
{{grfTill|7}} Note that GRF versions 7 and lower only distinguished zero and non-zero return values.
  +
 
[[Category:Callbacks]]
 
[[Category:Callbacks]]

Latest revision as of 13:28, 1 April 2012

Decide drawing default foundations (30/14E/150)

This callback is called when TTD starts drawing the industry/house/airport tile on sloped land. It should return 0 to disable the default slope graphics and 1 to enable them.

If you chose to disable the foundation, you can draw your own by specifying

  • no ground sprite, i.e. a sprite number 00 00 00 00,
  • then a foundation sprite with bit 30 set to make foundations visible even in transparent mode, and the normal TTD foundation height of 7px,
  • then the normal graphics with bounding boxes adjusted with regards to the foundation sprite:
100 * 4 01 09 02 01
// foundation
101 C:\ttdlx\newgrf\sprites\slope.pcx 220 130 09 40 63 -30 -9
// building
102 C:\ttdlx\newgrf\sprites\slope.pcx 80 130 09 31 64 -31 0

103 * 28 02 09 00 02
00 00 00 00 // no groundsprite
00 00 00 C0 00 00 00 10 10 07 // foundation
01 00 00 80 00 00 08 10 10 10 // building

Supported by TTDPatch Please note that TTDPatch and OpenTTD up to 0.7 do not have suitable foundation graphics for steep slopes. In any way, variable 60 comes in handy when selecting the correct foundation to draw.

GRFv≤7 Note that GRF versions 7 and lower only distinguished zero and non-zero return values.