renamed some HE specific akos fields

svn-id: r18866
This commit is contained in:
Gregory Montoir 2005-09-23 23:23:34 +00:00
parent 1897e6046b
commit 39fcf8dc58
3 changed files with 24 additions and 25 deletions

View file

@ -1144,8 +1144,7 @@ void Actor::drawActorCostume(bool hitTestMode) {
bcr->_paletteNum = _hePaletteNum; bcr->_paletteNum = _hePaletteNum;
if (_vm->_heversion >= 80 && _heNoTalkAnimation == 0) { if (_vm->_heversion >= 80 && _heNoTalkAnimation == 0) {
_heCondMask &= 0xFFFFFC00; _heCondMask = (_heCondMask & ~0x3FF) | 1;
_heCondMask |= 1;
if (_vm->getTalkingActor() == _number) { if (_vm->getTalkingActor() == _number) {
// Checks if talk sound is active? // Checks if talk sound is active?
// Otherwise just do rand animation // Otherwise just do rand animation

View file

@ -63,9 +63,9 @@ struct CostumeData {
uint16 end[16]; uint16 end[16];
uint16 frame[16]; uint16 frame[16];
uint16 seq1[16]; uint16 heJumpOffsetTable[16];
uint16 seq2[16]; uint16 heJumpCountTable[16];
uint32 seq3[16]; uint32 heCondMaskTable[16];
void reset() { void reset() {
stopped = 0; stopped = 0;

View file

@ -203,7 +203,7 @@ void AkosCostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) {
a->_cost.end[i] = 0; a->_cost.end[i] = 0;
a->_cost.start[i] = 0; a->_cost.start[i] = 0;
a->_cost.curpos[i] = 0; a->_cost.curpos[i] = 0;
a->_cost.seq3[i] = 0; a->_cost.heCondMaskTable[i] = 0;
if (akst) { if (akst) {
int size = _vm->getResourceDataSize(akst) / 8; int size = _vm->getResourceDataSize(akst) / 8;
@ -211,7 +211,7 @@ void AkosCostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) {
bool found = false; bool found = false;
while (size--) { while (size--) {
if (READ_LE_UINT32(akst) == 0) { if (READ_LE_UINT32(akst) == 0) {
a->_cost.seq3[i] = READ_LE_UINT32(akst + 4); a->_cost.heCondMaskTable[i] = READ_LE_UINT32(akst + 4);
found = true; found = true;
break; break;
} }
@ -233,16 +233,16 @@ void AkosCostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) {
start = READ_LE_UINT16(r); r += 2; start = READ_LE_UINT16(r); r += 2;
len = READ_LE_UINT16(r); r += 2; len = READ_LE_UINT16(r); r += 2;
a->_cost.seq1[i] = 0; a->_cost.heJumpOffsetTable[i] = 0;
a->_cost.seq2[i] = 0; a->_cost.heJumpCountTable[i] = 0;
if (aksf) { if (aksf) {
int size = _vm->getResourceDataSize(aksf) / 6; int size = _vm->getResourceDataSize(aksf) / 6;
if (size > 0) { if (size > 0) {
bool found = false; bool found = false;
while (size--) { while (size--) {
if (READ_LE_UINT16(aksf) == start) { if (READ_LE_UINT16(aksf) == start) {
a->_cost.seq1[i] = READ_LE_UINT16(aksf + 2); a->_cost.heJumpOffsetTable[i] = READ_LE_UINT16(aksf + 2);
a->_cost.seq2[i] = READ_LE_UINT16(aksf + 4); a->_cost.heJumpCountTable[i] = READ_LE_UINT16(aksf + 4);
found = true; found = true;
break; break;
} }
@ -259,14 +259,14 @@ void AkosCostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) {
a->_cost.end[i] = start + len; a->_cost.end[i] = start + len;
a->_cost.start[i] = start; a->_cost.start[i] = start;
a->_cost.curpos[i] = start; a->_cost.curpos[i] = start;
a->_cost.seq3[i] = 0; a->_cost.heCondMaskTable[i] = 0;
if (akst) { if (akst) {
int size = _vm->getResourceDataSize(akst) / 8; int size = _vm->getResourceDataSize(akst) / 8;
if (size > 0) { if (size > 0) {
bool found = false; bool found = false;
while (size--) { while (size--) {
if (READ_LE_UINT32(akst) == start) { if (READ_LE_UINT32(akst) == start) {
a->_cost.seq3[i] = READ_LE_UINT32(akst + 4); a->_cost.heCondMaskTable[i] = READ_LE_UINT32(akst + 4);
found = true; found = true;
break; break;
} }
@ -353,13 +353,13 @@ byte AkosRenderer::drawLimb(const Actor *a, int limb) {
uint i, extra; uint i, extra;
byte result = 0; byte result = 0;
int xmoveCur, ymoveCur; int xmoveCur, ymoveCur;
uint32 seq3Idx[32]; uint32 heCondMaskIndex[32];
uint8 hasSeq3Idx; bool useCondMask;
int lastDx, lastDy; int lastDx, lastDy;
lastDx = lastDy = 0; lastDx = lastDy = 0;
for (i = 0; i < 32; ++i) { for (i = 0; i < 32; ++i) {
seq3Idx[i] = i; heCondMaskIndex[i] = i;
} }
if (_skipLimbs) if (_skipLimbs)
@ -371,7 +371,7 @@ byte AkosRenderer::drawLimb(const Actor *a, int limb) {
if (!cost.active[limb] || cost.stopped & (1 << limb)) if (!cost.active[limb] || cost.stopped & (1 << limb))
return 0; return 0;
hasSeq3Idx = 0; useCondMask = false;
p = aksq + cost.curpos[limb]; p = aksq + cost.curpos[limb];
code = p[0]; code = p[0];
@ -383,11 +383,11 @@ byte AkosRenderer::drawLimb(const Actor *a, int limb) {
uint j = 0; uint j = 0;
extra = p[3]; extra = p[3];
uint8 n = extra; uint8 n = extra;
assert(n < ARRAYSIZE(seq3Idx)); assert(n < ARRAYSIZE(heCondMaskIndex));
while (n--) { while (n--) {
seq3Idx[j++] = aksq[s++]; heCondMaskIndex[j++] = aksq[s++];
} }
hasSeq3Idx = 1; useCondMask = true;
p += extra + 2; p += extra + 2;
code = (code == AKC_C021) ? AKC_ComplexChan : AKC_ComplexChan2; code = (code == AKC_C021) ? AKC_ComplexChan : AKC_ComplexChan2;
} }
@ -436,7 +436,7 @@ byte AkosRenderer::drawLimb(const Actor *a, int limb) {
extra = p[2]; extra = p[2];
p += 3; p += 3;
uint32 decflag = seq3Idx[0]; uint32 decflag = heCondMaskIndex[0];
for (i = 0; i != extra; i++) { for (i = 0; i != extra; i++) {
code = p[4]; code = p[4];
@ -458,10 +458,10 @@ byte AkosRenderer::drawLimb(const Actor *a, int limb) {
_ymove -= lastDy; _ymove -= lastDy;
} }
if (!hasSeq3Idx || !akct) { if (!useCondMask || !akct) {
decflag = 1; decflag = 1;
} else { } else {
uint32 cond = READ_LE_UINT32(akct + cost.seq3[limb] + seq3Idx[i] * 4); uint32 cond = READ_LE_UINT32(akct + cost.heCondMaskTable[limb] + heCondMaskIndex[i] * 4);
if (cond == 0) { if (cond == 0) {
decflag = 1; decflag = 1;
} else { } else {
@ -1513,9 +1513,9 @@ bool ScummEngine::akos_increaseAnim(Actor *a, int chan, const byte *aksq, const
error("akos_increaseAnim: no AKFO table"); error("akos_increaseAnim: no AKFO table");
tmp = a->getAnimVar(GB(2)) - 1; tmp = a->getAnimVar(GB(2)) - 1;
if (_heversion >= 80) { if (_heversion >= 80) {
if (tmp < 0 || tmp > a->_cost.seq2[chan] - 1) if (tmp < 0 || tmp > a->_cost.heJumpCountTable[chan] - 1)
error("akos_increaseAnim: invalid jump value %d", tmp); error("akos_increaseAnim: invalid jump value %d", tmp);
curpos = READ_LE_UINT16(akfo + a->_cost.seq1[chan] + tmp * 2); curpos = READ_LE_UINT16(akfo + a->_cost.heJumpOffsetTable[chan] + tmp * 2);
} else { } else {
if (tmp < 0 || tmp > numakfo - 1) if (tmp < 0 || tmp > numakfo - 1)
error("akos_increaseAnim: invalid jump value %d", tmp); error("akos_increaseAnim: invalid jump value %d", tmp);