aboutsummaryrefslogtreecommitdiff
path: root/engines/made/resource.cpp
diff options
context:
space:
mode:
authorBenjamin Haisch2008-04-23 20:12:06 +0000
committerBenjamin Haisch2008-04-23 20:12:06 +0000
commitd0ad5867e0d8ecb21aee7abfe0e7beb8eacfcf25 (patch)
tree77bafd6d29d67402ed0d22db8c43b64c4eb5f926 /engines/made/resource.cpp
parentc841481aa37e673af7cadda41da6dbc77514a8d4 (diff)
downloadscummvm-rg350-d0ad5867e0d8ecb21aee7abfe0e7beb8eacfcf25.tar.gz
scummvm-rg350-d0ad5867e0d8ecb21aee7abfe0e7beb8eacfcf25.tar.bz2
scummvm-rg350-d0ad5867e0d8ecb21aee7abfe0e7beb8eacfcf25.zip
Fixed palette issues when showing the inventory and the menu.
Moved drawing code from drawFlex/drawAnimFrame to drawSurface. Implemented opcodes: - o1_VISUALFX - o1_SCREENLOCK - o1_SETTIMER - o1_SETGROUND - o1_SETCLIP - o1_SETEXCLUDE svn-id: r31675
Diffstat (limited to 'engines/made/resource.cpp')
-rw-r--r--engines/made/resource.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/engines/made/resource.cpp b/engines/made/resource.cpp
index be212be733..3d9cec6fc1 100644
--- a/engines/made/resource.cpp
+++ b/engines/made/resource.cpp
@@ -69,12 +69,14 @@ void PictureResource::load(byte *source, int size) {
/*uint16 u = */sourceS->readUint16LE();
uint16 width = sourceS->readUint16LE();
uint16 height = sourceS->readUint16LE();
+
+ _paletteColorCount = (cmdOffs - 18) / 3; // 18 = sizeof header
debug(2, "width = %d; height = %d\n", width, height);
if (_hasPalette) {
- _picturePalette = new byte[768];
- sourceS->read(_picturePalette, 768);
+ _picturePalette = new byte[_paletteColorCount * 3];
+ sourceS->read(_picturePalette, _paletteColorCount * 3);
}
_picture = new Graphics::Surface();
@@ -196,6 +198,13 @@ void MenuResource::load(byte *source, int size) {
delete sourceS;
}
+const char *MenuResource::getString(int index) const {
+ if (index < _strings.size())
+ return _strings[index].c_str();
+ else
+ return NULL;
+}
+
/* ProjectReader */
ProjectReader::ProjectReader() {