aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Hamm2007-12-20 19:02:16 +0000
committerVincent Hamm2007-12-20 19:02:16 +0000
commitb9aaa43bfba4f37705c03b053536bd7cf064a795 (patch)
tree7cd48c7a9d243374ad1ac57d68623cabc937034b
parent335e9da41dfe5f019c83478f8ffe95b0a8807dd4 (diff)
downloadscummvm-rg350-b9aaa43bfba4f37705c03b053536bd7cf064a795.tar.gz
scummvm-rg350-b9aaa43bfba4f37705c03b053536bd7cf064a795.tar.bz2
scummvm-rg350-b9aaa43bfba4f37705c03b053536bd7cf064a795.zip
Fix palette manipulation code
Add one missing opcode svn-id: r29928
-rw-r--r--engines/cruise/function.cpp16
-rw-r--r--engines/cruise/gfxModule.cpp4
2 files changed, 16 insertions, 4 deletions
diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp
index 25899a56ed..38d5c966b2 100644
--- a/engines/cruise/function.cpp
+++ b/engines/cruise/function.cpp
@@ -571,12 +571,24 @@ int16 Op_WriteObject(void) {
int16 param3 = popVar();
int16 param4 = popVar();
-getSingleObjectParam(param4, param3, param2, &returnParam);
+ getSingleObjectParam(param4, param3, param2, &returnParam);
setObjectPosition(param4, param3, param2, param1);
return returnParam;
}
+int16 Op_ReadObject(void) {
+ int16 returnParam;
+
+ int member = popVar();
+ int obj = popVar();
+ int ovl = popVar();
+
+ getSingleObjectParam(ovl, obj, member, &returnParam);
+
+ return returnParam;
+}
+
int16 Op_FadeIn(void) {
doFade = 1;
return 0;
@@ -1614,7 +1626,7 @@ opcodeFunction opcodeTablePtr[] =
Op_FindObject,
Op_FindProc,
Op_WriteObject,
- NULL, // Op_ReadObject
+ Op_ReadObject,
Op_RemoveOverlay,
Op_AddBackgroundIncrust,
diff --git a/engines/cruise/gfxModule.cpp b/engines/cruise/gfxModule.cpp
index d7a2a9cbf8..dbb7614245 100644
--- a/engines/cruise/gfxModule.cpp
+++ b/engines/cruise/gfxModule.cpp
@@ -184,13 +184,13 @@ void flip() {
//uint8* inPtr = globalScreen;
if (palDirtyMax != -1) {
- for (i = palDirtyMin; i < palDirtyMax; i++) {
+ for (i = palDirtyMin; i <= palDirtyMax; i++) {
paletteRGBA[i * 4 + 0] = lpalette[i].R;
paletteRGBA[i * 4 + 1] = lpalette[i].G;
paletteRGBA[i * 4 + 2] = lpalette[i].B;
paletteRGBA[i * 4 + 3] = 0xFF;
}
- g_system->setPalette(paletteRGBA, palDirtyMin, palDirtyMax - palDirtyMin + 1);
+ g_system->setPalette(paletteRGBA+palDirtyMin*4, palDirtyMin, palDirtyMax - palDirtyMin + 1);
palDirtyMin = 256;
palDirtyMax = -1;
}