diff options
author | Paul Gilbert | 2019-08-30 21:04:07 -0700 |
---|---|---|
committer | Paul Gilbert | 2019-08-30 21:04:07 -0700 |
commit | 0f1722ebce2105485f48f6903c7b02a56ff63a06 (patch) | |
tree | 6afc518789176535de776cbef0058fe67ce03bd2 /engines/xeen | |
parent | 1588218f6f7f3c23d8c4d4b4186c51b1bae1100b (diff) | |
download | scummvm-rg350-0f1722ebce2105485f48f6903c7b02a56ff63a06.tar.gz scummvm-rg350-0f1722ebce2105485f48f6903c7b02a56ff63a06.tar.bz2 scummvm-rg350-0f1722ebce2105485f48f6903c7b02a56ff63a06.zip |
XEEN: Fix to use correct drawer for shades, drawer cleanup
Diffstat (limited to 'engines/xeen')
-rw-r--r-- | engines/xeen/interface_scene.cpp | 2 | ||||
-rw-r--r-- | engines/xeen/sprites.cpp | 6 | ||||
-rw-r--r-- | engines/xeen/sprites.h | 8 |
3 files changed, 11 insertions, 5 deletions
diff --git a/engines/xeen/interface_scene.cpp b/engines/xeen/interface_scene.cpp index 01f03feed8..5e24403b0c 100644 --- a/engines/xeen/interface_scene.cpp +++ b/engines/xeen/interface_scene.cpp @@ -2668,7 +2668,7 @@ void InterfaceScene::setMonsterSprite(DrawStruct &drawStruct, MazeMonster &monst drawStruct._flags &= ~0xFFF; if (monster._effect2) - drawStruct._flags = Res.MONSTER_EFFECT_FLAGS[monster._effect2][monster._effect3]; + drawStruct._flags = Res.MONSTER_EFFECT_FLAGS[monster._effect2 - 1][monster._effect3]; } void InterfaceScene::setIndoorsObjects() { diff --git a/engines/xeen/sprites.cpp b/engines/xeen/sprites.cpp index fc2159bca9..25b6a04100 100644 --- a/engines/xeen/sprites.cpp +++ b/engines/xeen/sprites.cpp @@ -475,10 +475,10 @@ void SpriteDrawer4::drawPixel(byte *dest, byte pixel) { /*------------------------------------------------------------------------*/ -const uint16 DRAWER5_MASK[4] = { 0x3333, 0x6666, 0x999A, 0xCCCD }; +const uint16 DRAWER5_THRESHOLD[4] = { 0x3333, 0x6666, 0x999A, 0xCCCD }; SpriteDrawer5::SpriteDrawer5(byte *data, size_t filesize, int index) : SpriteDrawer(data, filesize) { - _mask = DRAWER5_MASK[index]; + _threshold = DRAWER5_THRESHOLD[index]; _random1 = g_vm->getRandomNumber(0xffff); _random2 = g_vm->getRandomNumber(0xffff); } @@ -491,7 +491,7 @@ void SpriteDrawer5::drawPixel(byte *dest, byte pixel) { rcr(_random2, flag); _random2 ^= _random1; - if (_random2 > _mask) + if (_random2 > _threshold) *dest = pixel; } diff --git a/engines/xeen/sprites.h b/engines/xeen/sprites.h index e8d83e1054..f2619c81b6 100644 --- a/engines/xeen/sprites.h +++ b/engines/xeen/sprites.h @@ -218,6 +218,9 @@ public: SpriteDrawer1(byte *data, size_t filesize, int index); }; +/** + * Draws the sprite as faint ghostly, see-through. + */ class SpriteDrawer3 : public SpriteDrawer { private: uint16 _offset, _mask; @@ -248,9 +251,12 @@ public: SpriteDrawer4(byte *data, size_t filesize, int index); }; +/** + * Draws a sprite with a fuzziness effect where only some pixels of the sprite are randomly drawn + */ class SpriteDrawer5 : public SpriteDrawer { private: - uint16 _mask, _random1, _random2; + uint16 _threshold, _random1, _random2; private: /** * Roll carry right opcode emulation |