[Scummvm-git-logs] scummvm master -> e830ddbc70c84060de2cb78e315990850e504b06
dreammaster
dreammaster at scummvm.org
Mon Aug 7 02:38:10 CEST 2017
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
e830ddbc70 TITANIC: Bring movement rates in the starfield closer to the original
Commit: e830ddbc70c84060de2cb78e315990850e504b06
https://github.com/scummvm/scummvm/commit/e830ddbc70c84060de2cb78e315990850e504b06
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-08-06T20:36:28-04:00
Commit Message:
TITANIC: Bring movement rates in the starfield closer to the original
The original updated the camera during the general scene drawing,
which was done at a much higher rate than I wanted for the ScummVM
implementation. So I've added this workaround to update the camera
every 10ms when the player is in the star control scene. This gives
it a comparible rate of movement to the original.
Changed paths:
engines/titanic/events.cpp
engines/titanic/star_control/star_control.h
engines/titanic/star_control/star_view.cpp
engines/titanic/star_control/star_view.h
diff --git a/engines/titanic/events.cpp b/engines/titanic/events.cpp
index f554796..f946f7b 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 8013eed..90de2eb 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 f1adaf6..a502837 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 7e3f1d0..204c023 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);
More information about the Scummvm-git-logs
mailing list