aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Hesse2014-03-16 15:15:07 +0100
committerSven Hesse2014-03-16 15:35:35 +0100
commit0f9b1364cf0f4e15abd4c11519f4cbbcda44789f (patch)
treea6d3c828ebe83ce7671ea1748c2042a17cd66951
parent175cc60a0fff5cf20351020dcc246cb0ce396d38 (diff)
downloadscummvm-rg350-0f9b1364cf0f4e15abd4c11519f4cbbcda44789f.tar.gz
scummvm-rg350-0f9b1364cf0f4e15abd4c11519f4cbbcda44789f.tar.bz2
scummvm-rg350-0f9b1364cf0f4e15abd4c11519f4cbbcda44789f.zip
GOB: Remove the last remnants of Draw::_vgaSmallPalette
Draw::_vgaSmallPalette was supposed to be a 16-color VGA palette / EGA palette, but we've been using the first 16 entries of Draw::_vgaPalette for that for ages now. The only parts where we didn't were codepaths never actually taken in the gob games, so for the sake of clarity (and fixing Coverity issues), this commit removes those as well. Fixes Coverity issues 1192648 and 1192649.
-rw-r--r--engines/gob/draw.cpp5
-rw-r--r--engines/gob/draw.h1
-rw-r--r--engines/gob/inter_v1.cpp18
-rw-r--r--engines/gob/minigames/geisha/diving.cpp3
-rw-r--r--engines/gob/minigames/geisha/penetration.cpp3
5 files changed, 11 insertions, 19 deletions
diff --git a/engines/gob/draw.cpp b/engines/gob/draw.cpp
index 081afe4a05..3ee6d64bec 100644
--- a/engines/gob/draw.cpp
+++ b/engines/gob/draw.cpp
@@ -88,11 +88,6 @@ Draw::Draw(GobEngine *vm) : _vm(vm) {
_vgaPalette[i].blue = 0;
_vgaPalette[i].green = 0;
}
- for (int i = 0; i < 16; i++) {
- _vgaSmallPalette[i].red = 0;
- _vgaSmallPalette[i].blue = 0;
- _vgaSmallPalette[i].green = 0;
- }
_showCursor = 0;
_cursorIndex = 0;
diff --git a/engines/gob/draw.h b/engines/gob/draw.h
index ba6f183c6c..eb12e85468 100644
--- a/engines/gob/draw.h
+++ b/engines/gob/draw.h
@@ -115,7 +115,6 @@ public:
int16 _unusedPalette1[18];
int16 _unusedPalette2[16];
Video::Color _vgaPalette[256];
- Video::Color _vgaSmallPalette[16];
// 0 (00b): No cursor
// 1 (01b): Cursor would be on _backSurface
diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp
index 10364952f2..40134bbf17 100644
--- a/engines/gob/inter_v1.cpp
+++ b/engines/gob/inter_v1.cpp
@@ -1125,7 +1125,7 @@ void Inter_v1::o1_palLoad(OpFuncParams &params) {
_vm->_draw->_vgaPalette[i].blue = _vm->_game->_script->readByte();
}
- memcpy(_vm->_draw->_vgaSmallPalette, _vm->_draw->_vgaPalette, 16 * 3);
+ memcpy(_vm->_draw->_vgaPalette, _vm->_draw->_vgaPalette, 16 * 3);
break;
case 53:
@@ -1183,7 +1183,7 @@ void Inter_v1::o1_palLoad(OpFuncParams &params) {
_vm->_palAnim->fade(_vm->_global->_pPaletteDesc, 0, 0);
return;
}
- _vm->_global->_pPaletteDesc->vgaPal = _vm->_draw->_vgaSmallPalette;
+ _vm->_global->_pPaletteDesc->vgaPal = _vm->_draw->_vgaPalette;
_vm->_palAnim->fade(_vm->_global->_pPaletteDesc, 0, 0);
}
}
@@ -2489,21 +2489,21 @@ void Inter_v1::animPalette() {
_vm->_video->waitRetrace();
if (_animPalDir[0] == -1) {
- col = _vm->_draw->_vgaSmallPalette[_animPalLowIndex[0]];
+ col = _vm->_draw->_vgaPalette[_animPalLowIndex[0]];
for (i = _animPalLowIndex[0]; i < _animPalHighIndex[0]; i++)
- _vm->_draw->_vgaSmallPalette[i] = _vm->_draw->_vgaSmallPalette[i + 1];
+ _vm->_draw->_vgaPalette[i] = _vm->_draw->_vgaPalette[i + 1];
- _vm->_draw->_vgaSmallPalette[_animPalHighIndex[0]] = col;
+ _vm->_draw->_vgaPalette[_animPalHighIndex[0]] = col;
} else {
- col = _vm->_draw->_vgaSmallPalette[_animPalHighIndex[0]];
+ col = _vm->_draw->_vgaPalette[_animPalHighIndex[0]];
for (i = _animPalHighIndex[0]; i > _animPalLowIndex[0]; i--)
- _vm->_draw->_vgaSmallPalette[i] = _vm->_draw->_vgaSmallPalette[i - 1];
+ _vm->_draw->_vgaPalette[i] = _vm->_draw->_vgaPalette[i - 1];
- _vm->_draw->_vgaSmallPalette[_animPalLowIndex[0]] = col;
+ _vm->_draw->_vgaPalette[_animPalLowIndex[0]] = col;
}
- _vm->_global->_pPaletteDesc->vgaPal = _vm->_draw->_vgaSmallPalette;
+ _vm->_global->_pPaletteDesc->vgaPal = _vm->_draw->_vgaPalette;
_vm->_video->setFullPalette(_vm->_global->_pPaletteDesc);
}
diff --git a/engines/gob/minigames/geisha/diving.cpp b/engines/gob/minigames/geisha/diving.cpp
index 20c0688dd7..37ef291a93 100644
--- a/engines/gob/minigames/geisha/diving.cpp
+++ b/engines/gob/minigames/geisha/diving.cpp
@@ -389,8 +389,7 @@ void Diving::initScreen() {
_vm->_util->setFrameRate(15);
// Set palette
- memcpy(_vm->_draw->_vgaPalette , kPalette, sizeof(kPalette));
- memcpy(_vm->_draw->_vgaSmallPalette, kPalette, sizeof(kPalette));
+ memcpy(_vm->_draw->_vgaPalette, kPalette, sizeof(kPalette));
// Draw background decal
_vm->_draw->_backSurface->clear();
diff --git a/engines/gob/minigames/geisha/penetration.cpp b/engines/gob/minigames/geisha/penetration.cpp
index 16742c712f..0ebcd2c55b 100644
--- a/engines/gob/minigames/geisha/penetration.cpp
+++ b/engines/gob/minigames/geisha/penetration.cpp
@@ -840,8 +840,7 @@ void Penetration::setPalette() {
_vm->_palAnim->fade(0, 0, 0);
// Set palette
- memcpy(_vm->_draw->_vgaPalette , kPalettes[_floor], 3 * kPaletteSize);
- memcpy(_vm->_draw->_vgaSmallPalette, kPalettes[_floor], 3 * kPaletteSize);
+ memcpy(_vm->_draw->_vgaPalette, kPalettes[_floor], 3 * kPaletteSize);
_needFadeIn = true;
}