Callback: Decide drawing default foundations

From GRFSpecs
Revision as of 18:58, 16 June 2011 by Pm-bot (talk | contribs) (Create a separate page for each callback)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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 default slope graphics and any other value 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

Please note that TTD doesn't have suitable foundation graphics for steep slopes. In any way, variable 60 comes in handy when selecting the correct foundation to draw.