diff options
Diffstat (limited to 'engines/teenagent/objects.cpp')
-rw-r--r-- | engines/teenagent/objects.cpp | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/engines/teenagent/objects.cpp b/engines/teenagent/objects.cpp index 748f342d54..5dad9ab99d 100644 --- a/engines/teenagent/objects.cpp +++ b/engines/teenagent/objects.cpp @@ -21,8 +21,10 @@ #include "common/debug.h" #include "common/memstream.h" + #include "teenagent/objects.h" #include "teenagent/resources.h" +#include "teenagent/teenagent.h" namespace TeenAgent { @@ -51,7 +53,6 @@ void Rect::render(Graphics::Surface *surface, uint8 color) const { surface->vLine(right, bottom, top, color); } - void Object::load(byte *src) { _base = src; @@ -59,39 +60,39 @@ void Object::load(byte *src) { rect.load(src); src += 8; - actor_rect.load(src); + actorRect.load(src); src += 8; - actor_orientation = *src++; + actorOrientation = *src++; enabled = *src++; name = (const char *)src; - description = parse_description((const char *)src); + description = parseDescription((const char *)src); } void Object::save() const { assert(_base != NULL); rect.save(); - actor_rect.save(); - _base[17] = actor_orientation; + actorRect.save(); + _base[17] = actorOrientation; _base[18] = enabled; } -void Object::setName(const Common::String &new_name) { +void Object::setName(const Common::String &newName) { assert(_base != 0); - strcpy((char *)(_base + 19), new_name.c_str()); - name = new_name; + strcpy((char *)(_base + 19), newName.c_str()); + name = newName; } 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, + debugC(level, kDebugObject, "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() + actorRect.left, actorRect.top, actorRect.right, actorRect.bottom, + actorOrientation, name.c_str() ); } -Common::String Object::parse_description(const char *name) { +Common::String Object::parseDescription(const char *name) { const char *desc = name + strlen(name) + 1; if (*desc == 0) return Common::String(); @@ -101,7 +102,7 @@ Common::String Object::parse_description(const char *name) { while (*desc != 1 && *desc != 0) { Common::String line; while (*desc != 1 && *desc != 0) { - //debug(0, "%02x ", *desc); + debugC(2, kDebugObject, "%02x ", *desc); line += *desc++; } @@ -115,7 +116,7 @@ Common::String Object::parse_description(const char *name) { if (!result.empty()) result.deleteLastChar(); else - result = "Cool."; + result = "Cool."; // FIXME - Use dsAddr_coolMsg ? return result; } @@ -124,31 +125,31 @@ void InventoryObject::load(byte *src) { id = *src++; animated = *src++; name = (const char *)src; - description = Object::parse_description((const char *)src); + description = Object::parseDescription((const char *)src); } void UseHotspot::load(byte *src) { Common::MemoryReadStream in(src, 9); - inventory_id = in.readByte(); - object_id = in.readByte(); + inventoryId = in.readByte(); + objectId = in.readByte(); orientation = in.readByte(); - actor_x = in.readUint16LE(); - actor_y = in.readUint16LE(); + actorX = in.readUint16LE(); + actorY = in.readUint16LE(); callback = in.readUint16LE(); } 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 + debugC(level, kDebugObject, + "hotspot: invId: %02x, objId: %02x, orientation: %02x, actor position: (%d,%d), callback: %04x", + inventoryId, objectId, orientation, actorX, actorY, callback ); } void Walkbox::dump(int level) const { - debug(level, "walkbox %02x %02x [%d, %d, %d, %d] top: %u, right: %u, bottom: %u, left: %u", + debugC(level, kDebugObject, "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]); + sideHint[0], sideHint[1], sideHint[2], sideHint[3]); } void Walkbox::load(byte *src) { @@ -159,7 +160,7 @@ void Walkbox::load(byte *src) { rect.load(src); src += 8; for (byte i = 0; i < 4; ++i) - side_hint[i] = *src++; + sideHint[i] = *src++; } void Walkbox::save() const { |