aboutsummaryrefslogtreecommitdiff
path: root/engines/saga/actor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/saga/actor.cpp')
-rw-r--r--engines/saga/actor.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/engines/saga/actor.cpp b/engines/saga/actor.cpp
index 067511d3be..f53eff6288 100644
--- a/engines/saga/actor.cpp
+++ b/engines/saga/actor.cpp
@@ -128,7 +128,7 @@ Actor::Actor(SagaEngine *vm) : _vm(vm) {
// Load ITE actor strings. (IHNM actor strings are loaded by
// loadGlobalResources() instead.)
- if (_vm->getGameType() == GType_ITE) {
+ if (_vm->getGameId() == GID_ITE) {
_vm->_resource->loadResource(_actorContext, _vm->getResourceDescription()->actorsStringsResourceId, stringsPointer, stringsLength);
@@ -136,7 +136,7 @@ Actor::Actor(SagaEngine *vm) : _vm(vm) {
free(stringsPointer);
}
- if (_vm->getGameType() == GType_ITE) {
+ if (_vm->getGameId() == GID_ITE) {
_actorsCount = ITE_ACTORCOUNT;
_actors = (ActorData **)malloc(_actorsCount * sizeof(*_actors));
for (i = 0; i < _actorsCount; i++) {
@@ -244,7 +244,7 @@ void Actor::loadFrameList(int frameListResourceId, ActorFrameSequence *&framesPo
for (int orient = 0; orient < ACTOR_DIRECTIONS_COUNT; orient++) {
// Load all four orientations
framesPointer[i].directions[orient].frameIndex = readS.readUint16();
- if (_vm->getGameType() == GType_ITE) {
+ if (_vm->getGameId() == GID_ITE) {
framesPointer[i].directions[orient].frameCount = readS.readSint16();
} else {
framesPointer[i].directions[orient].frameCount = readS.readByte();
@@ -272,7 +272,7 @@ bool Actor::loadActorResources(ActorData *actor) {
// It's normal for some actors to have no frames
//warning("Frame List ID = 0 for actor index %d", actor->_index);
- //if (_vm->getGameType() == GType_ITE)
+ //if (_vm->getGameId() == GID_ITE)
return true;
}
@@ -313,7 +313,7 @@ void Actor::loadActorSpriteList(ActorData *actor) {
_vm->_sprite->loadList(resourceId, actor->_spriteList);
- if (_vm->getGameType() == GType_ITE) {
+ if (_vm->getGameId() == GID_ITE) {
if (actor->_flags & kExtended) {
while ((lastFrame >= actor->_spriteList.spriteCount)) {
resourceId++;
@@ -612,7 +612,7 @@ ActorData *Actor::getActor(uint16 actorId) {
void Actor::setProtagState(int state) {
_protagState = state;
- if (_vm->getGameType() == GType_IHNM) {
+ if (_vm->getGameId() == GID_IHNM) {
if (!_protagonist->_shareFrames)
free(_protagonist->_frames);
@@ -624,7 +624,7 @@ void Actor::setProtagState(int state) {
int Actor::getFrameType(ActorFrameTypes frameType) {
- if (_vm->getGameType() == GType_ITE) {
+ if (_vm->getGameId() == GID_ITE) {
switch (frameType) {
case kFrameStand:
return kFrameITEStand;
@@ -678,7 +678,7 @@ 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);
- if (_vm->getGameType() == GType_ITE) {
+ if (_vm->getGameId() == GID_ITE) {
if (frameType >= actor->_framesCount) {
warning("Actor::getActorFrameRange Wrong frameType 0x%X (%d) actorId 0x%X", frameType, actor->_framesCount, actorId);
return &def;
@@ -689,7 +689,7 @@ ActorFrameRange *Actor::getActorFrameRange(uint16 actorId, int frameType) {
return &actor->_frames[frameType].directions[fourDirection];
}
- if (_vm->getGameType() == GType_IHNM) {
+ if (_vm->getGameId() == GID_IHNM) {
// It is normal for some actors to have no frames for a given frameType
// These are mainly actors with no frames at all (e.g. narrators or immovable actors)
// Examples are AM and the boy when he is talking to Benny via the computer screen.
@@ -819,12 +819,12 @@ void Actor::handleSpeech(int msec) {
width = _activeSpeech.speechBox.width();
height = _vm->_font->getHeight(kKnownFontScript, _activeSpeech.strings[0], width - 2, _activeSpeech.getFontFlags(0)) + 1;
- if (_vm->getGameType() == GType_IHNM) {
+ if (_vm->getGameId() == GID_IHNM) {
if (height > _vm->_scene->getHeight(true) / 2 && width < _vm->getDisplayWidth() - 20) {
width = _vm->getDisplayWidth() - 20;
height = _vm->_font->getHeight(kKnownFontScript, _activeSpeech.strings[0], width - 2, _activeSpeech.getFontFlags(0)) + 1;
}
- } else if (_vm->getGameType() == GType_ITE) {
+ } else if (_vm->getGameId() == GID_ITE) {
if (height > 40 && width < _vm->getDisplayWidth() - 100) {
width = _vm->getDisplayWidth() - 100;
height = _vm->_font->getHeight(kKnownFontScript, _activeSpeech.strings[0], width - 2, _activeSpeech.getFontFlags(0)) + 1;
@@ -875,9 +875,9 @@ bool Actor::calcScreenPosition(CommonObjectData *commonObjectData) {
if (middle <= beginSlope) {
commonObjectData->_screenScale = 256;
- } else if (_vm->getGameType() == GType_IHNM && (objectTypeId(commonObjectData->_id) & kGameObjectObject)) {
+ } else if (_vm->getGameId() == GID_IHNM && (objectTypeId(commonObjectData->_id) & kGameObjectObject)) {
commonObjectData->_screenScale = 256;
- } else if (_vm->getGameType() == GType_IHNM && (commonObjectData->_flags & kNoScale)) {
+ } else if (_vm->getGameId() == GID_IHNM && (commonObjectData->_flags & kNoScale)) {
commonObjectData->_screenScale = 256;
} else if (middle >= endSlope) {
commonObjectData->_screenScale = 1;
@@ -940,7 +940,7 @@ uint16 Actor::hitTest(const Point &testPoint, bool skipProtagonist) {
}
if (_vm->_sprite->hitTest(*spriteList, frameNumber, drawObject->_screenPosition, drawObject->_screenScale, testPoint)) {
result = drawObject->_id;
- if (_vm->getGameType() == GType_ITE)
+ if (_vm->getGameId() == GID_ITE)
return result; // in ITE, return the first result found (read above)
}
}
@@ -956,7 +956,7 @@ void Actor::createDrawOrderList() {
if (_vm->_scene->getFlags() & kSceneFlagISO) {
compareFunction = &tileCommonObjectCompare;
} else {
- if (_vm->getGameType() == GType_ITE)
+ if (_vm->getGameId() == GID_ITE)
compareFunction = &commonObjectCompare;
else
compareFunction = &commonObjectCompareIHNM;
@@ -1068,8 +1068,8 @@ void Actor::drawActors() {
void Actor::drawSpeech(void) {
if (!isSpeaking() || !_activeSpeech.playing || _vm->_script->_skipSpeeches
- || (!_vm->_subtitlesEnabled && (_vm->getFeatures() & GF_CD_FX))
- || (!_vm->_subtitlesEnabled && (_vm->getGameType() == GType_IHNM)))
+ || (!_vm->_subtitlesEnabled && _vm->getGameId() == GID_ITE && !(_vm->getFeatures() & GF_ITE_FLOPPY))
+ || (!_vm->_subtitlesEnabled && (_vm->getGameId() == GID_IHNM)))
return;
Point textPoint;
@@ -1093,9 +1093,9 @@ void Actor::drawSpeech(void) {
textPoint.x = CLIP(actor->_screenPosition.x - width / 2, 10, _vm->getDisplayWidth() - 10 - width);
- if (_vm->getGameType() == GType_ITE)
+ if (_vm->getGameId() == GID_ITE)
textPoint.y = CLIP(actor->_screenPosition.y - 58, 10, _vm->_scene->getHeight(true) - 10 - height);
- else if (_vm->getGameType() == GType_IHNM)
+ else if (_vm->getGameId() == GID_IHNM)
textPoint.y = 10; // CLIP(actor->_screenPosition.y - 160, 10, _vm->_scene->getHeight(true) - 10 - height);
_vm->_font->textDraw(kKnownFontScript, outputString, textPoint,
@@ -1132,7 +1132,7 @@ void Actor::actorSpeech(uint16 actorId, const char **strings, int stringsCount,
dist = MIN(actor->_screenPosition.x - 10, _vm->getDisplayWidth() - 10 - actor->_screenPosition.x);
- if (_vm->getGameType() == GType_ITE)
+ if (_vm->getGameId() == GID_ITE)
dist = CLIP<int16>(dist, 60, 150);
else
dist = CLIP<int16>(dist, 120, 300);
@@ -1154,7 +1154,7 @@ void Actor::actorSpeech(uint16 actorId, const char **strings, int stringsCount,
// scene. After speaking with AM, the compact disk is visible. She always says this line
// when entering room 59, after speaking with AM, if the compact disk is not picked up yet
// Check Script::sfDropObject for the other part of this hack
- if (_vm->getGameType() == GType_IHNM && _vm->_scene->currentChapterNumber() == 3 &&
+ if (_vm->getGameId() == GID_IHNM && _vm->_scene->currentChapterNumber() == 3 &&
_vm->_scene->currentSceneNumber() == 59 && _activeSpeech.sampleResourceId == 286) {
for (i = 0; i < _objsCount; i++) {
if (_objs[i]->_id == 16385) { // the compact disk
@@ -1178,7 +1178,7 @@ void Actor::nonActorSpeech(const Common::Rect &box, const char **strings, int st
_activeSpeech.speechFlags = speechFlags;
_activeSpeech.actorsCount = 1;
_activeSpeech.actorIds[0] = 0;
- if (!(_vm->getFeatures() & GF_CD_FX))
+ if (_vm->getFeatures() & GF_ITE_FLOPPY)
_activeSpeech.sampleResourceId = -1;
else
_activeSpeech.sampleResourceId = sampleResourceId;
@@ -1212,7 +1212,7 @@ void Actor::simulSpeech(const char *string, uint16 *actorIds, int actorIdsCount,
void Actor::abortAllSpeeches() {
// WORKAROUND: Don't abort speeches in scene 31 (tree with beehive). This prevents the
// making fire animation from breaking
- if (_vm->getGameType() == GType_ITE && _vm->_scene->currentSceneNumber() == 31)
+ if (_vm->getGameId() == GID_ITE && _vm->_scene->currentSceneNumber() == 31)
return;
abortSpeech();