diff options
Diffstat (limited to 'engines/toltecs/screen.h')
-rw-r--r-- | engines/toltecs/screen.h | 153 |
1 files changed, 0 insertions, 153 deletions
diff --git a/engines/toltecs/screen.h b/engines/toltecs/screen.h index 6050257c1b..0e188607e6 100644 --- a/engines/toltecs/screen.h +++ b/engines/toltecs/screen.h @@ -120,8 +120,6 @@ protected: byte *_fontData; }; -//*BEGIN*TEST*CODE******************************************************************************************** - struct PixelPacket { byte count; byte pixel; @@ -142,157 +140,6 @@ protected: SpriteDrawItem *_sprite; }; -class SpriteReader : public SpriteFilter { -public: - SpriteReader(byte *source, SpriteDrawItem *sprite) : SpriteFilter(sprite), _source(source) { - _curWidth = _sprite->origWidth; - _curHeight = _sprite->origHeight; - } - SpriteReaderStatus readPacket(PixelPacket &packet) { - if (_sprite->flags & 0x40) { - // shadow sprite - packet.count = _source[0] & 0x7F; - if (_source[0] & 0x80) - packet.pixel = 1; - else - packet.pixel = 0; - _source++; - } else if (_sprite->flags & 0x10) { - // 256-color sprite - packet.pixel = *_source++; - packet.count = *_source++; - } else { - // 16-color sprite - packet.count = _source[0] & 0x0F; - packet.pixel = (_source[0] & 0xF0) >> 4; - _source++; - } - _curWidth -= packet.count; - if (_curWidth <= 0) { - _curHeight--; - if (_curHeight == 0) { - return kSrsEndOfSprite; - } else { - _curWidth = _sprite->origWidth; - return kSrsEndOfLine; - } - } else { - return kSrsPixelsLeft; - } - } - byte *getSource() { - return _source; - } - void setSource(byte *source) { - _source = source; - _curHeight++; - } -protected: - byte *_source; - int16 _curWidth, _curHeight; -}; - -class SpriteFilterScaleDown : public SpriteFilter { -public: - SpriteFilterScaleDown(SpriteDrawItem *sprite, SpriteReader *reader) : SpriteFilter(sprite), _reader(reader) { - _height = _sprite->height; - _yerror = _sprite->yerror; - _origHeight = _sprite->origHeight; - _scalerStatus = 0; - } - SpriteReaderStatus readPacket(PixelPacket &packet) { - SpriteReaderStatus status; - if (_scalerStatus == 0) { - _xerror = _sprite->xdelta; - _yerror -= 100; - while (_yerror <= 0) { - do { - status = _reader->readPacket(packet); - } while (status == kSrsPixelsLeft); - _yerror += _sprite->ydelta - 100; - } - if (status == kSrsEndOfSprite) - return kSrsEndOfSprite; - _scalerStatus = 1; - } - if (_scalerStatus == 1) { - status = _reader->readPacket(packet); - byte updcount = packet.count; - while (updcount--) { - _xerror -= 100; - if (_xerror <= 0) { - if (packet.count > 0) - packet.count--; - _xerror += _sprite->xdelta; - } - } - if (status == kSrsEndOfLine) { - if (--_height == 0) - return kSrsEndOfSprite; - _scalerStatus = 0; - return kSrsEndOfLine; - } - } - return kSrsPixelsLeft; - } -protected: - SpriteReader *_reader; - int16 _xerror, _yerror; - int16 _height; - int16 _origHeight; - int _scalerStatus; -}; - -class SpriteFilterScaleUp : public SpriteFilter { -public: - SpriteFilterScaleUp(SpriteDrawItem *sprite, SpriteReader *reader) : SpriteFilter(sprite), _reader(reader) { - _height = _sprite->height; - _yerror = _sprite->yerror; - _origHeight = _sprite->origHeight; - _scalerStatus = 0; - } - SpriteReaderStatus readPacket(PixelPacket &packet) { - SpriteReaderStatus status; - if (_scalerStatus == 0) { - _xerror = _sprite->xdelta; - _sourcep = _reader->getSource(); - _scalerStatus = 1; - } - if (_scalerStatus == 1) { - status = _reader->readPacket(packet); - byte updcount = packet.count; - while (updcount--) { - _xerror -= 100; - if (_xerror <= 0) { - packet.count++; - _xerror += _sprite->xdelta; - } - } - if (status == kSrsEndOfLine) { - if (--_height == 0) - return kSrsEndOfSprite; - _yerror -= 100; - if (_yerror <= 0) { - _reader->setSource(_sourcep); - _yerror += _sprite->ydelta + 100; - } - _scalerStatus = 0; - return kSrsEndOfLine; - } - } - return kSrsPixelsLeft; - } -protected: - SpriteReader *_reader; - byte *_sourcep; - int16 _xerror, _yerror; - int16 _height; - int16 _origHeight; - int _scalerStatus; -}; - -//*END*TEST*CODE********************************************************************************************** - struct TextRect { int16 x, y; int16 width, length; |