diff options
author | Alyssa Milburn | 2011-07-16 20:02:19 +0200 |
---|---|---|
committer | Alyssa Milburn | 2011-07-16 20:02:19 +0200 |
commit | aa52698d7ee5488e37f8c13c8a212259614b453e (patch) | |
tree | 5d7594fa1fffd354a3618fd7cd4886b0811325a4 | |
parent | 54f26b6c452b4b09e0af76d67498899ff8bc28f6 (diff) | |
download | scummvm-rg350-aa52698d7ee5488e37f8c13c8a212259614b453e.tar.gz scummvm-rg350-aa52698d7ee5488e37f8c13c8a212259614b453e.tar.bz2 scummvm-rg350-aa52698d7ee5488e37f8c13c8a212259614b453e.zip |
COMPOSER: Fix z-ordering (properly, this time).
-rw-r--r-- | engines/composer/composer.cpp | 8 | ||||
-rw-r--r-- | engines/composer/composer.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/engines/composer/composer.cpp b/engines/composer/composer.cpp index ec4d45a71b..4edf513a35 100644 --- a/engines/composer/composer.cpp +++ b/engines/composer/composer.cpp @@ -465,7 +465,7 @@ void ComposerEngine::processAnimFrame() { } } -void ComposerEngine::addSprite(uint16 id, uint16 animId, int16 zorder, const Common::Point &pos) { +void ComposerEngine::addSprite(uint16 id, uint16 animId, uint16 zorder, const Common::Point &pos) { Sprite sprite; sprite.id = id; sprite.animId = animId; @@ -477,9 +477,9 @@ void ComposerEngine::addSprite(uint16 id, uint16 animId, int16 zorder, const Com } for (Common::List<Sprite>::iterator i = _sprites.begin(); i != _sprites.end(); i++) { - if (sprite.zorder > i->zorder) + if (sprite.zorder <= i->zorder) continue; - i++; + // insert *before* this sprite _sprites.insert(i, sprite); return; } @@ -689,7 +689,7 @@ void ComposerEngine::loadLibrary(uint id) { // add background sprite, if it exists if (hasResource(ID_BMAP, 1000)) - addSprite(1000, 0, -1, Common::Point()); + addSprite(1000, 0, 0xffff, Common::Point()); // TODO: better CTBL logic loadCTBL(1000, 100); diff --git a/engines/composer/composer.h b/engines/composer/composer.h index eba51759a2..3fce79e362 100644 --- a/engines/composer/composer.h +++ b/engines/composer/composer.h @@ -62,7 +62,7 @@ class ComposerEngine; struct Sprite { uint16 id; uint16 animId; - int16 zorder; + uint16 zorder; Common::Point pos; Graphics::Surface surface; }; @@ -205,7 +205,7 @@ private: void playWaveForAnim(uint16 id, bool bufferingOnly); void processAnimFrame(); - void addSprite(uint16 id, uint16 animId, int16 zorder, const Common::Point &pos); + void addSprite(uint16 id, uint16 animId, uint16 zorder, const Common::Point &pos); void removeSprite(uint16 id, uint16 animId); void loadCTBL(uint id, uint fadePercent); |