[Scummvm-cvs-logs] SF.net SVN: scummvm:[55687] scummvm/trunk/engines/saga
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Mon Jan 31 17:11:50 CET 2011
Revision: 55687
http://scummvm.svn.sourceforge.net/scummvm/?rev=55687&view=rev
Author: thebluegr
Date: 2011-01-31 16:11:49 +0000 (Mon, 31 Jan 2011)
Log Message:
-----------
SAGA: Simplified loadActorResources() and removed the unused _disabled field
Modified Paths:
--------------
scummvm/trunk/engines/saga/actor.cpp
scummvm/trunk/engines/saga/actor.h
scummvm/trunk/engines/saga/actor_walk.cpp
Modified: scummvm/trunk/engines/saga/actor.cpp
===================================================================
--- scummvm/trunk/engines/saga/actor.cpp 2011-01-31 15:25:29 UTC (rev 55686)
+++ scummvm/trunk/engines/saga/actor.cpp 2011-01-31 16:11:49 UTC (rev 55687)
@@ -277,10 +277,7 @@
actor->_location.y = ITE_ActorTable[i].y;
actor->_location.z = ITE_ActorTable[i].z;
- actor->_disabled = !loadActorResources(actor);
- if (actor->_disabled) {
- warning("Disabling actor Id=%d index=%d", actor->_id, actor->_index);
- }
+ loadActorResources(actor);
}
_objs.resize(ITE_OBJECTCOUNT);
i = 0;
@@ -335,29 +332,11 @@
}
}
-bool Actor::loadActorResources(ActorData *actor) {
- bool gotSomething = false;
-
+void Actor::loadActorResources(ActorData *actor) {
if (actor->_frameListResourceId) {
loadFrameList(actor->_frameListResourceId, actor->_framesContainer);
actor->_frames = &actor->_framesContainer;
-
- gotSomething = true;
- } else {
- // It's normal for some actors to have no frames
- //warning("Frame List ID = 0 for actor index %d", actor->_index);
-
- //if (_vm->getGameId() == GID_ITE)
- return true;
}
-
- if (actor->_spriteListResourceId) {
- gotSomething = true;
- } else {
- warning("Sprite List ID = 0 for actor index %d", actor->_index);
- }
-
- return gotSomething;
}
void Actor::loadActorSpriteList(ActorData *actor) {
@@ -612,9 +591,6 @@
obj = &_objs[objIdToIndex(objId)];
- if (obj->_disabled)
- error("Actor::getObj disabled objId 0x%X", objId);
-
return obj;
}
@@ -635,9 +611,6 @@
actor = &_actors[actorIdToIndex(actorId)];
- if (actor->_disabled)
- error("Actor::getActor disabled actorId 0x%X", actorId);
-
return actor;
}
@@ -704,8 +677,6 @@
static ActorFrameRange def = {0, 0};
actor = getActor(actorId);
- if (actor->_disabled)
- error("Actor::getActorFrameRange Wrong actorId 0x%X", actorId);
if ((actor->_facingDirection < kDirUp) || (actor->_facingDirection > kDirUpLeft))
error("Actor::getActorFrameRange Wrong direction 0x%X actorId 0x%X", actor->_facingDirection, actorId);
@@ -1026,9 +997,6 @@
}
for (ObjectDataArray::iterator obj = _objs.begin(); obj != _objs.end(); ++obj) {
- if (obj->_disabled)
- continue;
-
if (obj->_sceneNumber != _vm->_scene->currentSceneNumber())
continue;
Modified: scummvm/trunk/engines/saga/actor.h
===================================================================
--- scummvm/trunk/engines/saga/actor.h 2011-01-31 15:25:29 UTC (rev 55686)
+++ scummvm/trunk/engines/saga/actor.h 2011-01-31 16:11:49 UTC (rev 55687)
@@ -287,7 +287,6 @@
class CommonObjectData {
public:
//constant
- bool _disabled; // disabled in init section
int32 _index; // index in local array
uint16 _id; // object id
int32 _scriptEntrypointNumber; // script entrypoint number
@@ -327,7 +326,6 @@
}
CommonObjectData() {
- _disabled = false;
_index = 0;
_id = 0;
_scriptEntrypointNumber = 0;
@@ -550,7 +548,7 @@
protected:
friend class Script;
- bool loadActorResources(ActorData *actor);
+ void loadActorResources(ActorData *actor);
void loadFrameList(int frameListResourceId, ActorFrameSequences &frames);
private:
void stepZoneAction(ActorData *actor, const HitZone *hitZone, bool exit, bool stopped);
Modified: scummvm/trunk/engines/saga/actor_walk.cpp
===================================================================
--- scummvm/trunk/engines/saga/actor_walk.cpp 2011-01-31 15:25:29 UTC (rev 55686)
+++ scummvm/trunk/engines/saga/actor_walk.cpp 2011-01-31 16:11:49 UTC (rev 55687)
@@ -198,9 +198,6 @@
for (ActorDataArray::iterator actor = _actors.begin(); actor != _actors.end(); ++actor) {
actor->_inScene = false;
actor->_spriteList.clear();
- if (actor->_disabled) {
- continue;
- }
if ((actor->_flags & (kProtagonist | kFollower)) || (actor->_index == 0)) {
if (actor->_flags & kProtagonist) {
actor->_finalTarget = actor->_location;
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