[Scummvm-git-logs] scummvm master -> 7e41d4ba2b5b1bc9d297e08952980cc8a0195c94
neuromancer
noreply at scummvm.org
Sun Jan 8 18:36:45 UTC 2023
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
2564442fe6 FREESCAPE: use _mouseSensitivity and removed old code
c2c656d041 FREESCAPE: fix areaView for Driller DOS demo
7e41d4ba2b FREESCAPE: make sure crossair does not leave the view area in shooting mode
Commit: 2564442fe69875a6c9e04bbade2c74cf978f77f4
https://github.com/scummvm/scummvm/commit/2564442fe69875a6c9e04bbade2c74cf978f77f4
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-01-08T15:29:18-03:00
Commit Message:
FREESCAPE: use _mouseSensitivity and removed old code
Changed paths:
engines/freescape/freescape.cpp
engines/freescape/freescape.h
diff --git a/engines/freescape/freescape.cpp b/engines/freescape/freescape.cpp
index fe83506056c..6d9f5bb9500 100644
--- a/engines/freescape/freescape.cpp
+++ b/engines/freescape/freescape.cpp
@@ -87,7 +87,6 @@ FreescapeEngine::FreescapeEngine(OSystem *syst, const ADGameDescription *gd)
_yaw = 0;
_pitch = 0;
_upVector = Math::Vector3d(0, 1, 0);
- _movementSpeed = 1.5f;
_mouseSensitivity = 0.25f;
_demoMode = false;
_shootMode = false;
@@ -460,7 +459,7 @@ void FreescapeEngine::processInput() {
break;
}
- rotate(event.relMouse.x / 10., event.relMouse.y / 10.);
+ rotate(event.relMouse.x * _mouseSensitivity, event.relMouse.y * _mouseSensitivity);
break;
case Common::EVENT_LBUTTONDOWN:
@@ -621,31 +620,6 @@ void FreescapeEngine::rotate(float xoffset, float yoffset) {
updateCamera();
}
-void FreescapeEngine::rotate(Common::Point lastMousePos, Common::Point mousePos) {
- if (lastMousePos != Common::Point(0, 0)) {
- float xoffset = mousePos.x - lastMousePos.x;
- float yoffset = mousePos.y - lastMousePos.y;
-
- xoffset *= _mouseSensitivity;
- yoffset *= _mouseSensitivity;
-
- _yaw -= xoffset;
- _pitch += yoffset;
-
- // Make sure that when pitch is out of bounds, screen doesn't get flipped
- if (_pitch > 360.0f)
- _pitch -= 360.0f;
- if (_pitch < 0.0f)
- _pitch += 360.0f;
-
- if (_yaw > 360.0f)
- _yaw -= 360.0f;
- if (_yaw < 0.0f)
- _yaw += 360.0f;
- }
- updateCamera();
-}
-
void FreescapeEngine::updateCamera() {
_cameraFront = directionToVector(_pitch, _yaw);
// _right = _front x _up;
diff --git a/engines/freescape/freescape.h b/engines/freescape/freescape.h
index c78ed219fc0..6605a9db304 100644
--- a/engines/freescape/freescape.h
+++ b/engines/freescape/freescape.h
@@ -188,7 +188,6 @@ public:
bool tryStepDown(Math::Vector3d currentPosition);
bool _hasFallen;
- void rotate(Common::Point lastMousePos, Common::Point mousePos);
void rotate(float xoffset, float yoffset);
// Input state
float _lastFrame;
@@ -209,7 +208,6 @@ public:
// Camera options
Common::Point _crossairPosition;
float _mouseSensitivity;
- float _movementSpeed;
Math::Vector3d _upVector; // const
Math::Vector3d _cameraFront, _cameraRight;
// Spacial attributes
Commit: c2c656d0416e3c6379e1ee2cca3347a4c16b0077
https://github.com/scummvm/scummvm/commit/c2c656d0416e3c6379e1ee2cca3347a4c16b0077
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-01-08T15:29:18-03:00
Commit Message:
FREESCAPE: fix areaView for Driller DOS demo
Changed paths:
engines/freescape/games/driller.cpp
diff --git a/engines/freescape/games/driller.cpp b/engines/freescape/games/driller.cpp
index 8513c9e9700..d30288a79f4 100644
--- a/engines/freescape/games/driller.cpp
+++ b/engines/freescape/games/driller.cpp
@@ -332,6 +332,7 @@ void DrillerEngine::loadAssetsDemo() {
loadSoundsFx(&file, 0, 25);
} else if (isDOS()) {
_renderMode = Common::kRenderCGA; // DOS demos is CGA only
+ _viewArea = Common::Rect(36, 16, 284, 117); // correct view area
_gfx->_renderMode = _renderMode;
loadBundledImages();
file.open("d2");
Commit: 7e41d4ba2b5b1bc9d297e08952980cc8a0195c94
https://github.com/scummvm/scummvm/commit/7e41d4ba2b5b1bc9d297e08952980cc8a0195c94
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-01-08T15:29:18-03:00
Commit Message:
FREESCAPE: make sure crossair does not leave the view area in shooting mode
Changed paths:
engines/freescape/freescape.cpp
diff --git a/engines/freescape/freescape.cpp b/engines/freescape/freescape.cpp
index 6d9f5bb9500..a9c0c277296 100644
--- a/engines/freescape/freescape.cpp
+++ b/engines/freescape/freescape.cpp
@@ -421,11 +421,12 @@ void FreescapeEngine::processInput() {
break;
case Common::KEYCODE_SPACE:
_shootMode = !_shootMode;
+ centerCrossair();
if (!_shootMode) {
g_system->lockMouse(true);
- centerCrossair();
} else {
g_system->lockMouse(false);
+ g_system->warpMouse(_crossairPosition.x, _crossairPosition.y);
}
break;
case Common::KEYCODE_i:
@@ -456,6 +457,14 @@ void FreescapeEngine::processInput() {
if (_shootMode) {
_crossairPosition = mousePos;
+ if (mousePos.x < _viewArea.left)
+ g_system->warpMouse(_viewArea.left + 1, _crossairPosition.y);
+ else if (mousePos.x > _viewArea.right)
+ g_system->warpMouse(_viewArea.right - 1, _crossairPosition.y);
+ else if (mousePos.y < _viewArea.top)
+ g_system->warpMouse(_crossairPosition.x, _viewArea.top + 1);
+ else if (mousePos.y > _viewArea.bottom)
+ g_system->warpMouse(_crossairPosition.x, _viewArea.bottom - 1);
break;
}
More information about the Scummvm-git-logs
mailing list