mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 22:28:10 +00:00
ASYLUM: Move actorIndex to SharedData
This commit is contained in:
parent
8f470f1fcb
commit
f106c50b36
@ -283,7 +283,7 @@ void Actor::update() {
|
||||
break;
|
||||
|
||||
case kActorStatus16:
|
||||
if (_index != getScene()->getPlayerIndex())
|
||||
if (_index != getSharedData()->getPlayerIndex())
|
||||
break;
|
||||
|
||||
if (getWorld()->chapter == 2) {
|
||||
@ -329,7 +329,7 @@ void Actor::update() {
|
||||
getScene()->getActor(0)->updateFromDirection(kDirectionS);
|
||||
|
||||
// Queue script
|
||||
getScript()->queueScript(getWorld()->getActionAreaById(2696)->scriptIndex, getScene()->getPlayerIndex());
|
||||
getScript()->queueScript(getWorld()->getActionAreaById(2696)->scriptIndex, getSharedData()->getPlayerIndex());
|
||||
|
||||
_vm->setGameFlag(kGameFlag279);
|
||||
_vm->setGameFlag(kGameFlag368);
|
||||
@ -358,7 +358,7 @@ void Actor::update() {
|
||||
}
|
||||
}
|
||||
|
||||
if (_index == getScene()->getPlayerIndex()) {
|
||||
if (_index == getSharedData()->getPlayerIndex()) {
|
||||
if (_frameIndex <= _frameCount - 1) {
|
||||
++_frameIndex;
|
||||
} else {
|
||||
@ -368,12 +368,12 @@ void Actor::update() {
|
||||
_vm->setGameFlag(kGameFlag238);
|
||||
|
||||
// Queue script
|
||||
getScript()->queueScript(getWorld()->getActionAreaById(1000)->scriptIndex, getScene()->getPlayerIndex());
|
||||
getScript()->queueScript(getWorld()->getActionAreaById(1000)->scriptIndex, getSharedData()->getPlayerIndex());
|
||||
}
|
||||
}
|
||||
|
||||
} else if (getWorld()->chapter == kChapter11) {
|
||||
if (_index == getScene()->getPlayerIndex()) {
|
||||
if (_index == getSharedData()->getPlayerIndex()) {
|
||||
if (_frameIndex <= _frameCount - 1)
|
||||
++_frameIndex;
|
||||
else
|
||||
@ -390,7 +390,7 @@ void Actor::update() {
|
||||
if (_index > 12)
|
||||
updateStatus15_Chapter2();
|
||||
|
||||
if (_index == getScene()->getPlayerIndex())
|
||||
if (_index == getSharedData()->getPlayerIndex())
|
||||
updateStatus15_Chapter2_Player();
|
||||
|
||||
if (_index == 11)
|
||||
@ -400,7 +400,7 @@ void Actor::update() {
|
||||
if (_index >= 10 && _index < 16)
|
||||
updateStatus15_Chapter11();
|
||||
|
||||
if (_index == getScene()->getPlayerIndex())
|
||||
if (_index == getSharedData()->getPlayerIndex())
|
||||
updateStatus15_Chapter11_Player();
|
||||
}
|
||||
break;
|
||||
@ -490,7 +490,7 @@ void Actor::update() {
|
||||
if (_soundResourceId != kResourceNone && getSound()->isPlaying(_soundResourceId))
|
||||
setVolume();
|
||||
|
||||
if (_index != getScene()->getPlayerIndex() && getWorld()->chapter != kChapter9)
|
||||
if (_index != getSharedData()->getPlayerIndex() && getWorld()->chapter != kChapter9)
|
||||
getSpecial()->run(NULL, _index);
|
||||
|
||||
updateDirection();
|
||||
@ -550,7 +550,7 @@ void Actor::update() {
|
||||
if (_soundResourceId != kResourceNone && getSound()->isPlaying(_soundResourceId))
|
||||
setVolume();
|
||||
|
||||
if (_index != getScene()->getPlayerIndex() && getWorld()->chapter != kChapter9)
|
||||
if (_index != getSharedData()->getPlayerIndex() && getWorld()->chapter != kChapter9)
|
||||
getSpecial()->run(NULL, _index);
|
||||
|
||||
updateDirection();
|
||||
@ -610,7 +610,7 @@ void Actor::update() {
|
||||
if (_soundResourceId && getSound()->isPlaying(_soundResourceId))
|
||||
setVolume();
|
||||
|
||||
if (_index != getScene()->getPlayerIndex() && getWorld()->chapter != kChapter9)
|
||||
if (_index != getSharedData()->getPlayerIndex() && getWorld()->chapter != kChapter9)
|
||||
error("[Actor::update] call to actor sound functions missing!");
|
||||
|
||||
updateDirection();
|
||||
@ -628,7 +628,7 @@ void Actor::updateStatus(ActorStatus actorStatus) {
|
||||
case kActorStatus1:
|
||||
case kActorStatus12:
|
||||
if ((getWorld()->chapter == kChapter2
|
||||
&& _index == getScene()->getPlayerIndex() && (_status == kActorStatus18 || _status == kActorStatus16 || _status == kActorStatus17))
|
||||
&& _index == getSharedData()->getPlayerIndex() && (_status == kActorStatus18 || _status == kActorStatus16 || _status == kActorStatus17))
|
||||
|| (_status != kActorStatusEnabled && _status != kActorStatus9 && _status != kActorStatus14 && _status != kActorStatus15 && _status != kActorStatus18))
|
||||
return;
|
||||
|
||||
@ -672,7 +672,7 @@ void Actor::updateStatus(ActorStatus actorStatus) {
|
||||
actor->getPoint1()->y = _point2.y + _point1.y - actor->getPoint2()->y;
|
||||
actor->setDirection(kDirectionS);
|
||||
|
||||
getScene()->setPlayerActorIndex(0);
|
||||
getSharedData()->setPlayerIndex(0);
|
||||
|
||||
// Hide this actor and the show the other one
|
||||
hide();
|
||||
@ -713,7 +713,7 @@ void Actor::updateStatus(ActorStatus actorStatus) {
|
||||
if (_index > 12)
|
||||
_resourceId = _graphicResourceIds[_direction + 30];
|
||||
|
||||
if (getScene()->getPlayerIndex() == _index) {
|
||||
if (getSharedData()->getPlayerIndex() == _index) {
|
||||
resource->load(_resourceId);
|
||||
_frameIndex = resource->count() - 1;
|
||||
}
|
||||
@ -1676,7 +1676,7 @@ void Actor::move(ActorDirection actorDir, uint32 dist) {
|
||||
|
||||
// Compute volume
|
||||
int32 vol = sqrt((double)-Config.sfxVolume);
|
||||
if (_index != getScene()->getPlayerIndex())
|
||||
if (_index != getSharedData()->getPlayerIndex())
|
||||
vol += sqrt((double)abs(getSound()->calculateVolumeAdjustement(sum, 10, 0)));
|
||||
|
||||
int32 volume = (Config.sfxVolume + vol) * (Config.sfxVolume + vol);
|
||||
@ -1713,7 +1713,7 @@ void Actor::move(ActorDirection actorDir, uint32 dist) {
|
||||
|
||||
// Compute volume
|
||||
int32 vol = getWorld()->actions[_actionIdx3]->volume;
|
||||
if (_index != getScene()->getPlayerIndex())
|
||||
if (_index != getSharedData()->getPlayerIndex())
|
||||
vol += sqrt((double)abs(getSound()->calculateVolumeAdjustement(sum, 10, 0)));
|
||||
|
||||
int32 volume = (Config.sfxVolume + vol) * (Config.sfxVolume + vol);
|
||||
@ -1831,7 +1831,7 @@ bool Actor::canMoveCheckActors(Common::Point *point, ActorDirection dir) {
|
||||
int32 x3 = actor->getPoint1()->x + actor->getPoint2()->x + 2 * actor->getField948() + 15;
|
||||
int32 y3 = actor->getPoint1()->y + actor->getPoint2()->y + 2 * actor->getField94C() + 10;
|
||||
|
||||
if (i == getScene()->getPlayerIndex() && getWorld()->chapter == kChapter11) {
|
||||
if (i == getSharedData()->getPlayerIndex() && getWorld()->chapter == kChapter11) {
|
||||
x2 -= 10;
|
||||
y2 -= 10;
|
||||
x3 += 10;
|
||||
@ -2006,7 +2006,7 @@ void Actor::updatePlayerChapter9(AsylumEngine *engine, int nextPlayer) {
|
||||
Actor *player = engine->scene()->getActor();
|
||||
world->nextPlayer = nextPlayer;
|
||||
|
||||
switch (engine->scene()->getPlayerIndex()) {
|
||||
switch (engine->data()->getPlayerIndex()) {
|
||||
default:
|
||||
break;
|
||||
|
||||
@ -2080,7 +2080,7 @@ void Actor::updateStatus3_19() {
|
||||
updateStatus(kActorStatus20);
|
||||
}
|
||||
} else {
|
||||
if (_index == getScene()->getPlayerIndex())
|
||||
if (_index == getSharedData()->getPlayerIndex())
|
||||
updateStatus19_Player();
|
||||
|
||||
++_frameIndex;
|
||||
@ -2129,7 +2129,7 @@ void Actor::updateStatusEnabled() {
|
||||
}
|
||||
|
||||
// Actor: Player
|
||||
if (_index == getScene()->getPlayerIndex()) {
|
||||
if (_index == getSharedData()->getPlayerIndex()) {
|
||||
if (_vm->lastScreenUpdate && (_vm->screenUpdateCount - _vm->lastScreenUpdate) > 500) {
|
||||
|
||||
if (_vm->isGameFlagNotSet(kGameFlagScriptProcessing)
|
||||
@ -2262,7 +2262,7 @@ void Actor::updateStatusEnabledProcessStatus(int32 testX, int32 testY, uint32 co
|
||||
}
|
||||
|
||||
void Actor::updateStatus9() {
|
||||
if (_index == getScene()->getPlayerIndex()
|
||||
if (_index == getSharedData()->getPlayerIndex()
|
||||
&& getWorld()->chapter != kChapter9
|
||||
&& getWorld()->actorType == 0
|
||||
&& _frameIndex == 0
|
||||
@ -2287,7 +2287,7 @@ void Actor::updateStatus12_Chapter2() {
|
||||
uint32 distance = abs((double)getDistanceForFrame(_direction, frameIndex));
|
||||
|
||||
// Face actor
|
||||
faceTarget(getScene()->getPlayerIndex(), kDirectionFromActor);
|
||||
faceTarget(getSharedData()->getPlayerIndex(), kDirectionFromActor);
|
||||
|
||||
int32 data = getSharedData()->getChapter2Data(3, _index + 1);
|
||||
if (data > 0) {
|
||||
@ -2339,7 +2339,7 @@ void Actor::updateStatus12_Chapter2_Actor11() {
|
||||
}
|
||||
|
||||
// Face player
|
||||
faceTarget(getScene()->getPlayerIndex(), kDirectionFromActor);
|
||||
faceTarget(getSharedData()->getPlayerIndex(), kDirectionFromActor);
|
||||
|
||||
// Compute coordinates
|
||||
Common::Point delta = Common::Point((sumPlayer.x + sum.x) / 2, (sumPlayer.y + sum.y) / 2);
|
||||
@ -2388,7 +2388,7 @@ void Actor::updateStatus12_Chapter2_Actor11() {
|
||||
if (player->getStatus() != kActorStatus17 && player->getStatus() != kActorStatus16) {
|
||||
if (sqrt((double)((sum.y - sumPlayer.y) * (sum.y - sumPlayer.y) + (sum.x - sumPlayer.x) * (sum.x - sumPlayer.x))) < 80.0) {
|
||||
_frameIndex = 0;
|
||||
faceTarget(getScene()->getPlayerIndex(), kDirectionFromActor);
|
||||
faceTarget(getSharedData()->getPlayerIndex(), kDirectionFromActor);
|
||||
updateStatus(kActorStatus15);
|
||||
}
|
||||
}
|
||||
@ -2591,7 +2591,7 @@ void Actor::updateStatus15_Chapter2() {
|
||||
uint32 dist = euclidianDistance(sumPlayer, sum);
|
||||
uint32 offset = (dist <= 10) ? 7 : 12;
|
||||
if (dist > 20) {
|
||||
faceTarget(getScene()->getPlayerIndex(), kDirectionFromActor);
|
||||
faceTarget(getSharedData()->getPlayerIndex(), kDirectionFromActor);
|
||||
getScene()->getActor(_index + 9)->setDirection(_direction);
|
||||
}
|
||||
|
||||
@ -2715,7 +2715,7 @@ void Actor::updateStatus15_Chapter2_Helper() {
|
||||
}
|
||||
|
||||
void Actor::updateStatus15_Chapter2_Player() {
|
||||
if (_index != getScene()->getPlayerIndex())
|
||||
if (_index != getSharedData()->getPlayerIndex())
|
||||
error("[Actor::updateStatus15_Chapter2_Player] Function is only available for the current player");
|
||||
|
||||
// Update frame index and process
|
||||
@ -3145,7 +3145,7 @@ void Actor::updateStatus18_Chapter2_Actor11() {
|
||||
updateStatus(kActorStatus12);
|
||||
}
|
||||
|
||||
faceTarget(getScene()->getPlayerIndex(), kDirectionFromActor);
|
||||
faceTarget(getSharedData()->getPlayerIndex(), kDirectionFromActor);
|
||||
|
||||
Common::Point sum = _point1 + _point2;
|
||||
if (canMove(&sum, DIR(_direction + 4), distance, false)) {
|
||||
|
@ -41,7 +41,7 @@ SharedData::SharedData() {
|
||||
_globalPoint.y = -1;
|
||||
_flagSkipScriptProcessing = false;
|
||||
_flagIsEncounterRunning = false;
|
||||
// player ActorIndex
|
||||
_playerIndex = 0;
|
||||
_sceneOffset = 0;
|
||||
_sceneOffsetAdd = 0;
|
||||
memset(&_cursorResources, kResourceNone, sizeof(_cursorResources));
|
||||
@ -308,7 +308,7 @@ void SharedData::saveLoadWithSerializer(Common::Serializer &s) {
|
||||
s.syncAsUint32LE(_flagIsEncounterRunning);
|
||||
|
||||
// Player index
|
||||
//s.syncAsUint32LE(playerIndex);
|
||||
s.syncAsSint32LE(_playerIndex);
|
||||
|
||||
// Scene coordinates
|
||||
s.syncAsSint32LE(_sceneCoords.x);
|
||||
|
@ -65,11 +65,11 @@ enum GlobalFlag {
|
||||
* uint32 {15} - ambient ticks
|
||||
* uint32 {1} - UNUSED
|
||||
* uint32 {1} - UNUSED (scene updateScreen calls count)
|
||||
* uint32 {1} - Skip script processing
|
||||
* -- Script queue (stored in ScriptManager)
|
||||
* uint32 {1} - global Object X
|
||||
* uint32 {1} - global Object Y
|
||||
* -- Skip processing flag (stored in ScriptManager)
|
||||
* -- Encounter running flag (stored in Encounter)
|
||||
* uint32 {1} - Skip script processing flag
|
||||
* uint32 {1} - Encounter running flag
|
||||
* uint32 {1} - Player ActorIndex
|
||||
* uint32 {1} - scene xLeft
|
||||
* uint32 {1} - scene yTop
|
||||
@ -152,6 +152,18 @@ public:
|
||||
void setAmbientFlag(uint32 index, uint32 val);
|
||||
void resetAmbientFlags();
|
||||
|
||||
/**
|
||||
* Return the index of the player actor
|
||||
*/
|
||||
ActorIndex getPlayerIndex() { return _playerIndex; }
|
||||
|
||||
/**
|
||||
* Sets the player actor index.
|
||||
*
|
||||
* @param index index of the player actor
|
||||
*/
|
||||
void setPlayerIndex(ActorIndex index) { _playerIndex = index; }
|
||||
|
||||
// Coordinates
|
||||
Common::Point getGlobalPoint() { return _globalPoint; }
|
||||
void setGlobalPoint(const Common::Point &point) { _globalPoint = point; }
|
||||
@ -210,7 +222,7 @@ private:
|
||||
Common::Point _globalPoint; // global point
|
||||
bool _flagSkipScriptProcessing;
|
||||
bool _flagIsEncounterRunning;
|
||||
// player ActorIndex
|
||||
int32 _playerIndex;
|
||||
Common::Point _sceneCoords;
|
||||
int16 _sceneOffset;
|
||||
int16 _sceneOffsetAdd;
|
||||
|
@ -1196,7 +1196,7 @@ END_OPCODE
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opcode 0x3F
|
||||
IMPLEMENT_OPCODE(JumpIfActor)
|
||||
ActorIndex index = (cmd->param1 == kActorInvalid) ? getScene()->getPlayerIndex() : cmd->param1;
|
||||
ActorIndex index = (cmd->param1 == kActorInvalid) ? getSharedData()->getPlayerIndex() : cmd->param1;
|
||||
|
||||
if (_currentQueueEntry->actorIndex != index)
|
||||
_currentQueueEntry->currentLine = cmd->param2 - 1;
|
||||
|
@ -467,7 +467,7 @@ void Special::chapter7(Object *object, ActorIndex actorIndex) {
|
||||
if (_vm->isGameFlagSet(kGameFlag1023)) {
|
||||
if (player->getField638()) {
|
||||
getScript()->queueScript(getWorld()->actions[getWorld()->getActionAreaIndexById(player->getField638() == 3 ? 2447 : 2448)]->scriptIndex,
|
||||
getScene()->getPlayerIndex());
|
||||
getSharedData()->getPlayerIndex());
|
||||
_vm->clearGameFlag(kGameFlag1023);
|
||||
} else if (player->getStatus() != kActorStatus6) {
|
||||
_vm->clearGameFlag(kGameFlag1023);
|
||||
@ -478,7 +478,7 @@ void Special::chapter7(Object *object, ActorIndex actorIndex) {
|
||||
if (_vm->isGameFlagSet(kGameFlag1022)) {
|
||||
_vm->clearGameFlag(kGameFlag1022);
|
||||
getScript()->queueScript(getWorld()->actions[getWorld()->getActionAreaIndexById(2445)]->scriptIndex,
|
||||
getScene()->getPlayerIndex());
|
||||
getSharedData()->getPlayerIndex());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -60,7 +60,6 @@ Scene::Scene(AsylumEngine *engine): _vm(engine),
|
||||
|
||||
// Initialize data
|
||||
_packId = kResourcePackInvalid;
|
||||
_playerIndex = 0;
|
||||
|
||||
_hitAreaChapter7Counter = 0;
|
||||
_isCTRLPressed = false;
|
||||
@ -94,7 +93,7 @@ void Scene::enter(ResourcePackId packId) {
|
||||
|
||||
getCursor()->hide();
|
||||
|
||||
_playerIndex = 0;
|
||||
getSharedData()->setPlayerIndex(0);
|
||||
|
||||
// Load the scene data
|
||||
load(packId);
|
||||
@ -437,7 +436,7 @@ bool Scene::key(const AsylumEvent &evt) {
|
||||
if (getCursor()->isHidden() || _ws->chapter != kChapter9)
|
||||
return true;
|
||||
|
||||
getScript()->queueScript(_ws->actions[_ws->getActionAreaIndexById(2206)]->scriptIndex, _playerIndex);
|
||||
getScript()->queueScript(_ws->actions[_ws->getActionAreaIndexById(2206)]->scriptIndex, getSharedData()->getPlayerIndex());
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -446,7 +445,7 @@ bool Scene::key(const AsylumEvent &evt) {
|
||||
if (getCursor()->isHidden() || _ws->chapter != kChapter9)
|
||||
return true;
|
||||
|
||||
getScript()->queueScript(_ws->actions[_ws->getActionAreaIndexById(2207)]->scriptIndex, _playerIndex);
|
||||
getScript()->queueScript(_ws->actions[_ws->getActionAreaIndexById(2207)]->scriptIndex, getSharedData()->getPlayerIndex());
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -455,7 +454,7 @@ bool Scene::key(const AsylumEvent &evt) {
|
||||
if (getCursor()->isHidden() || _ws->chapter != kChapter9)
|
||||
return true;
|
||||
|
||||
getScript()->queueScript(_ws->actions[_ws->getActionAreaIndexById(2208)]->scriptIndex, _playerIndex);
|
||||
getScript()->queueScript(_ws->actions[_ws->getActionAreaIndexById(2208)]->scriptIndex, getSharedData()->getPlayerIndex());
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -693,7 +692,7 @@ void Scene::updateMouse() {
|
||||
player->adjustCoordinates(&pt);
|
||||
|
||||
Common::Rect actorRect;
|
||||
if (_ws->chapter != kChapter2 || _playerIndex != 10) {
|
||||
if (_ws->chapter != kChapter2 || getSharedData()->getPlayerIndex() != 10) {
|
||||
actorRect.left = pt.x + 20;
|
||||
actorRect.top = pt.y;
|
||||
actorRect.right = (int16)(pt.x + 2 * player->getPoint2()->x);
|
||||
@ -1193,7 +1192,7 @@ void Scene::updateCursor(ActorDirection direction, const Common::Rect &rect) {
|
||||
|
||||
int32 index = hitTest(type);
|
||||
if (index == -1) {
|
||||
if (_ws->chapter != kChapter2 || _playerIndex != 10) {
|
||||
if (_ws->chapter != kChapter2 || getSharedData()->getPlayerIndex() != 10) {
|
||||
if (getCursor()->getResourceId() != _ws->cursorResources[kCursorResourceMagnifyingGlass] || getCursor()->getAnimation())
|
||||
getCursor()->set(_ws->cursorResources[kCursorResourceMagnifyingGlass]);
|
||||
} else {
|
||||
@ -1235,7 +1234,7 @@ void Scene::updateCursor(ActorDirection direction, const Common::Rect &rect) {
|
||||
} else if (actionType & kActionType16) {
|
||||
if (getCursor()->getResourceId() != _ws->cursorResources[kCursorResourceTalkNPC2] || getCursor()->getAnimation() != kCursorAnimationMirror)
|
||||
getCursor()->set(_ws->cursorResources[kCursorResourceTalkNPC2]);
|
||||
} else if (_ws->chapter != kChapter2 && _playerIndex != 10) {
|
||||
} else if (_ws->chapter != kChapter2 && getSharedData()->getPlayerIndex() != 10) {
|
||||
if (getCursor()->getResourceId() != _ws->cursorResources[kCursorResourceMagnifyingGlass] || getCursor()->getAnimation())
|
||||
getCursor()->set(_ws->cursorResources[kCursorResourceMagnifyingGlass]);
|
||||
} else {
|
||||
@ -1564,7 +1563,7 @@ void Scene::handleHit(int32 index, HitType type) {
|
||||
|
||||
case kHitActionArea:
|
||||
if (!getScript()->isInQueue(_ws->actions[index]->scriptIndex))
|
||||
getScript()->queueScript(_ws->actions[index]->scriptIndex, _playerIndex);
|
||||
getScript()->queueScript(_ws->actions[index]->scriptIndex, getSharedData()->getPlayerIndex());
|
||||
|
||||
switch (_ws->chapter) {
|
||||
default:
|
||||
@ -1595,7 +1594,7 @@ void Scene::handleHit(int32 index, HitType type) {
|
||||
}
|
||||
|
||||
if (!getScript()->isInQueue(object->getScriptIndex()))
|
||||
getScript()->queueScript(object->getScriptIndex(), _playerIndex);
|
||||
getScript()->queueScript(object->getScriptIndex(), getSharedData()->getPlayerIndex());
|
||||
|
||||
// Original executes special script hit functions, but since there is none defined, we can skip this part
|
||||
}
|
||||
@ -1607,7 +1606,7 @@ void Scene::handleHit(int32 index, HitType type) {
|
||||
if (actor->actionType & (kActionTypeFind | kActionType16)) {
|
||||
|
||||
if (getScript()->isInQueue(actor->getScriptIndex()))
|
||||
getScript()->queueScript(actor->getScriptIndex(), _playerIndex);
|
||||
getScript()->queueScript(actor->getScriptIndex(), getSharedData()->getPlayerIndex());
|
||||
|
||||
} else if (actor->actionType & kActionTypeTalk) {
|
||||
|
||||
@ -1620,7 +1619,7 @@ void Scene::handleHit(int32 index, HitType type) {
|
||||
}
|
||||
|
||||
if (getScript()->isInQueue(actor->getScriptIndex()))
|
||||
getScript()->queueScript(actor->getScriptIndex(), _playerIndex);
|
||||
getScript()->queueScript(actor->getScriptIndex(), getSharedData()->getPlayerIndex());
|
||||
}
|
||||
|
||||
switch (_ws->chapter) {
|
||||
@ -1674,15 +1673,15 @@ void Scene::playerReaction() {
|
||||
break;
|
||||
|
||||
case 0:
|
||||
getScript()->queueScript(_ws->actions[_ws->getActionAreaIndexById(2206)]->scriptIndex, _playerIndex);
|
||||
getScript()->queueScript(_ws->actions[_ws->getActionAreaIndexById(2206)]->scriptIndex, getSharedData()->getPlayerIndex());
|
||||
break;
|
||||
|
||||
case 1:
|
||||
getScript()->queueScript(_ws->actions[_ws->getActionAreaIndexById(2207)]->scriptIndex, _playerIndex);
|
||||
getScript()->queueScript(_ws->actions[_ws->getActionAreaIndexById(2207)]->scriptIndex, getSharedData()->getPlayerIndex());
|
||||
break;
|
||||
|
||||
case 2:
|
||||
getScript()->queueScript(_ws->actions[_ws->getActionAreaIndexById(2208)]->scriptIndex, _playerIndex);
|
||||
getScript()->queueScript(_ws->actions[_ws->getActionAreaIndexById(2208)]->scriptIndex, getSharedData()->getPlayerIndex());
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@ -2069,7 +2068,7 @@ Actor* Scene::getActor(ActorIndex index) {
|
||||
if (!_ws)
|
||||
error("[Scene::getActor] WorldStats not initialized properly!");
|
||||
|
||||
ActorIndex computedIndex = (index != kActorInvalid) ? index : _playerIndex;
|
||||
ActorIndex computedIndex = (index != kActorInvalid) ? index : getSharedData()->getPlayerIndex();
|
||||
|
||||
if (computedIndex < 0 || computedIndex >= (int16)_ws->actors.size())
|
||||
error("[Scene::getActor] Invalid actor index: %d ([0-%d] allowed)", computedIndex, _ws->actors.size() - 1);
|
||||
@ -2240,7 +2239,8 @@ void Scene::changePlayer(ActorIndex index) {
|
||||
|
||||
getActor(index)->show();
|
||||
}
|
||||
_playerIndex = index;
|
||||
|
||||
getSharedData()->setPlayerIndex(index);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
@ -2257,7 +2257,7 @@ void Scene::changePlayer(ActorIndex index) {
|
||||
getActor(index)->show();
|
||||
}
|
||||
|
||||
_playerIndex = index;
|
||||
getSharedData()->setPlayerIndex(index);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
@ -2274,7 +2274,7 @@ void Scene::changePlayer(ActorIndex index) {
|
||||
getActor(index)->show();
|
||||
}
|
||||
|
||||
_playerIndex = index;
|
||||
getSharedData()->setPlayerIndex(index);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
@ -2292,7 +2292,7 @@ void Scene::changePlayer(ActorIndex index) {
|
||||
}
|
||||
|
||||
getActor(index)->show();
|
||||
_playerIndex = index;
|
||||
getSharedData()->setPlayerIndex(index);
|
||||
break;
|
||||
|
||||
case 666:
|
||||
@ -2478,7 +2478,7 @@ void Scene::processUpdateList() {
|
||||
|
||||
int16 bottomRight = actor->getPoint1()->y + actor->getBoundingRect()->bottom + 4;
|
||||
|
||||
if (_ws->chapter == kChapter11 && _updateList[i].index != getPlayerIndex())
|
||||
if (_ws->chapter == kChapter11 && _updateList[i].index != getSharedData()->getPlayerIndex())
|
||||
bottomRight += 20;
|
||||
|
||||
// Our actor rect
|
||||
|
@ -106,18 +106,6 @@ public:
|
||||
*/
|
||||
bool handleEvent(const AsylumEvent &ev);
|
||||
|
||||
/**
|
||||
* Return the index of the player actor
|
||||
*/
|
||||
ActorIndex getPlayerIndex() { return _playerIndex; }
|
||||
|
||||
/**
|
||||
* Sets the player actor index.
|
||||
*
|
||||
* @param index index of the player actor
|
||||
*/
|
||||
void setPlayerActorIndex(ActorIndex index) { _playerIndex = index; }
|
||||
|
||||
/**
|
||||
* Gets the current scene pack identifier.
|
||||
*
|
||||
@ -210,7 +198,6 @@ private:
|
||||
AsylumEngine *_vm;
|
||||
|
||||
ResourcePackId _packId;
|
||||
int32 _playerIndex;
|
||||
|
||||
Polygons *_polygons;
|
||||
WorldStats *_ws;
|
||||
|
Loading…
Reference in New Issue
Block a user