1
0
Fork 0

(svn r11412) -Fix (r11403): animation was not turned on properly.

-Fix (r11410): wrong assumption about random reseeds made the whole thing reseed way too often, making the animation look very ugly.
release/0.6
rubidium 2007-11-11 18:22:06 +00:00
parent 9758a76512
commit 21c02fee87
3 changed files with 7 additions and 4 deletions

View File

@ -1437,8 +1437,9 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, int type, const Ind
i->owner = owner; i->owner = owner;
r = Random(); r = Random();
i->random_color = GB(r, 8, 4); i->random_color = GB(r, 0, 4);
i->counter = GB(r, 0, 12); i->counter = GB(r, 4, 12);
i->random = GB(r, 16, 16);
i->produced_cargo_waiting[0] = 0; i->produced_cargo_waiting[0] = 0;
i->produced_cargo_waiting[1] = 0; i->produced_cargo_waiting[1] = 0;
i->incoming_cargo_waiting[0] = 0; i->incoming_cargo_waiting[0] = 0;
@ -1512,7 +1513,8 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, int type, const Ind
if (_generating_world) { if (_generating_world) {
SetIndustryConstructionCounter(cur_tile, 3); SetIndustryConstructionCounter(cur_tile, 3);
SetIndustryConstructionStage(cur_tile, 2); SetIndustryConstructionStage(cur_tile, 2);
} else if (it->gfx >= NEW_INDUSTRYTILEOFFSET) { }
if (it->gfx >= NEW_INDUSTRYTILEOFFSET) {
/* New industry */ /* New industry */
const IndustryTileSpec *its = GetIndustryTileSpec(it->gfx); const IndustryTileSpec *its = GetIndustryTileSpec(it->gfx);
if (its->animation_info != 0xFFFF) AddAnimatedTile(cur_tile); if (its->animation_info != 0xFFFF) AddAnimatedTile(cur_tile);

View File

@ -169,6 +169,7 @@ static inline void MakeIndustry(TileIndex t, IndustryID index, IndustryGfx gfx)
_m[t].m3 = 0; _m[t].m3 = 0;
_m[t].m4 = 0; _m[t].m4 = 0;
SetIndustryGfx(t, gfx); SetIndustryGfx(t, gfx);
_me[t].m7 = Random();
} }
/** /**

View File

@ -252,7 +252,7 @@ static inline const SpriteGroup *ResolveRandom(const SpriteGroup *group, Resolve
/* Handle triggers */ /* Handle triggers */
/* Magic code that may or may not do the right things... */ /* Magic code that may or may not do the right things... */
byte waiting_triggers = object->GetTriggers(object); byte waiting_triggers = object->GetTriggers(object);
byte match = group->g.random.triggers & (waiting_triggers | object->trigger) || group->g.random.triggers == 0; byte match = group->g.random.triggers & (waiting_triggers | object->trigger);
bool res; bool res;
res = (group->g.random.cmp_mode == RSG_CMP_ANY) ? res = (group->g.random.cmp_mode == RSG_CMP_ANY) ?