aboutsummaryrefslogtreecommitdiff
path: root/saga/actor.cpp
diff options
context:
space:
mode:
authorAndrew Kurushin2004-12-24 10:22:01 +0000
committerAndrew Kurushin2004-12-24 10:22:01 +0000
commit53852dd52de16221829a888a724394d5af390fa9 (patch)
treefcc720c4963b5be10f6c02eb151ee8d39cfc11b5 /saga/actor.cpp
parent426eeb909c02f1d2ac1e9b474736779f83108efc (diff)
downloadscummvm-rg350-53852dd52de16221829a888a724394d5af390fa9.tar.gz
scummvm-rg350-53852dd52de16221829a888a724394d5af390fa9.tar.bz2
scummvm-rg350-53852dd52de16221829a888a724394d5af390fa9.zip
- fix of 8 to 4 direction conversion
- added sfSetActorState function svn-id: r16288
Diffstat (limited to 'saga/actor.cpp')
-rw-r--r--saga/actor.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/saga/actor.cpp b/saga/actor.cpp
index f80b3a7bcd..c4c1b2af3b 100644
--- a/saga/actor.cpp
+++ b/saga/actor.cpp
@@ -157,7 +157,9 @@ bool Actor::loadActorResources(ActorData * actor) {
for (orient = 0; orient < ACTOR_DIRECTIONS_COUNT; orient++) {
// Load all four orientations
framesPointer[i].directions[orient].frameIndex = readS.readUint16();
- framesPointer[i].directions[orient].frameCount = readS.readUint16();
+ framesPointer[i].directions[orient].frameCount = readS.readSint16();
+ if (framesPointer[i].directions[orient].frameCount < 0)
+ warning("frameCount < 0", framesPointer[i].directions[orient].frameCount);
if (framesPointer[i].directions[orient].frameIndex > lastFrame) {
lastFrame = framesPointer[i].directions[orient].frameIndex;
}
@@ -228,6 +230,7 @@ void Actor::updateActorsScene() {
ActorFrameRange *Actor::getActorFrameRange(uint16 actorId, int frameType) {
ActorData *actor;
+ int fourDirection;
actor = getActor(actorId);
if (actor->disabled)
@@ -239,7 +242,8 @@ ActorFrameRange *Actor::getActorFrameRange(uint16 actorId, int frameType) {
if ((actor->facingDirection < kDirUp) || (actor->facingDirection > kDirUpLeft))
error("Actor::getActorFrameRange Wrong direction 0x%X actorId 0x%X", actor->facingDirection, actorId);
- return &actor->frames[frameType].directions[actor->facingDirection];
+ fourDirection = ActorDirectectionsLUT[actor->facingDirection];
+ return &actor->frames[frameType].directions[fourDirection];
}
void Actor::handleSpeech(int msec) {