diff options
author | Paul Gilbert | 2019-08-30 19:36:02 -0700 |
---|---|---|
committer | Paul Gilbert | 2019-08-30 19:36:13 -0700 |
commit | 1588218f6f7f3c23d8c4d4b4186c51b1bae1100b (patch) | |
tree | 56cd0b0603a8531e77ebeb802ea6a975982a851d /engines/xeen/sprites.cpp | |
parent | 27efc15f8c22e550aaca36adc8ab9aef5fc9dee0 (diff) | |
download | scummvm-rg350-1588218f6f7f3c23d8c4d4b4186c51b1bae1100b.tar.gz scummvm-rg350-1588218f6f7f3c23d8c4d4b4186c51b1bae1100b.tar.bz2 scummvm-rg350-1588218f6f7f3c23d8c4d4b4186c51b1bae1100b.zip |
XEEN: Further sprite drawer mode code
Diffstat (limited to 'engines/xeen/sprites.cpp')
-rw-r--r-- | engines/xeen/sprites.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/engines/xeen/sprites.cpp b/engines/xeen/sprites.cpp index fed8b6a410..fc2159bca9 100644 --- a/engines/xeen/sprites.cpp +++ b/engines/xeen/sprites.cpp @@ -137,6 +137,8 @@ void SpriteResource::draw(XSurface &dest, int frame, const Common::Point &destPo case SPRFLAG_DRAWER1: draw = new SpriteDrawer1(_data, _filesize, flags & 0x1F); break; + case SPRFLAG_DRAWER2: + error("TODO: Sprite drawer mode 2"); case SPRFLAG_DRAWER3: draw = new SpriteDrawer3(_data, _filesize, flags & 0x1F); break; @@ -460,6 +462,19 @@ void SpriteDrawer3::drawPixel(byte *dest, byte pixel) { /*------------------------------------------------------------------------*/ +const byte DRAWER4_THRESHOLD[4] = { 4, 7, 10, 13 }; + +SpriteDrawer4::SpriteDrawer4(byte *data, size_t filesize, int index) : SpriteDrawer(data, filesize) { + _threshold = DRAWER4_THRESHOLD[index]; +} + +void SpriteDrawer4::drawPixel(byte *dest, byte pixel) { + if ((pixel & 0xf) >= _threshold) + *dest = pixel; +} + +/*------------------------------------------------------------------------*/ + const uint16 DRAWER5_MASK[4] = { 0x3333, 0x6666, 0x999A, 0xCCCD }; SpriteDrawer5::SpriteDrawer5(byte *data, size_t filesize, int index) : SpriteDrawer(data, filesize) { |