aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage/ringworld2/ringworld2_logic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/tsage/ringworld2/ringworld2_logic.cpp')
-rw-r--r--engines/tsage/ringworld2/ringworld2_logic.cpp34
1 files changed, 22 insertions, 12 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp
index 4050c62a78..b86b8283ed 100644
--- a/engines/tsage/ringworld2/ringworld2_logic.cpp
+++ b/engines/tsage/ringworld2/ringworld2_logic.cpp
@@ -38,8 +38,6 @@ namespace TsAGE {
namespace Ringworld2 {
Scene *Ringworld2Game::createScene(int sceneNumber) {
- warning("Switching to scene %d", sceneNumber);
-
switch (sceneNumber) {
/* Scene group #0 */
case 50:
@@ -1118,19 +1116,31 @@ void Ringworld2Game::start() {
if (slot >= 0)
R2_GLOBALS._sceneHandler->_loadGameSlot = slot;
else {
- // Switch to the first game scene
+ // Switch to the first title screen
R2_GLOBALS._events.setCursor(CURSOR_WALK);
R2_GLOBALS._uiElements._active = true;
- R2_GLOBALS._sceneManager.setNewScene(100);
+ R2_GLOBALS._sceneManager.setNewScene(180);
}
g_globals->_events.showCursor();
}
+void Ringworld2Game::restartGame() {
+ if (MessageDialog::show(Ringworld2::R2_RESTART_MSG, CANCEL_BTN_STRING, YES_MSG) == 1)
+ restart();
+}
+
void Ringworld2Game::restart() {
g_globals->_scenePalette.clearListeners();
g_globals->_soundHandler.stop();
+ // Reset the globals
+ g_globals->reset();
+
+ // Clear save/load slots
+ g_globals->_sceneHandler->_saveGameSlot = -1;
+ g_globals->_sceneHandler->_loadGameSlot = -1;
+
// Change to the first game scene
g_globals->_sceneManager.changeScene(100);
}
@@ -1307,18 +1317,18 @@ GfxSurface SceneActor::getFrame() {
// TODO: Proper effects handling
switch (_effect) {
- case 0:
- case 5:
+ case EFFECT_NONE:
+ case EFFECT_5:
// TODO: Figure out purpose of setting image flags to 64, and getting
// scene priorities -1 or _shade
break;
- case 1:
+ case EFFECT_SHADED:
// TODO: Transposing using R2_GLOBALS._pixelArrayMap
break;
- case 2:
+ case EFFECT_2:
// No effect
break;
- case 4:
+ case EFFECT_4:
break;
default:
// TODO: Default effect
@@ -2087,7 +2097,7 @@ void AnimationPlayer::close() {
_field38 = 0;
if (g_globals != NULL)
- R2_GLOBALS._animationCtr = MAX(R2_GLOBALS._animationCtr, 0);
+ R2_GLOBALS._animationCtr = MAX(R2_GLOBALS._animationCtr - 1, 0);
}
void AnimationPlayer::rleDecode(const byte *pSrc, byte *pDest, int size) {
@@ -2133,13 +2143,13 @@ void AnimationPlayer::getSlices() {
/*--------------------------------------------------------------------------*/
AnimationPlayerExt::AnimationPlayerExt(): AnimationPlayer() {
- _v = 0;
+ _isActive = false;
_field3A = 0;
}
void AnimationPlayerExt::synchronize(Serializer &s) {
AnimationPlayer::synchronize(s);
- s.syncAsSint16LE(_v);
+ s.syncAsSint16LE(_isActive);
}
/*--------------------------------------------------------------------------*/