XEEN: Fix to use correct drawer for shades, drawer cleanup

This commit is contained in:
Paul Gilbert 2019-08-30 21:04:07 -07:00
parent 1588218f6f
commit 0f1722ebce
3 changed files with 11 additions and 5 deletions

View File

@ -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() {

View File

@ -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;
}

View File

@ -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