2014-03-08 22:54:34 +01: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 "illusions/illusions.h"
|
2014-03-20 13:24:33 +01:00
|
|
|
#include "illusions/actor.h"
|
|
|
|
#include "illusions/actorresource.h"
|
2014-03-10 13:12:21 +01:00
|
|
|
#include "illusions/backgroundresource.h"
|
2014-03-10 17:49:08 +01:00
|
|
|
#include "illusions/camera.h"
|
2014-03-20 14:16:48 +01:00
|
|
|
#include "illusions/cursor.h"
|
2014-03-20 13:24:33 +01:00
|
|
|
#include "illusions/dictionary.h"
|
|
|
|
#include "illusions/fontresource.h"
|
2014-03-10 14:56:55 +01:00
|
|
|
#include "illusions/graphics.h"
|
2014-03-10 17:49:08 +01:00
|
|
|
#include "illusions/input.h"
|
2014-03-20 13:24:33 +01:00
|
|
|
#include "illusions/resourcesystem.h"
|
2014-03-17 12:57:39 +01:00
|
|
|
#include "illusions/screen.h"
|
2014-03-13 11:54:56 +01:00
|
|
|
#include "illusions/scriptresource.h"
|
2014-03-13 14:31:02 +01:00
|
|
|
#include "illusions/scriptman.h"
|
2014-03-20 13:24:33 +01:00
|
|
|
#include "illusions/soundresource.h"
|
2014-03-24 11:21:44 +01:00
|
|
|
#include "illusions/specialcode.h"
|
2014-03-20 13:24:33 +01:00
|
|
|
#include "illusions/talkresource.h"
|
|
|
|
#include "illusions/thread.h"
|
2014-03-15 21:57:51 +01:00
|
|
|
#include "illusions/time.h"
|
2014-03-20 13:24:33 +01:00
|
|
|
#include "illusions/updatefunctions.h"
|
2014-03-08 22:54:34 +01:00
|
|
|
|
|
|
|
#include "audio/audiostream.h"
|
|
|
|
#include "common/config-manager.h"
|
|
|
|
#include "common/debug-channels.h"
|
|
|
|
#include "common/error.h"
|
|
|
|
#include "common/fs.h"
|
|
|
|
#include "common/timer.h"
|
|
|
|
#include "engines/util.h"
|
|
|
|
#include "graphics/cursorman.h"
|
|
|
|
#include "graphics/font.h"
|
|
|
|
#include "graphics/fontman.h"
|
|
|
|
#include "graphics/palette.h"
|
|
|
|
#include "graphics/surface.h"
|
|
|
|
|
|
|
|
namespace Illusions {
|
|
|
|
|
|
|
|
IllusionsEngine::IllusionsEngine(OSystem *syst, const ADGameDescription *gd) :
|
|
|
|
Engine(syst), _gameDescription(gd) {
|
|
|
|
|
|
|
|
_random = new Common::RandomSource("illusions");
|
|
|
|
|
|
|
|
Engine::syncSoundSettings();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
IllusionsEngine::~IllusionsEngine() {
|
|
|
|
|
|
|
|
delete _random;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Common::Error IllusionsEngine::run() {
|
|
|
|
|
2014-03-10 13:12:21 +01:00
|
|
|
// Init search paths
|
|
|
|
const Common::FSNode gameDataDir(ConfMan.get("path"));
|
|
|
|
SearchMan.addSubDirectoryMatching(gameDataDir, "music");
|
|
|
|
SearchMan.addSubDirectoryMatching(gameDataDir, "resource");
|
|
|
|
SearchMan.addSubDirectoryMatching(gameDataDir, "resrem");
|
|
|
|
SearchMan.addSubDirectoryMatching(gameDataDir, "savegame");
|
|
|
|
SearchMan.addSubDirectoryMatching(gameDataDir, "sfx");
|
|
|
|
SearchMan.addSubDirectoryMatching(gameDataDir, "video");
|
|
|
|
SearchMan.addSubDirectoryMatching(gameDataDir, "voice");
|
|
|
|
|
2014-03-08 22:54:34 +01:00
|
|
|
Graphics::PixelFormat pixelFormat16(2, 5, 6, 5, 0, 11, 5, 0, 0);
|
|
|
|
initGraphics(640, 480, true, &pixelFormat16);
|
2014-03-10 13:12:21 +01:00
|
|
|
|
2014-03-18 11:41:14 +01:00
|
|
|
_dict = new Dictionary();
|
|
|
|
|
2014-03-10 13:12:21 +01:00
|
|
|
_resSys = new ResourceSystem();
|
2014-03-12 16:55:42 +01:00
|
|
|
_resSys->addResourceLoader(0x00060000, new ActorResourceLoader(this));
|
2014-03-20 13:24:33 +01:00
|
|
|
_resSys->addResourceLoader(0x00080000, new SoundGroupResourceLoader(this));
|
2014-03-13 11:54:56 +01:00
|
|
|
_resSys->addResourceLoader(0x000D0000, new ScriptResourceLoader(this));
|
2014-03-20 13:24:33 +01:00
|
|
|
_resSys->addResourceLoader(0x000F0000, new TalkResourceLoader(this));
|
2014-03-12 16:55:42 +01:00
|
|
|
_resSys->addResourceLoader(0x00100000, new ActorResourceLoader(this));
|
2014-03-10 13:12:21 +01:00
|
|
|
_resSys->addResourceLoader(0x00110000, new BackgroundResourceLoader(this));
|
2014-03-20 13:24:33 +01:00
|
|
|
_resSys->addResourceLoader(0x00120000, new FontResourceLoader(this));
|
2014-03-24 11:21:44 +01:00
|
|
|
_resSys->addResourceLoader(0x00170000, new SpecialCodeLoader(this));
|
2014-03-12 16:55:42 +01:00
|
|
|
|
2014-03-18 10:59:28 +01:00
|
|
|
_screen = new Screen(this);
|
2014-03-14 18:52:25 +01:00
|
|
|
_input = new Input();
|
|
|
|
_scriptMan = new ScriptMan(this);
|
2014-03-13 19:55:25 +01:00
|
|
|
_actorItems = new ActorItems(this);
|
2014-03-11 17:36:10 +01:00
|
|
|
_backgroundItems = new BackgroundItems(this);
|
2014-03-11 19:54:22 +01:00
|
|
|
_camera = new Camera(this);
|
2014-03-18 14:53:17 +01:00
|
|
|
_controls = new Controls(this);
|
2014-03-20 14:16:48 +01:00
|
|
|
_cursor = new Cursor(this);
|
2014-03-21 19:58:53 +01:00
|
|
|
_talkItems = new TalkItems(this);
|
2014-03-30 09:31:53 +02:00
|
|
|
_triggerFunctions = new TriggerFunctions();
|
2014-03-10 13:12:21 +01:00
|
|
|
|
2014-03-19 13:59:13 +01:00
|
|
|
// TODO Move to own class
|
|
|
|
_resGetCtr = 0;
|
|
|
|
_unpauseControlActorFlag = false;
|
|
|
|
_lastUpdateTime = 0;
|
|
|
|
|
2014-03-18 14:53:17 +01:00
|
|
|
#if 1
|
2014-03-19 20:39:16 +01:00
|
|
|
// Actor/graphics/script test
|
2014-03-19 13:59:13 +01:00
|
|
|
|
|
|
|
/* TODO 0x0010000B LinkIndex 0x00060AAB 0x00060556
|
2014-03-30 09:31:53 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
_scriptMan->_globalSceneId = 0x00010003;
|
2014-03-19 13:59:13 +01:00
|
|
|
|
2014-03-19 20:39:16 +01:00
|
|
|
_resSys->loadResource(0x000D0001, 0, 0);
|
2014-03-21 17:21:55 +01:00
|
|
|
|
2014-03-19 20:39:16 +01:00
|
|
|
_scriptMan->startScriptThread(0x00020004, 0, 0, 0, 0);
|
2014-03-26 14:04:17 +01:00
|
|
|
_scriptMan->_doScriptThreadInit = true;
|
2014-03-19 20:39:16 +01:00
|
|
|
|
2014-03-18 14:53:17 +01:00
|
|
|
while (!shouldQuit()) {
|
2014-03-19 20:39:16 +01:00
|
|
|
_scriptMan->_threads->updateThreads();
|
2014-03-19 13:59:13 +01:00
|
|
|
updateActors();
|
|
|
|
updateSequences();
|
2014-03-18 14:53:17 +01:00
|
|
|
updateGraphics();
|
|
|
|
_screen->updateSprites();
|
|
|
|
_system->updateScreen();
|
|
|
|
updateEvents();
|
2014-03-19 13:59:13 +01:00
|
|
|
_system->delayMillis(10);
|
2014-03-18 14:53:17 +01:00
|
|
|
}
|
2014-03-13 19:55:25 +01:00
|
|
|
#endif
|
2014-03-08 22:54:34 +01:00
|
|
|
|
2014-03-30 09:31:53 +02:00
|
|
|
delete _triggerFunctions;
|
2014-03-21 19:58:53 +01:00
|
|
|
delete _talkItems;
|
2014-03-20 14:16:48 +01:00
|
|
|
delete _cursor;
|
2014-03-18 14:53:17 +01:00
|
|
|
delete _controls;
|
2014-03-11 19:54:22 +01:00
|
|
|
delete _camera;
|
2014-03-11 17:36:10 +01:00
|
|
|
delete _backgroundItems;
|
2014-03-12 16:55:42 +01:00
|
|
|
delete _actorItems;
|
2014-03-13 19:55:25 +01:00
|
|
|
delete _scriptMan;
|
2014-03-14 18:52:25 +01:00
|
|
|
delete _input;
|
2014-03-17 12:57:39 +01:00
|
|
|
delete _screen;
|
2014-03-10 13:12:21 +01:00
|
|
|
delete _resSys;
|
2014-03-18 11:41:14 +01:00
|
|
|
delete _dict;
|
2014-03-10 13:12:21 +01:00
|
|
|
|
2014-03-20 13:24:33 +01:00
|
|
|
debug("Ok");
|
|
|
|
|
2014-03-08 22:54:34 +01:00
|
|
|
return Common::kNoError;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IllusionsEngine::hasFeature(EngineFeature f) const {
|
|
|
|
return
|
|
|
|
false;
|
|
|
|
/*
|
|
|
|
(f == kSupportsRTL) ||
|
|
|
|
(f == kSupportsLoadingDuringRuntime) ||
|
|
|
|
(f == kSupportsSavingDuringRuntime);
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
|
|
|
void IllusionsEngine::updateEvents() {
|
|
|
|
Common::Event event;
|
|
|
|
while (_eventMan->pollEvent(event)) {
|
2014-03-25 19:57:21 +01:00
|
|
|
_input->processEvent(event);
|
2014-03-08 22:54:34 +01:00
|
|
|
switch (event.type) {
|
|
|
|
case Common::EVENT_QUIT:
|
|
|
|
quitGame();
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-12 13:14:22 +01:00
|
|
|
Common::Point *IllusionsEngine::getObjectActorPositionPtr(uint32 objectId) {
|
2014-03-25 19:57:21 +01:00
|
|
|
Control *control = _dict->getObjectControl(objectId);
|
|
|
|
if (control && control->_actor)
|
|
|
|
return &control->_actor->_position;
|
2014-03-12 13:14:22 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-03-18 10:59:28 +01:00
|
|
|
void IllusionsEngine::notifyThreadId(uint32 &threadId) {
|
|
|
|
if (threadId) {
|
|
|
|
uint32 tempThreadId = threadId;
|
|
|
|
threadId = 0;
|
|
|
|
_scriptMan->_threads->notifyId(tempThreadId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-19 13:59:13 +01:00
|
|
|
uint32 IllusionsEngine::getElapsedUpdateTime() {
|
|
|
|
uint32 result = 0;
|
|
|
|
uint32 currTime = getCurrentTime();
|
|
|
|
if (_resGetCtr <= 0 ) {
|
|
|
|
if (_unpauseControlActorFlag) {
|
|
|
|
_unpauseControlActorFlag = false;
|
|
|
|
result = 0;
|
|
|
|
} else {
|
|
|
|
result = currTime - _lastUpdateTime;
|
|
|
|
}
|
|
|
|
_lastUpdateTime = currTime;
|
|
|
|
} else {
|
|
|
|
result = _resGetTime - _lastUpdateTime;
|
|
|
|
_lastUpdateTime = _resGetTime;
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
int IllusionsEngine::updateActors() {
|
|
|
|
// TODO Move to Controls class
|
|
|
|
uint32 deltaTime = getElapsedUpdateTime();
|
|
|
|
for (Controls::ItemsIterator it = _controls->_controls.begin(); it != _controls->_controls.end(); ++it) {
|
|
|
|
Control *control = *it;
|
|
|
|
if (control->_pauseCtr == 0 && control->_actor && control->_actor->_controlRoutine)
|
|
|
|
control->_actor->runControlRoutine(control, deltaTime);
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
int IllusionsEngine::updateSequences() {
|
|
|
|
// TODO Move to Controls class
|
|
|
|
for (Controls::ItemsIterator it = _controls->_controls.begin(); it != _controls->_controls.end(); ++it) {
|
|
|
|
Control *control = *it;
|
2014-04-01 11:22:58 +02:00
|
|
|
if (control->_pauseCtr == 0 && control->_actor && control->_actor->_seqCodeIp) {
|
2014-03-19 13:59:13 +01:00
|
|
|
control->sequenceActor();
|
2014-04-01 11:22:58 +02:00
|
|
|
}
|
2014-03-19 13:59:13 +01:00
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2014-03-18 14:53:17 +01:00
|
|
|
int IllusionsEngine::updateGraphics() {
|
|
|
|
Common::Point panPoint(0, 0);
|
|
|
|
|
|
|
|
uint32 currTime = getCurrentTime();
|
2014-03-25 19:57:21 +01:00
|
|
|
|
2014-03-19 13:59:13 +01:00
|
|
|
_camera->update(currTime);
|
|
|
|
|
|
|
|
// TODO Move to BackgroundItems class
|
|
|
|
BackgroundItem *backgroundItem = _backgroundItems->findActiveBackground();
|
|
|
|
if (backgroundItem) {
|
|
|
|
BackgroundResource *bgRes = backgroundItem->_bgRes;
|
|
|
|
for (uint i = 0; i < bgRes->_bgInfosCount; ++i) {
|
|
|
|
BgInfo *bgInfo = &bgRes->_bgInfos[i];
|
2014-03-27 18:55:41 +01:00
|
|
|
uint32 priority = getPriorityFromBase(bgInfo->_priorityBase);
|
2014-03-18 14:53:17 +01:00
|
|
|
_screen->_drawQueue->insertSurface(backgroundItem->_surfaces[i],
|
|
|
|
bgInfo->_surfInfo._dimensions, backgroundItem->_panPoints[i], priority);
|
|
|
|
if (bgInfo->_flags & 1)
|
|
|
|
panPoint = backgroundItem->_panPoints[i];
|
|
|
|
}
|
|
|
|
}
|
2014-03-25 19:57:21 +01:00
|
|
|
|
2014-03-18 14:53:17 +01:00
|
|
|
// TODO Move to Controls class
|
|
|
|
for (Controls::ItemsIterator it = _controls->_controls.begin(); it != _controls->_controls.end(); ++it) {
|
|
|
|
Control *control = *it;
|
|
|
|
Actor *actor = control->_actor;
|
|
|
|
|
|
|
|
if (control->_pauseCtr == 0 && actor && (actor->_flags & 1) && !(actor->_flags & 0x0200)) {
|
2014-03-18 16:00:51 +01:00
|
|
|
Common::Point drawPosition = control->calcPosition(panPoint);
|
2014-03-18 14:53:17 +01:00
|
|
|
if (actor->_flags & 0x2000) {
|
|
|
|
Frame *frame = &(*actor->_frames)[actor->_frameIndex - 1];
|
|
|
|
_screen->_decompressQueue->insert(&actor->_drawFlags, frame->_flags,
|
|
|
|
frame->_surfInfo._pixelSize, frame->_surfInfo._dimensions,
|
|
|
|
frame->_compressedPixels, actor->_surface);
|
|
|
|
actor->_flags &= ~0x2000;
|
|
|
|
}
|
|
|
|
/* Unused
|
|
|
|
if (actor->_flags & 0x4000) {
|
|
|
|
nullsub_1(&actor->drawFlags);
|
|
|
|
actor->flags &= ~0x4000;
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
if (actor->_surfInfo._dimensions._width && actor->_surfInfo._dimensions._height) {
|
2014-03-27 18:55:41 +01:00
|
|
|
uint32 priority = control->getPriority();
|
2014-03-18 14:53:17 +01:00
|
|
|
_screen->_drawQueue->insertSprite(&actor->_drawFlags, actor->_surface,
|
|
|
|
actor->_surfInfo._dimensions, drawPosition, control->_position,
|
2014-03-30 10:46:12 +02:00
|
|
|
priority, actor->_scale, actor->_spriteFlags);
|
2014-03-18 14:53:17 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#if 0 // TODO
|
|
|
|
if (_textInfo._surface) {
|
|
|
|
int16 priority = getPriorityFromBase(99);
|
|
|
|
_screen->_drawQueue->insertTextSurface(_textInfo._surface, _textInfo._dimensions,
|
|
|
|
_textInfo._position, priority);
|
|
|
|
}
|
|
|
|
#endif
|
2014-03-19 13:59:13 +01:00
|
|
|
|
2014-03-18 14:53:17 +01:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2014-03-19 13:59:13 +01:00
|
|
|
int IllusionsEngine::getRandom(int max) {
|
|
|
|
return _random->getRandomNumber(max - 1);
|
|
|
|
}
|
|
|
|
|
2014-03-26 14:04:17 +01:00
|
|
|
bool IllusionsEngine::causeIsDeclared(uint32 sceneId, uint32 verbId, uint32 objectId2, uint32 objectId) {
|
|
|
|
uint32 codeOffs;
|
2014-03-30 09:31:53 +02:00
|
|
|
bool r =
|
|
|
|
_triggerFunctions->find(sceneId, verbId, objectId2, objectId) ||
|
|
|
|
_scriptMan->findTriggerCause(sceneId, verbId, objectId2, objectId, codeOffs);
|
2014-03-27 18:55:41 +01:00
|
|
|
debug(3, "causeIsDeclared() sceneId: %08X; verbId: %08X; objectId2: %08X; objectId: %08X -> %d",
|
2014-03-26 14:04:17 +01:00
|
|
|
sceneId, verbId, objectId2, objectId, r);
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
2014-03-30 09:31:53 +02:00
|
|
|
void IllusionsEngine::causeDeclare(uint32 verbId, uint32 objectId2, uint32 objectId, TriggerFunctionCallback *callback) {
|
|
|
|
_triggerFunctions->add(getCurrentScene(), verbId, objectId2, objectId, callback);
|
|
|
|
}
|
|
|
|
|
2014-03-26 14:04:17 +01:00
|
|
|
uint32 IllusionsEngine::causeTrigger(uint32 sceneId, uint32 verbId, uint32 objectId2, uint32 objectId, uint32 callingThreadId) {
|
|
|
|
uint32 codeOffs;
|
|
|
|
uint32 causeThreadId = 0;
|
2014-03-30 09:31:53 +02:00
|
|
|
TriggerFunction *triggerFunction = _triggerFunctions->find(sceneId, verbId, objectId2, objectId);
|
|
|
|
if (triggerFunction) {
|
|
|
|
triggerFunction->run(callingThreadId);
|
|
|
|
} else if (_scriptMan->findTriggerCause(sceneId, verbId, objectId2, objectId, codeOffs)) {
|
|
|
|
//debug("Run cause at %08X", codeOffs);
|
2014-03-26 14:04:17 +01:00
|
|
|
causeThreadId = _scriptMan->startTempScriptThread(_scriptMan->_scriptResource->getCode(codeOffs),
|
|
|
|
callingThreadId, verbId, objectId2, objectId);
|
|
|
|
}
|
|
|
|
return causeThreadId;
|
|
|
|
}
|
|
|
|
|
2014-03-19 13:59:13 +01:00
|
|
|
int IllusionsEngine::convertPanXCoord(int16 x) {
|
|
|
|
// TODO
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-03-19 20:39:16 +01:00
|
|
|
Common::Point IllusionsEngine::getNamedPointPosition(uint32 namedPointId) {
|
2014-03-27 18:55:41 +01:00
|
|
|
Common::Point pt;
|
|
|
|
if (_backgroundItems->findActiveBackgroundNamedPoint(namedPointId, pt) ||
|
|
|
|
_actorItems->findNamedPoint(namedPointId, pt) ||
|
|
|
|
_controls->findNamedPoint(namedPointId, pt))
|
|
|
|
return pt;
|
2014-03-19 20:39:16 +01:00
|
|
|
// TODO
|
2014-03-30 09:31:53 +02:00
|
|
|
//debug("getNamedPointPosition(%08X) UNKNOWN", namedPointId);
|
2014-03-20 13:24:33 +01:00
|
|
|
return Common::Point(0, 0);
|
2014-03-19 20:39:16 +01:00
|
|
|
}
|
|
|
|
|
2014-03-27 18:55:41 +01:00
|
|
|
uint32 IllusionsEngine::getPriorityFromBase(int16 priority) {
|
|
|
|
return 32000000 * priority;
|
|
|
|
}
|
|
|
|
|
2014-04-02 13:16:01 +02:00
|
|
|
bool IllusionsEngine::calcPointDirection(Common::Point &srcPt, Common::Point &dstPt, uint &facing) {
|
2014-03-27 18:55:41 +01:00
|
|
|
facing = 0;
|
2014-04-02 13:16:01 +02:00
|
|
|
uint xd = 0, yd = 0;
|
|
|
|
if (srcPt.x < dstPt.x)
|
|
|
|
xd = 0x40;
|
|
|
|
else if (srcPt.x > dstPt.x)
|
|
|
|
xd = 0x04;
|
|
|
|
else
|
|
|
|
xd = 0x00;
|
|
|
|
if (srcPt.y < dstPt.y)
|
|
|
|
yd = 0x01;
|
|
|
|
else if (srcPt.y > dstPt.y)
|
|
|
|
yd = 0x10;
|
|
|
|
else
|
|
|
|
yd = 0x00;
|
|
|
|
if (!xd && !yd)
|
|
|
|
facing = 0;
|
|
|
|
else if (!yd && xd)
|
|
|
|
facing = xd;
|
|
|
|
else if (yd && !xd)
|
|
|
|
facing = yd;
|
|
|
|
else if (xd == 0x04 && yd == 0x01)
|
|
|
|
facing = 0x02;
|
|
|
|
else if (xd == 0x40 && yd == 0x01)
|
|
|
|
facing = 0x80;
|
|
|
|
else if (xd == 0x04 && yd == 0x10)
|
|
|
|
facing = 0x08;
|
|
|
|
else if (xd == 0x40 && yd == 0x10)
|
|
|
|
facing = 0x20;
|
|
|
|
return facing != 0;
|
2014-03-27 18:55:41 +01:00
|
|
|
}
|
|
|
|
|
2014-03-19 20:39:16 +01:00
|
|
|
void IllusionsEngine::playVideo(uint32 videoId, uint32 objectId, uint32 priority, uint32 threadId) {
|
2014-03-22 02:32:44 +01:00
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IllusionsEngine::isSoundActive() {
|
|
|
|
// TODO
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IllusionsEngine::cueVoice(byte *voiceName) {
|
|
|
|
// TODO
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IllusionsEngine::isVoiceCued() {
|
|
|
|
// TODO
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void IllusionsEngine::startVoice(int volume, int panX) {
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
void IllusionsEngine::stopVoice() {
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IllusionsEngine::isVoicePlaying() {
|
|
|
|
// TODO
|
|
|
|
return false;
|
2014-03-19 20:39:16 +01:00
|
|
|
}
|
|
|
|
|
2014-03-26 14:04:17 +01:00
|
|
|
uint32 IllusionsEngine::getCurrentScene() {
|
|
|
|
return _scriptMan->_activeScenes.getCurrentScene();
|
|
|
|
}
|
|
|
|
|
2014-03-08 22:54:34 +01:00
|
|
|
} // End of namespace Illusions
|