diff options
| -rw-r--r-- | graphics/ilbm.cpp | 23 | ||||
| -rw-r--r-- | graphics/ilbm.h | 28 | 
2 files changed, 12 insertions, 39 deletions
| diff --git a/graphics/ilbm.cpp b/graphics/ilbm.cpp index e0c53ac0be..a1280b52ee 100644 --- a/graphics/ilbm.cpp +++ b/graphics/ilbm.cpp @@ -27,7 +27,6 @@  namespace Graphics { -  static char * ID2string(IFF_ID id) {  	static char str[] = "abcd"; @@ -39,7 +38,6 @@ static char * ID2string(IFF_ID id) {  	return str;  } -  #define ID_FORM     MKID_BE('FORM')  /* EA IFF 85 group identifier */  #define ID_CAT      MKID_BE('CAT ') @@ -78,7 +76,7 @@ page 376) */  /* EA IFF 85 Generic character string chunk */  #define ID_NAME     MKID_BE('NAME')  /* EA IFF 85 Generic Name of art, music, etc. chunk */ -#define ID_TEXT     MKID_BE('TEXT')) +#define ID_TEXT     MKID_BE('TEXT')  /* EA IFF 85 Generic unformatted ASCII text chunk */  #define ID_copy     MKID_BE('(c) ')  /* EA IFF 85 Generic Copyright text chunk */ @@ -181,9 +179,6 @@ IFFDecoder::IFFDecoder(Common::ReadStream &input) : _formChunk(&input), _chunk(&  	}  } -IFFDecoder::~IFFDecoder() { -} -  void IFFDecoder::decode(Surface &surface, byte *&colors) {  	_surface = &surface;  	_colors = colors; @@ -222,12 +217,9 @@ void IFFDecoder::decode(Surface &surface, byte *&colors) {  		_chunk.feed();  		_formChunk.incBytesRead(_chunk.size); -  	}  } - -  bool PBMDecoder::isTypeSupported(IFF_ID type) {  	return type == ID_PBM;  } @@ -274,16 +266,6 @@ void PBMDecoder::readBody() {  } -PBMDecoder::PBMDecoder(Common::ReadStream &input) : IFFDecoder(input) { - -} - -PBMDecoder::~PBMDecoder() { - -} - - -  void decodeILBM(Common::ReadStream &input, Surface &surface, byte *&colors) {  	IFF_ID typeId;  	BMHD bitmapHeader; @@ -292,7 +274,7 @@ void decodeILBM(Common::ReadStream &input, Surface &surface, byte *&colors) {  	uint32 colorCount = 0, i, j, si;  	byte byteRun;  	byte idx; -	colors = NULL; +	colors = 0;   	si = 0;  	formChunk.readHeader(); @@ -388,3 +370,4 @@ void decodeILBM(Common::ReadStream &input, Surface &surface, byte *&colors) {  }  }	// End of namespace Graphics + diff --git a/graphics/ilbm.h b/graphics/ilbm.h index 7d1f06767b..45c01933f5 100644 --- a/graphics/ilbm.h +++ b/graphics/ilbm.h @@ -26,7 +26,6 @@ namespace Graphics {  void decodeILBM(Common::ReadStream &input, Surface &surface, byte *&colors); -  typedef uint32 IFF_ID;  struct Chunk { @@ -94,7 +93,6 @@ struct Chunk {  	}  }; -  struct BMHD {  	uint16 width, height;  	uint16 x, y; @@ -105,14 +103,18 @@ struct BMHD {  	uint16 transparentColor;  	byte xAspect, yAspect;  	uint16 pageWidth, pageHeight; +  	BMHD() {  		memset(this, 0, sizeof(*this));  	}  }; - -  class IFFDecoder { +public: +	IFFDecoder(Common::ReadStream &input); +	virtual ~IFFDecoder() {} + +	virtual void decode(Surface &surface, byte *&colors);  protected:  	Chunk 	_formChunk; @@ -130,29 +132,17 @@ protected:  	virtual void readBMHD();  	virtual void readCMAP(); - -public: -	IFFDecoder(Common::ReadStream &input); -	virtual ~IFFDecoder(); - -	virtual void decode(Surface &surface, byte *&colors); -  }; - -  class PBMDecoder : public IFFDecoder { - +public: +	PBMDecoder(Common::ReadStream &input) : IFFDecoder(input) {}  protected:  	bool isTypeSupported(IFF_ID type);  	void readBody(); - -public: -	PBMDecoder(Common::ReadStream &input); -	~PBMDecoder(); -  };  }	// End of namespace Graphics  #endif + | 
