[Scummvm-cvs-logs] CVS: residual actor.cpp,1.21,1.22 actor.h,1.9,1.10 lua.cpp,1.48,1.49
James Brown
ender at users.sourceforge.net
Mon Mar 22 04:57:06 CET 2004
Update of /cvsroot/scummvm/residual
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8173
Modified Files:
actor.cpp actor.h lua.cpp
Log Message:
Still no closer to finding the mysteries of the stuck elevator from (or is that to? sorry Glottis) hell!
Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/actor.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- actor.cpp 20 Mar 2004 09:38:33 -0000 1.21
+++ actor.cpp 22 Mar 2004 12:46:38 -0000 1.22
@@ -31,6 +31,7 @@
visible_(true), talkSound_(NULL), turning_(false), walking_(false), walkChore_(-1) {
Engine::instance()->registerActor(this);
lookingMode_ = false;
+ constrain_ = false;
}
void Actor::turnTo(float pitch, float yaw, float roll) {
@@ -59,11 +60,15 @@
}
bool Actor::validBoxVector(Vector3d forwardVec, float dist) {
- //TODO: Obey Actor 'constrain' flags. Verify if any other sector flags allow walking
- //Possibly use a box-aware TraceLine function instead of just checking dest point
+ // TODO: Verify if any other sector flags allow walking
+ // Possibly use a box-aware TraceLine function instead of just checking
+ // dest point
Vector3d tempVec = pos_ + (forwardVec * dist);
int numSectors = Engine::instance()->currScene()->getSectorCount();
+ if (constrain_ == false)
+ return true;
+
for (int i = 0; i < numSectors; i++) {
Sector *sector = Engine::instance()->currScene()->getSectorBase(i);
if ((sector->type() & 0x1000) && sector->visible()) {
Index: actor.h
===================================================================
RCS file: /cvsroot/scummvm/residual/actor.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- actor.h 24 Feb 2004 08:20:44 -0000 1.9
+++ actor.h 22 Mar 2004 12:46:38 -0000 1.10
@@ -87,7 +87,9 @@
int costumeStackDepth() const {
return costumeStack_.size();
}
-
+ void setConstrain(bool constrain) {
+ constrain_ = constrain;
+ }
void update();
void draw();
@@ -116,6 +118,7 @@
float pitch_, yaw_, roll_;
float walkRate_, turnRate_;
+ bool constrain_; // Constrain to walkboxes
bool visible_;
bool lookingMode_;
ResPtr<Sound> talkSound_;
Index: lua.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/lua.cpp,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- lua.cpp 22 Mar 2004 11:23:37 -0000 1.48
+++ lua.cpp 22 Mar 2004 12:46:38 -0000 1.49
@@ -579,6 +579,14 @@
act->setHead( joint1, joint2, joint3, maxRoll, maxPitch, maxYaw );
}
+static void SetActorFollowBoxes() { // Constrain actor to walkplanes?
+ Actor *act = check_actor(1);
+ bool constrain = !lua_isnil(lua_getparam(2));
+
+ act->setConstrain(constrain);
+}
+
+/////////////
static void GetVisibleThings() {
lua_Object result = lua_createtable();
Actor *sel = Engine::instance()->selectedActor();
@@ -1205,8 +1213,6 @@
"DimScreen",
"ForceRefresh",
"RenderModeUser",
- "SetActorConstrain",
- "SetActorWalkDominate",
"SetGamma",
"ImSetVoiceEffect",
"ImResume",
@@ -1259,7 +1265,8 @@
"GetPointSector",
"IsPointInSector",
"SetActorFrustrumCull",
- "SetActorFollowBoxes",
+ "SetActorWalkDominate",
+ "SetActorConstrain",
"GetCameraActor",
"DriveActorTo",
"WalkActorVector",
@@ -1477,6 +1484,7 @@
{ "SetActorTalkColor", SetActorTalkColor },
{ "GetActorTalkColor", GetActorTalkColor },
{ "SetActorVisibility", SetActorVisibility },
+ { "SetActorFollowBoxes", SetActorFollowBoxes },
{ "PutActorAt", PutActorAt },
{ "GetActorPos", GetActorPos },
{ "SetActorRot", SetActorRot },
More information about the Scummvm-git-logs
mailing list