From dde259f06813534c7179a714403d8fd6fe918d09 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 24 Jul 2017 21:01:19 +0200 Subject: 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. --- engines/macventure/container.h | 1 - engines/macventure/image.cpp | 12 ++++++------ engines/macventure/image.h | 13 +++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'engines/macventure') 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 &data, uint &bitHeight delete baseStream; } -void ImageAsset::decodePPIC0(Common::BitStream &stream, Common::Array &data, uint bitHeight, uint bitWidth, uint rowBytes) { +void ImageAsset::decodePPIC0(Common::BitStream32BEMSB &stream, Common::Array &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 &dat } -void ImageAsset::decodePPIC1(Common::BitStream &stream, Common::Array &data, uint bitHeight, uint bitWidth, uint rowBytes) { +void ImageAsset::decodePPIC1(Common::BitStream32BEMSB &stream, Common::Array &data, uint bitHeight, uint bitWidth, uint rowBytes) { decodeHuffGraphic(PPIC1Huff, stream, data, bitHeight, bitWidth, rowBytes); } -void ImageAsset::decodePPIC2(Common::BitStream &stream, Common::Array &data, uint bitHeight, uint bitWidth, uint rowBytes) { +void ImageAsset::decodePPIC2(Common::BitStream32BEMSB &stream, Common::Array &data, uint bitHeight, uint bitWidth, uint rowBytes) { decodeHuffGraphic(PPIC2Huff, stream, data, bitHeight, bitWidth, rowBytes); } -void ImageAsset::decodePPIC3(Common::BitStream &stream, Common::Array &data, uint bitHeight, uint bitWidth, uint rowBytes) { +void ImageAsset::decodePPIC3(Common::BitStream32BEMSB &stream, Common::Array &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 &dat decodeHuffGraphic(huff, stream, data, bitHeight, bitWidth, rowBytes); } -void ImageAsset::decodeHuffGraphic(const PPICHuff &huff, Common::BitStream &stream, Common::Array &data, uint bitHeight, uint bitWidth, uint rowBytes) { +void ImageAsset::decodeHuffGraphic(const PPICHuff &huff, Common::BitStream32BEMSB &stream, Common::Array &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 &data, uint &bitHeight, uint &bitWidth, uint &rowBytes); - void decodePPIC0(Common::BitStream &stream, Common::Array &data, uint bitHeight, uint bitWidth, uint rowBytes); - void decodePPIC1(Common::BitStream &stream, Common::Array &data, uint bitHeight, uint bitWidth, uint rowBytes); - void decodePPIC2(Common::BitStream &stream, Common::Array &data, uint bitHeight, uint bitWidth, uint rowBytes); - void decodePPIC3(Common::BitStream &stream, Common::Array &data, uint bitHeight, uint bitWidth, uint rowBytes); + void decodePPIC0(Common::BitStream32BEMSB &stream, Common::Array &data, uint bitHeight, uint bitWidth, uint rowBytes); + void decodePPIC1(Common::BitStream32BEMSB &stream, Common::Array &data, uint bitHeight, uint bitWidth, uint rowBytes); + void decodePPIC2(Common::BitStream32BEMSB &stream, Common::Array &data, uint bitHeight, uint bitWidth, uint rowBytes); + void decodePPIC3(Common::BitStream32BEMSB &stream, Common::Array &data, uint bitHeight, uint bitWidth, uint rowBytes); - void decodeHuffGraphic(const PPICHuff &huff, Common::BitStream &stream, Common::Array &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 &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 &data, uint bitHeight, uint bitWidth, uint rowBytes); void blitBIC(Graphics::ManagedSurface *target, int ox, int oy, const Common::Array &data, uint bitHeight, uint bitWidth, uint rowBytes); -- cgit v1.2.3