[Scummvm-git-logs] scummvm branch-2-3 -> 4d74f2b91d765a6f584f07bdec933315b1564503
sev-
sev at scummvm.org
Sat Sep 4 21:16:43 UTC 2021
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:
75cc2d6ba7 CINE: Keep overflowing message box inside screen
dd56887c9e CINE: OS: Add detection for Italian Amiga version
13702e52f1 CINE: OS: Fix space missing in verb line
4d74f2b91d CINE: OS: Fix crash before entering secret base
Commit: 75cc2d6ba71a801e8e1304436172c14e73bca784
https://github.com/scummvm/scummvm/commit/75cc2d6ba71a801e8e1304436172c14e73bca784
Author: Kari Salminen (kari.salminen at gmail.com)
Date: 2021-09-04T23:16:22+02:00
Commit Message:
CINE: Keep overflowing message box inside screen
First calculate maximum used Y position in drawMessage
and then reposition the message box to stay inside the
main screen.
Fixes bug #11708
Changed paths:
NEWS.md
engines/cine/gfx.cpp
engines/cine/gfx.h
diff --git a/NEWS.md b/NEWS.md
index 835fa19e15..a640e78ed2 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -59,6 +59,9 @@ For a more comprehensive changelog of the latest experimental code, see:
CGE2:
- Added option to use Text To Speech for Sfinx.
+ Cine:
+ - Fixed vertically overflowing message boxes.
+
Dreamweb:
- Rendering fixes for Russian fan translation.
diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp
index b178b014cc..7585e108b8 100644
--- a/engines/cine/gfx.cpp
+++ b/engines/cine/gfx.cpp
@@ -330,15 +330,29 @@ void FWRenderer::drawString(const char *string, byte param) {
* @param y Top left message box corner coordinate
* @param width Message box width
* @param color Message box background color (Or if negative draws only the text)
+ * @param draw Draw the message box and its contents? If false then draw nothing
+ * but simply return the maximum Y position used by the message box.
* @note Negative colors are used in Operation Stealth's timed cutscenes
* (e.g. when first meeting The Movement for the Liberation of Santa Paragua).
+ * @return The maximum Y position used by the message box (Inclusive)
*/
-void FWRenderer::drawMessage(const char *str, int x, int y, int width, int color) {
+int FWRenderer::drawMessage(const char *str, int x, int y, int width, int color, bool draw) {
+ // Keep a vertically overflowing message box inside the main screen (Fixes bug #11708).
+ if (draw) {
+ int maxY = this->drawMessage(str, x, y, width, color, false);
+ if (maxY > 199) {
+ y -= (maxY - 199);
+ if (y < 0) {
+ y = 0;
+ }
+ }
+ }
+
int i, tx, ty, tw;
int line = 0, words = 0, cw = 0;
int space = 0, extraSpace = 0;
- if (color >= 0) {
+ if (draw && color >= 0) {
if (useTransparentDialogBoxes())
drawTransparentBox(x, y, width, 4);
else
@@ -364,7 +378,7 @@ void FWRenderer::drawMessage(const char *str, int x, int y, int width, int color
}
ty += 9;
- if (color >= 0) {
+ if (draw && color >= 0) {
if (useTransparentDialogBoxes())
drawTransparentBox(x, ty, width, 9);
else
@@ -381,18 +395,20 @@ void FWRenderer::drawMessage(const char *str, int x, int y, int width, int color
extraSpace = 0;
}
} else {
- tx = drawChar(str[i], tx, ty);
+ tx = drawChar(str[i], tx, ty, draw);
}
}
ty += 9;
- if (color >= 0) {
+ if (draw && color >= 0) {
if (useTransparentDialogBoxes())
drawTransparentBox(x, ty, width, 4);
else
drawPlainBox(x, ty, width, 4, color);
drawDoubleBorder(x, y, width, ty - y + 4, (useTransparentDialogBoxes() ? transparentDialogBoxStartColor() : 0) + 2);
}
+
+ return ty + 4;
}
/**
@@ -503,15 +519,18 @@ void FWRenderer::drawDoubleBorder(int x, int y, int width, int height, byte colo
* @param character Character to draw
* @param x Character coordinate
* @param y Character coordinate
+ * @param draw Draw the character?
*/
-int FWRenderer::drawChar(char character, int x, int y) {
+int FWRenderer::drawChar(char character, int x, int y, bool draw) {
int width;
if (character == ' ') {
x += 5;
} else if ((width = g_cine->_textHandler.fontParamTable[(unsigned char)character].characterWidth)) {
int idx = g_cine->_textHandler.fontParamTable[(unsigned char)character].characterIdx;
- drawSpriteRaw(g_cine->_textHandler.textTable[idx][FONT_DATA], g_cine->_textHandler.textTable[idx][FONT_MASK], FONT_WIDTH, FONT_HEIGHT, _backBuffer, x, y);
+ if (draw) {
+ drawSpriteRaw(g_cine->_textHandler.textTable[idx][FONT_DATA], g_cine->_textHandler.textTable[idx][FONT_MASK], FONT_WIDTH, FONT_HEIGHT, _backBuffer, x, y);
+ }
x += width + 1;
}
@@ -1469,15 +1488,18 @@ void OSRenderer::incrustSprite(const BGIncrust &incrust) {
* @param character Character to draw
* @param x Character coordinate
* @param y Character coordinate
+ * @param draw Draw the character?
*/
-int OSRenderer::drawChar(char character, int x, int y) {
+int OSRenderer::drawChar(char character, int x, int y, bool draw) {
int width;
if (character == ' ') {
x += 5;
} else if ((width = g_cine->_textHandler.fontParamTable[(unsigned char)character].characterWidth)) {
int idx = g_cine->_textHandler.fontParamTable[(unsigned char)character].characterIdx;
- drawSpriteRaw2(g_cine->_textHandler.textTable[idx][FONT_DATA], 0, FONT_WIDTH, FONT_HEIGHT, _backBuffer, x, y);
+ if (draw) {
+ drawSpriteRaw2(g_cine->_textHandler.textTable[idx][FONT_DATA], 0, FONT_WIDTH, FONT_HEIGHT, _backBuffer, x, y);
+ }
x += width + 1;
}
diff --git a/engines/cine/gfx.h b/engines/cine/gfx.h
index 421c4dd354..28db06c0e0 100644
--- a/engines/cine/gfx.h
+++ b/engines/cine/gfx.h
@@ -154,13 +154,13 @@ protected:
void drawMaskedSprite(const ObjectStruct &obj, const byte *mask);
virtual void drawSprite(const ObjectStruct &obj);
- void drawMessage(const char *str, int x, int y, int width, int color);
+ int drawMessage(const char *str, int x, int y, int width, int color, bool draw = true);
void drawPlainBox(int x, int y, int width, int height, byte color);
byte transparentDialogBoxStartColor();
void drawTransparentBox(int x, int y, int width, int height);
void drawBorder(int x, int y, int width, int height, byte color);
void drawDoubleBorder(int x, int y, int width, int height, byte color);
- virtual int drawChar(char character, int x, int y);
+ virtual int drawChar(char character, int x, int y, bool draw = true);
virtual int undrawChar(char character, int x, int y);
void drawLine(int x, int y, int width, int height, byte color);
void remaskSprite(byte *mask, Common::List<overlay>::iterator it);
@@ -260,7 +260,7 @@ protected:
const Cine::Palette& getFadeInSourcePalette() override;
void drawSprite(const ObjectStruct &obj) override;
void drawSprite(overlay *overlayPtr, const byte *spritePtr, int16 width, int16 height, byte *page, int16 x, int16 y, byte transparentColor, byte bpp);
- int drawChar(char character, int x, int y) override;
+ int drawChar(char character, int x, int y, bool draw = true) override;
void drawBackground() override;
void renderOverlay(const Common::List<overlay>::iterator &it) override;
Commit: dd56887c9e893a3fcf850d88bc1917fe1724ae52
https://github.com/scummvm/scummvm/commit/dd56887c9e893a3fcf850d88bc1917fe1724ae52
Author: Kari Salminen (kari.salminen at gmail.com)
Date: 2021-09-04T23:16:25+02:00
Commit Message:
CINE: OS: Add detection for Italian Amiga version
Closes #12812
Changed paths:
NEWS.md
engines/cine/detection_tables.h
diff --git a/NEWS.md b/NEWS.md
index a640e78ed2..ad58d49e85 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -60,6 +60,7 @@ For a more comprehensive changelog of the latest experimental code, see:
- Added option to use Text To Speech for Sfinx.
Cine:
+ - Added detection for Italian Amiga Operation Stealth.
- Fixed vertically overflowing message boxes.
Dreamweb:
diff --git a/engines/cine/detection_tables.h b/engines/cine/detection_tables.h
index a43c5cc877..c7e34a927d 100644
--- a/engines/cine/detection_tables.h
+++ b/engines/cine/detection_tables.h
@@ -407,6 +407,20 @@ static const CINEGameDescription gameDescriptions[] = {
0,
},
+ { // Submitted by Nyarlathotep7777 in #12812 (Italian Amiga version)
+ {
+ "os",
+ "",
+ AD_ENTRY1s("procs1", "d7458be2b14d77410e6330148ca6c371", 61682),
+ Common::IT_ITA,
+ Common::kPlatformAmiga,
+ ADGF_NO_FLAGS,
+ GUIO0()
+ },
+ GType_OS,
+ 0,
+ },
+
{
{
"os",
Commit: 13702e52f1a2c942f9c184f04a4d3f763101202e
https://github.com/scummvm/scummvm/commit/13702e52f1a2c942f9c184f04a4d3f763101202e
Author: Kari Salminen (kari.salminen at gmail.com)
Date: 2021-09-04T23:16:25+02:00
Commit Message:
CINE: OS: Fix space missing in verb line
Fixes #11687
Changed paths:
NEWS.md
engines/cine/various.cpp
diff --git a/NEWS.md b/NEWS.md
index ad58d49e85..99a1de2ce4 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -61,6 +61,7 @@ For a more comprehensive changelog of the latest experimental code, see:
Cine:
- Added detection for Italian Amiga Operation Stealth.
+ - Fixed space missing in verb line.
- Fixed vertically overflowing message boxes.
Dreamweb:
diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp
index 85a0d6f47f..f68f27540c 100644
--- a/engines/cine/various.cpp
+++ b/engines/cine/various.cpp
@@ -1074,6 +1074,7 @@ void playerCommandMouseLeft(uint16 &mouseButton, uint16 &mouseX, uint16 &mouseY)
g_cine->_commandBuffer = "";
} else if (g_cine->getGameType() == Cine::GType_OS) {
isDrawCommandEnabled = 1;
+ g_cine->_commandBuffer += " ";
g_cine->_commandBuffer += commandPrepositionTable[playerCommand];
}
Commit: 4d74f2b91d765a6f584f07bdec933315b1564503
https://github.com/scummvm/scummvm/commit/4d74f2b91d765a6f584f07bdec933315b1564503
Author: Kari Salminen (kari.salminen at gmail.com)
Date: 2021-09-04T23:16:25+02:00
Commit Message:
CINE: OS: Fix crash before entering secret base
Check that the filename can be found in the volume entries map before
trying to dereference it.
Fixes #11723
Changed paths:
NEWS.md
engines/cine/part.cpp
diff --git a/NEWS.md b/NEWS.md
index 99a1de2ce4..ae783db0b6 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -61,6 +61,7 @@ For a more comprehensive changelog of the latest experimental code, see:
Cine:
- Added detection for Italian Amiga Operation Stealth.
+ - Fixed crash before entering secret base.
- Fixed space missing in verb line.
- Fixed vertically overflowing message boxes.
diff --git a/engines/cine/part.cpp b/engines/cine/part.cpp
index b41ef1829f..cb94361808 100644
--- a/engines/cine/part.cpp
+++ b/engines/cine/part.cpp
@@ -197,7 +197,8 @@ void CineEngine::readVolCnf() {
int16 findFileInBundle(const char *fileName) {
// HACK: Fix underwater background palette by reading it from correct file
if (hacksEnabled && g_cine->getGameType() == Cine::GType_OS &&
- scumm_stricmp(currentPrcName, "SOUSMAR2.PRC") == 0) {
+ scumm_stricmp(currentPrcName, "SOUSMAR2.PRC") == 0 &&
+ g_cine->_volumeEntriesMap.contains(fileName)) {
Common::Array<VolumeResource> volRes = g_cine->_volumeEntriesMap.find(fileName)->_value;
if (volRes.size() == 2 && scumm_stricmp(volRes[0].name, "rsc12") == 0 &&
scumm_stricmp(volRes[1].name, "rsc08") == 0 &&
More information about the Scummvm-git-logs
mailing list