Cleanup
svn-id: r23439
This commit is contained in:
parent
8edc7ce1f7
commit
7bfaa0db78
9 changed files with 37 additions and 56 deletions
|
@ -434,44 +434,41 @@ bool Debugger::Cmd_ResLook(int argc, const char **argv) {
|
|||
}
|
||||
|
||||
// Open up the resource and take a look inside!
|
||||
uint8 type = _vm->_resman->fetchType(res);;
|
||||
byte name[NAME_LEN];
|
||||
|
||||
_vm->_resman->fetchName(res, name);
|
||||
uint8 type = _vm->_resman->fetchType(res);
|
||||
|
||||
switch (type) {
|
||||
case ANIMATION_FILE:
|
||||
DebugPrintf("<anim> %s\n", name);
|
||||
DebugPrintf("<anim> %s\n", _vm->_resman->fetchName(res));
|
||||
break;
|
||||
case SCREEN_FILE:
|
||||
DebugPrintf("<layer> %s\n", name);
|
||||
DebugPrintf("<layer> %s\n", _vm->_resman->fetchName(res));
|
||||
break;
|
||||
case GAME_OBJECT:
|
||||
DebugPrintf("<game object> %s\n", name);
|
||||
DebugPrintf("<game object> %s\n", _vm->_resman->fetchName(res));
|
||||
break;
|
||||
case WALK_GRID_FILE:
|
||||
DebugPrintf("<walk grid> %s\n", name);
|
||||
DebugPrintf("<walk grid> %s\n", _vm->_resman->fetchName(res));
|
||||
break;
|
||||
case GLOBAL_VAR_FILE:
|
||||
DebugPrintf("<global variables> %s\n", name);
|
||||
DebugPrintf("<global variables> %s\n", _vm->_resman->fetchName(res));
|
||||
break;
|
||||
case PARALLAX_FILE_null:
|
||||
DebugPrintf("<parallax file NOT USED!> %s\n", name);
|
||||
DebugPrintf("<parallax file NOT USED!> %s\n", _vm->_resman->fetchName(res));
|
||||
break;
|
||||
case RUN_LIST:
|
||||
DebugPrintf("<run list> %s\n", name);
|
||||
DebugPrintf("<run list> %s\n", _vm->_resman->fetchName(res));
|
||||
break;
|
||||
case TEXT_FILE:
|
||||
DebugPrintf("<text file> %s\n", name);
|
||||
DebugPrintf("<text file> %s\n", _vm->_resman->fetchName(res));
|
||||
break;
|
||||
case SCREEN_MANAGER:
|
||||
DebugPrintf("<screen manager> %s\n", name);
|
||||
DebugPrintf("<screen manager> %s\n", _vm->_resman->fetchName(res));
|
||||
break;
|
||||
case MOUSE_FILE:
|
||||
DebugPrintf("<mouse pointer> %s\n", name);
|
||||
DebugPrintf("<mouse pointer> %s\n", _vm->_resman->fetchName(res));
|
||||
break;
|
||||
case ICON_FILE:
|
||||
DebugPrintf("<menu icon> %s\n", name);
|
||||
DebugPrintf("<menu icon> %s\n", _vm->_resman->fetchName(res));
|
||||
break;
|
||||
default:
|
||||
DebugPrintf("unrecognised fileType %d\n", type);
|
||||
|
@ -511,9 +508,7 @@ bool Debugger::Cmd_RunList(int argc, const char **argv) {
|
|||
if (!res)
|
||||
break;
|
||||
|
||||
byte name[NAME_LEN];
|
||||
|
||||
DebugPrintf("%d %s\n", res, _vm->_resman->fetchName(res, name));
|
||||
DebugPrintf("%d %s\n", res, _vm->_resman->fetchName(res));
|
||||
}
|
||||
|
||||
_vm->_resman->closeResource(runList);
|
||||
|
@ -786,12 +781,11 @@ bool Debugger::Cmd_Events(int argc, const char **argv) {
|
|||
|
||||
for (uint32 i = 0; i < MAX_events; i++) {
|
||||
if (eventList[i].id) {
|
||||
byte buf[NAME_LEN];
|
||||
uint32 target = eventList[i].id;
|
||||
uint32 script = eventList[i].interact_id;
|
||||
|
||||
DebugPrintf("slot %2d: id = %s (%d)\n", i, _vm->_resman->fetchName(target, buf), target);
|
||||
DebugPrintf(" script = %s (%d) pos %d\n", _vm->_resman->fetchName(script / 65536, buf), script / 65536, script % 65536);
|
||||
DebugPrintf("slot %2d: id = %s (%d)\n", i, _vm->_resman->fetchName(target), target);
|
||||
DebugPrintf(" script = %s (%d) pos %d\n", _vm->_resman->fetchName(script / 65536), script / 65536, script % 65536);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -172,8 +172,6 @@ void Debugger::buildDebugText() {
|
|||
// general debug info
|
||||
|
||||
if (_displayDebugText) {
|
||||
byte name[NAME_LEN];
|
||||
|
||||
/*
|
||||
// CD in use
|
||||
sprintf(buf, "CD-%d", currentCD);
|
||||
|
@ -187,7 +185,7 @@ void Debugger::buildDebugText() {
|
|||
_vm->_logic->readVar(MOUSE_X),
|
||||
_vm->_logic->readVar(MOUSE_Y),
|
||||
_vm->_logic->readVar(CLICKED_ID),
|
||||
_vm->_resman->fetchName(_vm->_logic->readVar(CLICKED_ID), name));
|
||||
_vm->_resman->fetchName(_vm->_logic->readVar(CLICKED_ID)));
|
||||
else
|
||||
sprintf(buf, "last click at %d,%d (---)",
|
||||
_vm->_logic->readVar(MOUSE_X),
|
||||
|
@ -206,7 +204,7 @@ void Debugger::buildDebugText() {
|
|||
mouseX + screenInfo->scroll_offset_x,
|
||||
mouseY + screenInfo->scroll_offset_y,
|
||||
mouseTouching,
|
||||
_vm->_resman->fetchName(mouseTouching, name));
|
||||
_vm->_resman->fetchName(mouseTouching));
|
||||
else
|
||||
sprintf(buf, "mouse %d,%d (not touching)",
|
||||
mouseX + screenInfo->scroll_offset_x,
|
||||
|
@ -221,7 +219,7 @@ void Debugger::buildDebugText() {
|
|||
sprintf(buf, "player %d,%d %s (%d) #%d/%d",
|
||||
screenInfo->player_feet_x,
|
||||
screenInfo->player_feet_y,
|
||||
_vm->_resman->fetchName(_graphAnimRes, name),
|
||||
_vm->_resman->fetchName(_graphAnimRes),
|
||||
_graphAnimRes,
|
||||
_graphAnimPc,
|
||||
_graphNoFrames);
|
||||
|
@ -287,7 +285,7 @@ void Debugger::buildDebugText() {
|
|||
|
||||
if (_speechScriptWaiting) {
|
||||
sprintf(buf, "script waiting for %s (%d)",
|
||||
_vm->_resman->fetchName(_speechScriptWaiting, name),
|
||||
_vm->_resman->fetchName(_speechScriptWaiting),
|
||||
_speechScriptWaiting);
|
||||
makeDebugTextBlock(buf, 0, 90);
|
||||
}
|
||||
|
|
|
@ -876,9 +876,7 @@ int32 Logic::fnISpeak(int32 *params) {
|
|||
if (readVar(PLAYER_ID) != CUR_PLAYER_ID)
|
||||
debug(5, "(%d) Nico: %s", _officialTextNumber, text + 2);
|
||||
else {
|
||||
byte buf[NAME_LEN];
|
||||
|
||||
debug(5, "(%d) %s: %s", _officialTextNumber, _vm->_resman->fetchName(readVar(ID), buf), text + 2);
|
||||
debug(5, "(%d) %s: %s", _officialTextNumber, _vm->_resman->fetchName(readVar(ID)), text + 2);
|
||||
}
|
||||
|
||||
// Set up the speech animation
|
||||
|
|
|
@ -48,7 +48,6 @@ namespace Sword2 {
|
|||
*/
|
||||
|
||||
void Screen::initBackground(int32 res, int32 new_palette) {
|
||||
byte buf[NAME_LEN];
|
||||
int i;
|
||||
|
||||
assert(res);
|
||||
|
@ -56,7 +55,7 @@ void Screen::initBackground(int32 res, int32 new_palette) {
|
|||
_vm->_sound->clearFxQueue();
|
||||
waitForFade();
|
||||
|
||||
debug(1, "CHANGED TO LOCATION \"%s\"", _vm->_resman->fetchName(res, buf));
|
||||
debug(1, "CHANGED TO LOCATION \"%s\"", _vm->_resman->fetchName(res));
|
||||
|
||||
// if last screen was using a shading mask (see below)
|
||||
if (_thisScreen.mask_flag) {
|
||||
|
|
|
@ -539,7 +539,6 @@ void Mouse::dragMouse() {
|
|||
}
|
||||
|
||||
void Mouse::menuMouse() {
|
||||
byte buf[NAME_LEN];
|
||||
MouseEvent *me;
|
||||
int hit;
|
||||
|
||||
|
@ -587,7 +586,7 @@ void Mouse::menuMouse() {
|
|||
hideMouse();
|
||||
|
||||
debug(2, "Right-click on \"%s\" icon",
|
||||
_vm->_resman->fetchName(_vm->_logic->readVar(OBJECT_HELD), buf));
|
||||
_vm->_resman->fetchName(_vm->_logic->readVar(OBJECT_HELD)));
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -615,7 +614,7 @@ void Mouse::menuMouse() {
|
|||
setLuggage(_masterMenuList[hit].luggage_resource);
|
||||
|
||||
debug(2, "Left-clicked on \"%s\" icon - switch to drag mode",
|
||||
_vm->_resman->fetchName(_vm->_logic->readVar(OBJECT_HELD), buf));
|
||||
_vm->_resman->fetchName(_vm->_logic->readVar(OBJECT_HELD)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -817,10 +816,10 @@ void Mouse::normalMouse() {
|
|||
_vm->_resman->fetchName(_vm->_logic->readVar(CLICKED_ID), buf2));
|
||||
else if (_vm->_logic->readVar(LEFT_BUTTON))
|
||||
debug(2, "Left-clicked on \"%s\"",
|
||||
_vm->_resman->fetchName(_vm->_logic->readVar(CLICKED_ID), buf1));
|
||||
_vm->_resman->fetchName(_vm->_logic->readVar(CLICKED_ID)));
|
||||
else // RIGHT BUTTON
|
||||
debug(2, "Right-clicked on \"%s\"",
|
||||
_vm->_resman->fetchName(_vm->_logic->readVar(CLICKED_ID), buf1));
|
||||
_vm->_resman->fetchName(_vm->_logic->readVar(CLICKED_ID)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -993,9 +992,7 @@ void Mouse::mouseOnOff() {
|
|||
setLuggage(_currentLuggageResource);
|
||||
}
|
||||
} else {
|
||||
byte buf[NAME_LEN];
|
||||
|
||||
error("ERROR: mouse.pointer==0 for object %d (%s) - update logic script!", _mouseTouching, _vm->_resman->fetchName(_mouseTouching, buf));
|
||||
error("ERROR: mouse.pointer==0 for object %d (%s) - update logic script!", _mouseTouching, _vm->_resman->fetchName(_mouseTouching));
|
||||
}
|
||||
} else if (_oldMouseTouching && !_mouseTouching) {
|
||||
// the cursor has moved off something - reset cursor to
|
||||
|
|
|
@ -98,7 +98,12 @@ public:
|
|||
return ptr[0];
|
||||
}
|
||||
|
||||
byte *fetchName(uint32 res, byte *buf) {
|
||||
byte *fetchName(uint32 res, byte *buf = NULL) {
|
||||
static byte tempbuf[NAME_LEN];
|
||||
|
||||
if (!buf)
|
||||
buf = tempbuf;
|
||||
|
||||
byte *ptr = openResource(res);
|
||||
memcpy(buf, ptr + 10, NAME_LEN);
|
||||
closeResource(res);
|
||||
|
|
|
@ -491,12 +491,10 @@ void Screen::processLayer(byte *file, uint32 layer_number) {
|
|||
uint32 current_layer_area = layer_head.width * layer_head.height;
|
||||
|
||||
if (current_layer_area > _largestLayerArea) {
|
||||
byte buf[NAME_LEN];
|
||||
|
||||
_largestLayerArea = current_layer_area;
|
||||
sprintf(_largestLayerInfo,
|
||||
"largest layer: %s layer(%d) is %dx%d",
|
||||
_vm->_resman->fetchName(_thisScreen.background_layer_id, buf),
|
||||
_vm->_resman->fetchName(_thisScreen.background_layer_id),
|
||||
layer_number, layer_head.width, layer_head.height);
|
||||
}
|
||||
|
||||
|
@ -583,12 +581,10 @@ void Screen::processImage(BuildUnit *build_unit) {
|
|||
uint32 current_sprite_area = frame_head.width * frame_head.height;
|
||||
|
||||
if (current_sprite_area > _largestSpriteArea) {
|
||||
byte buf[NAME_LEN];
|
||||
|
||||
_largestSpriteArea = current_sprite_area;
|
||||
sprintf(_largestSpriteInfo,
|
||||
"largest sprite: %s frame(%d) is %dx%d",
|
||||
_vm->_resman->fetchName(build_unit->anim_resource, buf),
|
||||
_vm->_resman->fetchName(build_unit->anim_resource),
|
||||
build_unit->anim_pc,
|
||||
frame_head.width,
|
||||
frame_head.height);
|
||||
|
@ -618,11 +614,9 @@ void Screen::processImage(BuildUnit *build_unit) {
|
|||
|
||||
uint32 rv = drawSprite(&spriteInfo);
|
||||
if (rv) {
|
||||
byte buf[NAME_LEN];
|
||||
|
||||
error("Driver Error %.8x with sprite %s (%d) in processImage",
|
||||
rv,
|
||||
_vm->_resman->fetchName(build_unit->anim_resource, buf),
|
||||
_vm->_resman->fetchName(build_unit->anim_resource),
|
||||
build_unit->anim_resource);
|
||||
}
|
||||
|
||||
|
|
|
@ -202,9 +202,7 @@ void Sound::queueFx(int32 res, int32 type, int32 delay, int32 volume, int32 pan)
|
|||
break;
|
||||
}
|
||||
|
||||
byte buf[NAME_LEN];
|
||||
|
||||
debug(0, "SFX (sample=\"%s\", vol=%d, pan=%d, delay=%d, type=%s)", _vm->_resman->fetchName(res, buf), volume, pan, delay, typeStr);
|
||||
debug(0, "SFX (sample=\"%s\", vol=%d, pan=%d, delay=%d, type=%s)", _vm->_resman->fetchName(res), volume, pan, delay, typeStr);
|
||||
}
|
||||
|
||||
for (int i = 0; i < FXQ_LENGTH; i++) {
|
||||
|
|
|
@ -80,9 +80,7 @@ bool Sword2Engine::initStartMenu() {
|
|||
}
|
||||
|
||||
if (_resman->fetchType(id) != SCREEN_MANAGER) {
|
||||
byte name[NAME_LEN];
|
||||
|
||||
warning("startup.inf:%d: '%s' (%d) is not a screen manager", lineno, _resman->fetchName(id, name), id);
|
||||
warning("startup.inf:%d: '%s' (%d) is not a screen manager", lineno, _resman->fetchName(id), id);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue