aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2013-06-10 21:46:19 -0400
committerPaul Gilbert2013-06-10 21:46:19 -0400
commitca8a47700da17ef0c4de934a5fc980ca1e9de92e (patch)
treed8bd16fa29c0c173a9bcc6b75d24294ab9a574f2
parent7bf4d492538fefa73787f687913f1b905af8f808 (diff)
downloadscummvm-rg350-ca8a47700da17ef0c4de934a5fc980ca1e9de92e.tar.gz
scummvm-rg350-ca8a47700da17ef0c4de934a5fc980ca1e9de92e.tar.bz2
scummvm-rg350-ca8a47700da17ef0c4de934a5fc980ca1e9de92e.zip
VOYEUR: Add missing code from CMapResource & ViewPortListResource initialisation
-rw-r--r--engines/voyeur/files.cpp7
-rw-r--r--engines/voyeur/files.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/engines/voyeur/files.cpp b/engines/voyeur/files.cpp
index bdbf05c633..f258e53221 100644
--- a/engines/voyeur/files.cpp
+++ b/engines/voyeur/files.cpp
@@ -797,6 +797,7 @@ void ViewPortResource::setupViewPort() {
ViewPortListResource::ViewPortListResource(BoltFilesState &state, const byte *src) {
uint count = READ_LE_UINT16(src);
+ _palIndex = READ_LE_UINT16(src + 2);
// Load palette map
byte *palData = state._curLibPtr->memberAddr(READ_LE_UINT32(src + 4));
@@ -845,6 +846,12 @@ CMapResource::CMapResource(BoltFilesState &state, const byte *src): _vm(state._v
int count = _end - _start;
_entries = new byte[count * 3];
Common::copy(src + 6, src + 6 + 3 * count, _entries);
+
+ int palIndex = state._vm->_graphicsManager._viewPortListPtr->_palIndex;
+ if (_end > palIndex)
+ _end = palIndex;
+ if (_start > palIndex)
+ _start = palIndex;
}
CMapResource::~CMapResource() {
diff --git a/engines/voyeur/files.h b/engines/voyeur/files.h
index d1b3a09ac4..e24318fce1 100644
--- a/engines/voyeur/files.h
+++ b/engines/voyeur/files.h
@@ -272,6 +272,7 @@ class ViewPortListResource {
public:
Common::Array<ViewPortPalEntry> _palette;
Common::Array<ViewPortResource *> _entries;
+ int _palIndex;
ViewPortListResource(BoltFilesState &state, const byte *src);
virtual ~ViewPortListResource() {}