[Scummvm-git-logs] scummvm master -> 93e393e94341befc745c3fb29da7ab4662d0c92c

sev- noreply at scummvm.org
Fri Oct 13 23:55:15 UTC 2023


This automated email contains information about 7 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c1969faa7b GRAPHICS: MACGUI: Plug memory leak
8a2ebba04e GRAPHICS: MACGUI: Properly compute table height in MacText
bf851f574d GRAPHICS: MACGUI: Fix table cell rendering in MacText
0a32c7901c GRAPHICS: MACGUI: Properly pass table cell alignment from Markdown to MacText
af89b0dc2c SDL: Switch Keyboard shortcuts helptext to Markdown tables
ec986dfb59 GRAPHICS: MACGUI: Mark table headers as bold in Markdown
93e393e943 GRAPHICS: MACGUI: Added more debug output to MacText


Commit: c1969faa7b6faa571b1657ea846100434995eaa6
    https://github.com/scummvm/scummvm/commit/c1969faa7b6faa571b1657ea846100434995eaa6
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-10-14T01:54:01+02:00

Commit Message:
GRAPHICS: MACGUI: Plug memory leak

Changed paths:
    graphics/macgui/mactext.h


diff --git a/graphics/macgui/mactext.h b/graphics/macgui/mactext.h
index a7e702deb94..38679ced82c 100644
--- a/graphics/macgui/mactext.h
+++ b/graphics/macgui/mactext.h
@@ -197,6 +197,7 @@ struct MacTextLine {
 	uint getChunkNum(int *col);
 
 	~MacTextLine() {
+		delete table;
 		delete tableSurface;
 	}
 };


Commit: 8a2ebba04e24f79d1e2d97c7c74917d87347928d
    https://github.com/scummvm/scummvm/commit/8a2ebba04e24f79d1e2d97c7c74917d87347928d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-10-14T01:54:04+02:00

Commit Message:
GRAPHICS: MACGUI: Properly compute table height in MacText

Changed paths:
    graphics/macgui/mactext.cpp


diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 1c165009b6a..7fd21e673c3 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -1239,6 +1239,14 @@ int MacTextCanvas::getLineWidth(int lineNum, bool enforce, int col) {
 		return line->width;
 	}
 
+	if (line->table) {
+		line->width = _maxWidth;
+		line->height = line->tableSurface->h;
+		line->charwidth = _maxWidth;
+
+		return line->width;
+	}
+
 	int width = line->indent + line->firstLineIndent;
 	int height = 0;
 	int charwidth = 0;


Commit: bf851f574dfeb3fae7473b556469e264110e7359
    https://github.com/scummvm/scummvm/commit/bf851f574dfeb3fae7473b556469e264110e7359
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-10-14T01:54:04+02:00

Commit Message:
GRAPHICS: MACGUI: Fix table cell rendering in MacText

Changed paths:
    graphics/macgui/mactext.cpp


diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 7fd21e673c3..125f2b50ec7 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -3049,10 +3049,10 @@ void MacText::processTable(int line) {
 	}
 
 	r = 0;
-	x = 1 + gutter;
 	y = 1 + gutter;
 	for (auto &row : *table) {
 		int c = 0;
+		x = 1 + gutter;
 		for (auto &cell : row.cells) {
 			surf->blitFrom(*cell._surface, Common::Point(x, y));
 			x += gutter * 2 + 1 + colW[c];
@@ -3061,7 +3061,6 @@ void MacText::processTable(int line) {
 		y += gutter * 2 + 1 + rowH[r];
 		r++;
 	}
-
 }
 
 } // End of namespace Graphics


Commit: 0a32c7901c743ab69947278dbe50fc3b425bfe17
    https://github.com/scummvm/scummvm/commit/0a32c7901c743ab69947278dbe50fc3b425bfe17
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-10-14T01:54:05+02:00

Commit Message:
GRAPHICS: MACGUI: Properly pass table cell alignment from Markdown to MacText

Changed paths:
    graphics/macgui/mactext-md.cpp
    graphics/macgui/mactext.cpp
    graphics/macgui/mactext.h


