コード例 #1
0
ファイル: kyra_lok.cpp プロジェクト: phoenixtail26/scummvm
void KyraEngine_LoK::mainLoop() {
	// Initialize debugger since how it should be fully usable
	_debugger->initialize();

	_eventList.clear();

	while (!shouldQuit()) {
		int32 frameTime = (int32)_system->getMillis();

		if (_currentCharacter->sceneId == 210) {
			updateKyragemFading();
			if (seq_playEnd() && _deathHandler != 8)
				break;
		}

		if (_deathHandler != -1) {
			snd_playWanderScoreViaMap(0, 1);
			snd_playSoundEffect(49);
			_screen->hideMouse();
			_screen->setMouseCursor(1, 1, _shapes[0]);
			removeHandItem();
			_screen->showMouse();
			_gui->buttonMenuCallback(0);
			_deathHandler = -1;
		}

		if ((_brandonStatusBit & 2) && _brandonStatusBit0x02Flag)
			_animator->animRefreshNPC(0);

		if ((_brandonStatusBit & 0x20) && _brandonStatusBit0x20Flag) {
			_animator->animRefreshNPC(0);
			_brandonStatusBit0x20Flag = 0;
		}

		// FIXME: Why is this here?
		_screen->showMouse();

		int inputFlag = checkInput(_buttonList, _currentCharacter->sceneId != 210);
		removeInputTop();

		updateMousePointer();
		_timer->update();
		_sound->process();
		updateTextFade();

		if (inputFlag == 198 || inputFlag == 199)
			processInput(_mouseX, _mouseY);

		if (skipFlag())
			resetSkipFlag();

		delay((frameTime + _gameSpeed) - _system->getMillis(), true, true);
	}
}
コード例 #2
0
ファイル: kyra_lok.cpp プロジェクト: CatalystG/scummvm
void KyraEngine_LoK::delayWithTicks(int ticks) {
	uint32 nextTime = _system->getMillis() + ticks * _tickLength;

	while (_system->getMillis() < nextTime) {
		_sprites->updateSceneAnims();
		_animator->updateAllObjectShapes();

		if (_currentCharacter->sceneId == 210) {
			updateKyragemFading();
			seq_playEnd();
		}

		if (skipFlag())
			break;

		if (nextTime - _system->getMillis() >= 10)
			delay(10);
	}
}