added debug level to the dump() methods.

svn-id: r46334
This commit is contained in:
Vladimir Menshakov 2009-12-12 10:43:17 +00:00
parent 581fd0c42d
commit cc22b76c3b
3 changed files with 12 additions and 12 deletions

View File

@ -86,8 +86,8 @@ void Object::setName(const Common::String &new_name) {
name = new_name;
}
void Object::dump() const {
debug(0, "object: %u %u [%u,%u,%u,%u], actor: [%u,%u,%u,%u], orientation: %u, name: %s", id, enabled,
void Object::dump(int level) const {
debug(level, "object: %u %u [%u,%u,%u,%u], actor: [%u,%u,%u,%u], orientation: %u, name: %s", id, enabled,
rect.left, rect.top, rect.right, rect.bottom,
actor_rect.left, actor_rect.top, actor_rect.right, actor_rect.bottom,
actor_orientation, name.c_str()
@ -140,15 +140,15 @@ void UseHotspot::load(byte *src) {
callback = in.readUint16LE();
}
void UseHotspot::dump() const {
debug(0,
void UseHotspot::dump(int level) const {
debug(level,
"hotspot: inv_id: %02x, obj_id: %02x, orientation?: %02x, actor position: (%d,%d), callback: %04x",
inventory_id, object_id, orientation, actor_x, actor_y, callback
);
}
void Walkbox::dump() const {
debug(0, "walkbox %02x %02x [%d, %d, %d, %d] top: %u, right: %u, bottom: %u, left: %u",
void Walkbox::dump(int level) const {
debug(level, "walkbox %02x %02x [%d, %d, %d, %d] top: %u, right: %u, bottom: %u, left: %u",
type, orientation,
rect.left, rect.top, rect.right, rect.bottom,
side_hint[0], side_hint[1], side_hint[2], side_hint[3]);

View File

@ -54,8 +54,8 @@ struct Rect {
void render(Graphics::Surface *surface, uint8 color) const;
void dump() const {
debug(0, "rect[%u, %u, %u, %u]", left, top, right, bottom);
void dump(int level = 0) const {
debug(level, "rect[%u, %u, %u, %u]", left, top, right, bottom);
}
inline void clear() {
@ -167,7 +167,7 @@ struct Object {
Common::String name, description;
Object(): _base(NULL) {}
void dump() const;
void dump(int level = 0) const;
void setName(const Common::String &name);
void load(byte *addr);
void save() const;
@ -197,7 +197,7 @@ struct UseHotspot {
uint16 actor_x, actor_y;
uint16 callback;
void load(byte *src);
void dump() const;
void dump(int level = 0) const;
};
struct Walkbox {
@ -207,7 +207,7 @@ struct Walkbox {
byte side_hint[4];
Walkbox() : _base(NULL) {}
void dump() const;
void dump(int level = 0) const;
void load(byte *src);
void save() const;

View File

@ -82,7 +82,7 @@ bool Scene::findPath(Scene::Path &p, const Common::Point &src, const Common::Poi
continue;
}
w.dump();
w.dump(1);
debug(1, "%u: intersection mask 0x%04x, searching hints", *wi, mask);
int dx = p2.x - p1.x, dy = p2.y - p1.y;
if (dx >= 0) {