GNAP: Cosmetic changes

This commit is contained in:
Strangerke 2016-04-16 00:51:49 +02:00 committed by Eugene Sandulenko
parent 63a13bc2c0
commit 08ba28db7f
4 changed files with 20 additions and 32 deletions

View File

@ -72,7 +72,7 @@ byte *DatArchive::load(int index) {
DatManager::DatManager() {
for (int i = 0; i < kMaxDatArchives; ++i)
_datArchives[i] = 0;
_datArchives[i] = nullptr;
}
DatManager::~DatManager() {
@ -87,7 +87,7 @@ void DatManager::open(int index, const char *filename) {
void DatManager::close(int index) {
delete _datArchives[index];
_datArchives[index] = 0;
_datArchives[index] = nullptr;
}
byte *DatManager::loadResource(int resourceId) {

View File

@ -959,7 +959,6 @@ void GnapEngine::startSoundTimerC(int timerIndex) {
}
int GnapEngine::playSoundC() {
static const int kSoundIdsC[] = {
0x918, 0x91F, 0x920, 0x922, 0x923, 0x924,
0x926

View File

@ -770,11 +770,9 @@ void GnapEngine::scene18_run() {
if (isFlag(kGFGnapControlsToyUFO))
deleteSurface(&_s18_cowboyHatSurface);
}
void GnapEngine::scene18_updateAnimations() {
if (_gameSys->getAnimationStatus(0) == 2) {
_gameSys->setAnimation(0, 0, 0);
switch (_gnapActionStatus) {
@ -1016,7 +1014,6 @@ void GnapEngine::scene18_updateAnimations() {
scene18_platEndPhoning(true);
}
}
}
} // End of namespace Gnap

View File

@ -145,22 +145,19 @@ void GnapEngine::scene42_run() {
}
while (!_sceneDone) {
if (!isSoundPlaying(0x1094B))
playSound(0x1094B, true);
updateMouseCursor();
updateCursorByHotspot();
testWalk(0, 0, -1, -1, -1, -1);
_sceneClickedHotspot = getClickedHotspotId();
updateGrabCursorSprite(0, 0);
if (isFlag(kGFGnapControlsToyUFO)) {
switch (_sceneClickedHotspot) {
case kHSUfoExitLeft:
if (_toyUfoActionStatus < 0) {
_isLeavingScene = true;
@ -194,7 +191,6 @@ void GnapEngine::scene42_run() {
runMenu();
scene42_updateHotspots();
break;
}
} else {
switch (_sceneClickedHotspot) {
@ -203,7 +199,7 @@ void GnapEngine::scene42_run() {
scene42_updateHotspots();
_timers[4] = getRandom(20) + 30;
break;
case kHSPlatypus:
if (_gnapActionStatus < 0) {
if (_grabCursorSpriteIndex >= 0) {
@ -277,7 +273,7 @@ void GnapEngine::scene42_run() {
}
}
break;
case kHSChickenLeg:
if (_grabCursorSpriteIndex >= 0) {
playGnapShowCurrItem(_hotspotsWalkPos[kHSChickenLeg].x, _hotspotsWalkPos[kHSChickenLeg].y, _hotspotsWalkPos[kHSChickenLeg].x - 1, 0);
@ -297,17 +293,16 @@ void GnapEngine::scene42_run() {
}
}
break;
case kHSWalkArea1:
case kHSWalkArea2:
if (_gnapActionStatus < 0)
gnapWalkTo(-1, -1, -1, -1, 1);
break;
}
}
if (_mouseClickState._left && _gnapActionStatus < 0) {
_mouseClickState._left = false;
if (isFlag(kGFGnapControlsToyUFO)) {
@ -317,11 +312,11 @@ void GnapEngine::scene42_run() {
gnapWalkTo(-1, -1, -1, -1, 1);
}
}
scene42_updateAnimations();
toyUfoCheckTimer();
if (!_isLeavingScene) {
if (_beaverActionStatus < 0 && !isFlag(kGFGnapControlsToyUFO))
updateBeaverIdleSequence();
@ -353,20 +348,18 @@ void GnapEngine::scene42_run() {
}
}
}
checkGameKeys();
if (isKeyStatus1(8)) {
clearKeyStatus1(8);
runMenu();
scene42_updateHotspots();
_timers[4] = getRandom(20) + 30;
}
gameUpdateTick();
}
gameUpdateTick();
}
}
void GnapEngine::scene42_updateAnimations() {
@ -447,7 +440,7 @@ void GnapEngine::scene42_updateAnimations() {
break;
}
}
if (_gameSys->getAnimationStatus(2) == 2 && _s42_nextBBQVendorSequenceId != -1) {
_gameSys->insertSequence(_s42_nextBBQVendorSequenceId, 1, _s42_currBBQVendorSequenceId, 1, kSeqSyncWait, 0, 0, 0);
_gameSys->setAnimation(_s42_nextBBQVendorSequenceId, 1, 2);
@ -455,7 +448,7 @@ void GnapEngine::scene42_updateAnimations() {
_s42_nextBBQVendorSequenceId = -1;
_timers[4] = getRandom(20) + 30;
}
if (_gameSys->getAnimationStatus(3) == 2) {
switch (_toyUfoActionStatus) {
case kASToyUfoLeaveScene:
@ -494,7 +487,6 @@ void GnapEngine::scene42_updateAnimations() {
}
_toyUfoActionStatus = -1;
}
}
} // End of namespace Gnap