aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/actor.cpp5
-rw-r--r--engines/scumm/actor.h2
-rw-r--r--engines/scumm/akos.cpp2
-rw-r--r--engines/scumm/akos.h2
-rw-r--r--engines/scumm/base-costume.h2
-rw-r--r--engines/scumm/costume.cpp13
-rw-r--r--engines/scumm/costume.h6
-rw-r--r--engines/scumm/he/script_v100he.cpp6
-rw-r--r--engines/scumm/he/script_v90he.cpp6
-rw-r--r--engines/scumm/saveload.h2
10 files changed, 21 insertions, 25 deletions
diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index eea1ec070b..f3c8e2ff6b 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -2484,9 +2484,10 @@ void Actor::saveLoadWithSerializer(Serializer *ser) {
MKLINE(Actor, _flip, sleByte, VER(32)),
MKLINE(Actor, _heSkipLimbs, sleByte, VER(32)),
- // Actor palette grew from 64 to 256 bytes
+ // Actor palette grew from 64 to 256 bytes and switched to uint16 in HE games
MKARRAY_OLD(Actor, _palette[0], sleByte, 64, VER(8), VER(9)),
- MKARRAY(Actor, _palette[0], sleByte, 256, VER(10)),
+ MKARRAY_OLD(Actor, _palette[0], sleByte, 256, VER(10), VER(77)),
+ MKARRAY(Actor, _palette[0], sleUint16, 256, VER(78)),
MK_OBSOLETE(Actor, _mask, sleByte, VER(8), VER(9)),
MKLINE(Actor, _shadowMode, sleByte, VER(8)),
diff --git a/engines/scumm/actor.h b/engines/scumm/actor.h
index 3e8fe6626b..d32f268b11 100644
--- a/engines/scumm/actor.h
+++ b/engines/scumm/actor.h
@@ -157,7 +157,7 @@ protected:
};
- byte _palette[256];
+ uint16 _palette[256];
int _elevation;
uint16 _facing;
uint16 _targetFacing;
diff --git a/engines/scumm/akos.cpp b/engines/scumm/akos.cpp
index 347b5a03fc..b7e36b7cea 100644
--- a/engines/scumm/akos.cpp
+++ b/engines/scumm/akos.cpp
@@ -289,7 +289,7 @@ void AkosCostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) {
} while ((uint16)mask);
}
-void AkosRenderer::setPalette(byte *new_palette) {
+void AkosRenderer::setPalette(uint16 *new_palette) {
uint size, i;
size = _vm->getResourceDataSize(akpl);
diff --git a/engines/scumm/akos.h b/engines/scumm/akos.h
index 17576e5869..9f4f09d4dc 100644
--- a/engines/scumm/akos.h
+++ b/engines/scumm/akos.h
@@ -107,7 +107,7 @@ public:
int16 _actorHitX, _actorHitY;
bool _actorHitResult;
- void setPalette(byte *_palette);
+ void setPalette(uint16 *_palette);
void setFacing(const Actor *a);
void setCostume(int costume, int shadow);
diff --git a/engines/scumm/base-costume.h b/engines/scumm/base-costume.h
index 59ca3ded1f..d41d795e34 100644
--- a/engines/scumm/base-costume.h
+++ b/engines/scumm/base-costume.h
@@ -145,7 +145,7 @@ public:
}
virtual ~BaseCostumeRenderer() {}
- virtual void setPalette(byte *palette) = 0;
+ virtual void setPalette(uint16 *palette) = 0;
virtual void setFacing(const Actor *a) = 0;
virtual void setCostume(int costume, int shadow) = 0;
diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp
index 82497de87a..4358e03a2a 100644
--- a/engines/scumm/costume.cpp
+++ b/engines/scumm/costume.cpp
@@ -791,7 +791,7 @@ byte ClassicCostumeRenderer::drawLimb(const Actor *a, int limb) {
}
-void NESCostumeRenderer::setPalette(byte *palette) {
+void NESCostumeRenderer::setPalette(uint16 *palette) {
// TODO
}
@@ -874,17 +874,20 @@ void ClassicCostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask)
} while (mask&0xFFFF);
}
-void ClassicCostumeRenderer::setPalette(byte *palette) {
+void ClassicCostumeRenderer::setPalette(uint16 *palette) {
int i;
byte color;
if (_loaded._format == 0x57) {
- memcpy(_palette, palette, 13);
+ for (i = 0; i < 13; i++)
+ _palette[i] = color;
} else if (_vm->_game.features & GF_OLD_BUNDLE) {
if (_vm->getCurrentLights() & LIGHTMODE_actor_use_colors) {
- memcpy(_palette, palette, 16);
+ for (i = 0; i < 16; i++)
+ _palette[i] = color;
} else {
- memset(_palette, 8, 16);
+ for (i = 0; i < 16; i++)
+ _palette[i] = 8;
_palette[12] = 0;
}
_palette[_loaded._palette[0]] = _palette[0];
diff --git a/engines/scumm/costume.h b/engines/scumm/costume.h
index 003bd6ce2b..ecb12986cf 100644
--- a/engines/scumm/costume.h
+++ b/engines/scumm/costume.h
@@ -94,7 +94,7 @@ protected:
public:
ClassicCostumeRenderer(ScummEngine *vm) : BaseCostumeRenderer(vm), _loaded(vm) {}
- void setPalette(byte *palette);
+ void setPalette(uint16 *palette);
void setFacing(const Actor *a);
void setCostume(int costume, int shadow);
@@ -116,7 +116,7 @@ protected:
public:
NESCostumeRenderer(ScummEngine *vm) : BaseCostumeRenderer(vm), _loaded(vm) {}
- void setPalette(byte *palette);
+ void setPalette(uint16 *palette);
void setFacing(const Actor *a);
void setCostume(int costume, int shadow);
@@ -131,7 +131,7 @@ protected:
public:
C64CostumeRenderer(ScummEngine *vm) : BaseCostumeRenderer(vm), _loaded(vm) {}
- void setPalette(byte *palette) {}
+ void setPalette(uint16 *palette) {}
void setFacing(const Actor *a) {}
void setCostume(int costume, int shadow);
diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp
index d588c26a77..90f2764b3d 100644
--- a/engines/scumm/he/script_v100he.cpp
+++ b/engines/scumm/he/script_v100he.cpp
@@ -2617,11 +2617,7 @@ void ScummEngine_v100he::o100_getPaletteData() {
r = MAX(0, r);
r = MIN(r, 255);
if (_game.features & GF_16BIT_COLOR) {
- uint32 ar = ((r >> 3) << 10) & 0xFFFF;
- uint32 ag = ((g >> 3) << 5) & 0xFFFF;
- uint32 ab = ((b >> 3) << 0) & 0xFFFF;
- uint32 col = ar | ag | ab;
- push(col);
+ push(get16BitColor(r, g, b));
} else {
push(getHEPaletteSimilarColor(1, r, g, 10, 245));
}
diff --git a/engines/scumm/he/script_v90he.cpp b/engines/scumm/he/script_v90he.cpp
index 212ba69bdc..c6b919f554 100644
--- a/engines/scumm/he/script_v90he.cpp
+++ b/engines/scumm/he/script_v90he.cpp
@@ -2147,11 +2147,7 @@ void ScummEngine_v90he::o90_getPaletteData() {
r = MIN(r, 255);
if (_game.features & GF_16BIT_COLOR) {
- uint32 ar = ((r >> 3) << 10) & 0xFFFF;
- uint32 ag = ((g >> 3) << 5) & 0xFFFF;
- uint32 ab = ((b >> 3) << 0) & 0xFFFF;
- uint32 col = ar | ag | ab;
- push(col);
+ push(get16BitColor(r, g, b));
} else {
push(getHEPaletteSimilarColor(1, r, g, 10, 245));
}
diff --git a/engines/scumm/saveload.h b/engines/scumm/saveload.h
index 29184ad023..49bfe39b21 100644
--- a/engines/scumm/saveload.h
+++ b/engines/scumm/saveload.h
@@ -50,7 +50,7 @@ namespace Scumm {
* only saves/loads those which are valid for the version of the savegame
* which is being loaded/saved currently.
*/
-#define CURRENT_VER 77
+#define CURRENT_VER 78
/**
* An auxillary macro, used to specify savegame versions. We use this instead