aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/titanic/events.cpp17
-rw-r--r--engines/titanic/star_control/star_control.h5
-rw-r--r--engines/titanic/star_control/star_view.cpp3
-rw-r--r--engines/titanic/star_control/star_view.h10
4 files changed, 28 insertions, 7 deletions
diff --git a/engines/titanic/events.cpp b/engines/titanic/events.cpp
index f554796d09..f946f7b214 100644
--- a/engines/titanic/events.cpp
+++ b/engines/titanic/events.cpp
@@ -27,6 +27,7 @@
#include "titanic/events.h"
#include "titanic/titanic.h"
#include "titanic/main_game_window.h"
+#include "titanic/star_control/star_control.h"
namespace Titanic {
@@ -108,10 +109,22 @@ void Events::pollEventsAndWait() {
pollEvents();
g_system->delayMillis(10);
- // Regularly update the sound mixer
CGameManager *gameManager = g_vm->_window->_gameManager;
- if (gameManager)
+ if (gameManager) {
+ // Regularly update the sound mixer
gameManager->_sound.updateMixer();
+
+ // WORKAROUND: If in the Star Control view, update the camera
+ // frequently, to accomodate that the original had a higher
+ // draw rate than the ScummVM implementation does
+ CViewItem *view = gameManager->getView();
+ if (view->getFullViewName() == "Bridge.Node 4.N") {
+ CStarControl *starControl = dynamic_cast<CStarControl *>(
+ view->findChildInstanceOf(CStarControl::_type));
+ if (starControl && starControl->_visible)
+ starControl->updateCamera();
+ }
+ }
}
bool Events::checkForNextFrameCounter() {
diff --git a/engines/titanic/star_control/star_control.h b/engines/titanic/star_control/star_control.h
index 8013eed850..90de2eb3eb 100644
--- a/engines/titanic/star_control/star_control.h
+++ b/engines/titanic/star_control/star_control.h
@@ -97,6 +97,11 @@ public:
* Called when a star destination is set
*/
void starDestinationSet();
+
+ /**
+ * Updates the camerea for the star view
+ */
+ void updateCamera() { _view.updateCamera(); }
};
} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp
index f1adaf640d..a5028374ff 100644
--- a/engines/titanic/star_control/star_view.cpp
+++ b/engines/titanic/star_control/star_view.cpp
@@ -256,6 +256,9 @@ void CStarView::resetPosition() {
}
bool CStarView::updateCamera() {
+ if (_fader.isActive() || _showingPhoto)
+ return false;
+
if (_videoSurface) {
CErrorCode errorCode;
_camera.updatePosition(&errorCode);
diff --git a/engines/titanic/star_control/star_view.h b/engines/titanic/star_control/star_view.h
index 7e3f1d084a..204c02336c 100644
--- a/engines/titanic/star_control/star_view.h
+++ b/engines/titanic/star_control/star_view.h
@@ -50,11 +50,6 @@ private:
bool _field218;
bool _showingPhoto;
private:
- /**
- * Updates the camera, allowing for movement
- */
- bool updateCamera();
-
void fn18(CStarCamera *camera);
void fn19(int v);
@@ -99,6 +94,11 @@ public:
void draw(CScreenManager *screenManager);
/**
+ * Updates the camera, allowing for movement
+ */
+ bool updateCamera();
+
+ /**
* Handles mouse down messages
*/
bool MouseButtonDownMsg(int unused, const Point &pt);