[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.386,1.387 akos.cpp,1.241,1.242 akos.h,1.43,1.44 base-costume.h,1.44,1.45 costume.cpp,1.193,1.194 costume.h,1.40,1.41
kirben
kirben at users.sourceforge.net
Fri Oct 28 19:00:23 CEST 2005
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4425/scumm
Modified Files:
actor.cpp akos.cpp akos.h base-costume.h costume.cpp costume.h
Log Message:
Read from XMAP resource directly, instead of reading into memory.
Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.386
retrieving revision 1.387
diff -u -d -r1.386 -r1.387
--- actor.cpp 29 Oct 2005 00:44:30 -0000 1.386
+++ actor.cpp 29 Oct 2005 01:59:18 -0000 1.387
@@ -1106,27 +1106,13 @@
}
bcr->_shadow_mode = _shadowMode;
- if (_vm->_features & GF_SMALL_HEADER) {
- bcr->_shadow_table = NULL;
-#ifndef DISABLE_HE
- } else if (_vm->_heversion >= 95 && _heXmapNum) {
- byte shadow_table[65536];
- const uint8 *dataPtr = _vm->getResourceAddress(rtImage, _heXmapNum);
- assert(dataPtr);
- const uint8 *xmapPtr = _vm->findResourceData(MKID('XMAP'), dataPtr);
- assert(xmapPtr);
- int32 size = _vm->getResourceDataSize(xmapPtr);
- assert(size == 65536);
- memcpy(shadow_table, xmapPtr, size);
- bcr->_shadow_table = shadow_table;
+ if (_vm->_version >= 5 && _vm->_heversion == 0) {
+ bcr->_shadow_table = _vm->_shadowPalette;
} else if (_vm->_heversion == 70) {
bcr->_shadow_table = _vm->_HEV7ActorPalette;
-#endif
- } else {
- bcr->_shadow_table = _vm->_shadowPalette;
}
- bcr->setCostume(_costume);
+ bcr->setCostume(_costume, _heXmapNum);
bcr->setPalette(_palette);
bcr->setFacing(this);
Index: akos.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/akos.cpp,v
retrieving revision 1.241
retrieving revision 1.242
diff -u -d -r1.241 -r1.242
--- akos.cpp 28 Oct 2005 02:56:18 -0000 1.241
+++ akos.cpp 29 Oct 2005 01:59:18 -0000 1.242
@@ -324,7 +324,7 @@
}
}
-void AkosRenderer::setCostume(int costume) {
+void AkosRenderer::setCostume(int costume, int shadow) {
akos = _vm->getResourceAddress(rtCostume, costume);
assert(akos);
@@ -336,6 +336,13 @@
akpl = _vm->findResourceData(MKID('AKPL'), akos);
codec = READ_LE_UINT16(&akhd->codec);
akct = _vm->findResourceData(MKID('AKCT'), akos);
+
+ if (shadow) {
+ const uint8 *xmapPtr = _vm->getResourceAddress(rtImage, shadow);
+ assert(xmapPtr);
+ xmap = _vm->findResourceData(MKID('XMAP'), xmapPtr);
+ assert(xmap);
+ }
}
void AkosRenderer::setFacing(const Actor *a) {
@@ -491,7 +498,7 @@
continue;
if (_vm->_heversion >= 95) {
- _shadow_mode = ((shadowMask & 0x8000) && _shadow_table) ? 3 : 0;
+ _shadow_mode = ((shadowMask & 0x8000) && xmap) ? 3 : 0;
}
switch (codec) {
@@ -565,7 +572,10 @@
} else if (_shadow_mode == 2) {
error("codec1_spec2"); // TODO
} else if (_shadow_mode == 3) {
- if (_vm->_heversion >= 95 || pcolor < 8) {
+ if (_vm->_heversion >= 95) {
+ pcolor = (pcolor << 8) + *dst;
+ pcolor = xmap[pcolor];
+ } else if (pcolor < 8) {
pcolor = (pcolor << 8) + *dst;
pcolor = _shadow_table[pcolor];
}
@@ -1323,7 +1333,7 @@
byte *dstPtr = (byte *)_out.pixels + dst.left + dst.top * _out.pitch;
if (_shadow_mode == 3) {
- Wiz::decompressWizImage(dstPtr, _out.pitch, dst, _srcptr, src, palPtr, _shadow_table);
+ Wiz::decompressWizImage(dstPtr, _out.pitch, dst, _srcptr, src, palPtr, xmap);
} else {
Wiz::decompressWizImage(dstPtr, _out.pitch, dst, _srcptr, src, palPtr);
}
Index: akos.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/akos.h,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- akos.h 18 Oct 2005 01:30:20 -0000 1.43
+++ akos.h 29 Oct 2005 01:59:18 -0000 1.44
@@ -67,6 +67,7 @@
const AkosOffset *akof;
const byte *akcd;
const byte *akct;
+ const uint8 *xmap;
struct {
byte unk5;
@@ -90,6 +91,7 @@
akof = 0;
akcd = 0;
akct = 0;
+ xmap = 0;
_actorHitMode = false;
}
@@ -99,7 +101,7 @@
void setPalette(byte *palette);
void setFacing(const Actor *a);
- void setCostume(int costume);
+ void setCostume(int costume, int shadow);
protected:
byte drawLimb(const Actor *a, int limb);
Index: base-costume.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/base-costume.h,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- base-costume.h 18 Oct 2005 01:30:20 -0000 1.44
+++ base-costume.h 29 Oct 2005 01:59:18 -0000 1.45
@@ -151,7 +151,7 @@
virtual void setPalette(byte *palette) = 0;
virtual void setFacing(const Actor *a) = 0;
- virtual void setCostume(int costume) = 0;
+ virtual void setCostume(int costume, int shadow) = 0;
byte drawCostume(const VirtScreen &vs, int numStrips, const Actor *a, bool drawToBackBuf);
Index: costume.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/costume.cpp,v
retrieving revision 1.193
retrieving revision 1.194
diff -u -d -r1.193 -r1.194
--- costume.cpp 18 Oct 2005 01:30:20 -0000 1.193
+++ costume.cpp 29 Oct 2005 01:59:18 -0000 1.194
@@ -781,7 +781,7 @@
//_mirror = newDirToOldDir(a->getFacing()) != 0 || _loaded._mirror;
}
-void NESCostumeRenderer::setCostume(int costume) {
+void NESCostumeRenderer::setCostume(int costume, int shadow) {
_loaded.loadCostume(costume);
}
@@ -888,7 +888,7 @@
_mirror = newDirToOldDir(a->getFacing()) != 0 || _loaded._mirror;
}
-void ClassicCostumeRenderer::setCostume(int costume) {
+void ClassicCostumeRenderer::setCostume(int costume, int shadow) {
_loaded.loadCostume(costume);
}
@@ -1120,7 +1120,7 @@
return 0;
}
-void C64CostumeRenderer::setCostume(int costume) {
+void C64CostumeRenderer::setCostume(int costume, int shadow) {
_loaded.loadCostume(costume);
}
Index: costume.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/costume.h,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- costume.h 18 Oct 2005 01:30:20 -0000 1.40
+++ costume.h 29 Oct 2005 01:59:18 -0000 1.41
@@ -92,7 +92,7 @@
void setPalette(byte *palette);
void setFacing(const Actor *a);
- void setCostume(int costume);
+ void setCostume(int costume, int shadow);
protected:
byte drawLimb(const Actor *a, int limb);
@@ -114,7 +114,7 @@
void setPalette(byte *palette);
void setFacing(const Actor *a);
- void setCostume(int costume);
+ void setCostume(int costume, int shadow);
protected:
byte drawLimb(const Actor *a, int limb);
@@ -129,7 +129,7 @@
void setPalette(byte *palette) {}
void setFacing(const Actor *a) {}
- void setCostume(int costume);
+ void setCostume(int costume, int shadow);
protected:
byte drawLimb(const Actor *a, int limb);
More information about the Scummvm-git-logs
mailing list