[Scummvm-cvs-logs] SF.net SVN: scummvm:[44389] scummvm/trunk/engines/teenagent
megath at users.sourceforge.net
megath at users.sourceforge.net
Sun Sep 27 07:17:00 CEST 2009
Revision: 44389
http://scummvm.svn.sourceforge.net/scummvm/?rev=44389&view=rev
Author: megath
Date: 2009-09-27 05:17:00 +0000 (Sun, 27 Sep 2009)
Log Message:
-----------
added save()'s where needed
Modified Paths:
--------------
scummvm/trunk/engines/teenagent/callbacks.cpp
scummvm/trunk/engines/teenagent/objects.cpp
scummvm/trunk/engines/teenagent/objects.h
scummvm/trunk/engines/teenagent/scene.cpp
Modified: scummvm/trunk/engines/teenagent/callbacks.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/callbacks.cpp 2009-09-27 01:50:26 UTC (rev 44388)
+++ scummvm/trunk/engines/teenagent/callbacks.cpp 2009-09-27 05:17:00 UTC (rev 44389)
@@ -1277,7 +1277,7 @@
SET_FLAG(0xDB98, f);
if (f >= 2) {
//disable object boat for scene 15!!
- scene->getObject(1, 15)->enabled = 0;
+ disableObject(1, 15);
}
}
return true;
@@ -1297,7 +1297,7 @@
SET_FLAG(0xDB98, f);
if (f >= 2) {
//disable object boat for scene 15!!
- scene->getObject(1, 15)->enabled = 0;
+ disableObject(1, 15);
}
}
return true;
@@ -2392,14 +2392,17 @@
displayMessage(0x3cfb);
playAnimation(507, 1);
setOns(0, 4);
- Object * obj = scene->getObject(3);
- obj->rect.top += 20;
- obj->rect.bottom += 20;
+ {
+ Object *obj = scene->getObject(3);
+ obj->rect.top += 20;
+ obj->rect.bottom += 20;
+ obj->rect.save();
+ }
playSound(10);
playAnimation(503, 1);
setLan(1, 0, 22);
- scene->getObject(1, 22)->enabled = 0;
- scene->getObject(13, 20)->enabled = 0;
+ disableObject(1, 22);
+ disableObject(13, 20);
setLan(1, 0);
disableObject(1);
disableObject(2);
@@ -2419,10 +2422,18 @@
playSound(62);
//patch lan, 1
displayMessage(0x3d3a);
- scene->getObject(7)->actor_rect.left = 228;
- scene->getObject(7)->actor_rect.top = 171;
- scene->getObject(8)->actor_rect.left = 290;
- scene->getObject(8)->actor_rect.top = 171;
+ {
+ Object *obj = scene->getObject(7);
+ obj->actor_rect.left = 228;
+ obj->actor_rect.top = 171;
+ obj->actor_rect.save();
+ }
+ {
+ Object *obj = scene->getObject(8);
+ obj->actor_rect.left = 290;
+ obj->actor_rect.top = 171;
+ obj->actor_rect.save();
+ }
}
return true;
@@ -3347,12 +3358,24 @@
playAnimation(714, 1);
setLan(1, 0);
disableObject(1);
- scene->getObject(2)->actor_rect = Rect(81, 160, 81, 160);
- scene->getObject(2)->actor_orientation = 4;
- scene->getObject(3)->actor_rect = Rect(63, 168, 63, 168);
- scene->getObject(3)->actor_orientation = 4;
- scene->getObject(10)->actor_rect = Rect(105, 160, 105, 160);
- scene->getObject(10)->actor_orientation = 1;
+ {
+ Object *obj = scene->getObject(2);
+ obj->actor_rect = Rect(81, 160, 81, 160);
+ obj->actor_orientation = 4;
+ obj->save();
+ }
+ {
+ Object *obj = scene->getObject(3);
+ obj->actor_rect = Rect(63, 168, 63, 168);
+ obj->actor_orientation = 4;
+ obj->save();
+ }
+ {
+ Object *obj = scene->getObject(10);
+ obj->actor_rect = Rect(105, 160, 105, 160);
+ obj->actor_orientation = 1;
+ obj->save();
+ }
SET_FLAG(0xDBCC, 1);
return true;
@@ -3661,13 +3684,16 @@
Dialog::show(scene, 0x58a9);
- Object * obj = scene->getObject(1);
+ Object *obj = scene->getObject(1);
obj->actor_rect = Rect(270, 193, 270, 193);
obj->actor_orientation = 2;
+ obj->save();
obj = scene->getObject(3);
obj->actor_rect = Rect(254, 193, 254, 193);
obj->actor_orientation = 1;
+ obj->save();
+
SET_FLAG(0xDBD7, 1);
}
return true;
Modified: scummvm/trunk/engines/teenagent/objects.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/objects.cpp 2009-09-27 01:50:26 UTC (rev 44388)
+++ scummvm/trunk/engines/teenagent/objects.cpp 2009-09-27 05:17:00 UTC (rev 44389)
@@ -71,6 +71,15 @@
description = parse_description((const char *)src);
}
+void Object::save() {
+ assert(_base != NULL);
+
+ rect.save();
+ actor_rect.save();
+ _base[17] = actor_orientation;
+ _base[18] = enabled;
+}
+
void Object::setName(const Common::String &new_name) {
assert(_base != 0);
strcpy((char *)(_base + 19), new_name.c_str());
@@ -133,9 +142,9 @@
void Walkbox::dump() {
debug(0, "walkbox %02x %02x [%d, %d, %d, %d] %02x %02x %02x %02x ",
- unk00, orientation,
- rect.left, rect.right, rect.top, rect.bottom,
- unk0a, unk0b, unk0c, unk0d);
+ unk00, orientation,
+ rect.left, rect.right, rect.top, rect.bottom,
+ unk0a, unk0b, unk0c, unk0d);
}
void Walkbox::load(byte *src) {
Modified: scummvm/trunk/engines/teenagent/objects.h
===================================================================
--- scummvm/trunk/engines/teenagent/objects.h 2009-09-27 01:50:26 UTC (rev 44388)
+++ scummvm/trunk/engines/teenagent/objects.h 2009-09-27 05:17:00 UTC (rev 44389)
@@ -71,17 +71,19 @@
struct Object {
enum {kActorUp = 1, kActorRight = 2, kActorDown = 3, kActorLeft = 4 };
- byte id;
- Rect rect;
- Rect actor_rect;
- byte actor_orientation;
- byte enabled; //19 bytes
+ byte id; //0
+ Rect rect; //1
+ Rect actor_rect; //9
+ byte actor_orientation; //17
+ byte enabled; //18
+ //19
Common::String name, description;
Object(): _base(NULL) {}
void dump();
void setName(const Common::String &name);
void load(byte *addr);
+ void save();
static Common::String parse_description(const char *name);
Modified: scummvm/trunk/engines/teenagent/scene.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/scene.cpp 2009-09-27 01:50:26 UTC (rev 44388)
+++ scummvm/trunk/engines/teenagent/scene.cpp 2009-09-27 05:17:00 UTC (rev 44389)
@@ -392,6 +392,7 @@
obj->rect.top = s->y;
obj->rect.right = s->w + s->x;
obj->rect.bottom = s->h + s->y;
+ obj->rect.save();
//obj->dump();
}
}
@@ -585,6 +586,7 @@
debug(0, "%s object #%u", current_event.color ? "enabling" : "disabling", current_event.object - 1);
Object *obj = getObject(current_event.object - 1, current_event.scene == 0 ? _id : current_event.scene);
obj->enabled = current_event.color;
+ obj->save();
current_event.clear();
}
break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list