From 51c93575491a73e1c8d880b994190173bb0bbd9c Mon Sep 17 00:00:00 2001 From: Joseph-Eugene Winzer Date: Fri, 4 Aug 2017 11:24:02 +0200 Subject: SUPERNOVA: Implements death screen --- engines/supernova/state.cpp | 23 +++++++++++++++++++++++ engines/supernova/state.h | 1 + 2 files changed, 24 insertions(+) (limited to 'engines/supernova') diff --git a/engines/supernova/state.cpp b/engines/supernova/state.cpp index cd096874ca..d612c234df 100644 --- a/engines/supernova/state.cpp +++ b/engines/supernova/state.cpp @@ -805,6 +805,29 @@ void GameManager::closeLocker(const Room *room, Object *obj, Object *lock, int s } } +void GameManager::death(const char *message) { + _vm->paletteFadeOut(); + _guiEnabled = false; + _vm->renderImage(11, 0); + _vm->renderMessage(message); + _vm->playSound(kAudioDeath); + _vm->paletteFadeIn(); + getInput(); + _vm->paletteFadeOut(); + _vm->removeMessage(); + + // TODO: Load screen + destroyRooms(); + initRooms(); + initState(); + initGui(); + _inventory.clear(); + changeRoom(INTRO); + _vm->paletteFadeIn(); + + _guiEnabled = true; +} + int GameManager::invertSection(int section) { if (section < 128) section += 128; diff --git a/engines/supernova/state.h b/engines/supernova/state.h index b85ff76523..383b1caca7 100644 --- a/engines/supernova/state.h +++ b/engines/supernova/state.h @@ -180,6 +180,7 @@ public: void handleInput(); void handleTime(); void setAnimationTimer(int ticks); + void death(const char *message); }; } -- cgit v1.2.3