aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorNipun Garg2019-07-06 00:58:31 +0530
committerEugene Sandulenko2019-09-03 17:17:12 +0200
commit22ca561f4af1d524ab5519903e49f743020b48a4 (patch)
tree5b9c93bd0abd0d2679e16412d38ec049344a10da /engines
parentab06602332b3a10029127656dbc23471c3237f3e (diff)
downloadscummvm-rg350-22ca561f4af1d524ab5519903e49f743020b48a4.tar.gz
scummvm-rg350-22ca561f4af1d524ab5519903e49f743020b48a4.tar.bz2
scummvm-rg350-22ca561f4af1d524ab5519903e49f743020b48a4.zip
HDB: Add _laserRescan and _laserOnScreen
Diffstat (limited to 'engines')
-rw-r--r--engines/hdb/ai-bots.cpp20
-rw-r--r--engines/hdb/ai-funcs.cpp5
-rw-r--r--engines/hdb/ai-init.cpp3
-rw-r--r--engines/hdb/ai.h6
4 files changed, 19 insertions, 15 deletions
diff --git a/engines/hdb/ai-bots.cpp b/engines/hdb/ai-bots.cpp
index 9d6b18a92c..0f553b0bf8 100644
--- a/engines/hdb/ai-bots.cpp
+++ b/engines/hdb/ai-bots.cpp
@@ -1260,13 +1260,13 @@ void aiDiverterInit2(AIEntity *e) {
case DIR_NONE: break;
}
- warning("STUB: Set Laser Rescan to true");
+ g_hdb->_ai->_laserRescan = true;
}
void aiDiverterAction(AIEntity *e) {
if (e->goalX) {
g_hdb->_ai->animateEntity(e);
- warning("STUB: Set Laser Rescan to true");
+ g_hdb->_ai->_laserRescan = true;
// have to reset the state because we might have been moved...
switch (e->dir2) {
@@ -1294,7 +1294,7 @@ void aiDiverterDraw(AIEntity *e, int mx, int my) {
onScreen += g_hdb->_ai->_gfxLaserbeamUDTop[frame]->drawMasked(e->x - mx, i * kTileHeight - my);
if (onScreen) {
g_hdb->_sound->playSoundEx(SND_LASER_LOOP, kLaserChannel, true);
- warning("STUB: Set Laser onScreen to true");
+ g_hdb->_ai->_laserOnScreen = true;
}
} else {
for (i = e->value1 + 1; i < e->value2; i++)
@@ -1302,7 +1302,7 @@ void aiDiverterDraw(AIEntity *e, int mx, int my) {
onScreen += g_hdb->_ai->_gfxLaserbeamLRLeft[frame]->drawMasked(i * kTileWidth - mx, e->y - my);
if (onScreen) {
g_hdb->_sound->playSoundEx(SND_LASER_LOOP, kLaserChannel, true);
- warning("STUB: Set Laser onScreen to true");
+ g_hdb->_ai->_laserOnScreen = true;
}
}
break;
@@ -1313,7 +1313,7 @@ void aiDiverterDraw(AIEntity *e, int mx, int my) {
onScreen += g_hdb->_ai->_gfxLaserbeamUDTop[frame]->drawMasked(e->x - mx, i * kTileHeight - my);
if (onScreen) {
g_hdb->_sound->playSoundEx(SND_LASER_LOOP, kLaserChannel, true);
- warning("STUB: Set Laser onscreen to true");
+ g_hdb->_ai->_laserOnScreen = true;
}
} else {
for (i = e->value1 - 1; i > e->value2; i--)
@@ -1321,7 +1321,7 @@ void aiDiverterDraw(AIEntity *e, int mx, int my) {
onScreen += g_hdb->_ai->_gfxLaserbeamLRRight[frame]->drawMasked(i * kTileWidth - mx, e->y - my);
if (onScreen) {
g_hdb->_sound->playSoundEx(SND_LASER_LOOP, kLaserChannel, true);
- warning("STUB: Set Laser onscreen to true");
+ g_hdb->_ai->_laserOnScreen = true;
}
}
break;
@@ -1332,7 +1332,7 @@ void aiDiverterDraw(AIEntity *e, int mx, int my) {
onScreen += g_hdb->_ai->_gfxLaserbeamUDBottom[frame]->drawMasked(e->x - mx, i * kTileHeight - my);
if (onScreen) {
g_hdb->_sound->playSoundEx(SND_LASER_LOOP, kLaserChannel, true);
- warning("STUB: Set Laser onscreen to true");
+ g_hdb->_ai->_laserOnScreen = true;
}
} else {
for (i = e->value1 - 1; i > e->value2; i--)
@@ -1340,7 +1340,7 @@ void aiDiverterDraw(AIEntity *e, int mx, int my) {
onScreen += g_hdb->_ai->_gfxLaserbeamLRRight[frame]->drawMasked(i * kTileWidth - mx, e->y - my);
if (onScreen) {
g_hdb->_sound->playSoundEx(SND_LASER_LOOP, kLaserChannel, true);
- warning("STUB: Set Laser onscreen to true");
+ g_hdb->_ai->_laserOnScreen = true;
}
}
break;
@@ -1351,7 +1351,7 @@ void aiDiverterDraw(AIEntity *e, int mx, int my) {
onScreen += g_hdb->_ai->_gfxLaserbeamUDBottom[frame]->drawMasked(e->x - mx, i * kTileHeight - my);
if (onScreen) {
g_hdb->_sound->playSoundEx(SND_LASER_LOOP, kLaserChannel, true);
- warning("STUB: Set Laser onscreen to true");
+ g_hdb->_ai->_laserOnScreen = true;
}
} else {
for (i = e->value1 + 1; i < e->value2; i++)
@@ -1359,7 +1359,7 @@ void aiDiverterDraw(AIEntity *e, int mx, int my) {
onScreen += g_hdb->_ai->_gfxLaserbeamLRLeft[frame]->drawMasked(i * kTileWidth - mx, e->y - my);
if (onScreen) {
g_hdb->_sound->playSoundEx(SND_LASER_LOOP, kLaserChannel, true);
- warning("STUB: Set Laser onscreen to true");
+ g_hdb->_ai->_laserOnScreen = true;
}
}
break;
diff --git a/engines/hdb/ai-funcs.cpp b/engines/hdb/ai-funcs.cpp
index ed5183fb27..fd44017e5e 100644
--- a/engines/hdb/ai-funcs.cpp
+++ b/engines/hdb/ai-funcs.cpp
@@ -923,7 +923,7 @@ void AI::animateEntity(AIEntity *e) {
e->touchpWait = kPlayerTouchPWait;
}
}
- warning("STUB: animateEntity: Set laser_rescan to true");
+ _laserRescan = true;
break;
default:
debug(9, "animateEntity: Unintended Type");
@@ -1157,7 +1157,8 @@ void AI::animateEntity(AIEntity *e) {
case AI_MAGIC_EGG:
case AI_ICE_BLOCK:
case AI_DIVERTER:
- warning("STUB: animateEntity: Set _laserRescan to true");
+ if (g_hdb->_map->laserBeamExist(e->tileX, e->tileY))
+ _laserRescan = true;
break;
default:
debug(9, "animateEntity: Unintended State");
diff --git a/engines/hdb/ai-init.cpp b/engines/hdb/ai-init.cpp
index 075096cd46..85fd370e60 100644
--- a/engines/hdb/ai-init.cpp
+++ b/engines/hdb/ai-init.cpp
@@ -786,6 +786,9 @@ bool AI::init() {
// laser beam
_gfxLaserbeamUD[0] = _gfxLaserbeamUD[1] = _gfxLaserbeamLR[0] = _gfxLaserbeamLR[1] = NULL;
+ _laserRescan = false;
+ _laserOnScreen = false;
+
_dummyPlayer.type = AI_GUY;
_dummyLaser.type = AI_LASERBEAM;
strcpy(_dummyPlayer.entityName, "Virtual Player");
diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h
index 098b4d3ab0..be55122754 100644
--- a/engines/hdb/ai.h
+++ b/engines/hdb/ai.h
@@ -1209,6 +1209,9 @@ public:
TeleInfo _teleporters[kMaxTeleporters];
int _numTeleporters;
+ // Virtual Player
+ AIEntity _dummyPlayer, _dummyLaser;
+ bool _laserRescan, _laserOnScreen;
AutoAction _autoActions[kMaxAutoActions];
@@ -1223,9 +1226,6 @@ public:
Common::Array<HereT *> *_hereList;
Common::Array<Trigger *> *_triggerList;
- // Virtual Player
- AIEntity _dummyPlayer, _dummyLaser;
-
char _youGotBuffer[32]; // For printing the text of entities that are removed
// Cinematic Variables