aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/inter_v7.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/gob/inter_v7.cpp')
-rw-r--r--engines/gob/inter_v7.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/engines/gob/inter_v7.cpp b/engines/gob/inter_v7.cpp
index 6cf69ed9df..4d92386c94 100644
--- a/engines/gob/inter_v7.cpp
+++ b/engines/gob/inter_v7.cpp
@@ -27,6 +27,7 @@
#include "graphics/cursorman.h"
#include "graphics/wincursor.h"
+#include "graphics/decoders/iff.h"
#include "gob/gob.h"
#include "gob/global.h"
@@ -72,7 +73,7 @@ void Inter_v7::setupOpcodesDraw() {
OPCODEDRAW(0x95, o7_zeroVar);
OPCODEDRAW(0xA1, o7_getINIValue);
OPCODEDRAW(0xA2, o7_setINIValue);
- OPCODEDRAW(0xA4, o7_loadLBMPalette);
+ OPCODEDRAW(0xA4, o7_loadIFFPalette);
OPCODEDRAW(0xC4, o7_opendBase);
OPCODEDRAW(0xC5, o7_closedBase);
OPCODEDRAW(0xC6, o7_getDBString);
@@ -523,7 +524,7 @@ void Inter_v7::o7_setINIValue() {
_inis.setValue(file, section, key, value);
}
-void Inter_v7::o7_loadLBMPalette() {
+void Inter_v7::o7_loadIFFPalette() {
Common::String file = _vm->_game->_script->evalString();
if (!file.contains('.'))
file += ".LBM";
@@ -534,26 +535,26 @@ void Inter_v7::o7_loadLBMPalette() {
if (startIndex > stopIndex)
SWAP(startIndex, stopIndex);
- Common::SeekableReadStream *lbmFile = _vm->_dataIO->getFile(file);
- if (!lbmFile) {
- warning("o7_loadLBMPalette(): No such file \"%s\"", file.c_str());
+ Common::SeekableReadStream *iffFile = _vm->_dataIO->getFile(file);
+ if (!iffFile) {
+ warning("o7_loadIFFPalette(): No such file \"%s\"", file.c_str());
return;
}
- ImageType type = Surface::identifyImage(*lbmFile);
- if (type != kImageTypeLBM) {
- warning("o7_loadLBMPalette(): \"%s\" is no LBM", file.c_str());
+ ImageType type = Surface::identifyImage(*iffFile);
+ if (type != kImageTypeIFF) {
+ warning("o7_loadIFFPalette(): \"%s\" is no IFF", file.c_str());
return;
}
- byte palette[768];
-
- LBMLoader lbm(*lbmFile);
- if (!lbm.loadPalette(palette)) {
- warning("o7_loadLBMPalette(): Failed reading palette from LBM \"%s\"", file.c_str());
+ Graphics::IFFDecoder decoder;
+ decoder.loadStream(*iffFile);
+ if (!decoder.getPalette() || decoder.getPaletteColorCount() != 256) {
+ warning("o7_loadIFFPalette(): Failed reading palette from IFF \"%s\"", file.c_str());
return;
}
+ byte *palette = (byte *)decoder.getPalette();
memset(palette , 0x00, 3);
memset(palette + 765, 0xFF, 3);
for (int i = 0; i < 768; i++)