mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 21:59:17 +00:00
ASYLUM: Add Game::reset() function
- Set game as started in the menu, making return to game work properly git-svn-id: http://asylumengine.googlecode.com/svn/trunk@643 0bfb4aae-4ea4-11de-8d8d-752d95cf3e3c
This commit is contained in:
parent
7463acb772
commit
84dbd45ae0
@ -217,7 +217,7 @@ void AsylumEngine::restart() {
|
||||
_data.getPoint()->x = -1;
|
||||
_data.getPoint()->y = -1;
|
||||
|
||||
// FIXME the original runs a list of "reset" functions (some can be moved to constructors, others need to be part of the global data)
|
||||
reset();
|
||||
|
||||
_introPlayed = false;
|
||||
|
||||
@ -227,6 +227,18 @@ void AsylumEngine::restart() {
|
||||
startGame(kResourcePackTowerCells, kStartGamePlayIntro);
|
||||
}
|
||||
|
||||
void AsylumEngine::reset() {
|
||||
// Set game as started
|
||||
_mainMenu->setGameStarted();
|
||||
|
||||
// Reset puzzles
|
||||
for (uint32 i = 0; i < ARRAYSIZE(_puzzles); i++)
|
||||
if (_puzzles[i] != NULL)
|
||||
_puzzles[i]->reset();
|
||||
|
||||
// FIXME reset shared actor data
|
||||
}
|
||||
|
||||
void AsylumEngine::playIntro() {
|
||||
if (!_video || !_screen)
|
||||
error("[AsylumEngine::playIntro] Subsystems not initialized properly!");
|
||||
|
@ -126,6 +126,11 @@ public:
|
||||
*/
|
||||
SharedData *getData() { return &_data; }
|
||||
|
||||
/**
|
||||
* Resets the game
|
||||
*/
|
||||
void reset();
|
||||
|
||||
/**
|
||||
* This is the global tick counter.
|
||||
*/
|
||||
|
@ -51,6 +51,8 @@ public:
|
||||
virtual void open() = 0;
|
||||
virtual void close() = 0;
|
||||
|
||||
virtual void reset() {}
|
||||
|
||||
bool isActive() { return _active; }
|
||||
|
||||
protected:
|
||||
|
@ -57,6 +57,11 @@ public:
|
||||
*/
|
||||
bool handleEvent(const AsylumEvent &evt);
|
||||
|
||||
/**
|
||||
* Sets the game as started.
|
||||
*/
|
||||
void setGameStarted() { _gameStarted = true; }
|
||||
|
||||
private:
|
||||
AsylumEngine *_vm;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user