[Scummvm-cvs-logs] CVS: residual README,1.27,1.28 TODO,1.51,1.52 actor.cpp,1.55,1.56 actor.h,1.26,1.27 lua.cpp,1.143,1.144 lua.h,1.9,1.10 smush.cpp,1.63,1.64
Erich Edgar Hoover
compholio at users.sourceforge.net
Mon Jul 25 18:49:01 CEST 2005
- Previous message: [Scummvm-cvs-logs] CVS: residual/imuse imuse_track.cpp,1.14,1.15
- Next message: [Scummvm-cvs-logs] CVS: scummvm/saga game.cpp,1.82,1.83 music.cpp,1.60,1.61 rscfile.cpp,1.26,1.27 rscfile.h,1.12,1.13 saga.h,1.108,1.109 sndres.cpp,1.46,1.47 sndres.h,1.21,1.22 sound.cpp,1.30,1.31 sound.h,1.22,1.23
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/residual
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28561
Modified Files:
README TODO actor.cpp actor.h lua.cpp lua.h smush.cpp
Log Message:
Initial support for TurnActorTo, PointActorAt, RotateVector, GetPointSector, and SetActorPitch - little bit smarter SMUSH looping
Index: README
===================================================================
RCS file: /cvsroot/scummvm/residual/README,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- README 23 Jul 2005 08:39:11 -0000 1.27
+++ README 26 Jul 2005 01:46:45 -0000 1.28
@@ -1,5 +1,5 @@
Residual: A LucasArts 3D game interpreter Version: 0.05-CVS
-(C) 2003-2005 The ScummVM-Residual team Last Updated: 23 Jul 2005
+(C) 2003-2005 The ScummVM-Residual team Last Updated: 25 Jul 2005
------------------------------------------------------------------------------
What is Residual?
@@ -62,10 +62,22 @@
to save/load, lighting, etc. Crashes are likely.
Game currently playable to:
- Manny gives Glottis back his heart in the Petrified Forest
+ The Demon Beaver Dam (Petrified Forest)
Caveats:
-1) When Manny goes onto the DOD roof for the pigeon eggs you must not
- forget to use a balloon with the bread or else the game will hang
+1) When Manny goes onto the DOD roof for the pigeon eggs the pigeons
+ don't always act quite right
+2) Walking around objects toward an objective (such as the bread deposit
+ on the DOD roof) can hang the user input since the game does not yet
+ know how to navigate around an object to reach a destination
+3) Video of Copal's death (among other movies) plays at *almost* 2x
+ the correct speed, this causes buffer overflows in the audio.
+ While hardcoding the speed to the correct value used by the other
+ movies works, it is not a good fix and so it is not implemented
+4) Sound track destruction doesn't do quite a good enough job when
+ entering the spider web area (sp.set) in the Petrified Forest
+5) When you return from getting the shocks at the tree pump in the
+ Petrified Forest the scene doesn't change correctly and the game
+ stops allowing input
What are the default keys?
--------------------------
Index: TODO
===================================================================
RCS file: /cvsroot/scummvm/residual/TODO,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- TODO 23 Jul 2005 07:10:46 -0000 1.51
+++ TODO 26 Jul 2005 01:46:46 -0000 1.52
@@ -9,7 +9,7 @@
(Ender: May just need the blending of the lighting values (p2->r, ->g, ->b)
to the result of pp[_a] in the non-24bpp PUT_PIXEL macro of
ztriangle.cpp/ZB_FillTriangleMappingPerspective. Maybe. :)
- * Fix bug with pigeons, likely actor rotating/turning not being implemented (compholio)
+ * Improve actor rotating/turning (compholio)
* Improve SMUSH looping support (compholio)
* Improve menu support (compholio)
Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/actor.cpp,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- actor.cpp 21 Jul 2005 15:16:33 -0000 1.55
+++ actor.cpp 26 Jul 2005 01:46:48 -0000 1.56
@@ -53,6 +53,24 @@
}
}
+void Actor::setYaw(float yaw) {
+ // While the program correctly handle yaw angles outside
+ // of the range [0, 360), proper convention is to roll
+ // these values over correctly
+ if (yaw >= 360.0)
+ _yaw = yaw - 360;
+ else if (yaw < 0.0)
+ _yaw = yaw + 360;
+ else
+ _yaw = yaw;
+}
+
+void Actor::setRot(float pitch, float yaw, float roll) {
+ _pitch = pitch;
+ setYaw(yaw);
+ _roll = roll;
+}
+
void Actor::turnTo(float pitch, float yaw, float roll) {
_pitch = pitch;
_roll = roll;
@@ -95,6 +113,7 @@
void Actor::walkForward() {
float dist = g_engine->perSecond(_walkRate);
float yaw_rad = _yaw * (M_PI / 180), pitch_rad = _pitch * (M_PI / 180);
+ float yaw;
Vector3d forwardVec(-std::sin(yaw_rad) * std::cos(pitch_rad),
std::cos(yaw_rad) * std::cos(pitch_rad),
std::sin(pitch_rad));
@@ -158,7 +177,7 @@
float turnAmt = g_engine->perSecond(_turnRate);
if (turnAmt > ei.angleWithEdge)
turnAmt = ei.angleWithEdge;
- _yaw += turnAmt * turnDir;
+ setYaw(_yaw + turnAmt * turnDir);
}
Vector3d Actor::puckVector() const {
@@ -241,7 +260,7 @@
void Actor::turn(int dir) {
float delta = g_engine->perSecond(_turnRate) * dir;
- _yaw += delta;
+ setYaw(_yaw + delta);
_currTurnDir = dir;
}
@@ -449,13 +468,13 @@
while (dyaw < -180)
dyaw += 360;
if (turnAmt >= std::abs(dyaw)) {
- _yaw = _destYaw;
+ setYaw(_destYaw);
_turning = false;
}
else if (dyaw > 0)
- _yaw += turnAmt;
+ setYaw(_yaw + turnAmt);
else
- _yaw -= turnAmt;
+ setYaw(_yaw -= turnAmt);
_currTurnDir = (dyaw > 0 ? 1 : -1);
}
Index: actor.h
===================================================================
RCS file: /cvsroot/scummvm/residual/actor.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- actor.h 17 Jul 2005 23:40:21 -0000 1.26
+++ actor.h 26 Jul 2005 01:46:49 -0000 1.27
@@ -44,9 +44,7 @@
Vector3d pos() const { return _pos; }
void walkTo(Vector3d p);
bool isWalking() const;
- void setRot(float pitch, float yaw, float roll) {
- _pitch = pitch; _yaw = yaw; _roll = roll;
- }
+ void setRot(float pitch, float yaw, float roll);
void turnTo(float pitch, float yaw, float roll);
bool isTurning() const;
float pitch() const { return _pitch; }
@@ -180,6 +178,9 @@
static Font *_sayLineFont;
TextObject *_sayLineText;
+ // Validate a yaw angle then set it appropriately
+ void setYaw(float yaw);
+
int getTurnChore(int dir) {
return (dir > 0 ? _rightTurnChore : _leftTurnChore);
}
Index: lua.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/lua.cpp,v
retrieving revision 1.143
retrieving revision 1.144
diff -u -d -r1.143 -r1.144
--- lua.cpp 21 Jul 2005 15:16:34 -0000 1.143
+++ lua.cpp 26 Jul 2005 01:46:49 -0000 1.144
@@ -383,7 +383,11 @@
else
lua_pushnil();
- lua_call("next");
+ // If the call to "next" fails then register an error
+ if (lua_call("next") != 0) {
+ error("SetSayLineDefaults failed to get next key!\n");
+ return;
+ }
key = lua_getresult(1);
if (lua_isnil(key))
break;
@@ -443,6 +447,17 @@
act = check_actor(1);
chore = check_int(2);
costume = get_costume(act, 3, "SetActorWalkChore");
+ if (costume == NULL) {
+ if (debugLevel == DEBUG_CHORES || debugLevel == DEBUG_WARN || debugLevel == DEBUG_ALL)
+ warning("SetActorWalkChore() could not find the requested costume, attempting to load...");
+ act->pushCostume(lua_getstring(lua_getparam(3)));
+ costume = get_costume(act, 3, "SetActorWalkChore");
+ if (costume == NULL) {
+ if (debugLevel == DEBUG_CHORES || debugLevel == DEBUG_ERROR || debugLevel == DEBUG_ALL)
+ error("SetActorWalkChore() could not find the requested costume!");
+ return;
+ }
+ }
act->setWalkChore(chore, costume);
}
@@ -568,8 +583,8 @@
}
static void GetActorYawToPoint() {
+ Vector3d yawVector;
lua_Object param2;
- float x, y, z;
Actor *act;
DEBUG_FUNCTION();
@@ -578,19 +593,16 @@
// when this gets called by the tube-switcher guy it's sending
// only two things: an actor and a table with components x, y, z
if (lua_isnumber(param2)) {
- x = luaL_check_number(2);
- y = luaL_check_number(3);
- z = luaL_check_number(4);
+ yawVector = Vector3d(luaL_check_number(2), luaL_check_number(3), luaL_check_number(4));
} else if (lua_istable(param2)) {
- x = lua_getnumber(getTableValue(param2, "x"));
- y = lua_getnumber(getTableValue(param2, "y"));
- z = lua_getnumber(getTableValue(param2, "z"));
+ yawVector = tableToVector(param2);
} else {
if (debugLevel == DEBUG_ERROR || debugLevel == DEBUG_ALL)
error("Unhandled data type for GetActorYawToPoint!");
+ lua_pushnil();
return;
}
- lua_pushnumber(act->yawTo(Vector3d(x, y, z)));
+ lua_pushnumber(act->yawTo(yawVector));
}
static void PutActorInSet() {
@@ -752,13 +764,6 @@
pushbool(!(act->isWalking() || act->isTurning()));
}
-static void TurnActorTo() {
-stubWarning("TurnActorTo");
-}
-static void PointActorAt() {
-stubWarning("PointActorAt");
-}
-
/* Get the location of one of the actor's nodes, this is
* used by Glottis to watch where Manny is located in
* order to hand him the work order. This function is
@@ -1025,7 +1030,10 @@
}
static void ActorLookAt() {
- lua_Object x, y, z, rate;
+ float rate = 100.0; // Give a default rate
+ lua_Object x, y, z;
+ bool nullvector = false;
+ Vector3d vector;
Actor *act;
DEBUG_FUNCTION();
@@ -1033,21 +1041,19 @@
x = lua_getparam(2);
y = lua_getparam(3);
z = lua_getparam(4);
- rate = lua_getparam(5);
- if (lua_isnumber(rate))
- act->setLookAtRate(luaL_check_number(5));
// Look at nothing
if (lua_isnil(x)) {
- if (act->isLookAtVectorZero()) // already looking at nothing
+ if (act->isLookAtVectorZero()) {
+ if (debugLevel == DEBUG_WARN || debugLevel == DEBUG_ALL)
+ warning("Actor requested to look at nothing, already looking at nothing!\n");
return;
+ }
- act->setLookAtVectorZero();
-
+ nullvector = true;
if (lua_isnumber(y))
- act->setLookAtRate(luaL_check_number(3));
+ rate = luaL_check_number(3);
} else if ( lua_isnumber(x)) { // look at xyz
- Vector3d vector;
float fX;
float fY;
float fZ;
@@ -1066,21 +1072,152 @@
vector.set(fX,fY,fZ);
- act->setLookAtVector( vector );
+ if (lua_isnumber(lua_getparam(5)))
+ rate = luaL_check_number(5);
} else if (isActor(2)) { // look at another actor
Actor *lookedAct = check_actor(2);
act->setLookAtVector(lookedAct->pos());
if (lua_isnumber(y))
- act->setLookAtRate(luaL_check_number(3));
+ rate = luaL_check_number(3);
} else {
if (debugLevel == DEBUG_WARN || debugLevel == DEBUG_ALL)
warning("ActorLookAt: Don't know what to look at!");
+ return;
}
+ act->setLookAtRate(rate);
+ if (nullvector)
+ act->setLookAtVectorZero();
+ else
+ act->setLookAtVector(vector);
act->setLooking(true);
- lua_pushnumber(1);
+ pushbool(act->isTurning());
+}
+
+/* Turn the actor to a point specified in the 3D space,
+ * this should not have the actor look toward the point
+ * but should rotate the entire actor toward it.
+ */
+static void TurnActorTo() {
+ float x, y, z, yaw;
+ Actor *act;
+
+ DEBUG_FUNCTION();
+ stubWarning("VERIFY: TurnActorTo");
+ act = check_actor(1);
+ if (lua_isnumber(lua_getparam(2))) {
+ x = luaL_check_number(2);
+ y = luaL_check_number(3);
+ z = luaL_check_number(4);
+ } else if (isActor(2)) {
+ Actor *destActor;
+
+ destActor = check_actor(2);
+ x = destActor->pos().x();
+ y = destActor->pos().y();
+ z = destActor->pos().z();
+ } else {
+ if (debugLevel == DEBUG_WARN || debugLevel == DEBUG_ALL)
+ warning("TurnActorTo() parameter type not understood");
+ return;
+ }
+
+ Vector3d turnToVector(x, y, z);
+ Vector3d baseVector(std::sin(0), std::cos(0), 0);
+ Vector3d lookVector = turnToVector - act->pos();
+ lookVector.z() = 0;
+ yaw = angle(baseVector, lookVector) * (180 / M_PI);
+ if (lookVector.y() < 0)
+ yaw = -yaw;
+ act->turnTo(0, yaw, 0);
+
+ // Game will lock in elevator if this doesn't return false
+ pushbool(false);
+}
+
+/* PointActorAt seems to be an alias for TurnActorTo
+ */
+static void PointActorAt() {
+ DEBUG_FUNCTION();
+ TurnActorTo();
+}
+
+/* RotateVector takes a vector and rotates it around
+ * the point (0,0,0) by the requested number of degrees.
+ * This function is used to calculate the locations for
+ * getting on and off of the Bone Wagon.
+ */
+static void RotateVector() {
+ lua_Object param1, param2, result;
+
+ DEBUG_FUNCTION();
+ stubWarning("VERIFY: RotateVector");
+ param1 = lua_getparam(1);
+ param2 = lua_getparam(2);
+ if (lua_istable(param1) && lua_istable(param2)) {
+ Vector3d vec1 = tableToVector(param1);
+ lua_Object rotateObject = getTableValue(param2, "y");
+ float rotate, currAngle, newAngle;
+
+ // The signpost uses an indexed table (1,2,3) instead of
+ // a value-based table (x,y,z)
+ if (rotateObject == 0)
+ rotateObject = getIndexedTableValue(param2, 2);
+ rotate = lua_getnumber(rotateObject);
+ Vector3d baseVector(std::sin(0), std::cos(0), 0);
+ currAngle = angle(baseVector, vec1) * (180 / M_PI);
+ newAngle = (currAngle - rotate) * (M_PI / 180);
+ Vector3d vec2(std::sin(newAngle), std::cos(newAngle), 0);
+ vec2 *= vec1.magnitude();
+
+ result = lua_createtable();
+ lua_pushobject(result);
+ lua_pushstring("x");
+ lua_pushnumber(vec2.x());
+ lua_settable();
+ lua_pushobject(result);
+ lua_pushstring("y");
+ lua_pushnumber(vec2.y());
+ lua_settable();
+ lua_pushobject(result);
+ lua_pushstring("z");
+ lua_pushnumber(vec2.z());
+ lua_settable();
+ } else {
+ if (debugLevel == DEBUG_WARN || debugLevel == DEBUG_ALL)
+ warning("RotateVector() parameter type not understood!");
+ // This will likely cause a crash since LUA is expecting
+ // a table out of this function
+ lua_pushnil();
+ return;
+ }
+ lua_pushobject(result);
+}
+
+/* Set the pitch of the actor to the requested value,
+ * this will rotate an actor toward/away from the ground.
+ * This is used when Glottis runs over the signpost in
+ * the Petrified Forest
+ */
+static void SetActorPitch() {
+ lua_Object param2;
+ Actor *act;
+
+ DEBUG_FUNCTION();
+ stubWarning("VERIFY: SetActorPitch");
+ act = check_actor(1);
+ param2 = lua_getparam(2);
+ if (lua_isnumber(param2)) {
+ float pitch = lua_getnumber(param2);
+
+ act->setRot(pitch, act->yaw(), act->roll());
+ } else {
+ if (debugLevel == DEBUG_WARN || debugLevel == DEBUG_ALL)
+ warning("SetActorPitch() parameter type not understood!");
+ return;
+ }
}
static void SetActorLookRate() {
@@ -1343,6 +1480,40 @@
}
// Sector functions
+/* Find the sector (of any type) which contains
+ * the requested coordinate (x,y,z).
+ */
+static void GetPointSector(void) {
+ lua_Object xparam, yparam, zparam;
+ Sector *result;
+ float x, y, z;
+
+ DEBUG_FUNCTION();
+ stubWarning("VERIFY: GetPointSector");
+ xparam = lua_getparam(1);
+ yparam = lua_getparam(2);
+ zparam = lua_getparam(3);
+ if (lua_isnumber(xparam) && lua_isnumber(yparam) && lua_isnumber(zparam)) {
+ Vector3d point(x, y, z);
+
+ // Find the point in any available sector
+ result = g_engine->currScene()->findPointSector(point, 0xFFFF);
+ } else {
+ result = NULL;
+ }
+ if (result == NULL) {
+ if (debugLevel == DEBUG_ERROR || debugLevel == DEBUG_ALL)
+ error("GetPointSector() passed an unhandled type or failed to find any matching sector!");
+ lua_pushnil();
+ lua_pushnil();
+ lua_pushnil();
+ return;
+ }
+ lua_pushnumber(result->id());
+ lua_pushstring(const_cast<char *>(result->name()));
+ lua_pushnumber(result->type());
+}
+
static void GetActorSector(void) {
Actor *act;
int sectorType;
@@ -1931,7 +2102,11 @@
else
lua_pushnil();
- lua_call("next");
+ // If the call to "next" fails then register an error
+ if (lua_call("next") != 0) {
+ error("getTextObjectParams failed to get next key!\n");
+ return;
+ }
key = lua_getresult(1);
if (lua_isnil(key))
break;
@@ -2997,7 +3172,6 @@
STUB_FUNC(SetCameraRoll)
STUB_FUNC(SetCameraInterest)
STUB_FUNC(GetCameraPosition)
-STUB_FUNC(RotateVector)
STUB_FUNC(LoadCostume)
STUB_FUNC(PrintActorCostumes)
STUB_FUNC(SpewStartup)
@@ -3007,8 +3181,6 @@
STUB_FUNC(NextSetup)
STUB_FUNC(WorldToScreen)
STUB_FUNC(SetActorRoll)
-STUB_FUNC(SetActorPitch)
-STUB_FUNC(GetPointSector)
STUB_FUNC(IsPointInSector)
STUB_FUNC(SetActorFrustrumCull)
STUB_FUNC(GetCameraActor)
@@ -3775,10 +3947,24 @@
else
lua_pushnil();
- lua_call("next");
+ // If getTableValue is called against a bad value
+ // that it doesn't understand then an infinite loop
+ // will be set up repeating the same error.
+ if(lua_call("next") != 0) {
+ error("getTableValue could not find the next key!\n");
+ return 0;
+ }
key = lua_getresult(1);
- if (lua_isnil(key))
+ if (lua_isnil(key))
break;
+ // If this function is called against a table that is
+ // indexed (rather than keyed) then return zero so
+ // the indexed version can be called instead. This
+ // operation cannot be done automatically since the
+ // index number needs to be known in order to obtain
+ // the correct value.
+ if (lua_isnumber(key))
+ return 0;
key_text = lua_getstring(key);
if (strmatch(key_text, name))
@@ -3798,7 +3984,11 @@
lua_pushnil();
else
lua_pushnumber(index - 1);
- lua_call("next");
+ // If the call to "next" fails then register an error
+ if (lua_call("next") != 0) {
+ error("getIndexedTableValue failed to get next key!\n");
+ return 0;
+ }
return lua_getresult(2);
}
@@ -3819,6 +4009,28 @@
lua_settable();
}
+/* Obtain the x, y, and z coordinates from a LUA table
+ * and then create a Vector3d object with these values
+ */
+Vector3d tableToVector(lua_Object table) {
+ lua_Object xparam, yparam, zparam;
+ float x, y, z;
+
+ if (!lua_istable(table))
+ error("tableToVector passed a LUA object that is not a table!");
+
+ xparam = getTableValue(table, "x");
+ yparam = getTableValue(table, "y");
+ zparam = getTableValue(table, "z");
+ if (!lua_isnumber(xparam) || !lua_isnumber(yparam) || !lua_isnumber(zparam))
+ error("tableToVector passed a LUA table that does not contain vector coordinates!");
+
+ x = lua_getnumber(xparam);
+ y = lua_getnumber(yparam);
+ z = lua_getnumber(zparam);
+ return Vector3d(x, y, z);
+}
+
lua_Object getEventHandler(const char *name) {
lua_Object system_table = lua_getglobal("system");
return getTableFunction(system_table, (char *)name);
Index: lua.h
===================================================================
RCS file: /cvsroot/scummvm/residual/lua.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- lua.h 8 Apr 2005 08:22:02 -0000 1.9
+++ lua.h 26 Jul 2005 01:46:51 -0000 1.10
@@ -47,6 +47,9 @@
lua_Object getTableValue(lua_Object table, char *name);
lua_Object getIndexedTableValue(lua_Object table, int index);
+// make a Vector3d object from coordinate table values
+Vector3d tableToVector(lua_Object table);
+
// get a function stored in a table
lua_Object getTableFunction(lua_Object table, char *name);
Index: smush.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/smush.cpp,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- smush.cpp 21 Jul 2005 15:16:35 -0000 1.63
+++ smush.cpp 26 Jul 2005 01:46:51 -0000 1.64
@@ -29,6 +29,7 @@
#include <cstring>
#include <zlib.h>
+#define SMUSH_LOOPMOVIE(x) (x & 1)
#define ANNO_HEADER "MakeAnim animation type 'Bl16' parameters: "
#define BUFFER_SIZE 16385
@@ -69,7 +70,6 @@
_videoFinished = false;
_videoPause = false;
_updateNeeded = false;
- _videoLooping = false;
assert(!_internalBuffer);
assert(!_externalBuffer);
@@ -96,6 +96,11 @@
_videoLooping = false;
_videoFinished = true;
_videoPause = true;
+ if (_videoLooping && _startPos != NULL) {
+ free(_startPos->tmpBuf);
+ free(_startPos);
+ _startPos = NULL;
+ }
if (_stream) {
_stream->finish();
_stream = NULL;
@@ -153,22 +158,20 @@
anno = (char *)data;
if (strncmp(anno, ANNO_HEADER, sizeof(ANNO_HEADER)-1) == 0) {
char *annoData = anno + sizeof(ANNO_HEADER);
- int loop;
// Examples:
// Water streaming around boat from Manny's balcony
// MakeAnim animation type 'Bl16' parameters: 10000;12000;100;1;0;0;0;0;25;0;
// Water in front of the Blue Casket
- // MakeAnim animation type 'Bl16' parameters: 20000;25000;100;1;0;0;0;0;25;0;
+ // MakeAnim animation type 'Bl16' parameters: 20000;25000;100;1;0;0;0;0;25;0;
// Scrimshaw exterior:
// MakeAnim animation type 'Bl16' parameters: 6000;8000;100;0;0;0;0;0;2;0;
+ // Lola engine room (loops a limited number of times?):
+ // MakeAnim animation type 'Bl16' parameters: 6000;8000;90;1;0;0;0;0;2;0;
if (debugLevel == DEBUG_SMUSH || debugLevel == DEBUG_NORMAL || debugLevel == DEBUG_ALL)
printf("Announcement data: %s\n", anno);
- sscanf(annoData, "%*d;%*d;%*d;%d;%*d;%*d;%*d;%*d;%*d;%*d;%*d;", &loop);
- _videoLooping = true;
- _startPos = _file.getPos();
- if (debugLevel == DEBUG_SMUSH || debugLevel == DEBUG_NORMAL || debugLevel == DEBUG_ALL)
- printf("_videoLooping: %d\n", _videoLooping);
+ // It looks like the announcement data is actually for setting some of the
+ // header parameters, not for any looping purpose
} else {
if (debugLevel == DEBUG_SMUSH || debugLevel == DEBUG_NORMAL || debugLevel == DEBUG_ALL)
printf("Announcement header not understood: %s\n", anno);
@@ -244,6 +247,7 @@
bool Smush::setupAnim(const char *file, int x, int y) {
uint32 tag;
int32 size;
+ int16 flags;
if (!_file.open(file))
return false;
@@ -259,7 +263,6 @@
byte *s_header = (byte *)malloc(size);
_file.read(s_header, size);
_nbframes = READ_LE_UINT32(s_header + 2);
-
int width = READ_LE_UINT16(s_header + 8);
int height = READ_LE_UINT16(s_header + 10);
if ((_width != width) || (_height != height)) {
@@ -272,6 +275,21 @@
_height = height;
_speed = READ_LE_UINT32(s_header + 14);
+ // Videos "copaldie.snm" and "getshcks.snm" seem to have
+ // the wrong speed value, the value 66667 (used by the
+ // other videos) seems to work whereas "2x" does not.
+ // TODO: Find out what needs to go on here.
+ //_speed = 66667;
+ flags = READ_LE_UINT16(s_header + 18);
+ // Output information for checking out the flags
+ if (debugLevel == DEBUG_SMUSH || debugLevel == DEBUG_NORMAL || debugLevel == DEBUG_ALL) {
+ printf("SMUSH Flags:");
+ for(int i=0;i<16;i++)
+ printf(" %d", (flags & ((int) pow(2, i))) != 0);
+ printf("\n");
+ }
+ _videoLooping = SMUSH_LOOPMOVIE(flags);
+ _startPos = NULL; // Set later
free(s_header);
return true;
@@ -285,11 +303,16 @@
bool Smush::play(const char *filename, int x, int y) {
deinit();
+ if (debugLevel == DEBUG_SMUSH)
+ printf("Playing video '%s'.\n", filename);
+
// Load the video
if (!setupAnim(filename, x, y))
return false;
handleFramesHeader();
+ if (_videoLooping)
+ _startPos = _file.getPos();
init();
return true;
- Previous message: [Scummvm-cvs-logs] CVS: residual/imuse imuse_track.cpp,1.14,1.15
- Next message: [Scummvm-cvs-logs] CVS: scummvm/saga game.cpp,1.82,1.83 music.cpp,1.60,1.61 rscfile.cpp,1.26,1.27 rscfile.h,1.12,1.13 saga.h,1.108,1.109 sndres.cpp,1.46,1.47 sndres.h,1.21,1.22 sound.cpp,1.30,1.31 sound.h,1.22,1.23
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list