[Scummvm-git-logs] scummvm master -> d28712dcf40b290b1e1a5fd407afd5d47c5d281a
neuromancer
noreply at scummvm.org
Tue Jan 9 08:53:38 UTC 2024
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
a17805e2c9 FREESCAPE: ignore key repetition of certain special keys
f6445a17c6 FREESCAPE: movement fixes for eclipse (and other games)
c99bf4e6d4 FREESCAPE: purge key repetition in event manager wrapper
d28712dcf4 HYPNO: avoid using cursor palettes in wet
Commit: a17805e2c9ee981373cac82ebb729525c23c16a4
https://github.com/scummvm/scummvm/commit/a17805e2c9ee981373cac82ebb729525c23c16a4
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-01-09T09:50:16+01:00
Commit Message:
FREESCAPE: ignore key repetition of certain special keys
Changed paths:
engines/freescape/events.cpp
diff --git a/engines/freescape/events.cpp b/engines/freescape/events.cpp
index dd74d28c9a9..68685fb9c88 100644
--- a/engines/freescape/events.cpp
+++ b/engines/freescape/events.cpp
@@ -37,12 +37,18 @@ bool EventManagerWrapper::pollEvent(Common::Event &event) {
if (gotEvent) {
switch (event.type) {
case Common::EVENT_KEYDOWN:
+ if (event.kbd == Common::KEYCODE_ESCAPE || event.kbd == Common::KEYCODE_F5)
+ break;
+
// init continuous event stream
_currentKeyDown = event.kbd;
_keyRepeatTime = time + kKeyRepeatInitialDelay;
break;
case Common::EVENT_KEYUP:
+ if (event.kbd == Common::KEYCODE_ESCAPE || event.kbd == Common::KEYCODE_F5)
+ break;
+
if (event.kbd.keycode == _currentKeyDown.keycode) {
// Only stop firing events if it's the current key
_currentKeyDown.keycode = Common::KEYCODE_INVALID;
Commit: f6445a17c6b17ea1e576c641ff30d7c6a0367c35
https://github.com/scummvm/scummvm/commit/f6445a17c6b17ea1e576c641ff30d7c6a0367c35
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-01-09T09:50:16+01:00
Commit Message:
FREESCAPE: movement fixes for eclipse (and other games)
Changed paths:
engines/freescape/area.cpp
engines/freescape/games/eclipse/eclipse.cpp
engines/freescape/movement.cpp
diff --git a/engines/freescape/area.cpp b/engines/freescape/area.cpp
index 2871c2d2cb9..548f94d402b 100644
--- a/engines/freescape/area.cpp
+++ b/engines/freescape/area.cpp
@@ -311,10 +311,9 @@ Math::Vector3d Area::resolveCollisions(const Math::Vector3d &lastPosition_, cons
}
}
position = lastPosition + distance * direction + epsilon * normal;
- if (distance >= 1.0)
+ if (i > 1 || distance >= 1.0)
break;
i++;
- assert(i <= 5);
}
return position;
}
diff --git a/engines/freescape/games/eclipse/eclipse.cpp b/engines/freescape/games/eclipse/eclipse.cpp
index ce8a8df8f4d..4e480feb56b 100644
--- a/engines/freescape/games/eclipse/eclipse.cpp
+++ b/engines/freescape/games/eclipse/eclipse.cpp
@@ -57,7 +57,7 @@ EclipseEngine::EclipseEngine(OSystem *syst, const ADGameDescription *gd) : Frees
initZX();
_playerHeightNumber = 1;
- _playerHeights.push_back(16);
+ _playerHeights.push_back(32);
_playerHeights.push_back(48);
_playerHeight = _playerHeights[_playerHeightNumber];
diff --git a/engines/freescape/movement.cpp b/engines/freescape/movement.cpp
index 576f6d39ed1..347ada7fbe3 100644
--- a/engines/freescape/movement.cpp
+++ b/engines/freescape/movement.cpp
@@ -416,7 +416,7 @@ bool FreescapeEngine::runCollisionConditions(Math::Vector3d const lastPosition,
Math::Vector3d direction = newPosition - lastPosition;
direction.normalize();
- ray = Math::Ray(newPosition, direction);
+ ray = Math::Ray(lastPosition, direction);
collided = _currentArea->checkCollisionRay(ray, 45);
if (collided) {
gobj = (GeometricObject *)collided;
Commit: c99bf4e6d408ce67903b501ceef6b77654fc20a2
https://github.com/scummvm/scummvm/commit/c99bf4e6d408ce67903b501ceef6b77654fc20a2
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-01-09T09:50:16+01:00
Commit Message:
FREESCAPE: purge key repetition in event manager wrapper
Changed paths:
engines/freescape/events.cpp
diff --git a/engines/freescape/events.cpp b/engines/freescape/events.cpp
index 68685fb9c88..ffef850f65f 100644
--- a/engines/freescape/events.cpp
+++ b/engines/freescape/events.cpp
@@ -78,6 +78,7 @@ bool EventManagerWrapper::pollEvent(Common::Event &event) {
void EventManagerWrapper::purgeKeyboardEvents() {
_delegate->purgeKeyboardEvents();
+ _currentKeyDown.keycode = Common::KEYCODE_INVALID;
}
void EventManagerWrapper::purgeMouseEvents() {
Commit: d28712dcf40b290b1e1a5fd407afd5d47c5d281a
https://github.com/scummvm/scummvm/commit/d28712dcf40b290b1e1a5fd407afd5d47c5d281a
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-01-09T09:50:16+01:00
Commit Message:
HYPNO: avoid using cursor palettes in wet
Changed paths:
A engines/hypno/wet/cursors.cpp
engines/hypno/hypno.h
engines/hypno/module.mk
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index 75219c10d57..20fb2a48015 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -167,9 +167,9 @@ public:
uint32 _defaultCursorIdx;
void disableCursor();
void defaultCursor();
- void changeCursor(const Common::String &cursor, uint32 n, bool centerCursor = false);
- void changeCursor(const Common::String &cursor);
- void changeCursor(const Graphics::Surface &entry, byte *palette, bool centerCursor = false);
+ virtual void changeCursor(const Common::String &cursor, uint32 n, bool centerCursor = false);
+ virtual void changeCursor(const Common::String &cursor);
+ virtual void changeCursor(const Graphics::Surface &entry, byte *palette, bool centerCursor = false);
// Actions
virtual void runMenu(Hotspots *hs, bool only_menu = false);
@@ -392,6 +392,7 @@ public:
void loadFonts() override;
void drawString(const Filename &name, const Common::String &str, int x, int y, int w, uint32 c) override;
+ void changeCursor(const Common::String &cursor) override;
void showCredits() override;
bool clickedSecondaryShoot(const Common::Point &mousePos) override;
diff --git a/engines/hypno/module.mk b/engines/hypno/module.mk
index c6f7b9eccea..d47ee35c31f 100644
--- a/engines/hypno/module.mk
+++ b/engines/hypno/module.mk
@@ -22,6 +22,7 @@ MODULE_OBJS := \
spider/talk.o \
video.o \
wet/arcade.o \
+ wet/cursors.o \
wet/hard.o \
wet/wet.o
diff --git a/engines/hypno/wet/cursors.cpp b/engines/hypno/wet/cursors.cpp
new file mode 100644
index 00000000000..c9a3778f364
--- /dev/null
+++ b/engines/hypno/wet/cursors.cpp
@@ -0,0 +1,119 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "graphics/cursorman.h"
+
+#include "hypno/hypno.h"
+
+namespace Hypno {
+
+static const byte MOUSECURSOR_SCI[] = {
+ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 3, 3, 1, 0, 0, 0, 0, 0, 0, 0,
+ 1, 3, 3, 3, 1, 0, 0, 0, 0, 0, 0,
+ 1, 3, 3, 3, 3, 1, 0, 0, 0, 0, 0,
+ 1, 3, 3, 3, 3, 3, 1, 0, 0, 0, 0,
+ 1, 3, 3, 3, 3, 3, 3, 1, 0, 0, 0,
+ 1, 3, 3, 3, 3, 3, 3, 3, 1, 0, 0,
+ 1, 3, 3, 3, 3, 3, 3, 3, 3, 1, 0,
+ 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1,
+ 1, 3, 3, 3, 3, 3, 1, 0, 0, 0, 0,
+ 1, 3, 1, 0, 1, 3, 3, 1, 0, 0, 0,
+ 1, 1, 0, 0, 1, 3, 3, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 3, 3, 1, 0, 0,
+ 0, 0, 0, 0, 0, 1, 3, 3, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1, 3, 3, 1, 0};
+
+static const byte circleCursor[] = {
+ 0, 0, 0, 0, 250, 250, 250, 250, 250, 0, 0, 0, 0,
+ 0, 0, 250, 250, 0, 0, 0, 0, 0, 250, 250, 0, 0,
+ 0, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 0,
+ 0, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 0,
+ 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250,
+ 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250,
+ 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250,
+ 0, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 0,
+ 0, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 0,
+ 0, 0, 250, 250, 0, 0, 0, 0, 0, 250, 250, 0, 0,
+ 0, 0, 0, 0, 250, 250, 250, 250, 250, 0, 0, 0, 0};
+
+static const byte targetCursor[] = {
+ 0, 0, 0, 252, 252, 252, 252, 252, 252, 252, 252, 252, 0, 0, 0,
+ 0, 0, 252, 0, 0, 250, 250, 250, 250, 250, 0, 0, 252, 0, 0,
+ 0, 252, 0, 250, 250, 0, 0, 0, 0, 0, 250, 250, 0, 252, 0,
+ 252, 0, 250, 0, 0, 252, 252, 252, 252, 252, 0, 0, 250, 0, 252,
+ 252, 0, 250, 0, 252, 0, 0, 0, 0, 0, 252, 0, 250, 0, 252,
+ 252, 250, 0, 252, 0, 0, 0, 0, 0, 0, 0, 252, 0, 250, 252,
+ 252, 250, 0, 252, 0, 0, 0, 0, 0, 0, 0, 252, 0, 250, 252,
+ 252, 250, 0, 252, 0, 0, 0, 0, 0, 0, 0, 252, 0, 250, 252,
+ 252, 0, 250, 0, 252, 0, 0, 0, 0, 0, 252, 0, 250, 0, 252,
+ 252, 0, 250, 0, 0, 252, 252, 252, 252, 252, 0, 0, 250, 0, 252,
+ 0, 252, 0, 250, 250, 0, 0, 0, 0, 0, 250, 250, 0, 252, 0,
+ 0, 0, 252, 0, 0, 250, 250, 250, 250, 250, 0, 0, 252, 0, 0,
+ 0, 0, 0, 252, 252, 252, 252, 252, 252, 252, 252, 252, 0, 0, 0};
+
+static const byte crosshairCursor[] = {
+ 0, 0, 0, 0, 0, 0, 0, 250, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 250, 250, 250, 250, 250, 0, 0, 0, 0, 0,
+ 0, 0, 0, 250, 250, 0, 0, 250, 0, 0, 250, 250, 0, 0, 0,
+ 0, 0, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 0, 0,
+ 0, 0, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 0, 0,
+ 0, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 0,
+ 250, 250, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 250, 250,
+ 0, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 0,
+ 0, 0, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 0, 0,
+ 0, 0, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 0, 0,
+ 0, 0, 0, 250, 250, 0, 0, 250, 0, 0, 250, 250, 0, 0, 0,
+ 0, 0, 0, 0, 0, 250, 250, 250, 250, 250, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 250, 0, 0, 0, 0, 0, 0, 0};
+
+struct CursorTable {
+ const char *name;
+ const void *buf;
+ int w;
+ int h;
+ int hotspotX;
+ int hotspotY;
+};
+
+static const CursorTable cursorTable[] = {
+ {"default", MOUSECURSOR_SCI, 11, 16, 0, 0},
+ {"arcade", circleCursor, 13, 11, 7, 5},
+ {"target", targetCursor, 15, 13, 8, 6},
+ {"crosshair", crosshairCursor, 15, 13, 8, 6},
+ {nullptr, nullptr, 0, 0, 0, 0}};
+
+void WetEngine::changeCursor(const Common::String &cursor) {
+ const CursorTable *entry = cursorTable;
+ while (entry->name) {
+ if (cursor == entry->name)
+ break;
+ entry++;
+ }
+ assert(entry->name);
+
+ CursorMan.replaceCursor(entry->buf, entry->w, entry->h, entry->hotspotX, entry->hotspotY, 0);
+ CursorMan.showMouse(true);
+}
+
+} // End of namespace Hypno
+
More information about the Scummvm-git-logs
mailing list