aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/inter_v6.cpp
diff options
context:
space:
mode:
authorSven Hesse2008-12-11 03:06:43 +0000
committerSven Hesse2008-12-11 03:06:43 +0000
commitc7fa7f888ac8d3dac31bba9ff93bb54f917ea9fe (patch)
treef93a5bf2535809ef184770e55deaad992862c477 /engines/gob/inter_v6.cpp
parentc7094e20df6b4dfb497e16e5d1d06456f82e01d0 (diff)
downloadscummvm-rg350-c7fa7f888ac8d3dac31bba9ff93bb54f917ea9fe.tar.gz
scummvm-rg350-c7fa7f888ac8d3dac31bba9ff93bb54f917ea9fe.tar.bz2
scummvm-rg350-c7fa7f888ac8d3dac31bba9ff93bb54f917ea9fe.zip
On second thought, an octree only works if the color to look up is in the palette.
So using a table-based approach to find the nearest color now, using only the upper 6 bits to stop the table from getting too large. It still takes noticeable time to build it. :/ But as a result, the video actually looks okay now... svn-id: r35298
Diffstat (limited to 'engines/gob/inter_v6.cpp')
-rw-r--r--engines/gob/inter_v6.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/engines/gob/inter_v6.cpp b/engines/gob/inter_v6.cpp
index 05782e8f4f..d5ef5704d0 100644
--- a/engines/gob/inter_v6.cpp
+++ b/engines/gob/inter_v6.cpp
@@ -32,6 +32,7 @@
#include "gob/game.h"
#include "gob/parse.h"
#include "gob/draw.h"
+#include "gob/indeo3.h"
namespace Gob {
@@ -394,7 +395,7 @@ void Inter_v6::setupOpcodes() {
{NULL, ""},
OPCODE(o2_printText),
OPCODE(o1_loadTot),
- OPCODE(o1_palLoad),
+ OPCODE(o6_palLoad),
/* 14 */
OPCODE(o1_keyFunc),
OPCODE(o1_capturePush),
@@ -582,6 +583,8 @@ void Inter_v6::executeDrawOpcode(byte i) {
}
bool Inter_v6::executeFuncOpcode(byte i, byte j, OpFuncParams &params) {
+ _vm->_video->_palLUT->buildNext();
+
debugC(1, kDebugFuncOp, "opcodeFunc %d.%d [0x%X.0x%X] (%s) - %s, %d, %d",
i, j, i, j, getOpcodeFuncDesc(i, j), _vm->_game->_curTotFile,
(uint) (_vm->_global->_inter_execPtr - _vm->_game->_totFileData),
@@ -793,4 +796,11 @@ bool Inter_v6::o6_evaluateStore(OpFuncParams &params) {
return false;
}
+bool Inter_v6::o6_palLoad(OpFuncParams &params) {
+ o1_palLoad(params);
+ _vm->_video->_palLUT->setPalette((const byte *) _vm->_global->_pPaletteDesc->vgaPal,
+ PaletteLUT::kPaletteRGB, 6);
+ return false;
+}
+
} // End of namespace Gob