aboutsummaryrefslogtreecommitdiff
path: root/engines/sword2
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2013-04-22 22:27:19 +0200
committerWillem Jan Palenstijn2013-04-22 22:27:19 +0200
commit617b9cf613cb3ac67a033e38fd6fd1bcdf3b19ad (patch)
tree7e7b016a0871ad7dbbc9cc0fafe1df286e2394d3 /engines/sword2
parent22d8fe9544462af6d14e87df8ec2f6b70c5871bf (diff)
downloadscummvm-rg350-617b9cf613cb3ac67a033e38fd6fd1bcdf3b19ad.tar.gz
scummvm-rg350-617b9cf613cb3ac67a033e38fd6fd1bcdf3b19ad.tar.bz2
scummvm-rg350-617b9cf613cb3ac67a033e38fd6fd1bcdf3b19ad.zip
SWORD2: Fix reference to out-of-scope variable
Diffstat (limited to 'engines/sword2')
-rw-r--r--engines/sword2/palette.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/engines/sword2/palette.cpp b/engines/sword2/palette.cpp
index c3a3d24075..9634d3af10 100644
--- a/engines/sword2/palette.cpp
+++ b/engines/sword2/palette.cpp
@@ -288,19 +288,17 @@ void Screen::fadeServer() {
}
void Screen::setSystemPalette(const byte *colors, uint start, uint num) {
- const byte *palette;
-
if (_dimPalette) {
byte pal[256 * 3];
for (uint i = start * 3; i < 3 * (start + num); i++)
pal[i] = colors[i] / 2;
- palette = pal;
- } else
- palette = colors;
+ _vm->_system->getPaletteManager()->setPalette(pal, start, num);
+ } else {
+ _vm->_system->getPaletteManager()->setPalette(colors, start, num);
+ }
- _vm->_system->getPaletteManager()->setPalette(palette, start, num);
}
} // End of namespace Sword2