[Scummvm-git-logs] scummvm master -> 73b109b0351fa76b8506cd091d982ba02c423bad

sev- sev at scummvm.org
Sat Sep 4 21:14:24 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:
b3ef35c7e0 CINE: Keep overflowing message box inside screen
865e3d6179 CINE: OS: Add detection for Italian Amiga version
294ed169f9 CINE: OS: Fix space missing in verb line
73b109b035 CINE: OS: Fix crash before entering secret base


Commit: b3ef35c7e02fb28c89207a54f7c94bd2f0d94cd1
    https://github.com/scummvm/scummvm/commit/b3ef35c7e02fb28c89207a54f7c94bd2f0d94cd1
Author: Kari Salminen (kari.salminen at gmail.com)
Date: 2021-09-04T23:14:18+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 250542d8e8..6d15acb347 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -67,6 +67,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: 865e3d61799ca75bab20adf1d15c062aba5af2ab
    https://github.com/scummvm/scummvm/commit/865e3d61799ca75bab20adf1d15c062aba5af2ab
Author: Kari Salminen (kari.salminen at gmail.com)
Date: 2021-09-04T23:14:18+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 6d15acb347..18e4fae141 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -68,6 +68,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: 294ed169f90e0c6714037f08d75f70cc012c32b3
    https://github.com/scummvm/scummvm/commit/294ed169f90e0c6714037f08d75f70cc012c32b3
Author: Kari Salminen (kari.salminen at gmail.com)
Date: 2021-09-04T23:14:18+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 18e4fae141..5020b9f342 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -69,6 +69,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 80fb98899b..5d60aee290 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: 73b109b0351fa76b8506cd091d982ba02c423bad
    https://github.com/scummvm/scummvm/commit/73b109b0351fa76b8506cd091d982ba02c423bad
Author: Kari Salminen (kari.salminen at gmail.com)
Date: 2021-09-04T23:14:18+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 5020b9f342..f629a48c76 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -69,6 +69,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