aboutsummaryrefslogtreecommitdiff
path: root/engines/cge
diff options
context:
space:
mode:
authorPaul Gilbert2011-07-02 20:38:27 +1000
committerPaul Gilbert2011-07-02 20:38:27 +1000
commitadb27016294b995eb273663a2c33904050723f96 (patch)
tree4dd778938d55e4e07bfb41be1ade6221efb003e7 /engines/cge
parent72ae475c97e6f0ba1cae2f7aa0bc2860e45de495 (diff)
downloadscummvm-rg350-adb27016294b995eb273663a2c33904050723f96.tar.gz
scummvm-rg350-adb27016294b995eb273663a2c33904050723f96.tar.bz2
scummvm-rg350-adb27016294b995eb273663a2c33904050723f96.zip
CGE: Graceful exit rather than an error
Diffstat (limited to 'engines/cge')
-rw-r--r--engines/cge/cge.cpp22
-rw-r--r--engines/cge/cge_main.cpp1
-rw-r--r--engines/cge/vga13h.cpp4
3 files changed, 15 insertions, 12 deletions
diff --git a/engines/cge/cge.cpp b/engines/cge/cge.cpp
index f7e66183ce..da6365ca83 100644
--- a/engines/cge/cge.cpp
+++ b/engines/cge/cge.cpp
@@ -119,17 +119,7 @@ CGEEngine::~CGEEngine() {
_console = new CGEConsole(this);
- // Delete engine objects
- delete Text;
- delete Vga;
- delete _heart;
- delete Hero;
- delete Sys;
- delete _pocLight;
- delete _keyboard;
- delete _mouse;
- for (int i = 0; i < POCKET_NX; i++)
- delete _pocket[i];
+ // Delete engine objects
delete _sprite;
delete _miniCave;
delete _shadow;
@@ -148,8 +138,18 @@ CGEEngine::~CGEEngine() {
delete LI[1];
delete LI[2];
delete LI[3];
+ delete Text;
+ delete _heart;
+ delete _pocLight;
+ delete _keyboard;
+ delete _mouse;
+ for (int i = 0; i < POCKET_NX; i++)
+ delete _pocket[i];
delete Snail;
delete Snail_;
+ delete Hero;
+ delete Vga;
+ delete Sys;
}
Common::Error CGEEngine::run() {
diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp
index 0ee8f3ef0b..6562dac041 100644
--- a/engines/cge/cge_main.cpp
+++ b/engines/cge/cge_main.cpp
@@ -1896,7 +1896,6 @@ void CGEEngine::cge_main(void) {
movie("X03");
} else
Vga->Sunset();
- error("%s", Text->getText(EXIT_OK_TEXT + FINIS));
}
} // End of namespace CGE
diff --git a/engines/cge/vga13h.cpp b/engines/cge/vga13h.cpp
index 0e865ffd90..83c89892ca 100644
--- a/engines/cge/vga13h.cpp
+++ b/engines/cge/vga13h.cpp
@@ -366,6 +366,8 @@ Sprite::Sprite(CGEEngine *vm, BMP_PTR *shp)
Sprite::~Sprite() {
+ if (_sprite == this)
+ _sprite = NULL;
contract();
}
@@ -970,11 +972,13 @@ VGA::~VGA(void) {
Mono = 0;
if (isVga()) {
Common::String buffer = "";
+/*
Clear(0);
SetMode(OldMode);
SetColors();
RestoreScreen(OldScreen);
Sunrise(OldColors);
+*/
if (OldColors)
free(OldColors);
if (NewColors)