aboutsummaryrefslogtreecommitdiff
path: root/engines/illusions/illusions.cpp
diff options
context:
space:
mode:
authorjohndoe1232014-03-27 18:55:41 +0100
committerEugene Sandulenko2018-07-20 06:43:33 +0000
commit33d28deb690c79a6aca190c5b1bc998c39d95662 (patch)
treefaf3167dacc8c56a63e455af79cb8d7b2f16e2aa /engines/illusions/illusions.cpp
parent22e898f7eb1bddc363900f4146696bf6e9d41e2f (diff)
downloadscummvm-rg350-33d28deb690c79a6aca190c5b1bc998c39d95662.tar.gz
scummvm-rg350-33d28deb690c79a6aca190c5b1bc998c39d95662.tar.bz2
scummvm-rg350-33d28deb690c79a6aca190c5b1bc998c39d95662.zip
ILLUSIONS: Additions in various places
- Add NamedPoint and related code - Remove some debug output - Fix right mouse button input - Add bubble code - Add BBDOU inventory skeleton
Diffstat (limited to 'engines/illusions/illusions.cpp')
-rw-r--r--engines/illusions/illusions.cpp74
1 files changed, 19 insertions, 55 deletions
diff --git a/engines/illusions/illusions.cpp b/engines/illusions/illusions.cpp
index 5f7bb23b79..bd302f8959 100644
--- a/engines/illusions/illusions.cpp
+++ b/engines/illusions/illusions.cpp
@@ -113,41 +113,6 @@ Common::Error IllusionsEngine::run() {
_unpauseControlActorFlag = false;
_lastUpdateTime = 0;
-#if 0
- // ActorResource test
- _resSys->loadResource(0x00100006, 0, 0);
-#endif
-
-#if 0
- // BackgroundResource test
- _resSys->loadResource(0x00110007, 0, 0);
- BackgroundItem *backgroundItem = _backgroundItems->debugFirst();
- _system->copyRectToScreen((byte*)backgroundItem->_surfaces[0]->getBasePtr(0, 0), backgroundItem->_surfaces[0]->pitch, 0, 0, 640, 480);
- _system->updateScreen();
- _camera->panToPoint(Common::Point(800, 0), 500, 0);
- while (!shouldQuit()) {
- //debug("panPoints[0] = %d, %d", backgroundItem->_panPoints[0].x, backgroundItem->_panPoints[0].y);
- uint32 t = getCurrentTime();
- //debug("t = %d", t);
- _camera->update(t);
- _system->delayMillis(10);
- _system->copyRectToScreen((byte*)backgroundItem->_surfaces[0]->getBasePtr(backgroundItem->_panPoints[0].x, 0),
- backgroundItem->_surfaces[0]->pitch, 0, 0, 640, 480);
- _system->updateScreen();
- updateEvents();
- }
-#endif
-
-#if 0
- // ScriptResource test
- _resSys->loadResource(0x000D0001, 0, 0);
- _scriptMan->startScriptThread(0x00020004, 0, 0, 0, 0);
- while (!shouldQuit()) {
- updateEvents();
- _scriptMan->_threads->updateThreads();
- }
-#endif
-
#if 1
// Actor/graphics/script test
@@ -156,23 +121,9 @@ Common::Error IllusionsEngine::run() {
_resSys->loadResource(0x000D0001, 0, 0);
-#if 0
- _resSys->loadResource(0x0011000B, 0, 0);
- _resSys->loadResource(0x0010000B, 0, 0);
-
-#if 0
- _controls->placeActor(0x00050009, Common::Point(0, 0), 0x00060573, 0x00040001, 0);
- Control *control = *_controls->_controls.begin();
- control->setActorFrameIndex(1);
- control->appearActor();
-#endif
-#endif
-
_scriptMan->startScriptThread(0x00020004, 0, 0, 0, 0);
_scriptMan->_doScriptThreadInit = true;
- //_camera->panToPoint(Common::Point(800, 0), 500, 0);
-
while (!shouldQuit()) {
_scriptMan->_threads->updateThreads();
updateActors();
@@ -262,7 +213,6 @@ uint32 IllusionsEngine::getElapsedUpdateTime() {
int IllusionsEngine::updateActors() {
// TODO Move to Controls class
uint32 deltaTime = getElapsedUpdateTime();
- //debug("deltaTime: %d", deltaTime);
for (Controls::ItemsIterator it = _controls->_controls.begin(); it != _controls->_controls.end(); ++it) {
Control *control = *it;
if (control->_pauseCtr == 0 && control->_actor && control->_actor->_controlRoutine)
@@ -294,8 +244,7 @@ int IllusionsEngine::updateGraphics() {
BackgroundResource *bgRes = backgroundItem->_bgRes;
for (uint i = 0; i < bgRes->_bgInfosCount; ++i) {
BgInfo *bgInfo = &bgRes->_bgInfos[i];
- // TODO int16 priority = artcntrlGetPriorityFromBase(bgInfos[v7].priorityBase);
- int16 priority = -1;
+ uint32 priority = getPriorityFromBase(bgInfo->_priorityBase);
_screen->_drawQueue->insertSurface(backgroundItem->_surfaces[i],
bgInfo->_surfInfo._dimensions, backgroundItem->_panPoints[i], priority);
if (bgInfo->_flags & 1)
@@ -324,8 +273,7 @@ int IllusionsEngine::updateGraphics() {
}
*/
if (actor->_surfInfo._dimensions._width && actor->_surfInfo._dimensions._height) {
- // TODO int16 priority = control->getPriority();
- int16 priority = 2;
+ uint32 priority = control->getPriority();
_screen->_drawQueue->insertSprite(&actor->_drawFlags, actor->_surface,
actor->_surfInfo._dimensions, drawPosition, control->_position,
priority, actor->_scale, actor->_spriteFlags);
@@ -352,7 +300,7 @@ bool IllusionsEngine::causeIsDeclared(uint32 sceneId, uint32 verbId, uint32 obje
uint32 codeOffs;
// TODO Also search for native trigger functions later (findCauseFunc)
bool r = _scriptMan->findTriggerCause(sceneId, verbId, objectId2, objectId, codeOffs);
- debug("causeIsDeclared() sceneId: %08X; verbId: %08X; objectId2: %08X; objectId: %08X -> %d",
+ debug(3, "causeIsDeclared() sceneId: %08X; verbId: %08X; objectId2: %08X; objectId: %08X -> %d",
sceneId, verbId, objectId2, objectId, r);
return r;
}
@@ -374,10 +322,26 @@ int IllusionsEngine::convertPanXCoord(int16 x) {
}
Common::Point IllusionsEngine::getNamedPointPosition(uint32 namedPointId) {
+ Common::Point pt;
+ if (_backgroundItems->findActiveBackgroundNamedPoint(namedPointId, pt) ||
+ _actorItems->findNamedPoint(namedPointId, pt) ||
+ _controls->findNamedPoint(namedPointId, pt))
+ return pt;
// TODO
+ debug("getNamedPointPosition(%08X) UNKNOWN", namedPointId);
return Common::Point(0, 0);
}
+uint32 IllusionsEngine::getPriorityFromBase(int16 priority) {
+ return 32000000 * priority;
+}
+
+bool IllusionsEngine::calcPointDirection(Common::Point &pos1, Common::Point &pos2, uint &facing) {
+ // TODO
+ facing = 0;
+ return false;
+}
+
void IllusionsEngine::playVideo(uint32 videoId, uint32 objectId, uint32 priority, uint32 threadId) {
// TODO
}