[Scummvm-git-logs] scummvm master -> ea0580506e13376b30adb96dcef262dff7bdda7e

neuromancer noreply at scummvm.org
Thu Aug 3 19:57:12 UTC 2023


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
81d854826d FREESCAPE: collision and message-related fixes affecting dark
ea0580506e FREESCAPE: added basic keymapping for all the games


Commit: 81d854826defea298567f45260329f44b3b17854
    https://github.com/scummvm/scummvm/commit/81d854826defea298567f45260329f44b3b17854
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-08-03T21:52:57+02:00

Commit Message:
FREESCAPE: collision and message-related fixes affecting dark

Changed paths:
    engines/freescape/games/dark/dark.cpp
    engines/freescape/movement.cpp


diff --git a/engines/freescape/games/dark/dark.cpp b/engines/freescape/games/dark/dark.cpp
index f9947f6e668..2794ce40476 100644
--- a/engines/freescape/games/dark/dark.cpp
+++ b/engines/freescape/games/dark/dark.cpp
@@ -413,13 +413,12 @@ void DarkEngine::borderScreen() {
 void DarkEngine::executePrint(FCLInstruction &instruction) {
 	uint16 index = instruction._source - 1;
 	debugC(1, kFreescapeDebugCode, "Printing message %d", index);
-	_currentAreaMessages.clear();
 	if (index > 127) {
 		index = _messagesList.size() - (index - 254) - 2;
 		drawFullscreenMessageAndWait(_messagesList[index]);
 		return;
 	}
-	_currentAreaMessages.push_back(_messagesList[index]);
+	insertTemporaryMessage(_messagesList[index], _countdown - 2);
 }
 
 void DarkEngine::drawFullscreenMessage(Common::String message, uint32 front, Graphics::Surface *surface) {
diff --git a/engines/freescape/movement.cpp b/engines/freescape/movement.cpp
index cd3588cbb06..3cddb7a265b 100644
--- a/engines/freescape/movement.cpp
+++ b/engines/freescape/movement.cpp
@@ -318,7 +318,9 @@ bool FreescapeEngine::runCollisionConditions(Math::Vector3d const lastPosition,
 	bool executed = false;
 	// We need to make sure the bounding box touches the floor so we will expand it and run the collision checking
 	uint tolerance = isCastle() ? 1 : 3;
-	Math::Vector3d v(newPosition.x() - 1, newPosition.y() - _playerHeight - tolerance, newPosition.z() - 1);
+
+	int yDifference = _flyMode ? tolerance : -_playerHeight - tolerance;
+	Math::Vector3d v(newPosition.x() - 1, newPosition.y() + yDifference, newPosition.z() - 1);
 	Math::AABB boundingBox(lastPosition, lastPosition);
 	boundingBox.expand(v);
 


Commit: ea0580506e13376b30adb96dcef262dff7bdda7e
    https://github.com/scummvm/scummvm/commit/ea0580506e13376b30adb96dcef262dff7bdda7e
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-08-03T21:52:57+02:00

Commit Message:
FREESCAPE: added basic keymapping for all the games

Changed paths:
    engines/freescape/freescape.cpp
    engines/freescape/freescape.h
    engines/freescape/metaengine.cpp
    engines/freescape/movement.cpp


diff --git a/engines/freescape/freescape.cpp b/engines/freescape/freescape.cpp
index 912fecf810c..4c0651b96cf 100644
--- a/engines/freescape/freescape.cpp
+++ b/engines/freescape/freescape.cpp
@@ -394,6 +394,7 @@ void FreescapeEngine::processInput() {
 				break;
 			case Common::KEYCODE_KP5:
 			case Common::KEYCODE_KP0:
+			case Common::KEYCODE_0:
 				shoot();
 				break;
 			case Common::KEYCODE_p:
diff --git a/engines/freescape/freescape.h b/engines/freescape/freescape.h
index d29e4dd7c61..15eef320e85 100644
--- a/engines/freescape/freescape.h
+++ b/engines/freescape/freescape.h
@@ -221,6 +221,7 @@ public:
 	bool _flyMode;
 	bool _shootMode;
 	bool _noClipMode;
+	static Common::Array<Common::Keymap *> initKeymaps(const char *target);
 	void processInput();
 	void resetInput();
 	void generateDemoInput();
diff --git a/engines/freescape/metaengine.cpp b/engines/freescape/metaengine.cpp
index f9f50cae7a9..7b501f53dcb 100644
--- a/engines/freescape/metaengine.cpp
+++ b/engines/freescape/metaengine.cpp
@@ -110,6 +110,7 @@ public:
 
 	Common::Error createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const override;
 	void getSavegameThumbnail(Graphics::Surface &thumb) override;
+	Common::KeymapArray initKeymaps(const char *target) const override;
 };
 
 Common::Error FreescapeMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const {
@@ -127,6 +128,10 @@ Common::Error FreescapeMetaEngine::createInstance(OSystem *syst, Engine **engine
 	return Common::kNoError;
 }
 
+Common::KeymapArray FreescapeMetaEngine::initKeymaps(const char *target) const {
+	return Freescape::FreescapeEngine::initKeymaps(target);
+}
+
 void FreescapeMetaEngine::getSavegameThumbnail(Graphics::Surface &thumb) {
 	Freescape::FreescapeEngine *engine = (Freescape::FreescapeEngine *)g_engine;
 	assert(engine->_savedScreen);
diff --git a/engines/freescape/movement.cpp b/engines/freescape/movement.cpp
index 3cddb7a265b..170186ae3a8 100644
--- a/engines/freescape/movement.cpp
+++ b/engines/freescape/movement.cpp
@@ -19,10 +19,81 @@
  *
  */
 
+#include "common/translation.h"
+
+#include "backends/keymapper/action.h"
+#include "backends/keymapper/keymap.h"
+#include "backends/keymapper/standard-actions.h"
+
 #include "freescape/freescape.h"
 
 namespace Freescape {
 
+Common::Array<Common::Keymap *> FreescapeEngine::initKeymaps(const char *target) {
+	Common::Keymap *engineKeyMap = new Common::Keymap(Common::Keymap::kKeymapTypeGame, "freescape", "Freescape game");
+	Common::Action *act;
+
+	act = new Common::Action(Common::kStandardActionMoveUp, _("Up"));
+	act->setKeyEvent(Common::KEYCODE_UP);
+	act->allowKbdRepeats();
+	act->addDefaultInputMapping("JOY_UP");
+	engineKeyMap->addAction(act);
+
+	act = new Common::Action(Common::kStandardActionMoveDown, _("Down"));
+	act->setKeyEvent(Common::KEYCODE_DOWN);
+	act->allowKbdRepeats();
+	act->addDefaultInputMapping("JOY_DOWN");
+	engineKeyMap->addAction(act);
+
+	act = new Common::Action(Common::kStandardActionMoveLeft, _("Strafe Left"));
+	act->setKeyEvent(Common::KEYCODE_LEFT);
+	act->allowKbdRepeats();
+	act->addDefaultInputMapping("JOY_LEFT");
+	engineKeyMap->addAction(act);
+
+	act = new Common::Action(Common::kStandardActionMoveRight, _("Strafe Right"));
+	act->setKeyEvent(Common::KEYCODE_RIGHT);
+	act->allowKbdRepeats();
+	act->addDefaultInputMapping("JOY_RIGHT");
+	engineKeyMap->addAction(act);
+
+	act = new Common::Action("SHOOT", _("Shoot"));
+	act->setKeyEvent(Common::KeyState(Common::KEYCODE_0, '0'));
+	act->allowKbdRepeats();
+	act->setLeftClickEvent();
+	act->addDefaultInputMapping("JOY_A");
+	engineKeyMap->addAction(act);
+
+	act = new Common::Action("RISE", _("Rise/Fly up"));
+	act->setKeyEvent(Common::KeyState(Common::KEYCODE_r, 'r'));
+	act->addDefaultInputMapping("JOY_B");
+	engineKeyMap->addAction(act);
+
+	act = new Common::Action("LOWER", _("Lower/Fly down"));
+	act->setKeyEvent(Common::KeyState(Common::KEYCODE_f, 'f'));
+	engineKeyMap->addAction(act);
+
+	act = new Common::Action("SWITCH", _("Change mode"));
+	act->setKeyEvent(Common::KeyState(Common::KEYCODE_SPACE, Common::ASCII_SPACE));
+	act->addDefaultInputMapping("JOY_X");
+	engineKeyMap->addAction(act);
+
+	act = new Common::Action("ROTL", _("Rotate Left"));
+	act->setKeyEvent(Common::KeyState(Common::KEYCODE_q, 'q'));
+	engineKeyMap->addAction(act);
+
+	act = new Common::Action("ROTR", _("Rotate Right"));
+	act->setKeyEvent(Common::KeyState(Common::KEYCODE_w, 'w'));
+	engineKeyMap->addAction(act);
+
+	act = new Common::Action("MENU", _("Info Menu"));
+	act->setKeyEvent(Common::KeyState(Common::KEYCODE_i, 'i'));
+	act->addDefaultInputMapping("JOY_GUIDE");
+	engineKeyMap->addAction(act);
+
+	return Common::Keymap::arrayOf(engineKeyMap);
+}
+
 Math::AABB createPlayerAABB(Math::Vector3d const position, int playerHeight) {
 	Math::AABB boundingBox(position, position);
 




More information about the Scummvm-git-logs mailing list