[Scummvm-cvs-logs] SF.net SVN: scummvm: [31864] scummvm/trunk/engines/parallaction/disk_br.cpp
peres001 at users.sourceforge.net
peres001 at users.sourceforge.net
Sun May 4 17:06:48 CEST 2008
Revision: 31864
http://scummvm.svn.sourceforge.net/scummvm/?rev=31864&view=rev
Author: peres001
Date: 2008-05-04 08:06:47 -0700 (Sun, 04 May 2008)
Log Message:
-----------
Partly fixed loading of bitmaps in BRA Amiga. Bitmaps are still broken, but less than before.
Modified Paths:
--------------
scummvm/trunk/engines/parallaction/disk_br.cpp
Modified: scummvm/trunk/engines/parallaction/disk_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/disk_br.cpp 2008-05-04 13:53:22 UTC (rev 31863)
+++ scummvm/trunk/engines/parallaction/disk_br.cpp 2008-05-04 15:06:47 UTC (rev 31864)
@@ -437,56 +437,6 @@
}
}
-class BackgroundDecoder : public Graphics::ILBMDecoder {
-
- PaletteFxRange *_range;
- uint32 _i;
-
-protected:
- void readCRNG(Common::IFFChunk &chunk) {
- _range[_i]._timer = chunk.readUint16BE();
- _range[_i]._step = chunk.readUint16BE();
- _range[_i]._flags = chunk.readUint16BE();
- _range[_i]._first = chunk.readByte();
- _range[_i]._last = chunk.readByte();
-
- _i++;
- }
-
-public:
- BackgroundDecoder(Common::ReadStream &input, Graphics::Surface &surface, byte *&colors, PaletteFxRange *range) :
- Graphics::ILBMDecoder(input, surface, colors), _range(range), _i(0) {
- }
-
- void decode() {
- Common::IFFChunk *chunk;
- while ((chunk = nextChunk()) != 0) {
- switch (chunk->id) {
- case ID_BMHD:
- readBMHD(*chunk);
- break;
-
- case ID_CMAP:
- readCMAP(*chunk);
- break;
-
- case ID_BODY:
- readBODY(*chunk);
- break;
-
- case ID_CRNG:
- readCRNG(*chunk);
- break;
- }
- }
- }
-
- uint32 getNumRanges() {
- return _i;
- }
-};
-
-
void AmigaDisk_br::loadBackground(BackgroundInfo& info, const char *name) {
char path[PATH_LEN];
@@ -498,9 +448,8 @@
errorFileNotFound(path);
byte *pal;
- PaletteFxRange ranges[6];
- BackgroundDecoder decoder(s, info.bg, pal, ranges);
+ Graphics::ILBMDecoder decoder(s, info.bg, pal);
decoder.decode();
uint i;
@@ -606,8 +555,15 @@
errorFileNotFound(path);
}
- loadBackground(_backgroundTemp, path);
- return new SurfaceToFrames(&_backgroundTemp.bg);
+ byte *pal = 0;
+ Graphics::Surface* surf = new Graphics::Surface;
+
+ Graphics::ILBMDecoder decoder(stream, *surf, pal);
+ decoder.decode();
+
+ free(pal);
+
+ return new SurfaceToFrames(surf);
}
Sprites* AmigaDisk_br::createSprites(const char *path) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list