[Scummvm-git-logs] scummvm master -> 72facd228257f81d6c3753140707ec2071a2ddf5
antoniou79
noreply at scummvm.org
Sat Feb 7 23:12:09 UTC 2026
This automated email contains information about 9 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
eb8f6bbe85 MYST3: Specify room and age ids for special fixes of movies
c8f3a0402b MYST3: Fix for Saavedro blinking in J'nanin
c0eff54285 MYST3: Add warnings in script command handling
2c4f2e2caf MYST3: Fix proper rescale of subtitles window for widescreen mod
6d624adea5 MYST3: Draw subtitles lower in widescreen mod
523b2e2370 MYST3: Adjust subtitles to resized window dimensions
c722f46f04 MYST3: In widescreen mod hide the inventory in special cases
3420607321 MYST3: Properly rescale inventory in widescreen mod
72facd2282 MYST3: Properly scale main menu, dialogs and buttons in widescreen mod
Commit: eb8f6bbe85290fe1f2e9014340e6d7509b5bc78e
https://github.com/scummvm/scummvm/commit/eb8f6bbe85290fe1f2e9014340e6d7509b5bc78e
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2026-02-08T01:11:13+02:00
Commit Message:
MYST3: Specify room and age ids for special fixes of movies
A movie id can be re-used for different movies in different contexts (eg. a in-game node and the main menu)
Thus we specify room id and age id along with movie id, to make sure the fixes are applied only to the intended movie
Changed paths:
engines/myst3/movie.cpp
diff --git a/engines/myst3/movie.cpp b/engines/myst3/movie.cpp
index 6263d1b1f83..78fbf0a544e 100644
--- a/engines/myst3/movie.cpp
+++ b/engines/myst3/movie.cpp
@@ -296,9 +296,16 @@ void ScriptedMovie::update(bool pauseAtFirstFrame) {
effectiveStartFrame = effectiveEndFrame;
}
- if (getId() == 13011) {
- // Special case for the looping movie 13011 of the looping swiming jellyfish at node LIFO 11
- effectiveStartFrame = 0;
+ switch (getId()) {
+ case 13011:
+ // Special case for the looping movie 13011 (room: 603 age: 6) of the looping swiming jellyfish at node LIFO 11
+ if (_vm->_state->getLocationRoom() == 603 && _vm->_state->getLocationAge() == 6) {
+ effectiveStartFrame = 0;
+ }
+ break;
+
+ default:
+ break;
}
if (_posUVar) {
@@ -372,8 +379,11 @@ void ScriptedMovie::update(bool pauseAtFirstFrame) {
if (currFrame != nextFrame - 1) {
// Don't seek if we just want to display the next frame
if (currFrame + 1 != nextFrame - 1) {
- if (getId() == 12001 && nextFrame >= 200 && nextFrame < 250) {
- // fix glitchy transition for rotation of the left turntable track (movie id 12001),
+ if (getId() == 12001
+ && _vm->_state->getLocationRoom() == 1005 && _vm->_state->getLocationAge() == 10
+ && nextFrame >= 200 && nextFrame < 250) {
+ debug("effectiveStartframe for getId(): %d (room: %d, age: %d) is: %d", getId(), _vm->_state->getLocationRoom(), _vm->_state->getLocationAge(), effectiveStartFrame);
+ // fix glitchy transition for rotation of the left turntable track (movie id 12001, room: 1005, age: 10),
// eg. when the left dial panel has no wood pegs
if (nextFrame >= 247) {
// values 247 and 248 should stay at the same frame
Commit: c8f3a0402b9d771f089e1c5c3b8a2cd49ddda183
https://github.com/scummvm/scummvm/commit/c8f3a0402b9d771f089e1c5c3b8a2cd49ddda183
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2026-02-08T01:11:15+02:00
Commit Message:
MYST3: Fix for Saavedro blinking in J'nanin
When arriving a J'nanin after the prologue, Saavedro is already there ahead of the player, and he's running away
This fixes the movie of Saavedro, so that he appears to be there for the first frame, rather than "blinking"-in.
The blinking-in is an original game bug.
Changed paths:
engines/myst3/movie.cpp
diff --git a/engines/myst3/movie.cpp b/engines/myst3/movie.cpp
index 78fbf0a544e..54fe05b14a2 100644
--- a/engines/myst3/movie.cpp
+++ b/engines/myst3/movie.cpp
@@ -304,6 +304,17 @@ void ScriptedMovie::update(bool pauseAtFirstFrame) {
}
break;
+ case 20003:
+ // Special case for movie 20003 (room: 501 age: 5) of Saavedro running away at node LEIS 3, when the player first arrives at J'nanin
+ // Prevents Saavedro appearing as though he's "blinking in" (he's already there when the player arrives, and running away).
+ // (Original Bug)
+ // NOTE this movie id also exists in the Main Menu -> Options (room: 901 age: 9) (Archive::kStillMovie)
+ // and the startFrame should not be changed there (from 0)
+ if (_vm->_state->getLocationRoom() == 501 && _vm->_state->getLocationAge() == 5) {
+ effectiveStartFrame = 1;
+ }
+ break;
+
default:
break;
}
Commit: c0eff54285e006304bbd3103a9df1ee63b4d64e0
https://github.com/scummvm/scummvm/commit/c0eff54285e006304bbd3103a9df1ee63b4d64e0
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2026-02-08T01:11:16+02:00
Commit Message:
MYST3: Add warnings in script command handling
To catch potentially unexpected values
Also improve the printed message for a few debug printouts, to better indicate which script command they come from
Changed paths:
engines/myst3/script.cpp
diff --git a/engines/myst3/script.cpp b/engines/myst3/script.cpp
index 71f830048c1..86399959ae4 100644
--- a/engines/myst3/script.cpp
+++ b/engines/myst3/script.cpp
@@ -816,19 +816,19 @@ void Script::varSetZero(Context &c, const Opcode &cmd) {
}
void Script::varSetOne(Context &c, const Opcode &cmd) {
- debugC(kDebugScript, "Opcode %d: Set var value %d := 1", cmd.op, cmd.args[0]);
+ debugC(kDebugScript, "Opcode %d: Set var value(1) %d := 1", cmd.op, cmd.args[0]);
_vm->_state->setVar(cmd.args[0], 1);
}
void Script::varSetTwo(Context &c, const Opcode &cmd) {
- debugC(kDebugScript, "Opcode %d: Set var value %d := 2", cmd.op, cmd.args[0]);
+ debugC(kDebugScript, "Opcode %d: Set var value(2) %d := 2", cmd.op, cmd.args[0]);
_vm->_state->setVar(cmd.args[0], 2);
}
void Script::varSetOneHundred(Context &c, const Opcode &cmd) {
- debugC(kDebugScript, "Opcode %d: Set var value %d := 100", cmd.op, cmd.args[0]);
+ debugC(kDebugScript, "Opcode %d: Set var value(100) %d := 100", cmd.op, cmd.args[0]);
_vm->_state->setVar(cmd.args[0], 100);
}
@@ -2519,6 +2519,9 @@ void Script::soundPlayBlocking(Context &c, const Opcode &cmd) {
debugC(kDebugScript, "Opcode %d: Play skippable sound %d", cmd.op, cmd.args[0]);
int16 soundId = cmd.args[0];
+ if (soundId < 0) {
+ warning("soundPlayBlocking: negative sound id %d", soundId);
+ }
int32 volume = _vm->_state->valueOrVarValue(cmd.args[1]);
int32 heading = _vm->_state->valueOrVarValue(cmd.args[2]);
int32 att = _vm->_state->valueOrVarValue(cmd.args[3]);
@@ -2686,6 +2689,9 @@ void Script::ambientAddSound2(Context &c, const Opcode &cmd) {
int32 id = _vm->_state->valueOrVarValue(cmd.args[0]);
int32 volume = _vm->_state->valueOrVarValue(cmd.args[1]);
int32 fadeOutDelay = cmd.args[2];
+ if (fadeOutDelay < 0) {
+ warning("Negative fadeOutDelay %d in ambientAddSound2 opcode", fadeOutDelay);
+ }
_vm->_ambient->addSound(id, volume, 0, 0, 0, fadeOutDelay);
}
@@ -2696,6 +2702,9 @@ void Script::ambientAddSound3(Context &c, const Opcode &cmd) {
int32 id = _vm->_state->valueOrVarValue(cmd.args[0]);
int32 volume = _vm->_state->valueOrVarValue(cmd.args[1]);
int32 heading = cmd.args[2];
+ if (heading < 0) {
+ warning("Negative heading %d in ambientAddSound3 opcode", heading);
+ }
_vm->_ambient->addSound(id, volume, heading, 85, 0, 0);
}
@@ -2706,7 +2715,13 @@ void Script::ambientAddSound4(Context &c, const Opcode &cmd) {
int32 id = _vm->_state->valueOrVarValue(cmd.args[0]);
int32 volume = _vm->_state->valueOrVarValue(cmd.args[1]);
int32 heading = cmd.args[2];
+ if (heading < 0) {
+ warning("Negative heading %d in ambientAddSound4 opcode", heading);
+ }
int32 angle = cmd.args[3];
+ if (angle < 0) {
+ warning("Negative angle %d in ambientAddSound4 opcode", angle);
+ }
_vm->_ambient->addSound(id, volume, heading, angle, 0, 0);
}
@@ -2725,6 +2740,9 @@ void Script::ambientSetCue1(Context &c, const Opcode &cmd) {
debugC(kDebugScript, "Opcode %d: Set ambient cue1 %d, volume: %d", cmd.op, cmd.args[0], cmd.args[1]);
int32 id = cmd.args[0];
+ if (id < 0) {
+ warning("Negative sound id %d in ambientSetCue1 opcode", id);
+ }
int32 volume = _vm->_state->valueOrVarValue(cmd.args[1]);
_vm->_ambient->setCueSheet(id, volume, 0, 0);
@@ -2734,8 +2752,14 @@ void Script::ambientSetCue2(Context &c, const Opcode &cmd) {
debugC(kDebugScript, "Opcode %d: Set ambient cue2 %d, volume: %d, heading: %d", cmd.op, cmd.args[0], cmd.args[1], cmd.args[2]);
int32 id = cmd.args[0];
+ if (id < 0) {
+ warning("Negative sound id %d in ambientSetCue2 opcode", id);
+ }
int32 volume = _vm->_state->valueOrVarValue(cmd.args[1]);
int32 heading = cmd.args[2];
+ if (heading < 0) {
+ warning("Negative heading %d in ambientSetCue2 opcode", heading);
+ }
_vm->_ambient->setCueSheet(id, volume, heading, 85);
}
@@ -2744,9 +2768,18 @@ void Script::ambientSetCue3(Context &c, const Opcode &cmd) {
debugC(kDebugScript, "Opcode %d: Set ambient cue3 %d, volume: %d, heading: %d, angle: %d", cmd.op, cmd.args[0], cmd.args[1], cmd.args[2], cmd.args[3]);
int32 id = cmd.args[0];
+ if (id < 0) {
+ warning("Negative sound id %d in ambientSetCue3 opcode", id);
+ }
int32 volume = _vm->_state->valueOrVarValue(cmd.args[1]);
int32 heading = cmd.args[2];
+ if (heading < 0) {
+ warning("Negative heading %d in ambientSetCue3 opcode", heading);
+ }
int32 angle = cmd.args[3];
+ if (angle < 0) {
+ warning("Negative angle %d in ambientSetCue3 opcode", angle);
+ }
_vm->_ambient->setCueSheet(id, volume, heading, angle);
}
@@ -2755,6 +2788,9 @@ void Script::ambientSetCue4(Context &c, const Opcode &cmd) {
debugC(kDebugScript, "Opcode %d: Set ambient cue4 %d, volume: %d", cmd.op, cmd.args[0], cmd.args[1]);
int32 id = cmd.args[0];
+ if (id < 0) {
+ warning("Negative sound id %d in ambientSetCue4 opcode", id);
+ }
int32 volume = _vm->_state->valueOrVarValue(cmd.args[1]);
_vm->_ambient->setCueSheet(id, volume, 32766, 85);
Commit: 2c4f2e2caf39c187d7ed63e20afc8b45e86b97d6
https://github.com/scummvm/scummvm/commit/2c4f2e2caf39c187d7ed63e20afc8b45e86b97d6
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2026-02-08T01:11:17+02:00
Commit Message:
MYST3: Fix proper rescale of subtitles window for widescreen mod
Also vertically align the background rectangle for the subtitles to be at the bottom of the window,
and the texture with the subtitles drawn with its top aligned to the top of the background rectangle
Changed paths:
engines/myst3/subtitles.cpp
diff --git a/engines/myst3/subtitles.cpp b/engines/myst3/subtitles.cpp
index 50272d900b8..0e342c7348d 100644
--- a/engines/myst3/subtitles.cpp
+++ b/engines/myst3/subtitles.cpp
@@ -78,7 +78,11 @@ void FontSubtitles::loadResources() {
// We draw the subtitles in the adequate resolution so that they are not
// scaled up. This is the scale factor of the current resolution
// compared to the original
- _scale = getPosition().width() / (float) getOriginalPosition().width();
+ Common::Rect screen = _vm->_gfx->viewport();
+ _scale = MIN(
+ screen.width() / (float) Renderer::kOriginalWidth,
+ screen.height() / (float) Renderer::kOriginalHeight
+ );
#ifdef USE_FREETYPE2
const char *ttfFile;
@@ -403,8 +407,8 @@ void Subtitles::loadFontSettings(int32 id) {
_fontBold = fontNums.getMiscData(1);
_surfaceHeight = fontNums.getMiscData(2);
_singleLineTop = fontNums.getMiscData(3);
- _line1Top = fontNums.getMiscData(4);
- _line2Top = fontNums.getMiscData(5);
+ _line1Top = fontNums.getMiscData(4); // unused?
+ _line2Top = fontNums.getMiscData(5); // unused?
_surfaceTop = fontNums.getMiscData(6);
_fontCharsetCode = fontNums.getMiscData(7);
@@ -494,14 +498,23 @@ void Subtitles::drawOverlay() {
Common::Rect screen = _vm->_gfx->viewport();
Common::Rect bottomBorder = Common::Rect(Renderer::kOriginalWidth * scale, _surfaceHeight * scale);
- bottomBorder.translate(0, _surfaceTop);
if (_vm->isWideScreenModEnabled()) {
- // Draw a black background to cover the main game frame
- _vm->_gfx->drawRect2D(Common::Rect(screen.width(), Renderer::kBottomBorderHeight), 0xFF, 0x00, 0x00, 0x00);
+ // Draw a black background to cover the main game frame and clamp it to the bottom of the screen
+ int16 subsWindowPositionHeight = getPosition().height();
+ Common::Rect subtitlesBackgroundRect = Common::Rect(screen.width(), (_surfaceHeight - _surfaceTop) * scale);
+ int16 topOfSubtitlesBackgroundRect = subsWindowPositionHeight - subtitlesBackgroundRect.height();
+ if (topOfSubtitlesBackgroundRect < 0) {
+ topOfSubtitlesBackgroundRect = 0;
+ warning("Subtitles background rectangle is taller than the subtitles' container window.");
+ }
+ subtitlesBackgroundRect.translate(0, topOfSubtitlesBackgroundRect);
+ _vm->_gfx->drawRect2D(subtitlesBackgroundRect, 0xFF, 0x00, 0x00, 0x00);
- // Center the subtitles in the screen
- bottomBorder.translate((screen.width() - Renderer::kOriginalWidth * scale) / 2, 0);
+ // Center the subtitles in the screen, and start it at the same height as the subtitles background rectangle
+ bottomBorder.translate((screen.width() - Renderer::kOriginalWidth * scale) / 2, topOfSubtitlesBackgroundRect);
+ } else {
+ bottomBorder.translate(0, _surfaceTop * scale);
}
Common::Rect textureRect = Common::Rect(_texture->width, _texture->height);
@@ -543,7 +556,12 @@ Common::Rect Subtitles::getPosition() const {
Common::Rect frame;
if (_vm->isWideScreenModEnabled()) {
- frame = Common::Rect(screen.width(), Renderer::kBottomBorderHeight);
+ // This sets the position for the "Window" where the subtitles' texture and background are drawn
+ float scale = MIN(
+ screen.width() / (float) Renderer::kOriginalWidth,
+ screen.height() / (float) Renderer::kOriginalHeight
+ );
+ frame = Common::Rect(screen.width(), Renderer::kBottomBorderHeight * scale);
Common::Rect scenePosition = _vm->_scene->getPosition();
int16 top = CLIP<int16>(screen.height() - frame.height(), 0, scenePosition.bottom);
Commit: 6d624adea5638487f53b9bb1642b92d8fe60fffd
https://github.com/scummvm/scummvm/commit/6d624adea5638487f53b9bb1642b92d8fe60fffd
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2026-02-08T01:11:18+02:00
Commit Message:
MYST3: Draw subtitles lower in widescreen mod
The height in "original" resolution now would be 60
We set a lower height kBottomBorderHeightForSubsInWideScreen (60, scaled) for the "window" that contains the subtitle background and texture.
Before this change, that window used the same height as the inventory screen kBottomBorderHeight (90).
Changed paths:
engines/myst3/gfx.h
engines/myst3/subtitles.cpp
diff --git a/engines/myst3/gfx.h b/engines/myst3/gfx.h
index 73de5f40ab5..b3ab0fda28f 100644
--- a/engines/myst3/gfx.h
+++ b/engines/myst3/gfx.h
@@ -169,6 +169,7 @@ public:
static const int kOriginalHeight = 480;
static const int kTopBorderHeight = 30;
static const int kBottomBorderHeight = 90;
+ static const int kBottomBorderHeightForSubsInWideScreen = 60;
static const int kFrameHeight = 360;
void computeScreenViewport();
diff --git a/engines/myst3/subtitles.cpp b/engines/myst3/subtitles.cpp
index 0e342c7348d..63aff031cf6 100644
--- a/engines/myst3/subtitles.cpp
+++ b/engines/myst3/subtitles.cpp
@@ -561,7 +561,7 @@ Common::Rect Subtitles::getPosition() const {
screen.width() / (float) Renderer::kOriginalWidth,
screen.height() / (float) Renderer::kOriginalHeight
);
- frame = Common::Rect(screen.width(), Renderer::kBottomBorderHeight * scale);
+ frame = Common::Rect(screen.width(), Renderer::kBottomBorderHeightForSubsInWideScreen * scale);
Common::Rect scenePosition = _vm->_scene->getPosition();
int16 top = CLIP<int16>(screen.height() - frame.height(), 0, scenePosition.bottom);
Commit: 523b2e23702068fba65b4ac0197667dcdf1b6e2e
https://github.com/scummvm/scummvm/commit/523b2e23702068fba65b4ac0197667dcdf1b6e2e
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2026-02-08T01:11:19+02:00
Commit Message:
MYST3: Adjust subtitles to resized window dimensions
Reload and recreate font and subtitles texture and surface when the window gets resized
Prevents (next) subtitles from appearing blurry when resizing from a small window to a larger one.
This is a practical but not the best solution. A better way would be to use a mechanism similar to the "reflow" of inventory
at the events of Common::EVENT_SCREEN_CHANGED and when the engine is paused
Changed paths:
engines/myst3/subtitles.cpp
diff --git a/engines/myst3/subtitles.cpp b/engines/myst3/subtitles.cpp
index 63aff031cf6..ace115c30cb 100644
--- a/engines/myst3/subtitles.cpp
+++ b/engines/myst3/subtitles.cpp
@@ -268,14 +268,37 @@ static Common::CodePage getEncodingFromCharsetCode(uint32 gdiCharset) {
void FontSubtitles::drawToTexture(const Phrase *phrase) {
const Graphics::Font *font;
- if (_font)
+
+ bool needsRescaling = false;
+ Common::Rect screen = _vm->_gfx->viewport();
+ float newScale = MIN(
+ screen.width() / (float) Renderer::kOriginalWidth,
+ screen.height() / (float) Renderer::kOriginalHeight
+ );
+ needsRescaling = _scale != newScale;
+
+ if (_font) {
+ if (needsRescaling) {
+ warning("The font scale: %f does not match the expected value: %f. The subtitles might have been rendered incorrectly", _scale, newScale);
+ delete _font;
+ loadResources();
+ }
font = _font;
- else
+ } else {
font = FontMan.getFontByUsage(Graphics::FontManager::kLocalizedFont);
+ }
if (!font)
error("No available font");
+ if (needsRescaling) {
+ freeTexture();
+ if (_surface) {
+ _surface->free();
+ delete _surface;
+ _surface = nullptr;
+ }
+ }
if (!_texture || !_surface) {
createTexture();
}
Commit: c722f46f048902c22da1f569b0467e1e0069778f
https://github.com/scummvm/scummvm/commit/c722f46f048902c22da1f569b0467e1e0069778f
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2026-02-08T01:11:20+02:00
Commit Message:
MYST3: In widescreen mod hide the inventory in special cases
New special cases are when the mouse is hidden (eg. during simpleMovie playback) and when inventory is empty (during prologue)
Changed paths:
engines/myst3/inventory.h
engines/myst3/myst3.cpp
diff --git a/engines/myst3/inventory.h b/engines/myst3/inventory.h
index 8cdebabff5a..a3e5bfd1abf 100644
--- a/engines/myst3/inventory.h
+++ b/engines/myst3/inventory.h
@@ -64,6 +64,8 @@ public:
uint16 hoveredItem();
void useItem(uint16 var);
+ bool isEmpty() const { return _inventory.empty(); }
+
void draw() override;
private:
diff --git a/engines/myst3/myst3.cpp b/engines/myst3/myst3.cpp
index 7fd6626e5ef..036fcf9bdb3 100644
--- a/engines/myst3/myst3.cpp
+++ b/engines/myst3/myst3.cpp
@@ -824,8 +824,12 @@ bool Myst3Engine::isInventoryVisible() {
return false;
}
- // Only draw the inventory when the mouse is inside its area
- if (isWideScreenModEnabled() && !_inventory->isMouseInside()) {
+ // For widescreen mod:
+ // Only draw the inventory when:
+ // - the mouse is inside its area
+ // - and the cursor is visible
+ // - and the inventory is not empty
+ if (isWideScreenModEnabled() && (!_cursor->isVisible() || !_inventory->isMouseInside() || _inventory->isEmpty())) {
return false;
}
Commit: 34206073210feb0541bd8379f4e099b58c386597
https://github.com/scummvm/scummvm/commit/34206073210feb0541bd8379f4e099b58c386597
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2026-02-08T01:11:21+02:00
Commit Message:
MYST3: Properly rescale inventory in widescreen mod
Also add some tweaks for the inventory in widescreen mod only
Make the inventory background semi-transparent, and lower the draw trigger for it to kBottomTriggerForInventoryInWideScreen (35 (scaled))
Changed paths:
engines/myst3/gfx.h
engines/myst3/inventory.cpp
engines/myst3/inventory.h
diff --git a/engines/myst3/gfx.h b/engines/myst3/gfx.h
index b3ab0fda28f..a9377f7cd31 100644
--- a/engines/myst3/gfx.h
+++ b/engines/myst3/gfx.h
@@ -170,6 +170,7 @@ public:
static const int kTopBorderHeight = 30;
static const int kBottomBorderHeight = 90;
static const int kBottomBorderHeightForSubsInWideScreen = 60;
+ static const int kBottomTriggerForInventoryInWideScreen = 35;
static const int kFrameHeight = 360;
void computeScreenViewport();
diff --git a/engines/myst3/inventory.cpp b/engines/myst3/inventory.cpp
index 041b2d6464e..239c96a1b22 100644
--- a/engines/myst3/inventory.cpp
+++ b/engines/myst3/inventory.cpp
@@ -43,6 +43,7 @@ Inventory::Inventory(Myst3Engine *vm) :
_vm(vm),
_texture(nullptr) {
_scaled = !_vm->isWideScreenModEnabled();
+ _hidden = !_scaled;
initializeTexture();
}
@@ -61,14 +62,40 @@ void Inventory::initializeTexture() {
bool Inventory::isMouseInside() {
Common::Point mouse = _vm->_cursor->getPosition(false);
+ if (_vm->isWideScreenModEnabled()) {
+ Common::Rect triggerArea;
+ if (_hidden) {
+ Common::Rect screen = _vm->_gfx->viewport();
+ float scale = MIN(
+ screen.width() / (float) Renderer::kOriginalWidth,
+ screen.height() / (float) Renderer::kOriginalHeight
+ );
+ triggerArea = Common::Rect(screen.width(), Renderer::kBottomTriggerForInventoryInWideScreen * scale);
+ triggerArea.translate(0, screen.height() - triggerArea.height());
+ } else {
+ triggerArea = getPosition();
+ }
+
+ bool shouldShowInventory = triggerArea.contains(mouse);
+ if (shouldShowInventory) {
+ if (_hidden) _hidden = false;
+ } else {
+ if (!_hidden) _hidden = true;
+ }
+ return shouldShowInventory;
+ }
return getPosition().contains(mouse);
}
void Inventory::draw() {
if (_vm->isWideScreenModEnabled()) {
- // Draw a black background to cover the main game frame
+ // Draw a semi-transparent background to cover the main game frame
Common::Rect screen = _vm->_gfx->viewport();
- _vm->_gfx->drawRect2D(Common::Rect(screen.width(), Renderer::kBottomBorderHeight), 0xFF, 0x00, 0x00, 0x00);
+ float scale = MIN(
+ screen.width() / (float) Renderer::kOriginalWidth,
+ screen.height() / (float) Renderer::kOriginalHeight
+ );
+ _vm->_gfx->drawRect2D(Common::Rect(screen.width(), Renderer::kBottomBorderHeight * scale), 0x9F, 0x00, 0x00, 0x00);
}
uint16 hoveredItemVar = hoveredItem();
@@ -161,15 +188,24 @@ void Inventory::reflow() {
uint16 itemCount = 0;
uint16 totalWidth = 0;
+ float scale = 1.0f;
+ if (_vm->isWideScreenModEnabled()) {
+ Common::Rect screen = _vm->_gfx->viewport();
+ scale = MIN(
+ screen.width() / (float) Renderer::kOriginalWidth,
+ screen.height() / (float) Renderer::kOriginalHeight
+ );
+ }
+
for (uint i = 0; _availableItems[i].var; i++) {
if (hasItem(_availableItems[i].var)) {
- totalWidth += _availableItems[i].textureWidth;
+ totalWidth += (_availableItems[i].textureWidth * scale);
itemCount++;
}
}
if (itemCount >= 2)
- totalWidth += 9 * (itemCount - 1);
+ totalWidth += 9 * (itemCount - 1) * scale;
uint16 left;
if (_vm->isWideScreenModEnabled()) {
@@ -182,15 +218,17 @@ void Inventory::reflow() {
for (ItemList::iterator it = _inventory.begin(); it != _inventory.end(); it++) {
const ItemData &item = getData(it->var);
- uint16 top = (Renderer::kBottomBorderHeight - item.textureHeight) / 2;
+ uint16 top = ((Renderer::kBottomBorderHeight - item.textureHeight) / 2) * scale;
- it->rect = Common::Rect(item.textureWidth, item.textureHeight);
+ int16 itemTextureWidth = item.textureWidth * scale;
+ int16 itemTextureHeight = item.textureHeight * scale;
+ it->rect = Common::Rect(itemTextureWidth, itemTextureHeight);
it->rect.translate(left, top);
- left += item.textureWidth;
+ left += itemTextureWidth;
if (itemCount >= 2)
- left += 9;
+ left += 9 * scale;
}
}
@@ -294,7 +332,11 @@ Common::Rect Inventory::getPosition() const {
Common::Rect frame;
if (_vm->isWideScreenModEnabled()) {
- frame = Common::Rect(screen.width(), Renderer::kBottomBorderHeight);
+ float scale = MIN(
+ screen.width() / (float) Renderer::kOriginalWidth,
+ screen.height() / (float) Renderer::kOriginalHeight
+ );
+ frame = Common::Rect(screen.width(), Renderer::kBottomBorderHeight * scale);
Common::Rect scenePosition = _vm->_scene->getPosition();
int16 top = CLIP<int16>(screen.height() - frame.height(), 0, scenePosition.bottom);
diff --git a/engines/myst3/inventory.h b/engines/myst3/inventory.h
index a3e5bfd1abf..2ba2b8c87e3 100644
--- a/engines/myst3/inventory.h
+++ b/engines/myst3/inventory.h
@@ -90,6 +90,7 @@ private:
Texture *_texture;
ItemList _inventory;
+ bool _hidden;
void initializeTexture();
Commit: 72facd228257f81d6c3753140707ec2071a2ddf5
https://github.com/scummvm/scummvm/commit/72facd228257f81d6c3753140707ec2071a2ddf5
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2026-02-08T01:11:22+02:00
Commit Message:
MYST3: Properly scale main menu, dialogs and buttons in widescreen mod
Changed paths:
engines/myst3/menu.cpp
diff --git a/engines/myst3/menu.cpp b/engines/myst3/menu.cpp
index 4817142ade7..d7a6c4ece70 100644
--- a/engines/myst3/menu.cpp
+++ b/engines/myst3/menu.cpp
@@ -83,10 +83,14 @@ Common::Rect Dialog::getPosition() const {
} else {
viewport = _vm->_gfx->viewport();
}
-
- Common::Rect screenRect = Common::Rect(_texture->width, _texture->height);
- screenRect.translate((viewport.width() - _texture->width) / 2,
- (viewport.height() - _texture->height) / 2);
+ float scale = MIN(
+ viewport.width() / (float) Renderer::kOriginalWidth,
+ viewport.height() / (float) Renderer::kOriginalHeight
+ );
+
+ Common::Rect screenRect = Common::Rect(_texture->width * scale, _texture->height * scale);
+ screenRect.translate((viewport.width() - _texture->width * scale) / 2,
+ (viewport.height() - _texture->height * scale) / 2);
return screenRect;
}
@@ -107,13 +111,24 @@ void ButtonsDialog::loadButtons() {
if (!buttonsDesc.isValid())
error("Unable to load dialog buttons description");
+ Common::Rect viewport;
+ if (_scaled) {
+ viewport = Common::Rect(Renderer::kOriginalWidth, Renderer::kOriginalHeight);
+ } else {
+ viewport = _vm->_gfx->viewport();
+ }
+ float scale = MIN(
+ viewport.width() / (float) Renderer::kOriginalWidth,
+ viewport.height() / (float) Renderer::kOriginalHeight
+ );
+
for (uint i = 0; i < 3; i++) {
uint32 left = buttonsDesc.getMiscData(i * 4);
uint32 top = buttonsDesc.getMiscData(i * 4 + 1);
uint32 width = buttonsDesc.getMiscData(i * 4 + 2);
uint32 height = buttonsDesc.getMiscData(i * 4 + 3);
- _buttons[i] = Common::Rect(width, height);
- _buttons[i].translate(left, top);
+ _buttons[i] = Common::Rect(width * scale, height * scale);
+ _buttons[i].translate(left * scale, top * scale);
}
}
More information about the Scummvm-git-logs
mailing list