Changeset - r15963:24e1c8cf074d
[Not reviewed]
master
0 2 0
rubidium - 14 years ago 2010-08-28 18:50:32
rubidium@openttd.org
(svn r20661) -Codechange: implement the "decide colour" callback for objects
2 files changed with 6 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/newgrf_callbacks.h
Show inline comments
 
@@ -265,7 +265,7 @@ enum CallbackID {
 
	CBID_OBJECT_ANIMATION_SPEED          = 0x15A, // 8 bit callback, not implemented
 

	
 
	/** Called to determine the colour of a town building. */
 
	CBID_OBJECT_COLOUR                   = 0x15B, // 15 bit callback, not implemented
 
	CBID_OBJECT_COLOUR                   = 0x15B, // 15 bit callback
 

	
 
	/** Called to determine more text in the fund object window */
 
	CBID_OBJECT_FUND_MORE_TEXT           = 0x15C, // 15 bit callback, not implemented
src/object_cmd.cpp
Show inline comments
 
@@ -75,6 +75,11 @@ void BuildObject(ObjectType type, TileIn
 
	/* If the object wants only one colour, then give it that colour. */
 
	if ((spec->flags & OBJECT_FLAG_2CC_COLOUR) == 0) o->colour &= 0xF;
 

	
 
	if (HasBit(spec->callback_mask, CBM_OBJ_COLOUR)) {
 
		uint16 res = GetObjectCallback(CBID_OBJECT_COLOUR, o->colour, 0, spec, o, tile);
 
		if (res != CALLBACK_FAILED) o->colour = GB(res, 0, 8);
 
	}
 

	
 
	assert(o->town != NULL);
 

	
 
	TILE_AREA_LOOP(t, ta) {
0 comments (0 inline, 0 general)