[Scummvm-git-logs] scummvm master -> b458dabc50dd2e57d82353a9d4f94acffaa6b265
neuromancer
noreply at scummvm.org
Sat May 11 15:11:24 UTC 2024
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:
29000675cd FREESCAPE: make castle movement closer to the original
0fdc05fdda FREESCAPE: refactoring of key handling to allow better control of which keys are used by each game
b458dabc50 FREESCAPE: added missing key in eclipse
Commit: 29000675cd1559322aa9dc14a5a53140231eaf63
https://github.com/scummvm/scummvm/commit/29000675cd1559322aa9dc14a5a53140231eaf63
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-05-11T17:11:11+02:00
Commit Message:
FREESCAPE: make castle movement closer to the original
Changed paths:
engines/freescape/games/castle/castle.cpp
diff --git a/engines/freescape/games/castle/castle.cpp b/engines/freescape/games/castle/castle.cpp
index 4b74301c2b1..acb33cee580 100644
--- a/engines/freescape/games/castle/castle.cpp
+++ b/engines/freescape/games/castle/castle.cpp
@@ -34,6 +34,12 @@ CastleEngine::CastleEngine(OSystem *syst, const ADGameDescription *gd) : Freesca
_playerHeights.push_back(48);
_playerHeight = _playerHeights[_playerHeightNumber];
+ _playerSteps.clear();
+ _playerSteps.push_back(1);
+ _playerSteps.push_back(10);
+ _playerSteps.push_back(25);
+ _playerStepIndex = 2;
+
_playerWidth = 8;
_playerDepth = 8;
_stepUpDistance = 32;
Commit: 0fdc05fddad2c3dcfc3c9c2936046eeb4e42c548
https://github.com/scummvm/scummvm/commit/0fdc05fddad2c3dcfc3c9c2936046eeb4e42c548
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-05-11T17:11:11+02:00
Commit Message:
FREESCAPE: refactoring of key handling to allow better control of which keys are used by each game
Changed paths:
engines/freescape/freescape.cpp
engines/freescape/games/castle/castle.cpp
engines/freescape/games/castle/castle.h
engines/freescape/games/dark/dark.cpp
engines/freescape/games/driller/driller.cpp
engines/freescape/games/eclipse/eclipse.cpp
diff --git a/engines/freescape/freescape.cpp b/engines/freescape/freescape.cpp
index 9f9d66bb0c3..d6fff544b5e 100644
--- a/engines/freescape/freescape.cpp
+++ b/engines/freescape/freescape.cpp
@@ -473,27 +473,6 @@ void FreescapeEngine::processInput() {
case Common::KEYCODE_u:
rotate(180, 0);
break;
- case Common::KEYCODE_q:
- rotate(-_angleRotations[_angleRotationIndex], 0);
- break;
- case Common::KEYCODE_w:
- rotate(_angleRotations[_angleRotationIndex], 0);
- break;
- case Common::KEYCODE_s:
- increaseStepSize();
- break;
- case Common::KEYCODE_x:
- decreaseStepSize();
- break;
- case Common::KEYCODE_r:
- if (isEclipse())
- pressedKey(Common::KEYCODE_r);
- else
- rise();
- break;
- case Common::KEYCODE_f:
- lower();
- break;
case Common::KEYCODE_n:
_noClipMode = !_noClipMode;
_flyMode = _noClipMode;
diff --git a/engines/freescape/games/castle/castle.cpp b/engines/freescape/games/castle/castle.cpp
index acb33cee580..cc854fcfb01 100644
--- a/engines/freescape/games/castle/castle.cpp
+++ b/engines/freescape/games/castle/castle.cpp
@@ -180,6 +180,37 @@ void CastleEngine::endGame() {
}
}
+void CastleEngine::pressedKey(const int keycode) {
+ // This code is duplicated in the DrillerEngine::pressedKey (except for the J case)
+ if (keycode == Common::KEYCODE_z) {
+ rotate(-_angleRotations[_angleRotationIndex], 0);
+ } else if (keycode == Common::KEYCODE_x) {
+ rotate(_angleRotations[_angleRotationIndex], 0);
+ } else if (keycode == Common::KEYCODE_s) {
+ // TODO: show score
+ } else if (keycode == Common::KEYCODE_r) {
+ if (_playerHeightNumber == 0)
+ rise();
+ // TODO: raising can fail if there is no room, so the action should fail
+ _playerStepIndex = 1;
+ insertTemporaryMessage(_messagesList[15], _countdown - 2);
+ } else if (keycode == Common::KEYCODE_w) {
+ if (_playerHeightNumber == 0)
+ rise();
+ // TODO: raising can fail if there is no room, so the action should fail
+ _playerStepIndex = 1;
+ insertTemporaryMessage(_messagesList[14], _countdown - 2);
+ } else if (keycode == Common::KEYCODE_c) {
+ if (_playerHeightNumber == 1)
+ lower();
+ _playerStepIndex = 0;
+ insertTemporaryMessage(_messagesList[13], _countdown - 2);
+ } else if (keycode == Common::KEYCODE_f) {
+ _pitch = 0;
+ updateCamera();
+ }
+}
+
void CastleEngine::executePrint(FCLInstruction &instruction) {
uint16 index = instruction._source;
_currentAreaMessages.clear();
diff --git a/engines/freescape/games/castle/castle.h b/engines/freescape/games/castle/castle.h
index 4b3474b31a7..6c01a2943bf 100644
--- a/engines/freescape/games/castle/castle.h
+++ b/engines/freescape/games/castle/castle.h
@@ -34,6 +34,7 @@ public:
void loadAssetsAmigaDemo() override;
void drawDOSUI(Graphics::Surface *surface) override;
+ void pressedKey(const int keycode) override;
void executePrint(FCLInstruction &instruction) override;
void gotoArea(uint16 areaID, int entranceID) override;
diff --git a/engines/freescape/games/dark/dark.cpp b/engines/freescape/games/dark/dark.cpp
index 4e092dbe8f0..379b17e5d1f 100644
--- a/engines/freescape/games/dark/dark.cpp
+++ b/engines/freescape/games/dark/dark.cpp
@@ -562,7 +562,20 @@ void DarkEngine::gotoArea(uint16 areaID, int entranceID) {
}
void DarkEngine::pressedKey(const int keycode) {
- if (keycode == Common::KEYCODE_j) {
+ // This code is duplicated in the DrillerEngine::pressedKey (except for the J case)
+ if (keycode == Common::KEYCODE_q) {
+ rotate(-_angleRotations[_angleRotationIndex], 0);
+ } else if (keycode == Common::KEYCODE_w) {
+ rotate(_angleRotations[_angleRotationIndex], 0);
+ } else if (keycode == Common::KEYCODE_s) {
+ increaseStepSize();
+ } else if (keycode == Common::KEYCODE_x) {
+ decreaseStepSize();
+ } else if (keycode == Common::KEYCODE_r) {
+ rise();
+ } else if (keycode == Common::KEYCODE_f) {
+ lower();
+ } else if (keycode == Common::KEYCODE_j) {
_flyMode = !_flyMode;
//debugC(1, kFreescapeDebugMedia, "raw %d, hz: %f", freq, hzFreq);
diff --git a/engines/freescape/games/driller/driller.cpp b/engines/freescape/games/driller/driller.cpp
index 53178829839..82df29c8fbf 100644
--- a/engines/freescape/games/driller/driller.cpp
+++ b/engines/freescape/games/driller/driller.cpp
@@ -395,7 +395,19 @@ Math::Vector3d getProjectionToPlane(const Math::Vector3d &vect, const Math::Vect
}
void DrillerEngine::pressedKey(const int keycode) {
- if (keycode == Common::KEYCODE_d) {
+ if (keycode == Common::KEYCODE_q) {
+ rotate(-_angleRotations[_angleRotationIndex], 0);
+ } else if (keycode == Common::KEYCODE_w) {
+ rotate(_angleRotations[_angleRotationIndex], 0);
+ } else if (keycode == Common::KEYCODE_s) {
+ increaseStepSize();
+ } else if (keycode == Common::KEYCODE_x) {
+ decreaseStepSize();
+ } else if (keycode == Common::KEYCODE_r) {
+ rise();
+ } else if (keycode == Common::KEYCODE_f) {
+ lower();
+ } else if (keycode == Common::KEYCODE_d) {
if (isDOS() && isDemo()) // No support for drilling here yet
return;
clearTemporalMessages();
diff --git a/engines/freescape/games/eclipse/eclipse.cpp b/engines/freescape/games/eclipse/eclipse.cpp
index 13ebc7c3bdf..e8f6b7ecf96 100644
--- a/engines/freescape/games/eclipse/eclipse.cpp
+++ b/engines/freescape/games/eclipse/eclipse.cpp
@@ -348,7 +348,22 @@ void EclipseEngine::drawInfoMenu() {
}
void EclipseEngine::pressedKey(const int keycode) {
- if (keycode == Common::KEYCODE_r) {
+ if (keycode == Common::KEYCODE_q) {
+ rotate(-_angleRotations[_angleRotationIndex], 0);
+ } else if (keycode == Common::KEYCODE_w) {
+ rotate(_angleRotations[_angleRotationIndex], 0);
+ } else if (keycode == Common::KEYCODE_s) {
+ increaseStepSize();
+ } else if (keycode == Common::KEYCODE_x) {
+ decreaseStepSize();
+ } else if (keycode == Common::KEYCODE_h) {
+ if (_playerHeightNumber == 0)
+ rise();
+ else if (_playerHeightNumber == 1)
+ lower();
+ else
+ error("Invalid player height index: %d", _playerHeightNumber);
+ } else if (keycode == Common::KEYCODE_r) {
if (_currentArea->getAreaID() == 1) {
playSoundFx(3, false);
if (_temporaryMessages.empty())
Commit: b458dabc50dd2e57d82353a9d4f94acffaa6b265
https://github.com/scummvm/scummvm/commit/b458dabc50dd2e57d82353a9d4f94acffaa6b265
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-05-11T17:11:11+02:00
Commit Message:
FREESCAPE: added missing key in eclipse
Changed paths:
engines/freescape/games/eclipse/eclipse.cpp
diff --git a/engines/freescape/games/eclipse/eclipse.cpp b/engines/freescape/games/eclipse/eclipse.cpp
index e8f6b7ecf96..801f72a4847 100644
--- a/engines/freescape/games/eclipse/eclipse.cpp
+++ b/engines/freescape/games/eclipse/eclipse.cpp
@@ -374,6 +374,9 @@ void EclipseEngine::pressedKey(const int keycode) {
insertTemporaryMessage(_messagesList[7], _countdown - 2);
_countdown = _countdown - 5;
}
+ } else if (keycode == Common::KEYCODE_f) {
+ _pitch = 0;
+ updateCamera();
}
}
More information about the Scummvm-git-logs
mailing list