(svn r20661) -Codechange: implement the "decide colour" callback for objects

This commit is contained in:
rubidium
2010-08-28 18:50:32 +00:00
parent e014667eae
commit 43eadd4595
2 changed files with 6 additions and 1 deletions

View File

@@ -75,6 +75,11 @@ void BuildObject(ObjectType type, TileIndex tile, CompanyID owner, Town *town)
/* 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) {