diff --git a/graphics/macgui/mactext-md.cpp b/graphics/macgui/mactext-md.cpp
index a2394c88682..fee99563b46 100644
--- a/graphics/macgui/mactext-md.cpp
+++ b/graphics/macgui/mactext-md.cpp
@@ -155,7 +155,24 @@ void render_table_cell(Common::SDDataBuffer *ob, const Common::SDDataBuffer *tex
 	if (!text)
 		return;
 
-	Common::String res = Common::String::format("\001\016Tc%02x" "%s" "\001\016TC", flags, Common::String((const char *)text->data , text->size).c_str());
+	TextAlign align;
+
+	switch (flags) {
+	case Common::MKD_TABLE_ALIGN_R:
+		align = kTextAlignRight;
+		break;
+	case Common::MKD_TABLE_ALIGN_CENTER:
+		align = kTextAlignCenter;
+		break;
+	case Common::MKD_TABLE_ALIGN_L:
+	default:
+		align = kTextAlignLeft;
+	}
+
+	Common::String res = Common::String::format("\001\016Tc%02x" "%s" "\001\016TC", align, Common::String((const char *)text->data , text->size).c_str());
+
+	if (flags & Common::MKD_TABLE_HEADER)
+		res = Common::String::format("\001\016+%02x00" "%s" "\001\016-%02x00", kMacFontBold, res.c_str(), kMacFontBold);
 
 	sd_bufput(ob, res.c_str(), res.size());
 
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 125f2b50ec7..0b641766682 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -967,17 +967,18 @@ void MacText::splitString(const Common::U32String &str, int curLine) {
 						curTextLine->table->push_back(MacTextTableRow());
 						continue;
 					} else if (cmd == 'c') { // Cell start
-						uint16 flags;
-						s = readHex(&flags, s, 2);
+						uint16 align;
+						s = readHex(&align, s, 2);
 
 						curTextLine->table->back().cells.push_back(MacTextCanvas());
-						curTextLine->table->back().cells.back()._flags = flags;
+						curTextLine->table->back().cells.back()._textAlignment = (TextAlign)align;
 						curTextLine->table->back().cells.back()._wm = _wm;
 						curTextLine->table->back().cells.back()._macText = this;
 
 						curTextLine->table->back().cells.back()._text.resize(1);
 						curTextLine = &curTextLine->table->back().cells.back()._text[0];
 						curTextLine->chunks.push_back(_defaultFormatting);
+
 						continue;
 					} else if (cmd == 'C') { // Cell end
 					} else {
diff --git a/graphics/macgui/mactext.h b/graphics/macgui/mactext.h
index 38679ced82c..dd32be4e07d 100644
--- a/graphics/macgui/mactext.h
+++ b/graphics/macgui/mactext.h
@@ -122,12 +122,11 @@ struct MacTextLine;
 class MacTextCanvas {
 public:
 	Common::Array<MacTextLine> _text;
-	uint16 _flags = 0;
 	ManagedSurface *_surface = nullptr, *_shadowSurface = nullptr;
 	int _maxWidth = 0;
 	int _textMaxWidth = 0;
 	int _textMaxHeight = 0;
-	TextAlign _textAlignment = kTextAlignRight;
+	TextAlign _textAlignment = kTextAlignLeft;
 	int _interLinear = 0;
 	int _textShadow = 0;
 	MacWindowManager *_wm = nullptr;


Commit: af89b0dc2c213d3c37b221b3a012d576c0345d67
    https://github.com/scummvm/scummvm/commit/af89b0dc2c213d3c37b221b3a012d576c0345d67
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-10-14T01:54:05+02:00

Commit Message:
SDL: Switch Keyboard shortcuts helptext to Markdown tables

Changed paths:
    backends/platform/sdl/sdl.cpp


diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 3f5098e50ff..528359afb6a 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -1009,41 +1009,6 @@ void OSystem_SDL::clearGraphicsModes() {
 static const char * const helpTabs[] = {
 _s("Keyboard"),
 "",
-#if 1
-_s(
-"## Keyboard shortcuts\n"
-"\n"
-"ScummVM supports various in-game keyboard and mouse shortcuts, and since version 2.2.0 these can be manually configured in the **Keymaps tab**, or in the **configuration file**.\n"
-"\n"
-"For game-specific controls, see the [wiki entry](https://wiki.scummvm.org/index.php?title=Category:Supported_Games) for the game you are playing.\n"
-"\n"
-"Default shortcuts are shown in the table.\n"
-"\n"
-"| Shortcut      | Description\n"
-"| --------------------------------\n"
-"| `Ctrl+F5` -- Displays the Global Main Menu\n")
-#if defined(MACOSX)
-_s("| `Cmd+q`    -- Quit (macOS)\n")
-#elif defined(WIN32)
-_s("| `Alt+F4`  -- Quit (Windows)\n")
-#else
-_s("| `Ctrl+q`  -- Quit (Linux/Unix)\n")
-_s("| `Ctrl+z`  -- Quit (other platforms)\n")
-#endif
-_s(
-"| `Ctrl+u`  -- Mutes all sounds\n"
-"| `Ctrl+m`  -- Toggles mouse capture\n"
-"| `Ctrl+Alt` and `9` or `0` -- Cycles forwards/backwards between graphics filters\n"
-"| `Ctrl+Alt` and `+` or `-` -- Increases/decreases the scale factor\n"
-"| `Ctrl+Alt+a` -- Toggles aspect ratio correction on/off\n"
-"| `Ctrl+Alt+f` -- Toggles between nearest neighbor and bilinear interpolation (graphics filtering on/off)\n"
-"| `Ctrl+Alt+s` -- Cycles through stretch modes\n"
-"| `Alt+Enter`   -- Toggles full screen/windowed mode\n"
-"| `Alt+s`          -- Takes a screenshot\n"
-"| `Ctrl+F7`       -- Opens virtual keyboard (if enabled). This can also be opened with a long press of the middle mouse button or wheel.\n"
-"| `Ctrl+Alt+d` -- Opens the ScummVM debugger\n"
-),
-#else
 _s(
 "## Keyboard shortcuts\n"
 "\n"
@@ -1077,7 +1042,6 @@ _s(
 "| `Ctrl+F7`       | Opens virtual keyboard (if enabled). This can also be opened with a long press of the middle mouse button or wheel.\n"
 "| `Ctrl+Alt+d` | Opens the ScummVM debugger\n"
 ),
-#endif
 
 0,
 	};


Commit: ec986dfb5918d419bb6d311ab7323d32a5ed6c1a
    https://github.com/scummvm/scummvm/commit/ec986dfb5918d419bb6d311ab7323d32a5ed6c1a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-10-14T01:54:05+02:00

Commit Message:
GRAPHICS: MACGUI: Mark table headers as bold in Markdown

Changed paths:
    graphics/macgui/mactext-md.cpp


diff --git a/graphics/macgui/mactext-md.cpp b/graphics/macgui/mactext-md.cpp
index fee99563b46..f009baf62e6 100644
--- a/graphics/macgui/mactext-md.cpp
+++ b/graphics/macgui/mactext-md.cpp
@@ -169,11 +169,13 @@ void render_table_cell(Common::SDDataBuffer *ob, const Common::SDDataBuffer *tex
 		align = kTextAlignLeft;
 	}
 
-	Common::String res = Common::String::format("\001\016Tc%02x" "%s" "\001\016TC", align, Common::String((const char *)text->data , text->size).c_str());
+	Common::String res = Common::String((const char *)text->data, text->size);
 
 	if (flags & Common::MKD_TABLE_HEADER)
 		res = Common::String::format("\001\016+%02x00" "%s" "\001\016-%02x00", kMacFontBold, res.c_str(), kMacFontBold);
 
+	res = Common::String::format("\001\016Tc%02x" "%s" "\001\016TC", align, res.c_str());
+
 	sd_bufput(ob, res.c_str(), res.size());
 
 	debug(1, "render_table_cell(%s), flags: %d", PR(text), flags);


Commit: 93e393e94341befc745c3fb29da7ab4662d0c92c
    https://github.com/scummvm/scummvm/commit/93e393e94341befc745c3fb29da7ab4662d0c92c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-10-14T01:54:05+02:00

Commit Message:
GRAPHICS: MACGUI: Added more debug output to MacText

Changed paths:
    graphics/macgui/mactext.cpp


diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 0b641766682..a1585b0dfcd 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -1205,7 +1205,7 @@ void MacTextCanvas::render(int from, int to) {
 	render(from, to, 0);
 
 	for (uint i = 0; i < _text.size(); i++) {
-		debugN(9, "MacTextCanvas::render: %2d ", i);
+		debugN(9, "MacTextCanvas::render: %2d (firstInd: %d indent: %d) ", i, _text[i].firstLineIndent, _text[i].indent);
 
 		for (uint j = 0; j < _text[i].chunks.size(); j++)
 			debugN(9, "[%d (%d)] \"%s\" ", _text[i].chunks[j].fontId, _text[i].chunks[j].textSlant, _text[i].chunks[j].text.encode().c_str());




More information about the Scummvm-git-logs mailing list