ASYLUM: Remove Puzzle::reset() functions

- Recreate all puzzle instances on reset
- Clear shared data directly from the AsylumEngine::reset() function
This commit is contained in:
Julien Templier 2011-07-25 06:05:35 -04:00 committed by Eugene Sandulenko
parent 55a9a133da
commit 6b4f3435c0
No known key found for this signature in database
GPG key ID: 014D387312D34F08
10 changed files with 15 additions and 51 deletions

View file

@ -260,11 +260,19 @@ void AsylumEngine::reset() {
_menu->setGameStarted();
// Reset puzzles
for (uint32 i = 0; i < ARRAYSIZE(_puzzles); i++)
if (_puzzles[i] != NULL)
_puzzles[i]->reset();
for (uint i = 0; i < ARRAYSIZE(_puzzles); i++)
delete _puzzles[i];
// FIXME reset shared actor data
initPuzzles();
// Reset shared data
for (uint32 i = 0; i < 37; i++)
_data.setData(i, 160);
_data.setData(37, 1);
// Reset special palette info
_special->reset(true);
}
void AsylumEngine::playIntro() {