aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scumm/costume.cpp18
-rw-r--r--scumm/costume.h9
2 files changed, 19 insertions, 8 deletions
diff --git a/scumm/costume.cpp b/scumm/costume.cpp
index e939fc4d93..29e701bd34 100644
--- a/scumm/costume.cpp
+++ b/scumm/costume.cpp
@@ -1009,9 +1009,25 @@ void C64CostumeRenderer::setCostume(int costume) {
_loaded.loadCostume(costume);
}
+static const byte actorColorsMMC64[] = {
+ 0, 7, 2, 6, 9, 1, 3, 7, 7, 1, 1, 9, 1, 4, 5, 5,
+ 4, 1, 0, 5, 4, 2, 2, 7, 7, 0, 6, 6, 6, 6, 6, 6
+};
+
void C64CostumeLoader::loadCostume(int id) {
+ const byte *ptr = _vm->getResourceAddress(rtCostume, id);
_id = id;
- _baseptr = _vm->getResourceAddress(rtCostume, id);
+ _baseptr = ptr + 9;
+
+ _format = 0x57;
+ _numColors = 0;
+ _numAnim = 0;
+ _mirror = 0;
+ _palette = &actorColorsMMC64[id];
+
+ _frameOffsets = _baseptr + READ_LE_UINT16(ptr + 5);
+ _dataOffsets = ptr;
+ _animCmds = _baseptr + READ_LE_UINT16(ptr + 7);
}
void C64CostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) {
diff --git a/scumm/costume.h b/scumm/costume.h
index 905c1d9940..d770fe4f32 100644
--- a/scumm/costume.h
+++ b/scumm/costume.h
@@ -67,14 +67,9 @@ protected:
byte increaseAnim(Actor *a, int slot);
};
-class C64CostumeLoader : public BaseCostumeLoader {
+class C64CostumeLoader : public ClassicCostumeLoader {
public:
- int _id;
- const byte *_baseptr;
- const byte *_dataOffsets;
- byte _numAnim;
-
- C64CostumeLoader(ScummEngine *vm) : BaseCostumeLoader(vm) {}
+ C64CostumeLoader(ScummEngine *vm) : ClassicCostumeLoader(vm) {}
void loadCostume(int id);
void costumeDecodeData(Actor *a, int frame, uint usemask);
byte increaseAnims(Actor *a);