aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorNicola Mettifogo2007-03-03 10:10:46 +0000
committerNicola Mettifogo2007-03-03 10:10:46 +0000
commit84d2c1782f0a4c31fd8a75eb075ecbc5515d2c50 (patch)
tree520d4fa27ce2ab9620dc2895d302c00ecea18dfd /engines
parentc15310920a8a8899289366c12873cda7c2f80989 (diff)
downloadscummvm-rg350-84d2c1782f0a4c31fd8a75eb075ecbc5515d2c50.tar.gz
scummvm-rg350-84d2c1782f0a4c31fd8a75eb075ecbc5515d2c50.tar.bz2
scummvm-rg350-84d2c1782f0a4c31fd8a75eb075ecbc5515d2c50.zip
removed common-case code from loadBackground
svn-id: r25949
Diffstat (limited to 'engines')
-rw-r--r--engines/parallaction/graphics.cpp28
-rw-r--r--engines/parallaction/graphics.h3
2 files changed, 30 insertions, 1 deletions
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp
index 4f942a380f..bbd92b9a0a 100644
--- a/engines/parallaction/graphics.cpp
+++ b/engines/parallaction/graphics.cpp
@@ -1155,7 +1155,31 @@ void unpackBackgroundScanline(byte *src, byte *screen, byte *mask, byte *path) {
return;
}
+void Graphics::parseBackground(Common::SeekableReadStream &stream) {
+ stream.read(_palette, PALETTE_SIZE);
+
+ uint16 _si;
+ for (_si = 0; _si < 4; _si++)
+ _bgLayers[_si] = stream.readByte();
+
+ for (_si = 0; _si < 6; _si++) {
+ _palettefx[_si]._timer = stream.readUint16BE();
+ _palettefx[_si]._step = stream.readUint16BE();
+ _palettefx[_si]._flags = stream.readUint16BE();
+ _palettefx[_si]._first = stream.readByte();
+ _palettefx[_si]._last = stream.readByte();
+ }
+
+#if 0
+ uint16 v147;
+ for (v147 = 0; v147 < PALETTE_SIZE; v147++) {
+ byte _al = _palette[v147];
+ _palette[PALETTE_SIZE+v147] = _al / 2;
+ }
+#endif
+
+}
void Graphics::loadBackground(const char *filename, Graphics::Buffers buffer) {
@@ -1164,6 +1188,8 @@ void Graphics::loadBackground(const char *filename, Graphics::Buffers buffer) {
if (!_vm->_archive.openArchivedFile(filename))
errorFileNotFound(filename);
+ parseBackground(_vm->_archive);
+/*
_vm->_archive.read(_palette, PALETTE_SIZE);
uint16 _si;
@@ -1185,7 +1211,7 @@ void Graphics::loadBackground(const char *filename, Graphics::Buffers buffer) {
_palette[PALETTE_SIZE+v147] = _al / 2;
}
#endif
-
+*/
memset(_buffers[kPath0], 0, SCREENPATH_WIDTH*SCREEN_HEIGHT);
memset(_buffers[kMask0], 0, SCREENMASK_WIDTH*SCREEN_HEIGHT);
diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h
index 7f51cd34c7..54eb15cb3c 100644
--- a/engines/parallaction/graphics.h
+++ b/engines/parallaction/graphics.h
@@ -24,6 +24,8 @@
#define PARALLACTION_GRAPHICS_H
#include "parallaction/defs.h"
+#include "common/stream.h"
+
namespace Parallaction {
@@ -98,6 +100,7 @@ public:
// location
void loadBackground(const char *filename, Graphics::Buffers buffer);
+ void parseBackground(Common::SeekableReadStream &stream);
void loadMaskAndPath(const char *filename);
uint16 queryPath(uint16 x, uint16 y);
int16 queryMask(int16 v);