Difference between revisions of "Callback: Building colour"

From GRFSpecs
Jump to navigationJump to search
m (Create a separate page for each callback)
 
m (→‎Building colour (1E): version info for comment)
 
Line 5: Line 5:
 
This can be useful if you want something more complex than four random colours.
 
This can be useful if you want something more complex than four random colours.
   
From TTDPatch 2.0.1 alpha 67, you can return a value of col2*16+col1 plus bit 14 set, where col1 and col2 are two company colours. For example, a return value of 73 C0 uses col1=3=yellow and col2=7=dark green. If no two-company-colour maps have been installed, the colours from prop. 17 are used instead.
+
{{ottdp| |2.5|ttdprev=alpha 67}} From TTDPatch 2.0.1 alpha 67, you can return a value of col2*16+col1 plus bit 14 set, where col1 and col2 are two company colours. For example, a return value of 73 C0 uses col1=3=yellow and col2=7=dark green. If no two-company-colour maps have been installed, the colours from prop. 17 are used instead.
   
 
Uses 15 return bits.
 
Uses 15 return bits.

Latest revision as of 23:28, 3 August 2011

Building colour (1E)

Called to decide what colour mapping the building should use. Should return the number of the colour mapping to be used, for example, 775 for blue->dark blue mapping.

This can be useful if you want something more complex than four random colours.

Supported by OpenTTD Supported by TTDPatch 2.5 (alpha 67)2.5 From TTDPatch 2.0.1 alpha 67, you can return a value of col2*16+col1 plus bit 14 set, where col1 and col2 are two company colours. For example, a return value of 73 C0 uses col1=3=yellow and col2=7=dark green. If no two-company-colour maps have been installed, the colours from prop. 17 are used instead.

Uses 15 return bits.