diff options
author | frosch <frosch@openttd.org> | 2011-09-11 15:10:09 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-09-11 15:10:09 +0000 |
commit | 7f228d6909f3132b9f50c403de0100d635392305 (patch) | |
tree | 7fce3f562daee3147d6299dbc6ebdaea3858373a /src/newgrf_spritegroup.cpp | |
parent | de27360549ec0afcc5090369cf05cfeafeda5868 (diff) | |
download | openttd-7f228d6909f3132b9f50c403de0100d635392305.tar.xz |
(svn r22924) -Codechange: Enhance NewGRFSpriteLayout for drawing construction stages in spritelayouts with inconsistent number of sprites per spriteset.
Diffstat (limited to 'src/newgrf_spritegroup.cpp')
-rw-r--r-- | src/newgrf_spritegroup.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/newgrf_spritegroup.cpp b/src/newgrf_spritegroup.cpp index 80b58c273..6a42f9b4c 100644 --- a/src/newgrf_spritegroup.cpp +++ b/src/newgrf_spritegroup.cpp @@ -236,12 +236,14 @@ const SpriteGroup *RealSpriteGroup::Resolve(ResolverObject *object) const */ const DrawTileSprites *TileLayoutSpriteGroup::ProcessRegisters(uint8 *stage) const { - if (stage != NULL) *stage = GetConstructionStageOffset(*stage, this->num_building_stages); - if (!this->dts.NeedsPreprocessing()) return &this->dts; + if (!this->dts.NeedsPreprocessing()) { + if (stage != NULL && this->dts.consistent_max_offset > 0) *stage = GetConstructionStageOffset(*stage, this->dts.consistent_max_offset); + return &this->dts; + } static DrawTileSprites result; uint8 actual_stage = stage != NULL ? *stage : 0; - this->dts.PrepareLayout(0, actual_stage, actual_stage, false); + this->dts.PrepareLayout(0, 0, 0, actual_stage, false); this->dts.ProcessRegisters(0, 0, false); result.seq = this->dts.GetLayout(&result.ground); |