aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorFlorian Kagerer2009-10-19 21:27:39 +0000
committerFlorian Kagerer2009-10-19 21:27:39 +0000
commit557f32cdb14eeddff558abd9da6b64430ee56de9 (patch)
treeae142c9aff6c1c82c71466ba3d37e84e9043a149 /engines/kyra
parent7b8bc76453336eab50c7bcecc98e70481d86bc02 (diff)
downloadscummvm-rg350-557f32cdb14eeddff558abd9da6b64430ee56de9.tar.gz
scummvm-rg350-557f32cdb14eeddff558abd9da6b64430ee56de9.tar.bz2
scummvm-rg350-557f32cdb14eeddff558abd9da6b64430ee56de9.zip
LOL/PC-98: match vaelan's cube behaviour with original code
svn-id: r45252
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/lol.cpp34
1 files changed, 23 insertions, 11 deletions
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp
index e356187007..471e791c9e 100644
--- a/engines/kyra/lol.cpp
+++ b/engines/kyra/lol.cpp
@@ -2842,21 +2842,33 @@ int LoLEngine::processMagicSwarm(int charNum, int damage) {
}
int LoLEngine::processMagicVaelansCube() {
- uint8 *tmpPal1 = new uint8[768];
- uint8 *tmpPal2 = new uint8[768];
uint8 *sp1 = _screen->getPalette(1).getData();
+ int len = _screen->getPalette(1).getNumColors() * 3;
- memcpy(tmpPal1, sp1, 768);
- memcpy(tmpPal2, sp1, 768);
+ uint8 *tmpPal1 = new uint8[len];
+ uint8 *tmpPal2 = new uint8[len];
- for (int i = 0; i < 128; i++) {
- uint16 a = sp1[i * 3] + 16;
- tmpPal2[i * 3] = (a > 60) ? 60 : a;
- tmpPal2[i * 3 + 1] = sp1[i * 3 + 1];
- a = sp1[i * 3 + 2] + 19;
- tmpPal2[i * 3 + 2] = (a > 60) ? 60 : a;
- }
+ memcpy(tmpPal1, sp1, len);
+ memcpy(tmpPal2, sp1, len);
+ if (_flags.use16ColorMode) {
+ for (int i = 0; i < 16; i++) {
+ uint16 a = sp1[i * 3 + 1] + 16;
+ tmpPal2[i * 3 + 1] = (a > 58) ? 58 : a;
+ tmpPal2[i * 3] = sp1[i * 3];
+ a = sp1[i * 3 + 2] + 16;
+ tmpPal2[i * 3 + 2] = (a > 63) ? 63 : a;
+ }
+ } else {
+ for (int i = 0; i < 128; i++) {
+ uint16 a = sp1[i * 3] + 16;
+ tmpPal2[i * 3] = (a > 60) ? 60 : a;
+ tmpPal2[i * 3 + 1] = sp1[i * 3 + 1];
+ a = sp1[i * 3 + 2] + 19;
+ tmpPal2[i * 3 + 2] = (a > 60) ? 60 : a;
+ }
+ }
+
snd_playSoundEffect(146, -1);
uint32 ctime = _system->getMillis();