diff options
author | Willem Jan Palenstijn | 2017-07-24 21:01:19 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2017-08-24 19:46:59 +0200 |
commit | dde259f06813534c7179a714403d8fd6fe918d09 (patch) | |
tree | 1379a5c2600057ba53032c722e3a5a1578db8507 /engines/macventure | |
parent | 265fc48d1590cdd503187c79dc254d65623c8d7b (diff) | |
download | scummvm-rg350-dde259f06813534c7179a714403d8fd6fe918d09.tar.gz scummvm-rg350-dde259f06813534c7179a714403d8fd6fe918d09.tar.bz2 scummvm-rg350-dde259f06813534c7179a714403d8fd6fe918d09.zip |
COMMON: Remove BitStream base class to allow inlining calls
All users of BitStream were in fact using a specific, hardcoded variant,
so we can hardcode that variant, removing the need for virtual calls,
and enabling inlining.
Diffstat (limited to 'engines/macventure')
-rw-r--r-- | engines/macventure/container.h | 1 | ||||
-rw-r--r-- | engines/macventure/image.cpp | 12 | ||||
-rw-r--r-- | engines/macventure/image.h | 13 |
3 files changed, 13 insertions, 13 deletions
diff --git a/engines/macventure/container.h b/engines/macventure/container.h index ba1370d108..bd8cd0995a 100644 --- a/engines/macventure/container.h +++ b/engines/macventure/container.h @@ -35,7 +35,6 @@ #include "common/file.h" #include "common/fs.h" -#include "common/bitstream.h" namespace MacVenture { diff --git a/engines/macventure/image.cpp b/engines/macventure/image.cpp index 7fccaa81b4..a899341eb9 100644 --- a/engines/macventure/image.cpp +++ b/engines/macventure/image.cpp @@ -155,7 +155,7 @@ void ImageAsset::decodePPIC(ObjID id, Common::Array<byte> &data, uint &bitHeight delete baseStream; } -void ImageAsset::decodePPIC0(Common::BitStream &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes) { +void ImageAsset::decodePPIC0(Common::BitStream32BEMSB &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes) { uint words = bitWidth >> 4; uint bytes = bitWidth & 0xF; uint v = 0; @@ -178,15 +178,15 @@ void ImageAsset::decodePPIC0(Common::BitStream &stream, Common::Array<byte> &dat } -void ImageAsset::decodePPIC1(Common::BitStream &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes) { +void ImageAsset::decodePPIC1(Common::BitStream32BEMSB &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes) { decodeHuffGraphic(PPIC1Huff, stream, data, bitHeight, bitWidth, rowBytes); } -void ImageAsset::decodePPIC2(Common::BitStream &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes) { +void ImageAsset::decodePPIC2(Common::BitStream32BEMSB &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes) { decodeHuffGraphic(PPIC2Huff, stream, data, bitHeight, bitWidth, rowBytes); } -void ImageAsset::decodePPIC3(Common::BitStream &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes) { +void ImageAsset::decodePPIC3(Common::BitStream32BEMSB &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes) { // We need to load the huffman from the PPIC itself PPICHuff huff; uint16 v, bits; @@ -238,7 +238,7 @@ void ImageAsset::decodePPIC3(Common::BitStream &stream, Common::Array<byte> &dat decodeHuffGraphic(huff, stream, data, bitHeight, bitWidth, rowBytes); } -void ImageAsset::decodeHuffGraphic(const PPICHuff &huff, Common::BitStream &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes) { +void ImageAsset::decodeHuffGraphic(const PPICHuff &huff, Common::BitStream32BEMSB &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes) { byte flags = 0; _walkRepeat = 0; _walkLast = 0; @@ -333,7 +333,7 @@ void ImageAsset::decodeHuffGraphic(const PPICHuff &huff, Common::BitStream &stre } } -byte ImageAsset::walkHuff(const PPICHuff &huff, Common::BitStream &stream) { +byte ImageAsset::walkHuff(const PPICHuff &huff, Common::BitStream32BEMSB &stream) { if (_walkRepeat) { _walkRepeat--; _walkLast = ((_walkLast << 8) & 0xFF00) | (_walkLast >> 8); diff --git a/engines/macventure/image.h b/engines/macventure/image.h index 87c5cec2db..9a3a2a10e5 100644 --- a/engines/macventure/image.h +++ b/engines/macventure/image.h @@ -33,6 +33,7 @@ #include "macventure/macventure.h" #include "macventure/container.h" +#include "common/bitstream.h" namespace MacVenture { @@ -76,13 +77,13 @@ public: private: void decodePPIC(ObjID id, Common::Array<byte> &data, uint &bitHeight, uint &bitWidth, uint &rowBytes); - void decodePPIC0(Common::BitStream &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes); - void decodePPIC1(Common::BitStream &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes); - void decodePPIC2(Common::BitStream &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes); - void decodePPIC3(Common::BitStream &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes); + void decodePPIC0(Common::BitStream32BEMSB &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes); + void decodePPIC1(Common::BitStream32BEMSB &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes); + void decodePPIC2(Common::BitStream32BEMSB &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes); + void decodePPIC3(Common::BitStream32BEMSB &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes); - void decodeHuffGraphic(const PPICHuff &huff, Common::BitStream &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes); - byte walkHuff(const PPICHuff &huff, Common::BitStream &stream); + void decodeHuffGraphic(const PPICHuff &huff, Common::BitStream32BEMSB &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes); + byte walkHuff(const PPICHuff &huff, Common::BitStream32BEMSB &stream); void blitDirect(Graphics::ManagedSurface *target, int ox, int oy, const Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes); void blitBIC(Graphics::ManagedSurface *target, int ox, int oy, const Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes); |