[Scummvm-git-logs] scummvm master -> 1e53eb8e9907f126d5f3deaba71674dab11d659d
Scorpeg
noreply at scummvm.org
Fri Nov 13 07:02:14 UTC 2026
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
22f59b7ad7 SCUMM: Add hotspot marker overlay support
fbf85319f1 SCUMM: Suspend hotspots when screen effect in progress
530b944b16 SCUMM: Change hotspot action keymap initialization
1e53eb8e99 SCUMM: Smooth scrolling hotspots for FM-Towns
Commit: 22f59b7ad77bf3f3833a21edc8c96accebe1e82a
https://github.com/scummvm/scummvm/commit/22f59b7ad77bf3f3833a21edc8c96accebe1e82a
Author: Scorp (scorp at mrs.mn)
Date: 2026-11-13T09:54:20+03:00
Commit Message:
SCUMM: Add hotspot marker overlay support
Changed paths:
A engines/scumm/hotspots.cpp
A engines/scumm/hotspots.h
engines/scumm/charset-fontdata.cpp
engines/scumm/charset.h
engines/scumm/input.cpp
engines/scumm/metaengine.cpp
engines/scumm/module.mk
engines/scumm/object.cpp
engines/scumm/scumm.cpp
engines/scumm/scumm.h
diff --git a/engines/scumm/charset-fontdata.cpp b/engines/scumm/charset-fontdata.cpp
index 302bc0e4cec..1a8f7dac697 100644
--- a/engines/scumm/charset-fontdata.cpp
+++ b/engines/scumm/charset-fontdata.cpp
@@ -691,8 +691,6 @@ static const byte specialCharsetData[] = {
0x3C, 0x66, 0x60, 0x60, 0x66, 0x3C, 0x18, 0x38,
};
-#ifdef USE_TTS
-
static const uint16 specialCharactersEncoding[] = {
0x0024, 0x0025, 0x0060, 0x0040, 0xc3bc, 0xc3a4, 0xc39c, 0xc3b6, // $, %, `, @, ü, ä, Ã, ö
0xc384, 0xc396, 0xc39f, 0xc396, 0xc39f, 0xc384, 0xc39c, 0x0020, // Ã, Ã, Ã, Ã, Ã, Ã, Ã, â (replaced with space)
@@ -700,8 +698,6 @@ static const uint16 specialCharactersEncoding[] = {
0xc3b4, 0xc3b9, 0xc3bb, 0xc3a1, 0xc3ac, 0xc3b2 // ô, ù, û, á, ì, ò
};
-#endif
-
CharsetRendererV2::CharsetRendererV2(ScummEngine *vm, Common::Language language)
: CharsetRendererV3(vm) {
@@ -815,8 +811,6 @@ CharsetRendererV2::CharsetRendererV2(ScummEngine *vm, Common::Language language)
#endif
}
-#ifdef USE_TTS
-
Common::U32String CharsetRendererV2::convertText(const Common::String &text, Common::Language language) const {
const byte *map = nullptr;
int mapLen = 0;
@@ -933,8 +927,6 @@ Common::U32String CharsetRendererV2::convertText(const Common::String &text, Com
return result;
}
-#endif
-
CharsetRendererV2::~CharsetRendererV2() {
if (_deleteFontPtr)
delete[] _fontPtr;
diff --git a/engines/scumm/charset.h b/engines/scumm/charset.h
index 7f288d7b4df..11b25981db3 100644
--- a/engines/scumm/charset.h
+++ b/engines/scumm/charset.h
@@ -116,9 +116,7 @@ public:
void saveLoadWithSerializer(Common::Serializer &ser);
-#ifdef USE_TTS
virtual Common::U32String convertText(const Common::String &text, Common::Language language) const { return Common::U32String(text, _vm->getDialogCodePage()); }
-#endif
};
class CharsetRendererCommon : public CharsetRenderer {
@@ -286,9 +284,7 @@ public:
void setCurID(int32 id) override {}
int getCharWidth(uint16 chr) const override { return 8; }
-#ifdef USE_TTS
Common::U32String convertText(const Common::String &text, Common::Language language) const override;
-#endif
};
class CharsetRendererMac : public CharsetRendererCommon {
diff --git a/engines/scumm/hotspots.cpp b/engines/scumm/hotspots.cpp
new file mode 100644
index 00000000000..53706beecd9
--- /dev/null
+++ b/engines/scumm/hotspots.cpp
@@ -0,0 +1,60 @@
+/* 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 "scumm/hotspots.h"
+#include "common/util.h"
+#include "graphics/surface.h"
+
+namespace Scumm {
+using Graphics::Surface;
+using Graphics::PixelFormat;
+
+ScummHotspotRenderer::ScummHotspotRenderer() {
+ Graphics::HotspotStyle style;
+ style.markerSize = 11;
+ style.pointRadius = 6;
+ style.lineThickness = 2;
+ style.labelGap = 4;
+ style.paddingX = 3;
+ style.labelBorder = false;
+ setStyle(style);
+}
+
+void ScummHotspotRenderer::drawMarker(Surface *surface, const Graphics::HotspotInfo &hotspot, int x, int y, const PixelFormat &format, Graphics::MarkerShape shape) {
+ if (shape != Graphics::kMarkerDefault) {
+ HotspotRenderer::drawMarker(surface, hotspot, x, y, format, shape);
+ return;
+ }
+ addDrawRect(Common::Rect(x - _markerSize / 2, y - _markerSize / 2, x + _markerSize / 2 + 1, y + _markerSize / 2 + 1));
+ const int width = surface->w, height = surface->h;
+ const int radius = _markerSize / 2;
+ for (int dy = -radius; dy <= radius; ++dy) {
+ for (int dx = -radius; dx <= radius; ++dx) {
+ if (ABS(dx - dy) > _lineThickness && ABS(dx + dy) > _lineThickness)
+ continue;
+ const int px = x + dx, py = y + dy;
+ if (px >= 0 && px < width && py >= 0 && py < height)
+ blendPixel(surface, px, py, format, 0, 1);
+ }
+ }
+}
+
+} // End of namespace Scumm
diff --git a/engines/scumm/hotspots.h b/engines/scumm/hotspots.h
new file mode 100644
index 00000000000..5a9decbb81a
--- /dev/null
+++ b/engines/scumm/hotspots.h
@@ -0,0 +1,40 @@
+/* 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/>.
+ *
+ */
+
+#ifndef SCUMM_HOTSPOTS_H
+#define SCUMM_HOTSPOTS_H
+
+#include "graphics/hotspot_renderer.h"
+
+namespace Scumm {
+
+class ScummHotspotRenderer : public Graphics::HotspotRenderer {
+public:
+ ScummHotspotRenderer();
+
+private:
+ void drawMarker(Graphics::Surface *surface, const Graphics::HotspotInfo &hotspot, int x, int y,
+ const Graphics::PixelFormat &format, Graphics::MarkerShape shape) override;
+};
+
+} // End of namespace Scumm
+
+#endif
diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp
index 3525910f1fe..3fe06743b27 100644
--- a/engines/scumm/input.cpp
+++ b/engines/scumm/input.cpp
@@ -329,6 +329,9 @@ void ScummEngine::beginTextInput() {
Common::Keymap *engineDefault = keymapper->getKeymap("engine-default");
engineDefault->setEnabled(false);
+ Common::Keymap *hotspots = keymapper->getKeymap("scumm-hotspots");
+ if (hotspots)
+ hotspots->setEnabled(false);
_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
}
@@ -337,6 +340,9 @@ void ScummEngine::endTextInput() {
Common::Keymap *engineDefault = keymapper->getKeymap("engine-default");
engineDefault->setEnabled(true);
+ Common::Keymap *hotspots = keymapper->getKeymap("scumm-hotspots");
+ if (hotspots)
+ hotspots->setEnabled(true);
_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
}
diff --git a/engines/scumm/metaengine.cpp b/engines/scumm/metaengine.cpp
index 53fc9986041..01134d77dc0 100644
--- a/engines/scumm/metaengine.cpp
+++ b/engines/scumm/metaengine.cpp
@@ -1180,6 +1180,21 @@ Common::KeymapArray ScummMetaEngine::initKeymaps(const char *target) const {
}
#endif
+ if (gameId != "rebel1" && gameId != "rebel2" &&
+ gameId != "moonbase" &&
+ gameId != "baseball" && gameId != "baseball2001" && gameId != "Baseball2003" &&
+ gameId != "basketball" &&
+ gameId != "football" && gameId != "football2002" &&
+ gameId != "soccer" && gameId != "SoccerMLS" && gameId != "Soccer2004") {
+ Keymap *hotspotMap = new Keymap(Keymap::kKeymapTypeGame, "scumm-hotspots", _("Hotspots"));
+ hotspotMap->setPartialMatchAllowed(false);
+ act = new Action(kStandardActionToggleHotspots, _("Show/hide hotspots"));
+ act->setEvent(Common::EVENT_HOTSPOTS_SHOW);
+ act->addDefaultInputMapping("h");
+ hotspotMap->addAction(act);
+ keymaps.push_back(hotspotMap);
+ }
+
if (gameId == "rebel1" || gameId == "rebel2") {
for (uint i = 0; i < keymaps.size(); ++i) {
if (keymaps[i]->getId() == "engine-default") {
diff --git a/engines/scumm/module.mk b/engines/scumm/module.mk
index 5095cddc8dc..81c530c6084 100644
--- a/engines/scumm/module.mk
+++ b/engines/scumm/module.mk
@@ -29,6 +29,7 @@ MODULE_OBJS := \
he/script_v70he.o \
he/sound_he.o \
help.o \
+ hotspots.o \
imuse/imuse.o \
imuse/imuse_part.o \
imuse/imuse_player.o \
diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp
index 0e97ae972a1..d14dff7faf6 100644
--- a/engines/scumm/object.cpp
+++ b/engines/scumm/object.cpp
@@ -21,7 +21,9 @@
#include "scumm/actor.h"
#include "scumm/bomp.h"
+#include "scumm/charset.h"
#include "scumm/he/intern_he.h"
+#include "scumm/hotspots.h"
#include "scumm/object.h"
#include "scumm/resource.h"
#include "scumm/scumm_v0.h"
@@ -554,6 +556,85 @@ int ScummEngine::getObjActToObjActDist(int a, int b) {
return getDist(x, y, x2, y2);
}
+void ScummEngine::getHotspotPositions(Common::Array<Graphics::HotspotInfo> &hotspots) {
+ if (!_currentRoom || _cursor.state <= 0 || _userPut <= 0)
+ return;
+ // Full Throttle uses actor 27 for its action menu.
+ if (_game.id == GID_FT && _numActors > 27) {
+ const Actor *menuActor = _actors[27];
+ if (menuActor->_visible && menuActor->_costume == 5 && menuActor->_room == _currentRoom)
+ return;
+ }
+ const VirtScreen *vs = &_virtscr[kMainVirtScreen];
+ const int top = _game.version >= 7 ? _screenTop : 0;
+ const int bottom = MIN<int>(vs->h, top + _screenHeight - vs->topline);
+ if (bottom <= top || _screenWidth <= 0 || _screenHeight <= 0)
+ return;
+ auto add = [&](int x, int y, const byte *name, Graphics::HotspotType type) {
+ byte text[2048] = {};
+ if (name)
+ convertMessageToString(name, text, sizeof(text));
+ Common::U32String label = _charset->convertText((const char *)text, _language);
+ int screenX = x - vs->xstart;
+ int screenY = y - top + vs->topline;
+ if (_game.platform == Common::kPlatformNES && _NESStartStrip > 0)
+ screenX += 16;
+ if (screenX < 0 || screenX >= _screenWidth || screenY < 0 || screenY >= _screenHeight)
+ return;
+ if (_useMacScreenCorrectHeight && _macScreen)
+ screenY += _macScreenDrawOffset;
+ if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) {
+ screenX = screenX * 2 + (kHercWidth - _screenWidth * 2) / 2;
+ if (_game.version < 3)
+ screenY = (screenY - vs->topline) * 2 + vs->topline;
+ else
+ screenY = screenY * 7 / 4;
+ } else if (_textSurfaceMultiplier == 2 || _macScreen || _renderMode == Common::kRenderCGA_BW || _enableEGADithering) {
+ screenX *= 2;
+ screenY *= 2;
+ }
+ hotspots.push_back(Graphics::HotspotInfo(Common::Point(screenX, screenY), label, type));
+ };
+ for (int i = 1; i < _numLocalObjects; ++i) {
+ const ObjectData &obj = _objs[i];
+ if (obj.obj_nr < 1 || obj.width <= 0 || obj.height <= 0)
+ continue;
+ const int left = MAX<int>(vs->xstart, obj.x_pos);
+ const int right = MIN<int>(vs->xstart + vs->w, obj.x_pos + obj.width);
+ const int upper = MAX<int>(top, obj.y_pos);
+ const int lower = MIN<int>(bottom, obj.y_pos + obj.height);
+ if (left >= right || upper >= lower)
+ continue;
+ bool found = false;
+ const int fractions[] = {2, 1, 3};
+ for (int row = 0; row < 3 && !found; ++row) {
+ for (int col = 0; col < 3 && !found; ++col) {
+ const int x = left + (right - left - 1) * fractions[col] / 4;
+ const int y = upper + (lower - upper - 1) * fractions[row] / 4;
+ if (findObject(x, y) == obj.obj_nr) {
+ add(x, y, getObjOrActorName(obj.obj_nr), Graphics::kHotspotObject);
+ found = true;
+ }
+ }
+ }
+ }
+ for (int i = 1; i < _numActors; ++i) {
+ Actor *actor = _actors[i];
+ if (!actor->_visible || actor->_room != _currentRoom || i == VAR(VAR_EGO))
+ continue;
+ const int x = actor->getPos().x;
+ const int y = (actor->_top + actor->_bottom) / 2;
+ if (x < vs->xstart || x >= vs->xstart + vs->w || y < top || y >= bottom)
+ continue;
+ if (getActorFromPos(x, y) == i)
+ add(x, y, actor->getActorName(), Graphics::kHotspotNPC);
+ }
+}
+
+Graphics::HotspotRenderer *ScummEngine::createHotspotRenderer() {
+ return new ScummHotspotRenderer();
+}
+
int ScummEngine::findObject(int x, int y) {
int i, b;
byte a;
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 88e087d765e..3c4e5683c15 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -3350,6 +3350,7 @@ load_game:
playActorSounds();
}
+ drawHotspots();
scummLoop_handleSound();
camera._last = camera._cur;
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 356a3602374..b7dfddcc64d 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -1515,6 +1515,9 @@ protected:
bool _supportsEGADithering = false;
bool _enableSegaShadowMode = false;
+ void getHotspotPositions(Common::Array<Graphics::HotspotInfo> &hotspots) override;
+ Graphics::HotspotRenderer *createHotspotRenderer() override;
+ bool hideCursorForHotspots() const override { return false; }
virtual void drawDirtyScreenParts();
void updateDirtyScreen(VirtScreenNumber slot);
void drawStripToScreen(VirtScreen *vs, int x, int width, int top, int bottom);
Commit: fbf85319f1a98749584bff0dba2000907d32953e
https://github.com/scummvm/scummvm/commit/fbf85319f1a98749584bff0dba2000907d32953e
Author: Scorp (scorp at mrs.mn)
Date: 2026-11-13T09:54:21+03:00
Commit Message:
SCUMM: Suspend hotspots when screen effect in progress
Changed paths:
engines/scumm/gfx.cpp
engines/scumm/object.cpp
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index bf85f13c3ab..acd8f3ea332 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -4439,6 +4439,8 @@ void ScummEngine::fadeIn(int effect) {
}
void ScummEngine::fadeOut(int effect) {
+ suspendHotspots();
+
// Screen fades are disabled in the Amiga version of
// Maniac Mansion, verified on WinUAE
if (_game.id == GID_MANIAC && _game.platform == Common::kPlatformAmiga) {
diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp
index d14dff7faf6..3076633d1a7 100644
--- a/engines/scumm/object.cpp
+++ b/engines/scumm/object.cpp
@@ -557,7 +557,7 @@ int ScummEngine::getObjActToObjActDist(int a, int b) {
}
void ScummEngine::getHotspotPositions(Common::Array<Graphics::HotspotInfo> &hotspots) {
- if (!_currentRoom || _cursor.state <= 0 || _userPut <= 0)
+ if (!_currentRoom || !_screenEffectFlag || _cursor.state <= 0 || _userPut <= 0)
return;
// Full Throttle uses actor 27 for its action menu.
if (_game.id == GID_FT && _numActors > 27) {
Commit: 530b944b16f291fe8a170f16f851962102313832
https://github.com/scummvm/scummvm/commit/530b944b16f291fe8a170f16f851962102313832
Author: Scorp (scorp at mrs.mn)
Date: 2026-11-13T09:54:21+03:00
Commit Message:
SCUMM: Change hotspot action keymap initialization
Changed paths:
engines/scumm/metaengine.cpp
diff --git a/engines/scumm/metaengine.cpp b/engines/scumm/metaengine.cpp
index 01134d77dc0..38de518eef0 100644
--- a/engines/scumm/metaengine.cpp
+++ b/engines/scumm/metaengine.cpp
@@ -1188,10 +1188,7 @@ Common::KeymapArray ScummMetaEngine::initKeymaps(const char *target) const {
gameId != "soccer" && gameId != "SoccerMLS" && gameId != "Soccer2004") {
Keymap *hotspotMap = new Keymap(Keymap::kKeymapTypeGame, "scumm-hotspots", _("Hotspots"));
hotspotMap->setPartialMatchAllowed(false);
- act = new Action(kStandardActionToggleHotspots, _("Show/hide hotspots"));
- act->setEvent(Common::EVENT_HOTSPOTS_SHOW);
- act->addDefaultInputMapping("h");
- hotspotMap->addAction(act);
+ hotspotMap->addAction(createHotspotAction());
keymaps.push_back(hotspotMap);
}
Commit: 1e53eb8e9907f126d5f3deaba71674dab11d659d
https://github.com/scummvm/scummvm/commit/1e53eb8e9907f126d5f3deaba71674dab11d659d
Author: Scorp (scorp at mrs.mn)
Date: 2026-11-13T09:54:21+03:00
Commit Message:
SCUMM: Smooth scrolling hotspots for FM-Towns
Changed paths:
engines/scumm/gfx.h
engines/scumm/gfx_towns.cpp
engines/scumm/object.cpp
diff --git a/engines/scumm/gfx.h b/engines/scumm/gfx.h
index c4ba35cec01..4a7cdc39588 100644
--- a/engines/scumm/gfx.h
+++ b/engines/scumm/gfx.h
@@ -577,6 +577,7 @@ public:
void addDirtyRect(int x, int y, int w, int h);
void toggleLayers(int flags);
void scrollLayer(int layer, int offset, int top, int bottom, bool fast);
+ int getScrollRemainder() const { return _layers[0].scrollRemainder; }
void update();
bool isScrolling(int layer, int direction, int threshold = 0) const {
return (layer & ~1) ? false :
diff --git a/engines/scumm/gfx_towns.cpp b/engines/scumm/gfx_towns.cpp
index 3b474570b9b..79a0fb58a79 100644
--- a/engines/scumm/gfx_towns.cpp
+++ b/engines/scumm/gfx_towns.cpp
@@ -21,6 +21,7 @@
#include "common/endian.h"
#include "common/config-manager.h"
+#include "graphics/hotspot_renderer.h"
#include "scumm/scumm.h"
#include "scumm/charset.h"
@@ -238,6 +239,7 @@ void ScummEngine::towns_updateGfx() {
_refreshNeedCatchUp = (dur / ARRAYSIZE(_refreshDuration)) > (1000 / 60);
}
+ const int scrollRemainder = _scrollRequest + _townsScreen->getScrollRemainder();
if (_enableSmoothScrolling) {
int scrlTop = _virtscr[kMainVirtScreen].topline * _textSurfaceMultiplier;
int scrlBottom = scrlTop + _virtscr[kMainVirtScreen].h * _textSurfaceMultiplier;
@@ -256,6 +258,10 @@ void ScummEngine::towns_updateGfx() {
}
_townsScreen->update();
+ // Refresh only an active overlay, after the camera frame is complete.
+ if (_enableSmoothScrolling && scrollRemainder != _scrollRequest + _townsScreen->getScrollRemainder() &&
+ camera._cur == camera._last && _hotspotRenderer && _hotspotRenderer->ownsOverlay())
+ drawHotspots();
}
bool ScummEngine::towns_isRectInStringBox(int x1, int y1, int x2, int y2) {
diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp
index 3076633d1a7..8ea6c2ad0d1 100644
--- a/engines/scumm/object.cpp
+++ b/engines/scumm/object.cpp
@@ -566,6 +566,11 @@ void ScummEngine::getHotspotPositions(Common::Array<Graphics::HotspotInfo> &hots
return;
}
const VirtScreen *vs = &_virtscr[kMainVirtScreen];
+ int screenLeft = vs->xstart;
+#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
+ if (_townsScreen && _enableSmoothScrolling)
+ screenLeft += _scrollRequest + _townsScreen->getScrollRemainder();
+#endif
const int top = _game.version >= 7 ? _screenTop : 0;
const int bottom = MIN<int>(vs->h, top + _screenHeight - vs->topline);
if (bottom <= top || _screenWidth <= 0 || _screenHeight <= 0)
@@ -575,7 +580,7 @@ void ScummEngine::getHotspotPositions(Common::Array<Graphics::HotspotInfo> &hots
if (name)
convertMessageToString(name, text, sizeof(text));
Common::U32String label = _charset->convertText((const char *)text, _language);
- int screenX = x - vs->xstart;
+ int screenX = x - screenLeft;
int screenY = y - top + vs->topline;
if (_game.platform == Common::kPlatformNES && _NESStartStrip > 0)
screenX += 16;
@@ -599,8 +604,8 @@ void ScummEngine::getHotspotPositions(Common::Array<Graphics::HotspotInfo> &hots
const ObjectData &obj = _objs[i];
if (obj.obj_nr < 1 || obj.width <= 0 || obj.height <= 0)
continue;
- const int left = MAX<int>(vs->xstart, obj.x_pos);
- const int right = MIN<int>(vs->xstart + vs->w, obj.x_pos + obj.width);
+ const int left = MAX<int>(screenLeft, obj.x_pos);
+ const int right = MIN<int>(screenLeft + vs->w, obj.x_pos + obj.width);
const int upper = MAX<int>(top, obj.y_pos);
const int lower = MIN<int>(bottom, obj.y_pos + obj.height);
if (left >= right || upper >= lower)
@@ -624,7 +629,7 @@ void ScummEngine::getHotspotPositions(Common::Array<Graphics::HotspotInfo> &hots
continue;
const int x = actor->getPos().x;
const int y = (actor->_top + actor->_bottom) / 2;
- if (x < vs->xstart || x >= vs->xstart + vs->w || y < top || y >= bottom)
+ if (x < screenLeft || x >= screenLeft + vs->w || y < top || y >= bottom)
continue;
if (getActorFromPos(x, y) == i)
add(x, y, actor->getActorName(), Graphics::kHotspotNPC);
More information about the Scummvm-git-logs
mailing list