aboutsummaryrefslogtreecommitdiff
path: root/sword2/debug.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2004-04-24 12:29:35 +0000
committerTorbjörn Andersson2004-04-24 12:29:35 +0000
commita575576890045caf4beda9dacb7923558e7f3003 (patch)
tree5cd53b8c2057241031067d372c470c34a5a13c2c /sword2/debug.cpp
parent94962f6655f543f924048c23a6559932b089666b (diff)
downloadscummvm-rg350-a575576890045caf4beda9dacb7923558e7f3003.tar.gz
scummvm-rg350-a575576890045caf4beda9dacb7923558e7f3003.tar.bz2
scummvm-rg350-a575576890045caf4beda9dacb7923558e7f3003.zip
fetchObjectName() no longer assumes that the resource will still be in the
cache after it's been closed. (Currently it always is, but ideally I'd like for BS to work even if resource caching is disabled.) svn-id: r13610
Diffstat (limited to 'sword2/debug.cpp')
-rw-r--r--sword2/debug.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/sword2/debug.cpp b/sword2/debug.cpp
index 3c41f34655..da61b81b43 100644
--- a/sword2/debug.cpp
+++ b/sword2/debug.cpp
@@ -158,6 +158,8 @@ void Debugger::buildDebugText(void) {
// general debug info
if (_displayDebugText) {
+ byte name[NAME_LEN];
+
/*
// CD in use
sprintf(buf, "CD-%d", currentCD);
@@ -171,7 +173,7 @@ void Debugger::buildDebugText(void) {
Logic::_scriptVars[MOUSE_X],
Logic::_scriptVars[MOUSE_Y],
Logic::_scriptVars[CLICKED_ID],
- _vm->fetchObjectName(Logic::_scriptVars[CLICKED_ID]));
+ _vm->fetchObjectName(Logic::_scriptVars[CLICKED_ID], name));
else
sprintf(buf, "last click at %d,%d (---)",
Logic::_scriptVars[MOUSE_X],
@@ -184,7 +186,7 @@ void Debugger::buildDebugText(void) {
_vm->_input->_mouseX + _vm->_thisScreen.scroll_offset_x,
_vm->_input->_mouseY + _vm->_thisScreen.scroll_offset_y,
_vm->_mouseTouching,
- _vm->fetchObjectName(_vm->_mouseTouching));
+ _vm->fetchObjectName(_vm->_mouseTouching, name));
else
sprintf(buf, "mouse %d,%d (not touching)",
_vm->_input->_mouseX + _vm->_thisScreen.scroll_offset_x,
@@ -199,7 +201,7 @@ void Debugger::buildDebugText(void) {
sprintf(buf, "player %d,%d %s (%d) #%d/%d",
_vm->_thisScreen.player_feet_x,
_vm->_thisScreen.player_feet_y,
- _vm->fetchObjectName(_playerGraphic.anim_resource),
+ _vm->fetchObjectName(_playerGraphic.anim_resource, name),
_playerGraphic.anim_resource,
_playerGraphic.anim_pc,
_playerGraphicNoFrames);
@@ -265,7 +267,7 @@ void Debugger::buildDebugText(void) {
if (_vm->_logic->_speechScriptWaiting) {
sprintf(buf, "script waiting for %s (%d)",
- _vm->fetchObjectName(_vm->_logic->_speechScriptWaiting),
+ _vm->fetchObjectName(_vm->_logic->_speechScriptWaiting, name),
_vm->_logic->_speechScriptWaiting);
makeDebugTextBlock(buf, 0, 90);
}