[Scummvm-cvs-logs] SF.net SVN: scummvm: [26453] scummvm/trunk/engines/parallaction
peres001 at users.sourceforge.net
peres001 at users.sourceforge.net
Wed Apr 11 22:20:22 CEST 2007
Revision: 26453
http://scummvm.svn.sourceforge.net/scummvm/?rev=26453&view=rev
Author: peres001
Date: 2007-04-11 13:20:22 -0700 (Wed, 11 Apr 2007)
Log Message:
-----------
Implemented palette animation to Amiga version of Nippon Safes.
Modified Paths:
--------------
scummvm/trunk/engines/parallaction/disk.cpp
scummvm/trunk/engines/parallaction/graphics.cpp
Modified: scummvm/trunk/engines/parallaction/disk.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/disk.cpp 2007-04-11 20:01:06 UTC (rev 26452)
+++ scummvm/trunk/engines/parallaction/disk.cpp 2007-04-11 20:20:22 UTC (rev 26453)
@@ -1030,6 +1030,31 @@
}
}
+class BackgroundDecoder : public Graphics::ILBMDecoder {
+
+ PaletteFxRange *_range;
+ uint32 _i;
+
+protected:
+ void readCRNG() {
+ _range[_i]._timer = _chunk.readUint16();
+ _range[_i]._step = _chunk.readUint16();
+ _range[_i]._flags = _chunk.readUint16();
+ _range[_i]._first = _chunk.readByte();
+ _range[_i]._last = _chunk.readByte();
+
+ _i++;
+ }
+
+public:
+ BackgroundDecoder(Common::ReadStream &input, PaletteFxRange *range) : ILBMDecoder(input), _range(range), _i(0) {
+ }
+
+ uint32 getNumRanges() {
+ return _i;
+ }
+};
+
void AmigaDisk::loadScenery(const char* background, const char* mask) {
debugC(1, kDebugDisk, "AmigaDisk::loadScenery '%s', '%s'", background, mask);
@@ -1039,7 +1064,7 @@
sprintf(path, "%s.bkgnd", background);
Common::SeekableReadStream *s = openArchivedFile(path, true);
- Graphics::ILBMDecoder decoder(*s);
+ BackgroundDecoder decoder(*s, _vm->_gfx->_palettefx);
decoder.decode(surf, pal);
for (uint32 i = 0; i < PALETTE_SIZE; i++)
_vm->_gfx->_palette[i] = pal[i] >> 2;
Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp 2007-04-11 20:01:06 UTC (rev 26452)
+++ scummvm/trunk/engines/parallaction/graphics.cpp 2007-04-11 20:20:22 UTC (rev 26453)
@@ -883,17 +883,6 @@
return 3;
}
-void Gfx::initBuffers() {
-
- _buffers[kBitFront] = (byte*)malloc(SCREEN_SIZE);
- _buffers[kBitBack] = (byte*)malloc(SCREEN_SIZE);
- _buffers[kBit2] = (byte*)malloc(SCREEN_SIZE);
- _buffers[kMask0] = (byte*)malloc(SCREENMASK_WIDTH * SCREEN_HEIGHT);
-
- return;
-}
-
-
Gfx::Gfx(Parallaction* vm) :
_vm(vm) {
@@ -901,7 +890,10 @@
g_system->initSize(SCREEN_WIDTH, SCREEN_HEIGHT);
g_system->endGFXTransaction();
- initBuffers();
+ _buffers[kBitFront] = (byte*)malloc(SCREEN_SIZE);
+ _buffers[kBitBack] = (byte*)malloc(SCREEN_SIZE);
+ _buffers[kBit2] = (byte*)malloc(SCREEN_SIZE);
+ _buffers[kMask0] = (byte*)malloc(SCREENMASK_WIDTH * SCREEN_HEIGHT);
setBlackPalette();
@@ -917,7 +909,6 @@
Gfx::~Gfx() {
free(_buffers[kMask0]);
-
free(_buffers[kBitFront]);
free(_buffers[kBitBack]);
free(_buffers[kBit2]);
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