2014-05-25 15:01:06 +02:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "bladerunner/scene.h"
|
|
|
|
|
2015-05-02 22:31:07 +02:00
|
|
|
#include "bladerunner/actor.h"
|
2018-01-14 12:12:06 +01:00
|
|
|
#include "bladerunner/actor_dialogue_queue.h"
|
2017-08-24 23:43:47 +02:00
|
|
|
#include "bladerunner/bladerunner.h"
|
2014-05-25 15:01:06 +02:00
|
|
|
#include "bladerunner/chapters.h"
|
2018-01-14 12:12:06 +01:00
|
|
|
#include "bladerunner/game_info.h"
|
2016-10-12 23:00:33 +02:00
|
|
|
#include "bladerunner/items.h"
|
2017-09-10 20:19:02 +02:00
|
|
|
#include "bladerunner/overlays.h"
|
|
|
|
#include "bladerunner/regions.h"
|
2016-09-10 18:16:17 +02:00
|
|
|
#include "bladerunner/scene_objects.h"
|
2017-09-10 20:19:02 +02:00
|
|
|
#include "bladerunner/screen_effects.h"
|
2017-08-24 23:43:47 +02:00
|
|
|
#include "bladerunner/set.h"
|
|
|
|
#include "bladerunner/settings.h"
|
2015-09-13 01:48:13 +02:00
|
|
|
#include "bladerunner/slice_renderer.h"
|
2018-02-10 20:34:28 +01:00
|
|
|
#include "bladerunner/script/scene_script.h"
|
2018-01-14 12:12:06 +01:00
|
|
|
#include "bladerunner/ui/spinner.h"
|
|
|
|
#include "bladerunner/vqa_player.h"
|
2014-05-25 15:01:06 +02:00
|
|
|
|
|
|
|
#include "common/str.h"
|
|
|
|
|
|
|
|
namespace BladeRunner {
|
|
|
|
|
2017-08-24 23:43:47 +02:00
|
|
|
Scene::Scene(BladeRunnerEngine *vm)
|
|
|
|
: _vm(vm),
|
|
|
|
_setId(-1),
|
|
|
|
_sceneId(-1),
|
|
|
|
_vqaPlayer(nullptr),
|
|
|
|
_defaultLoop(0),
|
|
|
|
_defaultLoopSet(false),
|
2018-02-05 18:46:09 +01:00
|
|
|
_specialLoopMode(kSceneLoopModeLoseControl),
|
2017-08-24 23:43:47 +02:00
|
|
|
_specialLoop(0),
|
2018-02-25 19:31:52 +01:00
|
|
|
_defaultLoopPreloadedSet(false),
|
2018-01-28 11:14:29 +01:00
|
|
|
// _introFinished(false),
|
2017-08-24 23:43:47 +02:00
|
|
|
_nextSetId(-1),
|
|
|
|
_nextSceneId(-1),
|
|
|
|
_frame(0),
|
|
|
|
_actorStartFacing(0),
|
|
|
|
_playerWalkedIn(false),
|
|
|
|
_set(new Set(vm)),
|
|
|
|
_regions(new Regions()),
|
|
|
|
_exits(new Regions()) {
|
|
|
|
}
|
|
|
|
|
|
|
|
Scene::~Scene() {
|
|
|
|
delete _set;
|
|
|
|
delete _regions;
|
|
|
|
delete _exits;
|
|
|
|
delete _vqaPlayer;
|
|
|
|
}
|
|
|
|
|
2014-05-25 15:01:06 +02:00
|
|
|
bool Scene::open(int setId, int sceneId, bool isLoadingGame) {
|
|
|
|
if (!isLoadingGame) {
|
2018-01-14 12:12:06 +01:00
|
|
|
_vm->_actorDialogueQueue->flush(1, false);
|
2014-05-25 15:01:06 +02:00
|
|
|
}
|
2016-09-10 18:16:17 +02:00
|
|
|
|
2018-02-18 22:18:41 +01:00
|
|
|
_vm->walkingReset();
|
|
|
|
|
2014-05-25 15:01:06 +02:00
|
|
|
_setId = setId;
|
|
|
|
_sceneId = sceneId;
|
|
|
|
|
2018-02-05 18:46:09 +01:00
|
|
|
const Common::String sceneName = _vm->_gameInfo->getSceneName(_sceneId);
|
2014-05-25 15:01:06 +02:00
|
|
|
|
|
|
|
if (isLoadingGame) {
|
2018-02-18 22:18:41 +01:00
|
|
|
// TODO: _vm->overlays->resume()
|
2014-05-25 15:01:06 +02:00
|
|
|
} else {
|
2015-09-15 20:26:46 +02:00
|
|
|
_regions->clear();
|
|
|
|
_exits->clear();
|
2017-09-10 20:19:02 +02:00
|
|
|
_vm->_screenEffects->_entries.clear();
|
|
|
|
_vm->_overlays->removeAll();
|
2016-10-12 23:00:33 +02:00
|
|
|
_defaultLoop = 0;
|
2016-10-28 22:34:04 +02:00
|
|
|
_defaultLoopSet = false;
|
2018-02-25 19:31:52 +01:00
|
|
|
_defaultLoopPreloadedSet = false;
|
|
|
|
_specialLoopMode = kSceneLoopModeNone;
|
2016-10-12 23:00:33 +02:00
|
|
|
_specialLoop = -1;
|
|
|
|
_frame = -1;
|
2014-05-25 15:01:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Common::String vqaName;
|
|
|
|
int currentResourceId = _vm->_chapters->currentResourceId();
|
|
|
|
if (currentResourceId == 1) {
|
2018-02-05 18:46:09 +01:00
|
|
|
vqaName = Common::String::format("%s.VQA", sceneName.c_str());
|
2014-05-25 15:01:06 +02:00
|
|
|
} else {
|
2018-02-05 18:46:09 +01:00
|
|
|
vqaName = Common::String::format("%s_%d.VQA", sceneName.c_str(), MIN(currentResourceId, 3));
|
2014-05-25 15:01:06 +02:00
|
|
|
}
|
|
|
|
|
2017-08-24 23:43:47 +02:00
|
|
|
if (_vqaPlayer != nullptr) {
|
2016-09-29 21:00:36 +02:00
|
|
|
delete _vqaPlayer;
|
2017-08-24 23:43:47 +02:00
|
|
|
}
|
2016-09-29 21:00:36 +02:00
|
|
|
|
2018-01-14 12:12:06 +01:00
|
|
|
_vqaPlayer = new VQAPlayer(_vm, &_vm->_surfaceBack);
|
2016-09-29 21:00:36 +02:00
|
|
|
|
2018-02-10 20:34:28 +01:00
|
|
|
if (!_vm->_sceneScript->open(sceneName)) {
|
2014-05-25 15:01:06 +02:00
|
|
|
return false;
|
2017-08-24 23:43:47 +02:00
|
|
|
}
|
2014-05-25 15:01:06 +02:00
|
|
|
|
2017-08-24 23:43:47 +02:00
|
|
|
if (!isLoadingGame) {
|
2018-02-10 20:34:28 +01:00
|
|
|
_vm->_sceneScript->initializeScene();
|
2017-08-24 23:43:47 +02:00
|
|
|
}
|
2014-05-25 15:01:06 +02:00
|
|
|
|
|
|
|
Common::String setResourceName = Common::String::format("%s-MIN.SET", sceneName.c_str());
|
2017-08-24 23:43:47 +02:00
|
|
|
if (!_set->open(setResourceName)) {
|
2015-02-06 17:14:52 +01:00
|
|
|
return false;
|
2017-08-24 23:43:47 +02:00
|
|
|
}
|
2014-05-25 15:01:06 +02:00
|
|
|
|
2018-02-12 20:53:13 +01:00
|
|
|
_vm->_sliceRenderer->setView(_vm->_view);
|
2015-09-13 01:48:13 +02:00
|
|
|
|
2014-05-25 15:01:06 +02:00
|
|
|
if (isLoadingGame) {
|
2016-09-10 18:16:17 +02:00
|
|
|
// TODO: Advance VQA frame
|
2018-02-05 18:46:09 +01:00
|
|
|
if (sceneId == kScenePS10 || sceneId == kScenePS11 || sceneId == kScenePS12 || sceneId == kScenePS13) { // police maze?
|
2018-02-10 20:34:28 +01:00
|
|
|
_vm->_sceneScript->sceneLoaded();
|
2018-02-05 18:46:09 +01:00
|
|
|
}
|
2016-09-10 18:16:17 +02:00
|
|
|
return true;
|
2014-05-25 15:01:06 +02:00
|
|
|
}
|
|
|
|
|
2017-08-24 23:43:47 +02:00
|
|
|
if (!_vqaPlayer->open(vqaName)) {
|
2016-10-28 22:34:04 +02:00
|
|
|
return false;
|
2017-08-24 23:43:47 +02:00
|
|
|
}
|
2016-10-28 22:34:04 +02:00
|
|
|
|
2018-02-25 19:31:52 +01:00
|
|
|
if (_specialLoopMode == kSceneLoopModeNone) {
|
2017-08-24 23:43:47 +02:00
|
|
|
_vqaPlayer->setLoop(_defaultLoop, -1, kLoopSetModeImmediate, nullptr, nullptr);
|
2016-10-28 22:34:04 +02:00
|
|
|
_defaultLoopSet = true;
|
2018-02-25 19:31:52 +01:00
|
|
|
_defaultLoopPreloadedSet = false;
|
2016-10-28 22:34:04 +02:00
|
|
|
}
|
2017-07-30 22:34:21 +02:00
|
|
|
_vm->_scene->advanceFrame();
|
2015-05-02 22:31:07 +02:00
|
|
|
|
2016-09-10 18:16:17 +02:00
|
|
|
_vm->_playerActor->setAtXYZ(_actorStartPosition, _actorStartFacing);
|
2017-03-20 00:28:51 +01:00
|
|
|
_vm->_playerActor->setSetId(setId);
|
2016-09-10 18:16:17 +02:00
|
|
|
|
2018-02-10 20:34:28 +01:00
|
|
|
_vm->_sceneScript->sceneLoaded();
|
2014-05-25 15:01:06 +02:00
|
|
|
|
2015-09-15 20:26:46 +02:00
|
|
|
_vm->_sceneObjects->clear();
|
2016-09-10 18:16:17 +02:00
|
|
|
|
2014-05-25 15:01:06 +02:00
|
|
|
// Init click map
|
|
|
|
int actorCount = _vm->_gameInfo->getActorCount();
|
|
|
|
for (int i = 0; i != actorCount; ++i) {
|
|
|
|
Actor *actor = _vm->_actors[i];
|
2015-09-15 20:26:46 +02:00
|
|
|
if (actor->getSetId() == setId) {
|
2015-09-13 01:48:13 +02:00
|
|
|
_vm->_sceneObjects->addActor(
|
2018-01-14 12:12:06 +01:00
|
|
|
i + kSceneObjectOffsetActors,
|
2016-10-12 23:00:33 +02:00
|
|
|
actor->getBoundingBox(),
|
|
|
|
actor->getScreenRectangle(),
|
2018-02-25 19:31:52 +01:00
|
|
|
true,
|
|
|
|
false,
|
2018-02-18 22:18:41 +01:00
|
|
|
actor->isTarget(),
|
2016-10-12 23:00:33 +02:00
|
|
|
actor->isRetired());
|
2014-05-25 15:01:06 +02:00
|
|
|
}
|
|
|
|
}
|
2016-09-10 18:16:17 +02:00
|
|
|
|
2015-09-15 20:26:46 +02:00
|
|
|
_set->addObjectsToScene(_vm->_sceneObjects);
|
2016-10-12 23:00:33 +02:00
|
|
|
_vm->_items->addToSet(setId);
|
|
|
|
_vm->_sceneObjects->updateObstacles();
|
2016-09-10 18:16:17 +02:00
|
|
|
// TODO: add all items to scene
|
|
|
|
// TODO: calculate walking obstacles??
|
|
|
|
|
2018-02-05 18:46:09 +01:00
|
|
|
if (_specialLoopMode != kSceneLoopModeLoseControl) {
|
2018-02-10 20:34:28 +01:00
|
|
|
_vm->_sceneScript->playerWalkedIn();
|
2016-10-12 23:00:33 +02:00
|
|
|
}
|
2015-09-13 01:48:13 +02:00
|
|
|
|
2014-05-25 15:01:06 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-09-29 21:00:36 +02:00
|
|
|
bool Scene::close(bool isLoadingGame) {
|
|
|
|
bool result = true;
|
|
|
|
if (getSetId() == -1) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
//_vm->_policeMaze->clear(!isLoadingGame);
|
|
|
|
if (isLoadingGame) {
|
2018-02-10 20:34:28 +01:00
|
|
|
_vm->_sceneScript->playerWalkedOut();
|
2016-10-12 23:00:33 +02:00
|
|
|
}
|
2016-10-28 22:34:04 +02:00
|
|
|
|
2016-10-12 23:00:33 +02:00
|
|
|
// if (SceneScript_isLoaded() && !SceneScript_unload()) {
|
|
|
|
// result = false;
|
|
|
|
// }
|
2016-09-29 21:00:36 +02:00
|
|
|
if (_vqaPlayer != nullptr) {
|
|
|
|
//_vqaPlayer->stop();
|
|
|
|
delete _vqaPlayer;
|
|
|
|
_vqaPlayer = nullptr;
|
|
|
|
}
|
|
|
|
_sceneId = -1;
|
|
|
|
_setId = -1;
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2017-07-30 22:34:21 +02:00
|
|
|
int Scene::advanceFrame() {
|
2016-09-29 21:00:36 +02:00
|
|
|
int frame = _vqaPlayer->update();
|
2014-05-25 15:01:06 +02:00
|
|
|
if (frame >= 0) {
|
2018-01-14 12:12:06 +01:00
|
|
|
blit(_vm->_surfaceBack, _vm->_surfaceFront);
|
2017-03-28 17:50:04 +02:00
|
|
|
_vqaPlayer->updateZBuffer(_vm->_zbuffer);
|
2016-09-29 21:00:36 +02:00
|
|
|
_vqaPlayer->updateView(_vm->_view);
|
2017-09-10 20:19:02 +02:00
|
|
|
_vqaPlayer->updateScreenEffects(_vm->_screenEffects);
|
2016-09-29 21:00:36 +02:00
|
|
|
_vqaPlayer->updateLights(_vm->_lights);
|
2016-09-10 18:16:17 +02:00
|
|
|
}
|
2018-02-25 19:31:52 +01:00
|
|
|
|
|
|
|
if (_specialLoopMode == kSceneLoopModeLoseControl || _specialLoopMode == kSceneLoopModeOnce || _specialLoopMode == kSceneLoopModeSpinner) {
|
|
|
|
if (!_defaultLoopSet) {
|
|
|
|
_vqaPlayer->setLoop(_defaultLoop, -1, kLoopSetModeEnqueue, &Scene::loopEndedStatic, this);
|
|
|
|
_defaultLoopSet = true;
|
|
|
|
if (_specialLoopMode == kSceneLoopModeLoseControl) {
|
|
|
|
_vm->playerLosesControl();
|
2016-10-28 22:34:04 +02:00
|
|
|
}
|
|
|
|
}
|
2018-02-25 19:31:52 +01:00
|
|
|
} else if (_specialLoopMode == kSceneLoopModeChangeSet) {
|
|
|
|
if (frame == -3) { // EOF
|
|
|
|
_vm->_settings->setNewSetAndScene(_nextSetId, _nextSceneId);
|
|
|
|
_vm->playerGainsControl();
|
|
|
|
}
|
|
|
|
} else if (_specialLoopMode == kSceneLoopModeNone) {
|
|
|
|
if (!_defaultLoopPreloadedSet) {
|
|
|
|
_vqaPlayer->setLoop(_defaultLoop + 1, -1, kLoopSetModeJustStart, &Scene::loopEndedStatic, this);
|
|
|
|
_defaultLoopPreloadedSet = true;
|
2016-10-28 22:34:04 +02:00
|
|
|
}
|
2014-05-25 15:01:06 +02:00
|
|
|
}
|
2016-09-10 18:16:17 +02:00
|
|
|
|
2016-10-28 22:34:04 +02:00
|
|
|
if (frame >= 0) {
|
|
|
|
_frame = frame;
|
2016-09-10 18:16:17 +02:00
|
|
|
}
|
|
|
|
|
2014-05-25 15:01:06 +02:00
|
|
|
return frame;
|
|
|
|
}
|
|
|
|
|
2015-02-06 15:31:43 +01:00
|
|
|
void Scene::setActorStart(Vector3 position, int facing) {
|
|
|
|
_actorStartPosition = position;
|
|
|
|
_actorStartFacing = facing;
|
|
|
|
}
|
|
|
|
|
2016-10-28 22:34:04 +02:00
|
|
|
void Scene::loopSetDefault(int loopId) {
|
|
|
|
_defaultLoop = loopId;
|
2015-09-15 20:26:46 +02:00
|
|
|
}
|
|
|
|
|
2017-08-24 23:43:47 +02:00
|
|
|
void Scene::loopStartSpecial(int specialLoopMode, int loopId, bool immediately) {
|
2016-10-28 22:34:04 +02:00
|
|
|
_specialLoopMode = specialLoopMode;
|
|
|
|
_specialLoop = loopId;
|
2015-09-19 01:43:38 +02:00
|
|
|
|
2017-08-24 23:43:47 +02:00
|
|
|
int repeats = -1;
|
|
|
|
if (_specialLoopMode == kSceneLoopModeChangeSet) {
|
|
|
|
repeats = 0;
|
2016-09-10 18:16:17 +02:00
|
|
|
}
|
|
|
|
|
2017-08-24 23:43:47 +02:00
|
|
|
int loopMode = kLoopSetModeEnqueue;
|
|
|
|
if (immediately) {
|
|
|
|
loopMode = kLoopSetModeImmediate;
|
2016-10-28 22:34:04 +02:00
|
|
|
}
|
|
|
|
|
2017-08-24 23:43:47 +02:00
|
|
|
_vqaPlayer->setLoop(_specialLoop, repeats, loopMode, &Scene::loopEndedStatic, this);
|
|
|
|
if (_specialLoopMode == kSceneLoopModeChangeSet) {
|
|
|
|
_nextSetId = _vm->_settings->getNewSet();
|
|
|
|
_nextSceneId = _vm->_settings->getNewScene();
|
2016-10-28 22:34:04 +02:00
|
|
|
}
|
2017-08-24 23:43:47 +02:00
|
|
|
if (immediately) {
|
2018-02-25 19:31:52 +01:00
|
|
|
_defaultLoopPreloadedSet = true;
|
2016-10-28 22:34:04 +02:00
|
|
|
loopEnded(0, _specialLoop);
|
2016-09-10 18:16:17 +02:00
|
|
|
}
|
2015-09-19 01:43:38 +02:00
|
|
|
}
|
|
|
|
|
2016-09-10 18:16:17 +02:00
|
|
|
int Scene::findObject(const char *objectName) {
|
2015-09-15 20:26:46 +02:00
|
|
|
return _set->findObject(objectName);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Scene::objectSetHotMouse(int objectId) {
|
|
|
|
return _set->objectSetHotMouse(objectId);
|
|
|
|
}
|
|
|
|
|
2016-10-12 23:00:33 +02:00
|
|
|
bool Scene::objectGetBoundingBox(int objectId, BoundingBox *boundingBox) {
|
2015-09-15 20:26:46 +02:00
|
|
|
return _set->objectGetBoundingBox(objectId, boundingBox);
|
|
|
|
}
|
|
|
|
|
2015-09-19 01:43:38 +02:00
|
|
|
void Scene::objectSetIsClickable(int objectId, bool isClickable, bool sceneLoaded) {
|
|
|
|
_set->objectSetIsClickable(objectId, isClickable);
|
|
|
|
if (sceneLoaded) {
|
2018-01-14 12:12:06 +01:00
|
|
|
_vm->_sceneObjects->setIsClickable(objectId + kSceneObjectOffsetObjects, isClickable);
|
2015-09-19 01:43:38 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene::objectSetIsObstacle(int objectId, bool isObstacle, bool sceneLoaded, bool updateWalkpath) {
|
|
|
|
_set->objectSetIsObstacle(objectId, isObstacle);
|
|
|
|
if (sceneLoaded) {
|
2018-01-14 12:12:06 +01:00
|
|
|
_vm->_sceneObjects->setIsObstacle(objectId + kSceneObjectOffsetObjects, isObstacle);
|
2016-10-12 23:00:33 +02:00
|
|
|
if (updateWalkpath) {
|
2016-10-04 02:21:08 +02:00
|
|
|
_vm->_sceneObjects->updateObstacles();
|
2015-09-19 01:43:38 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene::objectSetIsObstacleAll(bool isObstacle, bool sceneLoaded) {
|
|
|
|
int i;
|
2016-09-10 18:16:17 +02:00
|
|
|
for (i = 0; i < (int)_set->getObjectCount(); i++) {
|
2015-09-19 01:43:38 +02:00
|
|
|
_set->objectSetIsObstacle(i, isObstacle);
|
|
|
|
if (sceneLoaded) {
|
2018-01-14 12:12:06 +01:00
|
|
|
_vm->_sceneObjects->setIsObstacle(i + kSceneObjectOffsetObjects, isObstacle);
|
2015-09-19 01:43:38 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-10 18:16:17 +02:00
|
|
|
void Scene::objectSetIsTarget(int objectId, bool isTarget, bool sceneLoaded) {
|
|
|
|
_set->objectSetIsTarget(objectId, isTarget);
|
2015-09-19 01:43:38 +02:00
|
|
|
if (sceneLoaded) {
|
2018-01-14 12:12:06 +01:00
|
|
|
_vm->_sceneObjects->setIsTarget(objectId + kSceneObjectOffsetObjects, isTarget);
|
2015-09-19 01:43:38 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-10 18:16:17 +02:00
|
|
|
const char *Scene::objectGetName(int objectId) {
|
|
|
|
return _set->objectGetName(objectId);
|
|
|
|
}
|
|
|
|
|
2016-10-28 22:34:04 +02:00
|
|
|
void Scene::loopEnded(int frame, int loopId) {
|
2018-02-25 19:31:52 +01:00
|
|
|
if (_specialLoopMode == kSceneLoopModeLoseControl || _specialLoopMode == kSceneLoopModeOnce || _specialLoopMode == kSceneLoopModeSpinner) {
|
|
|
|
if (_defaultLoopPreloadedSet) {
|
|
|
|
_vqaPlayer->setLoop(_defaultLoop, -1, kLoopSetModeEnqueue, &Scene::loopEndedStatic, this);
|
2016-10-28 22:34:04 +02:00
|
|
|
_defaultLoopSet = true;
|
2018-02-25 19:31:52 +01:00
|
|
|
_defaultLoopPreloadedSet = false;
|
|
|
|
if (_specialLoopMode == kSceneLoopModeLoseControl) {
|
|
|
|
_vm->playerLosesControl();
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (_specialLoopMode == kSceneLoopModeLoseControl) {
|
|
|
|
_vm->playerGainsControl();
|
|
|
|
_playerWalkedIn = true;
|
|
|
|
}
|
|
|
|
if (_specialLoopMode == kSceneLoopModeSpinner) {
|
|
|
|
_vm->_spinner->open();
|
|
|
|
}
|
|
|
|
_specialLoopMode = kSceneLoopModeNone;
|
|
|
|
_specialLoop = -1;
|
|
|
|
_vqaPlayer->setLoop(_defaultLoop + 1, -1, kLoopSetModeJustStart, nullptr, nullptr);
|
|
|
|
_defaultLoopPreloadedSet = true;
|
2016-10-28 22:34:04 +02:00
|
|
|
}
|
2018-02-25 19:31:52 +01:00
|
|
|
} else if (_specialLoopMode == kSceneLoopModeChangeSet) {
|
2016-10-28 22:34:04 +02:00
|
|
|
_defaultLoopSet = true;
|
2018-02-25 19:31:52 +01:00
|
|
|
_defaultLoopPreloadedSet = false;
|
|
|
|
_vm->playerLosesControl();
|
2016-10-28 22:34:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Scene::loopEndedStatic(void *data, int frame, int loopId) {
|
2018-01-14 12:12:06 +01:00
|
|
|
((Scene *)data)->loopEnded(frame, loopId);
|
2016-10-28 22:34:04 +02:00
|
|
|
}
|
2014-05-25 15:01:06 +02:00
|
|
|
} // End of namespace BladeRunner
|