GNAP: Reduce the scope of a couple of variables, make use of enum values in calls to InsertSequence

This commit is contained in:
Strangerke 2016-03-18 01:32:32 +01:00 committed by Eugene Sandulenko
parent cfaa49f5fd
commit b6ba5cfd89
15 changed files with 72 additions and 53 deletions

View File

@ -165,7 +165,7 @@ Common::Error GnapEngine::run() {
_gameSys->setBackgroundSurface(testBack, 0, 500, 1, 1000);
_gameSys->insertSequence(0x11b, 100, -1, -1, 0, 0, 0, 0);
_gameSys->insertSequence(0x11b, 100, -1, -1, kSeqNone, 0, 0, 0);
CursorMan.showMouse(true);
@ -1559,7 +1559,7 @@ void GnapEngine::gnapIdle() {
_gnapSequenceId == 0x831 || _gnapSequenceId == 0x89A)) {
_gameSys->insertSequence(getGnapSequenceId(gskIdle, 0, 0) | 0x10000, _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
32, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
kSeqSyncExists, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
_gnapSequenceId = getGnapSequenceId(gskIdle, 0, 0);
_gnapSequenceDatNum = 1;
}
@ -1570,7 +1570,7 @@ void GnapEngine::gnapActionIdle(int sequenceId) {
ridToEntryIndex(sequenceId) == _gnapSequenceId) {
_gameSys->insertSequence(getGnapSequenceId(gskIdle, 0, 0) | 0x10000, _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
32, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
kSeqSyncExists, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
_gnapSequenceId = getGnapSequenceId(gskIdle, 0, 0);
_gnapSequenceDatNum = 1;
}
@ -1580,6 +1580,7 @@ void GnapEngine::playGnapSequence(int sequenceId) {
_timers[2] = getRandom(30) + 20;
_timers[3] = 300;
gnapIdle();
// CHECKME: Check the value of the flag
_gameSys->insertSequence(sequenceId, _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
9, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
@ -1668,13 +1669,13 @@ void GnapEngine::updateGnapIdleSequence() {
if (_gnapIdleFacing == 1) {
_gameSys->insertSequence(0x107BD, _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
8, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
kSeqSyncWait, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
_gnapSequenceId = 0x7BD;
_gnapSequenceDatNum = 1;
} else if (_gnapIdleFacing == 3) {
_gameSys->insertSequence(0x107BE, _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
8, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
kSeqSyncWait, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
_gnapSequenceId = 0x7BE;
_gnapSequenceDatNum = 1;
}
@ -1702,13 +1703,13 @@ void GnapEngine::updateGnapIdleSequence2() {
if (_gnapIdleFacing == 1) {
_gameSys->insertSequence(0x107BD, _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
8, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
kSeqSyncWait, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
_gnapSequenceId = 0x7BD;
_gnapSequenceDatNum = 1;
} else if (_gnapIdleFacing == 3) {
_gameSys->insertSequence(0x107BE, _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
8, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
kSeqSyncWait, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
_gnapSequenceId = 0x7BE;
_gnapSequenceDatNum = 1;
}
@ -1752,7 +1753,7 @@ void GnapEngine::initGnapPos(int gridX, int gridY, int facing) {
_gnapSequenceDatNum = 1;
_gameSys->insertSequence(makeRid(1, _gnapSequenceId), 20 * _gnapY,
0, 0,
1, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
kSeqScale, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
}
void GnapEngine::gnapInitBrainPulseRndValue() {
@ -1766,13 +1767,13 @@ void GnapEngine::gnapUseDeviceOnBeaver() {
if (_beaverFacing != 0) {
_gameSys->insertSequence(makeRid(1, 0x7D5), _beaverId,
makeRid(_beaverSequenceDatNum, _beaverSequenceId), _beaverId,
8, 0, 75 * _platX - _platGridX, 48 * _platY - _platGridY);
kSeqSyncWait, 0, 75 * _platX - _platGridX, 48 * _platY - _platGridY);
_beaverSequenceId = 0x7D5;
_beaverSequenceDatNum = 1;
} else {
_gameSys->insertSequence(makeRid(1, 0x7D4), _beaverId,
makeRid(_beaverSequenceDatNum, _beaverSequenceId), _beaverId,
8, 0, 75 * _platX - _platGridX, 48 * _platY - _platGridY);
kSeqSyncWait, 0, 75 * _platX - _platGridX, 48 * _platY - _platGridY);
_beaverSequenceId = 0x7D4;
_beaverSequenceDatNum = 1;
}
@ -1780,7 +1781,7 @@ void GnapEngine::gnapUseDeviceOnBeaver() {
int newSequenceId = getGnapSequenceId(gskUseDevice, 0, 0);
_gameSys->insertSequence(makeRid(1, newSequenceId), _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
8, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
kSeqSyncWait, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY);
_gnapSequenceId = newSequenceId;
_gnapSequenceDatNum = 1;
@ -1838,12 +1839,12 @@ void GnapEngine::gnapKissPlatypus(int callback) {
_gameSys->setAnimation(0x10847, _gnapId, 0);
_gameSys->insertSequence(0x10847, _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
8, 0, 15 * (5 * _gnapX - 20) - (21 - _gridMinX), 48 * (_gnapY - 6) - (146 - _gridMinY));
kSeqSyncWait, 0, 15 * (5 * _gnapX - 20) - (21 - _gridMinX), 48 * (_gnapY - 6) - (146 - _gridMinY));
_gnapSequenceDatNum = 1;
_gnapSequenceId = 0x847;
_gameSys->insertSequence(0x107CB, _beaverId,
makeRid(_beaverSequenceDatNum, _beaverSequenceId), _beaverId,
8, getSequenceTotalDuration(0x10847), 75 * _platX - _platGridX, 48 * _platY - _platGridY);
kSeqSyncWait, getSequenceTotalDuration(0x10847), 75 * _platX - _platGridX, 48 * _platY - _platGridY);
_beaverSequenceDatNum = 1;
_beaverSequenceId = 0x7CB;
_beaverFacing = 0;
@ -1868,12 +1869,12 @@ void GnapEngine::gnapUseJointOnPlatypus() {
_gameSys->setAnimation(0x10876, _beaverId, 0);
_gameSys->insertSequence(0x10875, _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
8, 0, 15 * (5 * _gnapX - 30), 48 * (_gnapY - 7));
kSeqSyncWait, 0, 15 * (5 * _gnapX - 30), 48 * (_gnapY - 7));
_gnapSequenceDatNum = 1;
_gnapSequenceId = 0x875;
_gameSys->insertSequence(0x10876, _beaverId,
_beaverSequenceId | (_beaverSequenceDatNum << 16), _beaverId,
8, 0, 15 * (5 * _platX - 25), 48 * (_platY - 7));
kSeqSyncWait, 0, 15 * (5 * _platX - 25), 48 * (_platY - 7));
_beaverSequenceDatNum = 1;
_beaverSequenceId = 0x876;
_beaverFacing = 0;
@ -1927,6 +1928,7 @@ int GnapEngine::getBeaverSequenceId(int kind, int gridX, int gridY) {
}
void GnapEngine::playBeaverSequence(int sequenceId) {
// CHECKME: Check the value of the flag
_gameSys->insertSequence(sequenceId, _beaverId,
makeRid(_beaverSequenceDatNum, _beaverSequenceId), _beaverId,
9, 0, 75 * _platX - _platGridX, 48 * _platY - _platGridY);
@ -2020,7 +2022,7 @@ void GnapEngine::initBeaverPos(int gridX, int gridY, int facing) {
_beaverSequenceDatNum = 1;
_gameSys->insertSequence(makeRid(1, _beaverSequenceId), 20 * _platY,
0, 0,
1, 0, 75 * _platX - _platGridX, 48 * _platY - _platGridY);
kSeqScale, 0, 75 * _platX - _platGridX, 48 * _platY - _platGridY);
}
////////////////////////////////////////////////////////////////////////////////
@ -2166,7 +2168,7 @@ void GnapEngine::playSequences(int fullScreenSpriteId, int sequenceId1, int sequ
_gameSys->setAnimation(sequenceId2, _gnapId, 0);
_gameSys->insertSequence(sequenceId2, _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
8, 0, 15 * (5 * _gnapX - 25), 48 * (_gnapY - 8));
kSeqSyncWait, 0, 15 * (5 * _gnapX - 25), 48 * (_gnapY - 8));
_gnapSequenceId = sequenceId2;
_gnapSequenceDatNum = 0;
while (_gameSys->getAnimationStatus(0) != 2)
@ -2180,7 +2182,7 @@ void GnapEngine::playSequences(int fullScreenSpriteId, int sequenceId1, int sequ
_gameSys->setAnimation(sequenceId3, _gnapId, 0);
_gameSys->insertSequence(sequenceId3, _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
8, 0, 15 * (5 * _gnapX - 25), 48 * (_gnapY - 8));
kSeqSyncWait, 0, 15 * (5 * _gnapX - 25), 48 * (_gnapY - 8));
removeFullScreenSprite();
showCursor();
_gnapSequenceId = sequenceId3;
@ -2303,13 +2305,13 @@ void GnapEngine::toyUfoFlyTo(int destX, int destY, int minX, int maxX, int minY,
v16[0].id = 0;
_gameSys->insertSequence(seqId | 0x10000, 0,
_toyUfoSequenceId | 0x10000, _toyUfoId,
8, 0, v16[0].gridX1 - 365, v16[0].gridY1 - 128);
kSeqSyncWait, 0, v16[0].gridX1 - 365, v16[0].gridY1 - 128);
for (i = 1; i < v21; ++i) {
v16[i].sequenceId = seqId + (i % 8);
v16[i].id = i;
_gameSys->insertSequence(v16[i].sequenceId | 0x10000, v16[i].id,
v16[i - 1].sequenceId | 0x10000, v16[i - 1].id,
8, 0,
kSeqSyncWait, 0,
v16[i].gridX1 - 365, v16[i].gridY1 - 128);
}

View File

@ -581,12 +581,14 @@ bool GnapEngine::gnapWalkTo(int gridX, int gridY, int animationIndex, int sequen
_gnapWalkNodes[index].id = index + 20 * _gnapWalkNodes[index].gridY1;
if (_gnapWalkNodes[index].deltaX == 1 && _gnapWalkNodes[index].deltaY == 0) {
if (index % 2) {
// CHECKME: check the value of the flag
_gameSys->insertSequence(makeRid(datNum, 0x7AB), _gnapWalkNodes[index].id,
makeRid(gnapSequenceDatNum, gnapSequenceId), gnapId,
9, 0, 75 * _gnapWalkNodes[index].gridX1 - _gnapGridX, 48 * _gnapWalkNodes[index].gridY1 - _gnapGridY);
_gnapWalkNodes[index].sequenceId = 0x7AB;
gnapSequenceId = 0x7AB;
} else {
// CHECKME: check the value of the flag
_gameSys->insertSequence(makeRid(datNum, 0x7AC), _gnapWalkNodes[index].id,
makeRid(gnapSequenceDatNum, gnapSequenceId), gnapId,
9, 0, 75 * _gnapWalkNodes[index].gridX1 - _gnapGridX, 48 * _gnapWalkNodes[index].gridY1 - _gnapGridY);
@ -595,12 +597,14 @@ bool GnapEngine::gnapWalkTo(int gridX, int gridY, int animationIndex, int sequen
}
} else if (_gnapWalkNodes[index].deltaX == -1 && _gnapWalkNodes[index].deltaY == 0) {
if (index % 2) {
// CHECKME: check the value of the flag
_gameSys->insertSequence(makeRid(datNum, 0x7AF), _gnapWalkNodes[index].id,
makeRid(gnapSequenceDatNum, gnapSequenceId), gnapId,
9, 0, 75 * _gnapWalkNodes[index].gridX1 - _gnapGridX, 48 * _gnapWalkNodes[index].gridY1 - _gnapGridY);
_gnapWalkNodes[index].sequenceId = 0x7AF;
gnapSequenceId = 0x7AF;
} else {
// CHECKME: check the value of the flag
_gameSys->insertSequence(makeRid(datNum, 0x7B0), _gnapWalkNodes[index].id,
makeRid(gnapSequenceDatNum, gnapSequenceId), gnapId,
9, 0, 75 * _gnapWalkNodes[index].gridX1 - _gnapGridX, 48 * _gnapWalkNodes[index].gridY1 - _gnapGridY);
@ -613,6 +617,7 @@ bool GnapEngine::gnapWalkTo(int gridX, int gridY, int animationIndex, int sequen
else
_gnapWalkNodes[index].id += 10;
int newSequenceId = getGnapWalkSequenceId(_gnapWalkNodes[index].deltaX, _gnapWalkNodes[index].deltaY);
// CHECKME: check the value of the flag
_gameSys->insertSequence(makeRid(datNum, newSequenceId), _gnapWalkNodes[index].id,
makeRid(gnapSequenceDatNum, gnapSequenceId), gnapId,
9, 0, 75 * _gnapWalkNodes[index].gridX1 - _gnapGridX, 48 * _gnapWalkNodes[index].gridY1 - _gnapGridY);
@ -633,7 +638,7 @@ bool GnapEngine::gnapWalkTo(int gridX, int gridY, int animationIndex, int sequen
_gameSys->setAnimation(makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId, animationIndex);
} else if (animationIndex >= 0) {
_gameSys->setAnimation(0x107D3, 1, animationIndex);
_gameSys->insertSequence(0x107D3, 1, 0, 0, 0, 0, 0, 0);
_gameSys->insertSequence(0x107D3, 1, 0, 0, kSeqNone, 0, 0, 0);
}
} else {
if (sequenceId >= 0 && sequenceId != -1) {
@ -694,10 +699,12 @@ bool GnapEngine::gnapWalkTo(int gridX, int gridY, int animationIndex, int sequen
}
if (flags & 4) {
// CHECKME: check the value of the flag
_gameSys->insertSequence(makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
makeRid(gnapSequenceDatNum, gnapSequenceId), gnapId,
9, 0, 0, 0);
} else {
// CHECKME: check the value of the flag
_gameSys->insertSequence(makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
makeRid(gnapSequenceDatNum, gnapSequenceId), gnapId,
9, 0, 75 * _gnapWalkDestX - _gnapGridX, 48 * _gnapWalkDestY - _gnapGridY);
@ -1234,12 +1241,14 @@ bool GnapEngine::platypusWalkTo(int gridX, int gridY, int animationIndex, int se
_platWalkNodes[index].id = index + 20 * _platWalkNodes[index].gridY1;
if (_platWalkNodes[index].deltaX == 1 && _platWalkNodes[index].deltaY == 0) {
if (index % 2) {
// CHECKME: check the value of the flag
_gameSys->insertSequence(makeRid(datNum, 0x7CD), _platWalkNodes[index].id,
makeRid(platSequenceDatNum, platSequenceId), platId,
9, 0, 75 * _platWalkNodes[index].gridX1 - _platGridX, 48 * _platWalkNodes[index].gridY1 - _platGridY);
_platWalkNodes[index].sequenceId = 0x7CD;
platSequenceId = 0x7CD;
} else {
// CHECKME: check the value of the flag
_gameSys->insertSequence(makeRid(datNum, 0x7CE), _platWalkNodes[index].id,
makeRid(platSequenceDatNum, platSequenceId), platId,
9, 0, 75 * _platWalkNodes[index].gridX1 - _platGridX, 48 * _platWalkNodes[index].gridY1 - _platGridY);
@ -1248,12 +1257,14 @@ bool GnapEngine::platypusWalkTo(int gridX, int gridY, int animationIndex, int se
}
} else if (_platWalkNodes[index].deltaX == -1 && _platWalkNodes[index].deltaY == 0) {
if (index % 2) {
// CHECKME: check the value of the flag
_gameSys->insertSequence(makeRid(datNum, 0x7CF), _platWalkNodes[index].id,
makeRid(platSequenceDatNum, platSequenceId), platId,
9, 0, 75 * _platWalkNodes[index].gridX1 - _platGridX, 48 * _platWalkNodes[index].gridY1 - _platGridY);
_platWalkNodes[index].sequenceId = 0x7CF;
platSequenceId = 0x7CF;
} else {
// CHECKME: check the value of the flag
_gameSys->insertSequence(makeRid(datNum, 0x7D0), _platWalkNodes[index].id,
makeRid(platSequenceDatNum, platSequenceId), platId,
9, 0, 75 * _platWalkNodes[index].gridX1 - _platGridX, 48 * _platWalkNodes[index].gridY1 - _platGridY);
@ -1266,6 +1277,7 @@ bool GnapEngine::platypusWalkTo(int gridX, int gridY, int animationIndex, int se
else
_platWalkNodes[index].id += 10;
int newSequenceId = getBeaverWalkSequenceId(_platWalkNodes[index].deltaX, _platWalkNodes[index].deltaY);
// CHECKME: check the value of the flag
_gameSys->insertSequence(makeRid(datNum, newSequenceId), _platWalkNodes[index].id,
makeRid(platSequenceDatNum, platSequenceId), platId,
9, 0, 75 * _platWalkNodes[index].gridX1 - _platGridX, 48 * _platWalkNodes[index].gridY1 - _platGridY);
@ -1294,7 +1306,7 @@ bool GnapEngine::platypusWalkTo(int gridX, int gridY, int animationIndex, int se
_gameSys->setAnimation(makeRid(_beaverSequenceDatNum, _beaverSequenceId), _beaverId, animationIndex);
} else if (animationIndex >= 0) {
_gameSys->setAnimation(0x107D3, 1, animationIndex);
_gameSys->insertSequence(0x107D3, 1, 0, 0, 0, 0, 0, 0);
_gameSys->insertSequence(0x107D3, 1, 0, 0, kSeqNone, 0, 0, 0);
}
} else {
if (sequenceId >= 0 && sequenceId != -1) {

View File

@ -498,7 +498,7 @@ void GnapEngine::scene02_updateAnimations() {
break;
case kASUseTwigWithChicken:
playGnapShowItem(5, 0, 0);
_gameSys->insertSequence(0x155, 179, _s02_currChickenSequenceId, 179, 32, 0, 0, 0);
_gameSys->insertSequence(0x155, 179, _s02_currChickenSequenceId, 179, kSeqSyncExists, 0, 0, 0);
_s02_currChickenSequenceId = 0x155;
_s02_nextChickenSequenceId = -1;
_gnapActionStatus = -1;

View File

@ -406,7 +406,7 @@ void GnapEngine::scene03_updateAnimations() {
gameUpdateTick();
removeFullScreenSprite();
_gameSys->setAnimation(0x1BA, 99, 1);
_gameSys->insertSequence(0x1BA, 99, _beaverSequenceId | (_beaverSequenceDatNum << 16), 99, 32, 0, 0, 0);
_gameSys->insertSequence(0x1BA, 99, _beaverSequenceId | (_beaverSequenceDatNum << 16), 99, kSeqSyncExists, 0, 0, 0);
_beaverSequenceDatNum = 0;
_beaverSequenceId = 0x1BA;
_gnapActionStatus = -1;
@ -415,7 +415,7 @@ void GnapEngine::scene03_updateAnimations() {
break;
case kASHypnotizeScaredPlat:
playGnapBrainPulsating(0, 0);
_gameSys->insertSequence(0x1BF, 99, _beaverSequenceId | (_beaverSequenceDatNum << 16), 99, 32, 0, 0, 0);
_gameSys->insertSequence(0x1BF, 99, _beaverSequenceId | (_beaverSequenceDatNum << 16), 99, kSeqSyncExists, 0, 0, 0);
_gameSys->setAnimation(0x1BF, 99, 1);
while (_gameSys->getAnimationStatus(1) != 2)
gameUpdateTick();

View File

@ -184,6 +184,7 @@ void GnapEngine::scene13_run() {
if (_gnapX == 5 && _gnapY == 5) {
_s13_backToiletCtr = MIN(5, _s13_backToiletCtr + 1);
_gameSys->setAnimation(_s13_backToiletCtr + 0xA3, _gnapId, 0);
// CHECKME: Check the value of the flag
_gameSys->insertSequence(_s13_backToiletCtr + 0xA3, _gnapId,
makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
9, 0, 0, 0);

View File

@ -100,7 +100,7 @@ void GnapEngine::scene17_platHangUpPhone() {
_s17_platPhoneCtr = 0;
_beaverActionStatus = -1;
_gameSys->setAnimation(0x257, 254, 4);
_gameSys->insertSequence(0x257, 254, _s17_currPhoneSequenceId, 254, 32, 0, 0, 0);
_gameSys->insertSequence(0x257, 254, _s17_currPhoneSequenceId, 254, kSeqSyncExists, 0, 0, 0);
while (_gameSys->getAnimationStatus(4) != 2)
gameUpdateTick();
_gameSys->setAnimation(0x25B, _beaverId, 1);
@ -265,6 +265,7 @@ void GnapEngine::scene17_run() {
_platY = 8;
_beaverId = 160;
_gameSys->insertSequence(0x241, 160, 0, 0, kSeqNone, 0, 0, 0);
// CHECKME: Check the value of the flag
_gameSys->insertSequence(0x107C1, _beaverId, 0x241, _beaverId,
9, 0, 75 * _platX - _platGridX, 48 * _platY - _platGridY);
_gameSys->insertSequence(0x22C, 2, 0, 0, kSeqNone, 0, 0, 0);

View File

@ -219,6 +219,7 @@ void GnapEngine::scene18_gnapCarryGarbageCanTo(int x, int y, int animationIndex,
if (animationIndex >= 0)
_gameSys->setAnimation(makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId, animationIndex);
// CHECKME: Check the value of the flag
_gameSys->insertSequence(makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId,
gnapSeqId | (gnapDatNum << 16), gnapId,
9, 0, 75 * gnapGridX - _gnapGridX, 48 * _gnapY - _gnapGridY);
@ -264,7 +265,7 @@ void GnapEngine::scene18_platEndPhoning(bool platFl) {
_beaverActionStatus = -1;
if (_s18_currPhoneSequenceId != -1) {
_gameSys->setAnimation(0x21E, 254, 3);
_gameSys->insertSequence(0x21E, 254, _s18_currPhoneSequenceId, 254, 32, 0, 0, 0);
_gameSys->insertSequence(0x21E, 254, _s18_currPhoneSequenceId, 254, kSeqSyncExists, 0, 0, 0);
while (_gameSys->getAnimationStatus(3) != 2)
gameUpdateTick();
}
@ -843,6 +844,7 @@ void GnapEngine::scene18_updateAnimations() {
_gameSys->insertSequence(0x216, 39, 0, 0, kSeqNone, 21, 0, 0);
_gameSys->removeSequence(0x20C, 19, true);
_gameSys->setAnimation(0x217, 39, 5);
// CHECKME: check the value of the flag
_gameSys->insertSequence(0x217, 39, 0x216, 39, 10, 0, 0, 0);
while (_gameSys->getAnimationStatus(5) != 2)
gameUpdateTick();
@ -945,6 +947,7 @@ void GnapEngine::scene18_updateAnimations() {
_gameSys->requestRemoveSequence(0x1F9, 19);
_gameSys->removeSequence(0x20B, 19, true);
_gameSys->setAnimation(0x213, 39, 5);
// CHECKME: check the value of the flag
_gameSys->insertSequence(0x214, 39, 0x213, 39, 10, 0, 0, 0);
while (_gameSys->getAnimationStatus(5) != 2)
gameUpdateTick();
@ -961,6 +964,7 @@ void GnapEngine::scene18_updateAnimations() {
_gameSys->insertSequence(0x211, 39, 0, 0, kSeqNone, 21, 0, 0);
_gameSys->removeSequence(0x20B, 19, true);
_gameSys->setAnimation(0x211, 39, 5);
// CHECKME: check the value of the flag
_gameSys->insertSequence(0x212, 39, 0x211, 39, 10, 0, 0, 0);
while (_gameSys->getAnimationStatus(5) != 2)
gameUpdateTick();

View File

@ -551,8 +551,8 @@ void GnapEngine::scene20_updateAnimations() {
case kASTalkStonerGuyNoJoint:
_gameSys->setAnimation(0x170, 21, 2);
_gameSys->setAnimation(0x17B, 20, 3);
_gameSys->insertSequence(0x17B, 20, _s20_currGroceryStoreGuySequenceId, 20, 32, 0, 0, 0);
_gameSys->insertSequence(0x170, 21, _s20_currStonerGuySequenceId, 21, 32, 0, 0, 0);
_gameSys->insertSequence(0x17B, 20, _s20_currGroceryStoreGuySequenceId, 20, kSeqSyncExists, 0, 0, 0);
_gameSys->insertSequence(0x170, 21, _s20_currStonerGuySequenceId, 21, kSeqSyncExists, 0, 0, 0);
stopSound(0x1A1);
scene20_stopSounds();
_s20_currGroceryStoreGuySequenceId = 0x17B;
@ -565,8 +565,8 @@ void GnapEngine::scene20_updateAnimations() {
case kASTalkStonerGuyHasJoint:
_gameSys->setAnimation(0x168, 21, 2);
_gameSys->setAnimation(379, 20, 3);
_gameSys->insertSequence(0x17B, 20, _s20_currGroceryStoreGuySequenceId, 20, 32, 0, 0, 0);
_gameSys->insertSequence(0x170, 21, _s20_currStonerGuySequenceId, 21, 32, 0, 0, 0);
_gameSys->insertSequence(0x17B, 20, _s20_currGroceryStoreGuySequenceId, 20, kSeqSyncExists, 0, 0, 0);
_gameSys->insertSequence(0x170, 21, _s20_currStonerGuySequenceId, 21, kSeqSyncExists, 0, 0, 0);
_gameSys->insertSequence(0x168, 21, 0x170, 21, kSeqSyncWait, 0, 0, 0);
stopSound(0x1A1);
scene20_stopSounds();
@ -589,8 +589,8 @@ void GnapEngine::scene20_updateAnimations() {
case kASTalkGroceryStoreGuy:
_gameSys->setAnimation(0x170, 21, 2);
_gameSys->setAnimation(0x17B, 20, 3);
_gameSys->insertSequence(0x17B, 20, _s20_currGroceryStoreGuySequenceId, 20, 32, 0, 0, 0);
_gameSys->insertSequence(0x170, 21, _s20_currStonerGuySequenceId, 21, 32, 0, 0, 0);
_gameSys->insertSequence(0x17B, 20, _s20_currGroceryStoreGuySequenceId, 20, kSeqSyncExists, 0, 0, 0);
_gameSys->insertSequence(0x170, 21, _s20_currStonerGuySequenceId, 21, kSeqSyncExists, 0, 0, 0);
stopSound(0x1A1);
scene20_stopSounds();
_s20_currGroceryStoreGuySequenceId = 0x17B;
@ -606,8 +606,8 @@ void GnapEngine::scene20_updateAnimations() {
case kASGrabGroceryStoreGuy:
_gameSys->setAnimation(0x170, 21, 2);
_gameSys->setAnimation(0x17B, 20, 3);
_gameSys->insertSequence(0x170, 21, _s20_currStonerGuySequenceId, 21, 32, 0, 0, 0);
_gameSys->insertSequence(0x17B, 20, _s20_currGroceryStoreGuySequenceId, 20, 32, 0, 0, 0);
_gameSys->insertSequence(0x170, 21, _s20_currStonerGuySequenceId, 21, kSeqSyncExists, 0, 0, 0);
_gameSys->insertSequence(0x17B, 20, _s20_currGroceryStoreGuySequenceId, 20, kSeqSyncExists, 0, 0, 0);
stopSound(0x1A1);
scene20_stopSounds();
_s20_currGroceryStoreGuySequenceId = 0x17B;
@ -619,8 +619,8 @@ void GnapEngine::scene20_updateAnimations() {
case kASGrabGroceryStoreHat:
_gameSys->setAnimation(0x170, 21, 2);
_gameSys->setAnimation(0x17B, 20, 3);
_gameSys->insertSequence(0x17B, 20, _s20_currGroceryStoreGuySequenceId, 20, 32, 0, 0, 0);
_gameSys->insertSequence(0x170, 21, _s20_currStonerGuySequenceId, 21, 32, 0, 0, 0);
_gameSys->insertSequence(0x17B, 20, _s20_currGroceryStoreGuySequenceId, 20, kSeqSyncExists, 0, 0, 0);
_gameSys->insertSequence(0x170, 21, _s20_currStonerGuySequenceId, 21, kSeqSyncExists, 0, 0, 0);
stopSound(0x1A1);
scene20_stopSounds();
_s20_currGroceryStoreGuySequenceId = 0x17B;

View File

@ -352,7 +352,7 @@ void GnapEngine::scene25_updateAnimations() {
_s25_nextTicketVendorSequenceId = 0x5E;
_gameSys->setAnimation(0x5E, 39, 0);
_gameSys->setAnimation(_s25_nextTicketVendorSequenceId, 39, 3);
_gameSys->insertSequence(_s25_nextTicketVendorSequenceId, 39, _s25_currTicketVendorSequenceId, 39, 32, 0, 0, 0);
_gameSys->insertSequence(_s25_nextTicketVendorSequenceId, 39, _s25_currTicketVendorSequenceId, 39, kSeqSyncExists, 0, 0, 0);
_gameSys->insertSequence(0x60, 2, 0, 0, kSeqNone, 0, 0, 0);
_s25_currTicketVendorSequenceId = _s25_nextTicketVendorSequenceId;
_s25_nextTicketVendorSequenceId = -1;

View File

@ -353,7 +353,7 @@ void GnapEngine::scene27_updateAnimations() {
break;
case kASTryEnterClownTent:
_s27_nextJanitorSequenceId = 0xD1;
_gameSys->insertSequence(0xD1, 39, _s27_currJanitorSequenceId, 39, 32, 0, 0, 0);
_gameSys->insertSequence(0xD1, 39, _s27_currJanitorSequenceId, 39, kSeqSyncExists, 0, 0, 0);
_gameSys->setAnimation(_s27_nextJanitorSequenceId, 39, 3);
_gameSys->setAnimation(_s27_nextJanitorSequenceId, 39, 0);
_s27_currJanitorSequenceId = _s27_nextJanitorSequenceId;

View File

@ -123,13 +123,13 @@ void GnapEngine::scene47_initCutscene6() {
}
void GnapEngine::scene47_initCutscene7() {
int v1 = 4, v0, v4, v2, v3;
int v0, v4, v2, v3;
_s99_dword_47F370[0] = 0x316;
_s99_dword_47F370[1] = 0x31A;
_s99_dword_47F370[2] = 0x314;
_s99_dword_47F370[3] = 0x31B;
v1 = 4;
int v1 = 4;
if (!isFlag(3)) {
_s99_dword_47F370[4] = 0x31C;
v1 = 5;

View File

@ -190,7 +190,7 @@ void GnapEngine::scene49_updateObstacle(int i) {
kSeqSyncWait, 0, 0, -50);
_gameSys->insertSequence(obstacle.collisionSequenceId, 256,
_s49_truckSequenceId, _s49_truckId,
32, 0, 0, -50);
kSeqSyncExists, 0, 0, -50);
_s49_truckSequenceId = obstacle.collisionSequenceId;
_s49_truckId = 256;
obstacle.currSequenceId = obstacle.passedSequenceId;
@ -460,7 +460,7 @@ void GnapEngine::scene49_run() {
int steerSequenceId = (_s49_truckLaneNum == 3) ? 0xB3 : 0xB1;
if (_s49_truckSequenceId == 0xAE || _s49_truckSequenceId == 0xAF) {
_gameSys->setAnimation(steerSequenceId, 256, 0);
_gameSys->insertSequence(steerSequenceId, 256, _s49_truckSequenceId, _s49_truckId, 32, 0, 0, -50);
_gameSys->insertSequence(steerSequenceId, 256, _s49_truckSequenceId, _s49_truckId, kSeqSyncExists, 0, 0, -50);
_s49_truckSequenceId = steerSequenceId;
_s49_truckId = 256;
}
@ -478,7 +478,7 @@ void GnapEngine::scene49_run() {
int steerSequenceId = (_s49_truckLaneNum == 1) ? 0xB0 : 0xB2;
if (_s49_truckSequenceId == 0xAD || _s49_truckSequenceId == 0xAE) {
_gameSys->setAnimation(steerSequenceId, 256, 0);
_gameSys->insertSequence(steerSequenceId, 256, _s49_truckSequenceId, _s49_truckId, 32, 0, 0, -50);
_gameSys->insertSequence(steerSequenceId, 256, _s49_truckSequenceId, _s49_truckId, kSeqSyncExists, 0, 0, -50);
_s49_truckSequenceId = steerSequenceId;
_s49_truckId = 256;
}

View File

@ -281,7 +281,7 @@ void GnapEngine::scene50_updateAnimations() {
_gameSys->setAnimation(_s50_rightTongueNextSequenceId, _s50_rightTongueNextId, 5);
_gameSys->setAnimation(0xB9, _s50_leftTongueNextId, 6);
_gameSys->insertSequence(_s50_rightTongueNextSequenceId, _s50_rightTongueNextId, _s50_rightTongueSequenceId, _s50_rightTongueId, kSeqSyncWait, 0, 0, 0);
_gameSys->insertSequence(0xB9, _s50_leftTongueNextId, _s50_leftTongueSequenceId, _s50_leftTongueId, 32, 0, 0, 0);
_gameSys->insertSequence(0xB9, _s50_leftTongueNextId, _s50_leftTongueSequenceId, _s50_leftTongueId, kSeqSyncExists, 0, 0, 0);
_s50_rightTongueSequenceId = _s50_rightTongueNextSequenceId;
_s50_rightTongueNextSequenceId = -1;
_s50_leftTongueSequenceId = 0xB9;
@ -323,7 +323,7 @@ void GnapEngine::scene50_updateAnimations() {
_gameSys->setAnimation(_s50_leftTongueNextSequenceId, _s50_leftTongueNextId, 6);
_gameSys->setAnimation(0xC1, _s50_rightTongueNextId, 5);
_gameSys->insertSequence(_s50_leftTongueNextSequenceId, _s50_leftTongueNextId, _s50_leftTongueSequenceId, _s50_leftTongueId, kSeqSyncWait, 0, 0, 0);
_gameSys->insertSequence(0xC1, _s50_rightTongueNextId, _s50_rightTongueSequenceId, _s50_rightTongueId, 32, 0, 0, 0);
_gameSys->insertSequence(0xC1, _s50_rightTongueNextId, _s50_rightTongueSequenceId, _s50_rightTongueId, kSeqSyncExists, 0, 0, 0);
_s50_leftTongueSequenceId = _s50_leftTongueNextSequenceId;
_s50_leftTongueNextSequenceId = -1;
_s50_rightTongueSequenceId = 0xC1;
@ -344,7 +344,7 @@ void GnapEngine::scene50_updateAnimations() {
_gameSys->setAnimation(0xBB, _s50_rightTongueNextId, 5);
_gameSys->setAnimation(_s50_leftTongueNextSequenceId, _s50_leftTongueNextId, 6);
_gameSys->insertSequence(_s50_leftTongueNextSequenceId, _s50_leftTongueNextId, _s50_leftTongueSequenceId, _s50_leftTongueId, kSeqSyncWait, 0, 0, 0);
_gameSys->insertSequence(0xBB, _s50_rightTongueNextId, _s50_rightTongueSequenceId, _s50_rightTongueId, 32, 0, 0, 0);
_gameSys->insertSequence(0xBB, _s50_rightTongueNextId, _s50_rightTongueSequenceId, _s50_rightTongueId, kSeqSyncExists, 0, 0, 0);
_s50_rightTongueSequenceId = 0xBB;
_s50_rightTongueId = _s50_rightTongueNextId;
_s50_rightTongueNextSequenceId = -1;

View File

@ -236,7 +236,6 @@ int GnapEngine::scene51_checkCollision(int sequenceId) {
bool jumpingLeft = false, jumpingRight = false;
int v6 = 0;
int v2 = 0;
int v5 = 0;
int v8, v4;
int result = 0;
@ -260,18 +259,19 @@ int GnapEngine::scene51_checkCollision(int sequenceId) {
}
if (jumpingRight || jumpingLeft) {
int v5 = 0;
int i;
for (i = 0; i < 6; ++i) {
if (_s51_items[i].isCollision) {
if (jumpingRight && _s51_items[i].x2 > v8 && _s51_items[i].x2 < v4) {
v5 = v8 - 359;
if (v8 == 359)
if (v5 == 0)
v5 = 1;
_s51_platypusNextSequenceId = 0xB6;
break;
} else if (jumpingLeft && _s51_items[i].x2 < v4 && _s51_items[i].x2 > v8) {
v5 = v8 - 344;
if (v8 == 344)
if (v5 == 0)
v5 = 1;
_s51_platypusNextSequenceId = 0xB7;
break;
@ -294,7 +294,6 @@ int GnapEngine::scene51_checkCollision(int sequenceId) {
void GnapEngine::scene51_updateItemAnimation(Scene51Item *item, int index) {
switch (item->currSequenceId) {
case 0xBD:
case 0xC0:
case 0xC1:

View File

@ -110,11 +110,11 @@ void GnapEngine::scene53_runRandomCall() {
0x6A, 0x6B, 0x6C, 0x6D, 0x71
};
int index;
++_s53_callsMadeCtr;
if (_s53_callsMadeCtr <= 10) {
int index;
do {
index = scene53_getRandomCallIndex();
} while (!_s53_isGnapPhoning && (index == 0 || index == 3 || index == 4 || index == 11));