void CGEEngine::xScene() { debugC(6, kCGEDebugEngine, "CGEEngine::xScene()"); sceneDown(); if (_lev != -1) _commandHandler->addCommand(kCmdLevel, -1, _lev, &_sceneLight); sceneUp(); }
Common::Error CGE2Engine::loadGameState(int slot) { _commandHandler->clear(); _commandHandlerTurbo->clear(); sceneDown(); if (!loadGame(slot)) return Common::kReadingFailed; sceneUp(_now); initToolbar(); return Common::kNoError; }
Common::Error CGEEngine::saveGameState(int slot, const Common::String &desc) { sceneDown(); _oldLev = _lev; // Write out the user's progress saveGame(slot, desc); // Reload the scene sceneUp(); return Common::kNoError; }
Common::Error CGEEngine::loadGameState(int slot) { // Clear current game activity sceneDown(); resetGame(); // Load the game loadGame(slot, NULL); _commandHandler->addCommand(kCmdLevel, -1, _oldLev, &_sceneLight); _sceneLight->gotoxy(kSceneX + ((_now - 1) % kSceneNx) * kSceneDx + kSceneSX, kSceneY + ((_now - 1) / kSceneNx) * kSceneDy + kSceneSY); sceneUp(); return Common::kNoError; }
Common::Error CGEEngine::loadGameState(int slot) { // Clear current game activity sceneDown(); _hero->park(); resetGame(); // If music is playing, kill it. if (_music) _midiPlayer->killMidi(); // Load the game loadGame(slot, NULL); _commandHandler->addCommand(kCmdLevel, -1, _oldLev, &_sceneLight); _sceneLight->gotoxy(kSceneX + ((_now - 1) % kSceneNx) * kSceneDx + kSceneSX, kSceneY + ((_now - 1) / kSceneNx) * kSceneDy + kSceneSY); sceneUp(); return Common::kNoError; }
Common::Error CGEEngine::saveGameState(int slot, const Common::String &desc) { sceneDown(); _hero->park(); _oldLev = _lev; int x = _hero->_x; int y = _hero->_y; int z = _hero->_z; // Write out the user's progress saveGame(slot, desc); _commandHandler->addCommand(kCmdLevel, -1, _oldLev, &_sceneLight); // Reload the scene sceneUp(); // Restore player position _hero->gotoxy(x, y); _hero->_z = z; return Common::kNoError; }
void MidiWindow::getNewNoteValue(int channel, int note, int velocity) { if(isLearning) { learningNote->setValue(note); learningNote = NULL; isLearning = false; ui->btnSwitchDisplay->setEnabled(true); ui->btnSceneNext->setEnabled(true); ui->btnSceneBack->setEnabled(true); ui->btnTransitionUp->setEnabled(true); ui->btnTransitionDown->setEnabled(true); } else { if(note == ui->spinSwitchDisplay->value()) { emit switchDisplay(); } else if(note == ui->spinSceneNext->value()) { emit sceneUp(); } else if(note == ui->spinSceneBack->value()) { emit sceneDown(); } else if(note == ui->spinTransitionUp->value()) { emit transitionUp(); } else if(note == ui->spinTransitionDown->value()) { emit transitionDown(); } } saveConf(); }
void CGEEngine::runGame() { if (_quitFlag) return; loadHeroXY(); _sceneLight->_flags._tran = true; _vga->_showQ->append(_sceneLight); _sceneLight->_flags._hide = false; const Seq pocSeq[] = { { 0, 0, 0, 0, 20 }, { 1, 2, 0, 0, 4 }, { 2, 3, 0, 0, 4 }, { 3, 4, 0, 0, 16 }, { 2, 5, 0, 0, 4 }, { 1, 6, 0, 0, 4 }, { 0, 1, 0, 0, 16 }, }; Seq *seq = (Seq *)malloc(7 * sizeof(Seq)); Common::copy(pocSeq, pocSeq + 7, seq); _pocLight->setSeq(seq); _pocLight->_flags._tran = true; _pocLight->_time = 1; _pocLight->_z = 120; _vga->_showQ->append(_pocLight); selectPocket(-1); _vga->_showQ->append(_mouse); loadUser(); if ((_sprite = _vga->_spareQ->locate(121)) != NULL) _commandHandlerTurbo->addCommand(kCmdSeq, -1, _vga->_mono, _sprite); if ((_sprite = _vga->_spareQ->locate(122)) != NULL) _sprite->step(_music); _commandHandlerTurbo->addCommand(kCmdSeq, -1, _music, _sprite); if (!_music) _midiPlayer->killMidi(); if (_resman->exist("MINI.SPR")) { _miniShp = new BitmapPtr[2]; _miniShp[0] = _miniShp[1] = NULL; loadSprite("MINI", -1, 0, kMiniX, kMiniY); expandSprite(_miniScene = _sprite); // NULL is ok if (_miniScene) { _miniScene->_flags._kill = false; _miniScene->_flags._hide = true; _miniShp[0] = new Bitmap(this, *_miniScene->shp()); _miniShpList = _miniScene->setShapeList(_miniShp); postMiniStep(-1); } } if (_hero) { expandSprite(_hero); _hero->gotoxy(_heroXY[_now - 1].x, _heroXY[_now - 1].y); if (_resman->exist("00SHADOW.SPR")) { loadSprite("00SHADOW", -1, 0, _hero->_x + 14, _hero->_y + 51); delete _shadow; if ((_shadow = _sprite) != NULL) { _shadow->_ref = 2; _shadow->_flags._tran = true; _shadow->_flags._kill = false; _hero->_flags._shad = true; _vga->_showQ->insert(_vga->_spareQ->remove(_shadow), _hero); } } } _infoLine->gotoxy(kInfoX, kInfoY); _infoLine->_flags._tran = true; _infoLine->update(NULL); _vga->_showQ->insert(_infoLine); _debugLine->_z = 126; _vga->_showQ->insert(_debugLine); if (_horzLine) { _horzLine->_y = kMapTop - (kMapTop > 0); _horzLine->_z = 126; _vga->_showQ->insert(_horzLine); } _mouse->_busy = _vga->_spareQ->locate(kBusyRef); if (_mouse->_busy) expandSprite(_mouse->_busy); _startupMode = 0; _commandHandler->addCommand(kCmdLevel, -1, _oldLev, &_sceneLight); _sceneLight->gotoxy(kSceneX + ((_now - 1) % kSceneNx) * kSceneDx + kSceneSX, kSceneY + ((_now - 1) / kSceneNx) * kSceneDy + kSceneSY); sceneUp(); _keyboard->setClient(_sys); // main loop while (!_endGame && !_quitFlag) { if (_flag[3]) // Flag FINIS _commandHandler->addCallback(kCmdExec, -1, 0, kQGame); mainLoop(); } // If finishing game due to closing ScummVM window, explicitly save the game if (!_endGame && canSaveGameStateCurrently()) qGame(); _keyboard->setClient(NULL); _commandHandler->addCommand(kCmdClear, -1, 0, NULL); _commandHandlerTurbo->addCommand(kCmdClear, -1, 0, NULL); _mouse->off(); _vga->_showQ->clear(); _vga->_spareQ->clear(); _hero = NULL; _shadow = NULL; }
Common::Error CGE2Engine::saveGameState(int slot, const Common::String &desc) { storeHeroPos(); saveGame(slot, desc); sceneUp(_now); return Common::kNoError; }
void CGEEngine::xScene() { debugC(6, kCGEDebugEngine, "CGEEngine::xScene()"); sceneDown(); sceneUp(); }