aboutsummaryrefslogtreecommitdiff
path: root/sword2/console.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2003-12-01 07:47:54 +0000
committerTorbjörn Andersson2003-12-01 07:47:54 +0000
commit7c9d46765beeaed45971b98f5df0193688e37eab (patch)
tree80e091dbe28e6eb80077fd00598d41de16bc1322 /sword2/console.cpp
parenta008022b30e3585231cd316251b9fc39625e40f3 (diff)
downloadscummvm-rg350-7c9d46765beeaed45971b98f5df0193688e37eab.tar.gz
scummvm-rg350-7c9d46765beeaed45971b98f5df0193688e37eab.tar.bz2
scummvm-rg350-7c9d46765beeaed45971b98f5df0193688e37eab.zip
Removed some unnecessary / commented out code, and initialized the debug
console a bit earlier so that error messages about missing files will be more obvious to the user. (If an error happens that early, some of the debugger commands will cause ScummVM to crash. I might look into that later.) svn-id: r11443
Diffstat (limited to 'sword2/console.cpp')
-rw-r--r--sword2/console.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/sword2/console.cpp b/sword2/console.cpp
index a7461107b7..490514cac6 100644
--- a/sword2/console.cpp
+++ b/sword2/console.cpp
@@ -123,19 +123,25 @@ void Debugger::varSet(int var, int val) {
void Debugger::preEnter() {
// Pause sound output
- _vm->_sound->pauseFx();
- _vm->_sound->pauseSpeech();
- _vm->_sound->pauseMusic();
+ if (_vm->_sound) {
+ _vm->_sound->pauseFx();
+ _vm->_sound->pauseSpeech();
+ _vm->_sound->pauseMusic();
+ }
}
void Debugger::postEnter() {
- // Resume previous sound state
- _vm->_sound->unpauseFx();
- _vm->_sound->unpauseSpeech();
- _vm->_sound->unpauseMusic();
+ if (_vm->_sound) {
+ // Resume previous sound state
+ _vm->_sound->unpauseFx();
+ _vm->_sound->unpauseSpeech();
+ _vm->_sound->unpauseMusic();
+ }
- // Restore old mouse cursor
- _vm->_graphics->drawMouse();
+ if (_vm->_graphics) {
+ // Restore old mouse cursor
+ _vm->_graphics->drawMouse();
+ }
}
///////////////////////////////////////////////////