mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-27 05:32:45 +00:00
BLADERUNNER: added ADQ, fixed some minor memory leaks
This commit is contained in:
parent
2c15b164d7
commit
89d1805b37
151
engines/bladerunner/adq.cpp
Normal file
151
engines/bladerunner/adq.cpp
Normal file
@ -0,0 +1,151 @@
|
|||||||
|
#include "bladerunner/adq.h"
|
||||||
|
|
||||||
|
#include "bladerunner/bladerunner.h"
|
||||||
|
|
||||||
|
#include "bladerunner/actor.h"
|
||||||
|
#include "bladerunner/audio_speech.h"
|
||||||
|
#include "bladerunner/scene.h"
|
||||||
|
|
||||||
|
#include "script/script.h"
|
||||||
|
|
||||||
|
namespace BladeRunner {
|
||||||
|
|
||||||
|
ADQ::ADQEntry::ADQEntry() {
|
||||||
|
this->_isNotPause = false;
|
||||||
|
this->_isPause = false;
|
||||||
|
this->_actorId = -1;
|
||||||
|
this->_delay = -1;
|
||||||
|
this->_sentenceId = -1;
|
||||||
|
this->_animationMode = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
ADQ::ADQ(BladeRunnerEngine *vm) {
|
||||||
|
_vm = vm;
|
||||||
|
clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
ADQ::~ADQ() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void ADQ::add(int actorId, int sentenceId, int animationMode) {
|
||||||
|
if (actorId == 0 || actorId == 99) {
|
||||||
|
animationMode = -1;
|
||||||
|
}
|
||||||
|
if (_entries.size() < 25) {
|
||||||
|
ADQEntry entry;
|
||||||
|
entry._isNotPause = true;
|
||||||
|
entry._isPause = false;
|
||||||
|
entry._actorId = actorId;
|
||||||
|
entry._sentenceId = sentenceId;
|
||||||
|
entry._animationMode = animationMode;
|
||||||
|
entry._delay = -1;
|
||||||
|
|
||||||
|
_entries.push_back(entry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ADQ::addPause(int delay) {
|
||||||
|
if (_entries.size() < 25) {
|
||||||
|
ADQEntry entry;
|
||||||
|
entry._isNotPause = false;
|
||||||
|
entry._isPause = true;
|
||||||
|
entry._actorId = -1;
|
||||||
|
entry._sentenceId = -1;
|
||||||
|
entry._animationMode = -1;
|
||||||
|
entry._delay = delay;
|
||||||
|
|
||||||
|
_entries.push_back(entry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ADQ::flush(int a1, bool callScript) {
|
||||||
|
if (_isNotPause && _vm->_audioSpeech->isPlaying()) {
|
||||||
|
_vm->_audioSpeech->stopSpeech();
|
||||||
|
if (_animationModePrevious >= 0) {
|
||||||
|
_vm->_actors[_actorId]->changeAnimationMode(_animationModePrevious, false);
|
||||||
|
_animationModePrevious = -1;
|
||||||
|
}
|
||||||
|
_isNotPause = false;
|
||||||
|
_actorId = -1;
|
||||||
|
_sentenceId = -1;
|
||||||
|
_animationMode = -1;
|
||||||
|
}
|
||||||
|
if (_isPause) {
|
||||||
|
_isPause = false;
|
||||||
|
_delay = 0;
|
||||||
|
_timeLast = 0;
|
||||||
|
}
|
||||||
|
clear();
|
||||||
|
if (callScript) {
|
||||||
|
_vm->_script->DialogueQueueFlushed(a1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ADQ::tick() {
|
||||||
|
if (!_vm->_audioSpeech->isPlaying()) {
|
||||||
|
if (_isPause) {
|
||||||
|
int time = _vm->getTotalPlayTime();
|
||||||
|
int timeDiff = time - _timeLast;
|
||||||
|
_timeLast = time;
|
||||||
|
_delay -= timeDiff;
|
||||||
|
if (_delay > 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_isPause = false;
|
||||||
|
_delay = 0;
|
||||||
|
_timeLast = 0;
|
||||||
|
if (_entries.empty()) {
|
||||||
|
flush(0, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (_isNotPause) {
|
||||||
|
if (_animationModePrevious >= 0) {
|
||||||
|
_vm->_actors[_actorId]->changeAnimationMode(_animationModePrevious, false);
|
||||||
|
_animationModePrevious = -1;
|
||||||
|
}
|
||||||
|
_isNotPause = false;
|
||||||
|
_actorId = -1;
|
||||||
|
_sentenceId = -1;
|
||||||
|
_animationMode = -1;
|
||||||
|
if (_entries.empty()) {
|
||||||
|
flush(0, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!_entries.empty()) {
|
||||||
|
ADQEntry firstEntry = _entries.remove_at(0);
|
||||||
|
if (firstEntry._isNotPause) {
|
||||||
|
_animationMode = firstEntry._animationMode;
|
||||||
|
if (_vm->_actors[firstEntry._actorId]->getSetId() != _vm->_scene->getSetId()) {
|
||||||
|
_animationMode = -1;
|
||||||
|
}
|
||||||
|
_vm->_actors[firstEntry._actorId]->speechPlay(firstEntry._sentenceId, false);
|
||||||
|
_isNotPause = true;
|
||||||
|
_actorId = firstEntry._actorId;
|
||||||
|
_sentenceId = firstEntry._sentenceId;
|
||||||
|
if (_animationMode >= 0) {
|
||||||
|
_animationModePrevious = _vm->_actors[firstEntry._actorId]->getAnimationMode();
|
||||||
|
_vm->_actors[firstEntry._actorId]->changeAnimationMode(_animationMode, false);
|
||||||
|
} else {
|
||||||
|
_animationModePrevious = -1;
|
||||||
|
}
|
||||||
|
} else if (firstEntry._isPause) {
|
||||||
|
_isPause = true;
|
||||||
|
_delay = firstEntry._delay;
|
||||||
|
_timeLast = _vm->getTotalPlayTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ADQ::clear() {
|
||||||
|
_entries.clear();
|
||||||
|
_isNotPause = false;
|
||||||
|
_actorId = -1;
|
||||||
|
_sentenceId = -1;
|
||||||
|
_animationMode = -1;
|
||||||
|
_animationModePrevious = -1;
|
||||||
|
_isPause = false;
|
||||||
|
_delay = 0;
|
||||||
|
_timeLast = 0;
|
||||||
|
}
|
||||||
|
} // End of namespace BladeRunner
|
74
engines/bladerunner/adq.h
Normal file
74
engines/bladerunner/adq.h
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
/* 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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef BLADERUNNER_ADQ_H
|
||||||
|
#define BLADERUNNER_ADQ_H
|
||||||
|
#include "common/array.h"
|
||||||
|
|
||||||
|
namespace BladeRunner {
|
||||||
|
|
||||||
|
class BladeRunnerEngine;
|
||||||
|
|
||||||
|
// actor dialogue queue??
|
||||||
|
class ADQ {
|
||||||
|
BladeRunnerEngine *_vm;
|
||||||
|
|
||||||
|
class ADQEntry {
|
||||||
|
public:
|
||||||
|
bool _isNotPause;
|
||||||
|
bool _isPause;
|
||||||
|
int _actorId;
|
||||||
|
int _sentenceId;
|
||||||
|
int _animationMode;
|
||||||
|
int _delay;
|
||||||
|
|
||||||
|
ADQEntry();
|
||||||
|
};
|
||||||
|
|
||||||
|
Common::Array<ADQEntry> _entries;
|
||||||
|
|
||||||
|
bool _isNotPause;
|
||||||
|
int _actorId;
|
||||||
|
int _sentenceId;
|
||||||
|
int _animationMode;
|
||||||
|
int _animationModePrevious;
|
||||||
|
bool _isPause;
|
||||||
|
int _delay;
|
||||||
|
int _timeLast;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
ADQ(BladeRunnerEngine *vm);
|
||||||
|
~ADQ();
|
||||||
|
|
||||||
|
void add(int actorId, int speechId, int animationMode);
|
||||||
|
void addPause(int delay);
|
||||||
|
void flush(int a1, bool callScript);
|
||||||
|
void tick();
|
||||||
|
|
||||||
|
private:
|
||||||
|
void clear();
|
||||||
|
};
|
||||||
|
|
||||||
|
} // End of namespace BladeRunner
|
||||||
|
|
||||||
|
#endif
|
@ -24,6 +24,7 @@
|
|||||||
#include "bladerunner/bladerunner.h"
|
#include "bladerunner/bladerunner.h"
|
||||||
|
|
||||||
#include "bladerunner/actor.h"
|
#include "bladerunner/actor.h"
|
||||||
|
#include "bladerunner/adq.h"
|
||||||
#include "bladerunner/ambient_sounds.h"
|
#include "bladerunner/ambient_sounds.h"
|
||||||
#include "bladerunner/audio_player.h"
|
#include "bladerunner/audio_player.h"
|
||||||
#include "bladerunner/audio_speech.h"
|
#include "bladerunner/audio_speech.h"
|
||||||
@ -68,11 +69,12 @@ BladeRunnerEngine::BladeRunnerEngine(OSystem *syst)
|
|||||||
_gameIsRunning = true;
|
_gameIsRunning = true;
|
||||||
_playerLosesControlCounter = 0;
|
_playerLosesControlCounter = 0;
|
||||||
|
|
||||||
_clues = NULL;
|
_clues = nullptr;
|
||||||
_script = new Script(this);
|
_script = new Script(this);
|
||||||
_settings = new Settings(this);
|
_settings = new Settings(this);
|
||||||
_lights = new Lights(this);
|
_lights = new Lights(this);
|
||||||
_combat = new Combat(this);
|
_combat = new Combat(this);
|
||||||
|
_adq = new ADQ(this);
|
||||||
|
|
||||||
_walkSoundId = -1;
|
_walkSoundId = -1;
|
||||||
_walkSoundVolume = 0;
|
_walkSoundVolume = 0;
|
||||||
@ -99,7 +101,10 @@ BladeRunnerEngine::~BladeRunnerEngine() {
|
|||||||
|
|
||||||
// delete[] _zBuffer1;
|
// delete[] _zBuffer1;
|
||||||
// delete[] _zBuffer2;
|
// delete[] _zBuffer2;
|
||||||
|
|
||||||
|
delete _adq;
|
||||||
|
delete _combat;
|
||||||
|
delete _lights;
|
||||||
delete _settings;
|
delete _settings;
|
||||||
delete _script;
|
delete _script;
|
||||||
}
|
}
|
||||||
@ -345,7 +350,7 @@ void BladeRunnerEngine::shutdown() {
|
|||||||
// TODO: Shutdown Esper
|
// TODO: Shutdown Esper
|
||||||
|
|
||||||
delete _mouse;
|
delete _mouse;
|
||||||
_mouse = 0;
|
_mouse = nullptr;
|
||||||
|
|
||||||
for (uint i = 0; i != _shapes.size(); ++i) {
|
for (uint i = 0; i != _shapes.size(); ++i) {
|
||||||
delete _shapes[i];
|
delete _shapes[i];
|
||||||
@ -359,38 +364,38 @@ void BladeRunnerEngine::shutdown() {
|
|||||||
if (_chapters->hasOpenResources())
|
if (_chapters->hasOpenResources())
|
||||||
_chapters->closeResources();
|
_chapters->closeResources();
|
||||||
delete _chapters;
|
delete _chapters;
|
||||||
_chapters = 0;
|
_chapters = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete _clues;
|
delete _clues;
|
||||||
_clues = 0;
|
_clues = nullptr;
|
||||||
|
|
||||||
delete _sliceRenderer;
|
delete _sliceRenderer;
|
||||||
_sliceRenderer = 0;
|
_sliceRenderer = nullptr;
|
||||||
|
|
||||||
delete _sliceAnimations;
|
delete _sliceAnimations;
|
||||||
_sliceAnimations = 0;
|
_sliceAnimations = nullptr;
|
||||||
|
|
||||||
delete _textActorNames;
|
delete _textActorNames;
|
||||||
_textActorNames = 0;
|
_textActorNames = nullptr;
|
||||||
|
|
||||||
delete _textCrimes;
|
delete _textCrimes;
|
||||||
_textCrimes = 0;
|
_textCrimes = nullptr;
|
||||||
|
|
||||||
delete _textCluetype;
|
delete _textCluetype;
|
||||||
_textCluetype = 0;
|
_textCluetype = nullptr;
|
||||||
|
|
||||||
delete _textKIA;
|
delete _textKIA;
|
||||||
_textKIA = 0;
|
_textKIA = nullptr;
|
||||||
|
|
||||||
delete _textSpindest;
|
delete _textSpindest;
|
||||||
_textSpindest = 0;
|
_textSpindest = nullptr;
|
||||||
|
|
||||||
delete _textVK;
|
delete _textVK;
|
||||||
_textVK = 0;
|
_textVK = nullptr;
|
||||||
|
|
||||||
delete _textOptions;
|
delete _textOptions;
|
||||||
_textOptions = 0;
|
_textOptions = nullptr;
|
||||||
|
|
||||||
// TODO: Delete dialogue menu
|
// TODO: Delete dialogue menu
|
||||||
|
|
||||||
@ -418,26 +423,26 @@ void BladeRunnerEngine::shutdown() {
|
|||||||
// TODO: Delete KIA6PT.FON
|
// TODO: Delete KIA6PT.FON
|
||||||
|
|
||||||
delete _items;
|
delete _items;
|
||||||
_items = 0;
|
_items = nullptr;
|
||||||
|
|
||||||
delete _gameFlags;
|
delete _gameFlags;
|
||||||
_gameFlags = 0;
|
_gameFlags = nullptr;
|
||||||
|
|
||||||
delete _view;
|
delete _view;
|
||||||
_view = 0;
|
_view = nullptr;
|
||||||
|
|
||||||
delete _sceneObjects;
|
delete _sceneObjects;
|
||||||
_sceneObjects = 0;
|
_sceneObjects = nullptr;
|
||||||
|
|
||||||
// TODO: Delete sine and cosine lookup tables
|
// TODO: Delete sine and cosine lookup tables
|
||||||
|
|
||||||
// TODO: Unload AI dll
|
// TODO: Unload AI dll
|
||||||
|
|
||||||
delete[] _gameVars;
|
delete[] _gameVars;
|
||||||
_gameVars = 0;
|
_gameVars = nullptr;
|
||||||
|
|
||||||
delete _waypoints;
|
delete _waypoints;
|
||||||
_waypoints = 0;
|
_waypoints = nullptr;
|
||||||
|
|
||||||
// TODO: Delete Cover waypoints
|
// TODO: Delete Cover waypoints
|
||||||
|
|
||||||
@ -459,13 +464,13 @@ void BladeRunnerEngine::shutdown() {
|
|||||||
|
|
||||||
// TODO: Delete proper ZBuf class
|
// TODO: Delete proper ZBuf class
|
||||||
delete[] _zBuffer1;
|
delete[] _zBuffer1;
|
||||||
_zBuffer1 = 0;
|
_zBuffer1 = nullptr;
|
||||||
|
|
||||||
delete[] _zBuffer2;
|
delete[] _zBuffer2;
|
||||||
_zBuffer2 = 0;
|
_zBuffer2 = nullptr;
|
||||||
|
|
||||||
delete _gameInfo;
|
delete _gameInfo;
|
||||||
_gameInfo = 0;
|
_gameInfo = nullptr;
|
||||||
|
|
||||||
// TODO: Delete graphics surfaces here
|
// TODO: Delete graphics surfaces here
|
||||||
_surface1.free();
|
_surface1.free();
|
||||||
@ -548,7 +553,8 @@ void BladeRunnerEngine::gameTick() {
|
|||||||
// TODO: VK
|
// TODO: VK
|
||||||
// TODO: Elevators
|
// TODO: Elevators
|
||||||
// TODO: Scores
|
// TODO: Scores
|
||||||
|
|
||||||
|
_adq->tick();
|
||||||
if (_scene->didPlayerWalkIn()) {
|
if (_scene->didPlayerWalkIn()) {
|
||||||
_script->PlayerWalkedIn();
|
_script->PlayerWalkedIn();
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
namespace BladeRunner {
|
namespace BladeRunner {
|
||||||
|
|
||||||
class Actor;
|
class Actor;
|
||||||
|
class ADQ;
|
||||||
class AIScripts;
|
class AIScripts;
|
||||||
class AmbientSounds;
|
class AmbientSounds;
|
||||||
class AudioPlayer;
|
class AudioPlayer;
|
||||||
@ -65,6 +66,7 @@ public:
|
|||||||
bool _windowIsActive;
|
bool _windowIsActive;
|
||||||
int _playerLosesControlCounter;
|
int _playerLosesControlCounter;
|
||||||
|
|
||||||
|
ADQ *_adq;
|
||||||
AIScripts *_aiScripts;
|
AIScripts *_aiScripts;
|
||||||
AmbientSounds *_ambientSounds;
|
AmbientSounds *_ambientSounds;
|
||||||
AudioPlayer *_audioPlayer;
|
AudioPlayer *_audioPlayer;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "bladerunner/item.h"
|
#include "bladerunner/item.h"
|
||||||
|
|
||||||
#include "bladerunner/bladerunner.h"
|
#include "bladerunner/bladerunner.h"
|
||||||
//#include "bladerunner/slice_animations.h"
|
|
||||||
#include "bladerunner/slice_renderer.h"
|
#include "bladerunner/slice_renderer.h"
|
||||||
|
|
||||||
namespace BladeRunner {
|
namespace BladeRunner {
|
||||||
@ -94,7 +94,7 @@ void Item::setXYZ(Vector3 position) {
|
|||||||
_depth = screenPosition.z * 25.5f;
|
_depth = screenPosition.z * 25.5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Item::init(int itemId, int setId, int animationId, Vector3 position, int facing, int height, int width, bool isTargetable, bool isVisible, bool isPoliceMazeEnemy) {
|
void Item::setup(int itemId, int setId, int animationId, Vector3 position, int facing, int height, int width, bool isTargetable, bool isVisible, bool isPoliceMazeEnemy) {
|
||||||
_itemId = itemId;
|
_itemId = itemId;
|
||||||
_setId = setId;
|
_setId = setId;
|
||||||
_animationId = animationId;
|
_animationId = animationId;
|
||||||
|
@ -67,7 +67,7 @@ public:
|
|||||||
bool isTargetable();
|
bool isTargetable();
|
||||||
void tick(bool special);
|
void tick(bool special);
|
||||||
void setXYZ(Vector3 position);
|
void setXYZ(Vector3 position);
|
||||||
void init(int itemId, int setId, int animationId, Vector3 position, int facing, int height, int width, bool isTargetable, bool isVisible, bool isPoliceMazeEnemy);
|
void setup(int itemId, int setId, int animationId, Vector3 position, int facing, int height, int width, bool isTargetable, bool isVisible, bool isPoliceMazeEnemy);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -37,13 +37,13 @@ bool Items::add(int itemId, int animationId, int setId, Vector3 position, int fa
|
|||||||
if (_items.size() >= 100) {
|
if (_items.size() >= 100) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int i = findItem(itemId);
|
int itemIndex = findItem(itemId);
|
||||||
if(i == -1) {
|
if(itemIndex == -1) {
|
||||||
i = _items.size();
|
itemIndex = _items.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
Item *item = new Item(_vm);
|
Item *item = new Item(_vm);
|
||||||
item->init(itemId, setId, animationId, position, facing, height, width, isTargetable, isVisible, isPoliceMazeEnemy);
|
item->setup(itemId, setId, animationId, position, facing, height, width, isTargetable, isVisible, isPoliceMazeEnemy);
|
||||||
_items.push_back(item);
|
_items.push_back(item);
|
||||||
|
|
||||||
if(addToSet && setId == _vm->_scene->getSetId()) {
|
if(addToSet && setId == _vm->_scene->getSetId()) {
|
||||||
@ -52,6 +52,22 @@ bool Items::add(int itemId, int animationId, int setId, Vector3 position, int fa
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Items::remove(int itemId) {
|
||||||
|
if (_items.size() == 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
int itemIndex = findItem(itemId);
|
||||||
|
if(itemIndex == -1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_items[itemIndex]->_setId == _vm->_scene->getSetId()) {
|
||||||
|
_vm->_sceneObjects->remove(itemId + SCENE_OBJECTS_ITEMS_OFFSET);
|
||||||
|
}
|
||||||
|
_items.remove_at(itemIndex);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
int Items::findItem(int itemId) {
|
int Items::findItem(int itemId) {
|
||||||
for (int i = 0; i < (int)_items.size(); i++) {
|
for (int i = 0; i < (int)_items.size(); i++) {
|
||||||
if (_items[i]->_itemId == itemId)
|
if (_items[i]->_itemId == itemId)
|
||||||
|
@ -42,6 +42,7 @@ public:
|
|||||||
void getXYZ(int itemId, float *x, float *y, float *z);
|
void getXYZ(int itemId, float *x, float *y, float *z);
|
||||||
void tick();
|
void tick();
|
||||||
bool add(int itemId, int animationId, int setId, Vector3 position, int facing, int height, int width, bool isTargetable, bool isVisible, bool isPoliceMazeEnemy, bool b);
|
bool add(int itemId, int animationId, int setId, Vector3 position, int facing, int height, int width, bool isTargetable, bool isVisible, bool isPoliceMazeEnemy, bool b);
|
||||||
|
bool remove(int itemId);
|
||||||
private:
|
private:
|
||||||
int findItem(int itemId);
|
int findItem(int itemId);
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
MODULE := engines/bladerunner
|
MODULE := engines/bladerunner
|
||||||
|
|
||||||
MODULE_OBJS = \
|
MODULE_OBJS = \
|
||||||
|
adq.o \
|
||||||
actor.o \
|
actor.o \
|
||||||
actor_clues.o \
|
actor_clues.o \
|
||||||
actor_combat.o \
|
actor_combat.o \
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "bladerunner/bladerunner.h"
|
#include "bladerunner/bladerunner.h"
|
||||||
|
|
||||||
#include "bladerunner/actor.h"
|
#include "bladerunner/actor.h"
|
||||||
|
#include "bladerunner/adq.h"
|
||||||
#include "bladerunner/chapters.h"
|
#include "bladerunner/chapters.h"
|
||||||
#include "bladerunner/gameinfo.h"
|
#include "bladerunner/gameinfo.h"
|
||||||
#include "bladerunner/scene_objects.h"
|
#include "bladerunner/scene_objects.h"
|
||||||
@ -37,7 +38,7 @@ namespace BladeRunner {
|
|||||||
|
|
||||||
bool Scene::open(int setId, int sceneId, bool isLoadingGame) {
|
bool Scene::open(int setId, int sceneId, bool isLoadingGame) {
|
||||||
if (!isLoadingGame) {
|
if (!isLoadingGame) {
|
||||||
// flush ADQ
|
_vm->_adq->flush(1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
_setId = setId;
|
_setId = setId;
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
#include "bladerunner/actor.h"
|
#include "bladerunner/actor.h"
|
||||||
#include "bladerunner/actor_combat.h"
|
#include "bladerunner/actor_combat.h"
|
||||||
|
#include "bladerunner/adq.h"
|
||||||
#include "bladerunner/ambient_sounds.h"
|
#include "bladerunner/ambient_sounds.h"
|
||||||
#include "bladerunner/audio_player.h"
|
#include "bladerunner/audio_player.h"
|
||||||
#include "bladerunner/audio_speech.h"
|
#include "bladerunner/audio_speech.h"
|
||||||
@ -351,14 +352,14 @@ void ScriptBase::Actor_Set_Targetable(int actorId, bool targetable) {
|
|||||||
|
|
||||||
void ScriptBase::Actor_Says(int actorId, int sentenceId, int animationMode){
|
void ScriptBase::Actor_Says(int actorId, int sentenceId, int animationMode){
|
||||||
_vm->loopActorSpeaking();
|
_vm->loopActorSpeaking();
|
||||||
//_vm->ADQ->flush(1,1)
|
_vm->_adq->flush(1, true);
|
||||||
Actor_Says_With_Pause(actorId, sentenceId, 0.5f, animationMode);
|
Actor_Says_With_Pause(actorId, sentenceId, 0.5f, animationMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptBase::Actor_Says_With_Pause(int actorId, int sentenceId, float pause, int animationMode) {
|
void ScriptBase::Actor_Says_With_Pause(int actorId, int sentenceId, float pause, int animationMode) {
|
||||||
_vm->gameWaitForActive();
|
_vm->gameWaitForActive();
|
||||||
_vm->loopActorSpeaking();
|
_vm->loopActorSpeaking();
|
||||||
//_vm->ADQ->flush(1,1)
|
_vm->_adq->flush(1, true);
|
||||||
|
|
||||||
Actor *actor = _vm->_actors[actorId];
|
Actor *actor = _vm->_actors[actorId];
|
||||||
|
|
||||||
@ -432,8 +433,8 @@ void ScriptBase::Actor_Voice_Over(int sentenceId, int actorId) {
|
|||||||
void ScriptBase::Actor_Voice_Over(int sentenceId, int actorId) {
|
void ScriptBase::Actor_Voice_Over(int sentenceId, int actorId) {
|
||||||
_vm->gameWaitForActive();
|
_vm->gameWaitForActive();
|
||||||
_vm->loopActorSpeaking();
|
_vm->loopActorSpeaking();
|
||||||
//_vm->ADQ->flush(1,1)
|
_vm->_adq->flush(1, true);
|
||||||
|
|
||||||
Actor *actor = _vm->_actors[actorId];
|
Actor *actor = _vm->_actors[actorId];
|
||||||
|
|
||||||
actor->speechPlay(sentenceId, true);
|
actor->speechPlay(sentenceId, true);
|
||||||
@ -637,8 +638,7 @@ void ScriptBase::Item_Add_To_World(int itemId, int animationId, int setId, float
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ScriptBase::Item_Remove_From_World(int itemId) {
|
void ScriptBase::Item_Remove_From_World(int itemId) {
|
||||||
//TODO
|
_vm->_items->remove(itemId);
|
||||||
warning("Item_Remove_From_World(%d)", itemId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptBase::Item_Spin_In_World(int itemId) {
|
void ScriptBase::Item_Spin_In_World(int itemId) {
|
||||||
@ -930,6 +930,8 @@ int ScriptBase::Ambient_Sounds_Play_Sound(int a1, int a2, int a3, int a4, int a5
|
|||||||
// ScriptBase::Ambient_Sounds_Play_Speech_Sound
|
// ScriptBase::Ambient_Sounds_Play_Speech_Sound
|
||||||
|
|
||||||
void ScriptBase::Ambient_Sounds_Remove_All_Non_Looping_Sounds(int time) {
|
void ScriptBase::Ambient_Sounds_Remove_All_Non_Looping_Sounds(int time) {
|
||||||
|
//TODO
|
||||||
|
warning("Ambient_Sounds_Remove_All_Non_Looping_Sounds(%d)", time);
|
||||||
// _vm->_ambientSounds->removeAllNonLoopingSounds(time);
|
// _vm->_ambientSounds->removeAllNonLoopingSounds(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -948,6 +950,8 @@ void ScriptBase::Ambient_Sounds_Remove_Looping_Sound(int id, bool a2){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ScriptBase::Ambient_Sounds_Remove_All_Looping_Sounds(int time) {
|
void ScriptBase::Ambient_Sounds_Remove_All_Looping_Sounds(int time) {
|
||||||
|
//TODO
|
||||||
|
warning("Ambient_Sounds_Remove_All_Looping_Sounds(%d)", time);
|
||||||
// _vm->_ambientSounds->removeAllLoopingSounds(time);
|
// _vm->_ambientSounds->removeAllLoopingSounds(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1289,18 +1293,15 @@ void ScriptBase::Set_Fog_Density(const char* fogName, float density) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ScriptBase::ADQ_Flush() {
|
void ScriptBase::ADQ_Flush() {
|
||||||
//TODO
|
_vm->_adq->flush(0, true);
|
||||||
warning("ADQ_Flush()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptBase::ADQ_Add(int a1, int a2, int a3) {
|
void ScriptBase::ADQ_Add(int actorId, int sentenceId, int animationMode) {
|
||||||
//TODO
|
_vm->_adq->add(actorId, sentenceId, animationMode);
|
||||||
warning("ADQ_Add(%d, %d, %d)", a1, a2, a3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptBase::ADQ_Add_Pause(int delay) {
|
void ScriptBase::ADQ_Add_Pause(int delay) {
|
||||||
//TODO
|
_vm->_adq->addPause(delay);
|
||||||
warning("ADQ_Add_Pause(%d)", delay);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScriptBase::Game_Over() {
|
bool ScriptBase::Game_Over() {
|
||||||
|
@ -253,7 +253,7 @@ protected:
|
|||||||
void Set_Fog_Color(const char* fogName, float r, float g, float b);
|
void Set_Fog_Color(const char* fogName, float r, float g, float b);
|
||||||
void Set_Fog_Density(const char* fogName, float density);
|
void Set_Fog_Density(const char* fogName, float density);
|
||||||
void ADQ_Flush();
|
void ADQ_Flush();
|
||||||
void ADQ_Add(int a1, int a2, int a3);
|
void ADQ_Add(int actorId, int sentenceId, int animationMode);
|
||||||
void ADQ_Add_Pause(int delay);
|
void ADQ_Add_Pause(int delay);
|
||||||
bool Game_Over();
|
bool Game_Over();
|
||||||
void Autosave_Game(int textId);
|
void Autosave_Game(int textId);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user