[Scummvm-git-logs] scummvm master -> 52220346a947ea9a5ed574d4a95bb2653b78625c
sev-
noreply at scummvm.org
Wed Mar 4 23:43:09 UTC 2026
This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
4967fa52bc GUI: Add caching in Rich Text to speed up scrolling
9128ed80a7 GUI: Defer RichTextWidget creation to minimise intial loading time
7351104a24 GUI: Use theme background in RichTextWidget
448e8b3b62 GUI: Fix anti-aliased font rendering for RichTextWidget
52220346a9 GUI: Use Graphics::ALPHA_OPAQUE for faster drawing in RichText
Commit: 4967fa52bc9c733b47e92a06f0cbd185d19b6006
https://github.com/scummvm/scummvm/commit/4967fa52bc9c733b47e92a06f0cbd185d19b6006
Author: Mohit Bankar (mohitbankar1212 at gmail.com)
Date: 2026-03-05T00:43:03+01:00
Commit Message:
GUI: Add caching in Rich Text to speed up scrolling
Now the text is first rendered on Cached surface, and blitted from there on to the Surface.
Fixes scrolling lag in About Dialog
Changed paths:
gui/widgets/richtext.cpp
gui/widgets/richtext.h
diff --git a/gui/widgets/richtext.cpp b/gui/widgets/richtext.cpp
index 0e7ba50216a..5cfc1151f5a 100644
--- a/gui/widgets/richtext.cpp
+++ b/gui/widgets/richtext.cpp
@@ -171,6 +171,13 @@ void RichTextWidget::recalc() {
// }
if (!_surface || _surface->w != _textWidth) {
delete _txtWnd;
+ _txtWnd = nullptr;
+
+ if (_cachedTextSurface) {
+ _cachedTextSurface->free();
+ delete _cachedTextSurface;
+ _cachedTextSurface = nullptr;
+ }
createWidget();
} else if (_surface->h != _textHeight)
_surface->create(_textWidth, _textHeight, g_gui.getWM()->_pixelformat);
@@ -191,7 +198,10 @@ void RichTextWidget::recalc() {
void RichTextWidget::createWidget() {
Graphics::MacWindowManager *wm = g_gui.getWM();
- uint32 bg = wm->_pixelformat.ARGBToColor(0, 0xff, 0xff, 0xff); // transparent
+ uint32 themedBg = wm->_pixelformat.ARGBToColor(255, 0xFB, 0xF1, 0xCE);
+ uint32 fallbackBg = wm->_pixelformat.ARGBToColor(0, 0xFF, 0xFF, 0xFF);
+ uint32 bg = themedBg ? themedBg : fallbackBg;
+
TextColorData *normal = g_gui.theme()->getTextColorData(kTextColorNormal);
uint32 fg = wm->_pixelformat.RGBToColor(normal->r, normal->g, normal->b);
@@ -212,10 +222,26 @@ void RichTextWidget::createWidget() {
_txtWnd->setMarkdownText(_text);
- if (_surface)
- _surface->create(_textWidth, _textHeight, g_gui.getWM()->_pixelformat);
- else
- _surface = new Graphics::ManagedSurface(_textWidth, _textHeight, wm->_pixelformat);
+ int textHeight = _txtWnd->getTextHeight();
+
+ if (textHeight > 0) {
+ if (!_cachedTextSurface || _cachedTextSurface->w != _textWidth || _cachedTextSurface->h != textHeight) {
+ if (_cachedTextSurface) {
+ _cachedTextSurface->free();
+ delete _cachedTextSurface;
+ }
+ _cachedTextSurface = new Graphics::ManagedSurface(_textWidth, textHeight, wm->_pixelformat);
+ }
+ _cachedTextSurface->clear(bg);
+ _txtWnd->draw(_cachedTextSurface, 0, 0, _textWidth, textHeight, 0, 0);
+ }
+
+ if (!_surface || _surface->w != _textWidth || _surface->h != _textHeight) {
+ if (_surface)
+ _surface->create(_textWidth, _textHeight, g_gui.getWM()->_pixelformat);
+ else
+ _surface = new Graphics::ManagedSurface(_textWidth, _textHeight, wm->_pixelformat);
+ }
}
void RichTextWidget::reflowLayout() {
@@ -233,10 +259,21 @@ void RichTextWidget::drawWidget() {
g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x + _w, _y + _h), ThemeEngine::kWidgetBackgroundPlain);
- _surface->clear(g_gui.getWM()->_pixelformat.ARGBToColor(0, 0xff, 0xff, 0xff)); // transparent
-
- _txtWnd->draw(_surface, 0, _scrolledY, _textWidth, _textHeight, 0, 0);
-
+ uint32 themedBg = g_gui.getWM()->_pixelformat.ARGBToColor(255, 0xFB, 0xF1, 0xCE);
+ uint32 fallbackBg = g_gui.getWM()->_pixelformat.ARGBToColor(0, 0xFF, 0xFF, 0xFF);
+ uint32 bg = themedBg ? themedBg : fallbackBg;
+
+ _surface->clear(bg);
+
+ if (_cachedTextSurface) {
+ int cachedHeight = _cachedTextSurface->h;
+ int maxY = MAX(0, cachedHeight - _textHeight);
+ int srcY = CLIP((int)_scrolledY, 0, maxY);
+
+ _surface->simpleBlitFrom(*_cachedTextSurface, Common::Rect(0, srcY, _textWidth, MIN(srcY + _textHeight, cachedHeight)), Common::Point(0, 0));
+ } else
+ _txtWnd->draw(_surface, 0, _scrolledY, _textWidth, _textHeight, 0, 0);
+
g_gui.theme()->drawManagedSurface(Common::Point(_x + _innerMargin, _y + _innerMargin), *_surface, Graphics::ALPHA_FULL);
}
diff --git a/gui/widgets/richtext.h b/gui/widgets/richtext.h
index e7f2429375d..d6c8833b760 100644
--- a/gui/widgets/richtext.h
+++ b/gui/widgets/richtext.h
@@ -37,6 +37,7 @@ class ScrollBarWidget;
/* RichTextWidget */
class RichTextWidget : public Widget, public CommandSender {
protected:
+ Graphics::ManagedSurface *_cachedTextSurface = nullptr;
Graphics::MacText *_txtWnd = nullptr;
Graphics::ManagedSurface *_surface = nullptr;
Common::U32String _text;
Commit: 9128ed80a79840c9b16c2b2e1559dc1c25329a46
https://github.com/scummvm/scummvm/commit/9128ed80a79840c9b16c2b2e1559dc1c25329a46
Author: Mohit Bankar (mohitbankar1212 at gmail.com)
Date: 2026-03-05T00:43:03+01:00
Commit Message:
GUI: Defer RichTextWidget creation to minimise intial loading time
- Defer markdown parsing and MacText initialization.
- Add ensureWidget() to split
size detection from actual creation.
- Render only the active tab on dialog open to reduce
initial loading time.
Changed paths:
gui/widgets/richtext.cpp
gui/widgets/richtext.h
diff --git a/gui/widgets/richtext.cpp b/gui/widgets/richtext.cpp
index 5cfc1151f5a..1e80bae3005 100644
--- a/gui/widgets/richtext.cpp
+++ b/gui/widgets/richtext.cpp
@@ -109,6 +109,9 @@ void RichTextWidget::handleMouseUp(int x, int y, int button, int clickCount) {
_mouseDownY = _mouseDownStartY = 0;
+ if (!_txtWnd)
+ return;
+
Common::String link = _txtWnd->getMouseLink(x - _innerMargin + _scrolledX, y - _innerMargin + _scrolledY).encode();
if (link.hasPrefixIgnoreCase("http"))
@@ -116,7 +119,7 @@ void RichTextWidget::handleMouseUp(int x, int y, int button, int clickCount) {
}
void RichTextWidget::handleMouseMoved(int x, int y, int button) {
- if (_mouseDownStartY == 0 || _mouseDownY == y)
+ if (_mouseDownStartY == 0 || _mouseDownY == y || !_txtWnd)
return;
int h = _txtWnd->getTextHeight();
@@ -135,6 +138,9 @@ void RichTextWidget::handleMouseMoved(int x, int y, int button) {
}
void RichTextWidget::handleTooltipUpdate(int x, int y) {
+ if (!_txtWnd)
+ return;
+
_tooltip = _txtWnd->getMouseLink(x - _innerMargin + _scrolledX, y - _innerMargin + _scrolledY);
}
@@ -170,29 +176,35 @@ void RichTextWidget::recalc() {
// createWidget();
// }
if (!_surface || _surface->w != _textWidth) {
+ if (_surface) {
+ _surface->free();
+ delete _surface;
+ _surface = nullptr;
+ }
delete _txtWnd;
_txtWnd = nullptr;
-
- if (_cachedTextSurface) {
- _cachedTextSurface->free();
- delete _cachedTextSurface;
- _cachedTextSurface = nullptr;
- }
- createWidget();
- } else if (_surface->h != _textHeight)
+ if (_cachedTextSurface) {
+ _cachedTextSurface->free();
+ delete _cachedTextSurface;
+ _cachedTextSurface = nullptr;
+ }
+ } else if (_surface->h != _textHeight) {
_surface->create(_textWidth, _textHeight, g_gui.getWM()->_pixelformat);
- int h = _txtWnd->getTextHeight();
-
- if (h <= _limitH) _scrolledY = 0;
- if (_scrolledY > h - _limitH) _scrolledY = MAX(0, h - _limitH);
-
- _verticalScroll->_numEntries = h;
- _verticalScroll->_currentPos = _scrolledY;
- _verticalScroll->_entriesPerPage = _limitH;
- _verticalScroll->_singleStep = _h / 4;
- _verticalScroll->setPos(_w - _scrollbarWidth, 0);
- _verticalScroll->setSize(_scrollbarWidth, _h - 1);
+ int h = _txtWnd->getTextHeight();
+ if (h <= _limitH)
+ _scrolledY = 0;
+ if (_scrolledY > h - _limitH)
+ _scrolledY = MAX(0, h - _limitH);
+ _verticalScroll->_numEntries = h;
+ _verticalScroll->_currentPos = _scrolledY;
+ _verticalScroll->_entriesPerPage = _limitH;
+ _verticalScroll->_singleStep = _h / 4;
+ _verticalScroll->setPos(_w - _scrollbarWidth, 0);
+ _verticalScroll->setSize(_scrollbarWidth, _h - 1);
+ _verticalScroll->setVisible(_verticalScroll->_numEntries > _limitH); //show when there is something to scroll
+ _verticalScroll->recalc();
+ }
}
void RichTextWidget::createWidget() {
@@ -213,8 +225,8 @@ void RichTextWidget::createWidget() {
newId = wm->_fontMan->registerTTFFont(ttfFamily);
else
newId = Graphics::kMacFontNewYork;
- Graphics::MacFont macFont(newId, fontHeight, Graphics::kMacFontRegular);
+ Graphics::MacFont macFont(newId, fontHeight, Graphics::kMacFontRegular);
_txtWnd = new Graphics::MacText(Common::U32String(), wm, &macFont, fg, bg, _textWidth, Graphics::kTextAlignLeft);
if (!_imageArchive.empty())
@@ -242,18 +254,37 @@ void RichTextWidget::createWidget() {
else
_surface = new Graphics::ManagedSurface(_textWidth, _textHeight, wm->_pixelformat);
}
+
+ int h = _txtWnd->getTextHeight();
+ if (h <= _limitH)
+ _scrolledY = 0;
+ if (_scrolledY > h - _limitH)
+ _scrolledY = MAX(0, h - _limitH);
+ _verticalScroll->_numEntries = h;
+ _verticalScroll->_currentPos = _scrolledY;
+ _verticalScroll->_entriesPerPage = _limitH;
+ _verticalScroll->_singleStep = _h / 4;
+ _verticalScroll->setPos(_w - _scrollbarWidth, 0);
+ _verticalScroll->setSize(_scrollbarWidth, _h - 1);
+ _verticalScroll->setVisible(_verticalScroll->_numEntries > _limitH); //show when there is something to scroll
+ _verticalScroll->recalc();
}
void RichTextWidget::reflowLayout() {
Widget::reflowLayout();
recalc();
+}
- _verticalScroll->setVisible(_verticalScroll->_numEntries > _limitH); //show when there is something to scroll
- _verticalScroll->recalc();
+void RichTextWidget::ensureWidget() {
+ if (_txtWnd)
+ return;
+ createWidget();
}
void RichTextWidget::drawWidget() {
+ ensureWidget();
+
if (!_txtWnd)
recalc();
diff --git a/gui/widgets/richtext.h b/gui/widgets/richtext.h
index d6c8833b760..6b80fba7ad3 100644
--- a/gui/widgets/richtext.h
+++ b/gui/widgets/richtext.h
@@ -82,6 +82,7 @@ protected:
void recalc();
void drawWidget() override;
void createWidget();
+ void ensureWidget();
Widget *findWidget(int x, int y) override;
};
Commit: 7351104a241abea5a4b5674adb922c73ac82f277
https://github.com/scummvm/scummvm/commit/7351104a241abea5a4b5674adb922c73ac82f277
Author: Mohit Bankar (mohitbankar1212 at gmail.com)
Date: 2026-03-05T00:43:03+01:00
Commit Message:
GUI: Use theme background in RichTextWidget
Replace hardcoded background color with value
extracted from the active theme.
Add ThemeEngine::getDrawDataColor() and use it
in createWidget() and drawWidget(), with
fallback to opaque white.
Changed paths:
gui/ThemeEngine.cpp
gui/ThemeEngine.h
gui/widgets/richtext.cpp
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 44d6c9487ed..ac983be43bc 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -1721,6 +1721,26 @@ TextColorData *ThemeEngine::getTextColorData(TextColor color) const {
return _textColors[color];
}
+bool ThemeEngine::getDrawDataColor(DrawData ddId, uint8 &r, uint8 &g, uint8 &b) const {
+ if (ddId < 0 || ddId >= kDrawDataMAX || !_widgets[ddId])
+ return false;
+
+ const Common::List<Graphics::DrawStep> &steps = _widgets[ddId]->_steps;
+ if (steps.empty())
+ return false;
+
+ const Graphics::DrawStep &step = steps.front();
+
+ if (step.bgColor.set) {
+ r = step.bgColor.r;
+ g = step.bgColor.g;
+ b = step.bgColor.b;
+ } else
+ return false;
+
+ return true;
+}
+
DrawData ThemeEngine::parseDrawDataId(const Common::String &name) const {
for (int i = 0; i < kDrawDataMAX; ++i)
if (name.compareToIgnoreCase(kDrawDataDefaults[i].name) == 0)
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index e00f7f1331b..88c8abd3570 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -534,6 +534,12 @@ public:
TextColorData *getTextColorData(TextColor color) const;
+ /**
+ * Returns the background color of the first draw step for a given DrawData item.
+ * Useful for widgets that need a flat fill matching the theme background.
+ */
+ bool getDrawDataColor(DrawData ddId, uint8 &r, uint8 &g, uint8 &b) const;
+
/**
* Interface for ThemeParser class: Parsed DrawSteps are added via this function.
* There is no return type because DrawSteps can always be added, unless something
diff --git a/gui/widgets/richtext.cpp b/gui/widgets/richtext.cpp
index 1e80bae3005..4e5fd556468 100644
--- a/gui/widgets/richtext.cpp
+++ b/gui/widgets/richtext.cpp
@@ -210,9 +210,12 @@ void RichTextWidget::recalc() {
void RichTextWidget::createWidget() {
Graphics::MacWindowManager *wm = g_gui.getWM();
- uint32 themedBg = wm->_pixelformat.ARGBToColor(255, 0xFB, 0xF1, 0xCE);
- uint32 fallbackBg = wm->_pixelformat.ARGBToColor(0, 0xFF, 0xFF, 0xFF);
- uint32 bg = themedBg ? themedBg : fallbackBg;
+ uint8 bgR, bgG, bgB;
+ uint32 bg;
+ if (g_gui.theme()->getDrawDataColor(kDDWidgetBackgroundDefault, bgR, bgG, bgB))
+ bg = wm->_pixelformat.ARGBToColor(255, bgR, bgG, bgB);
+ else
+ bg = wm->_pixelformat.ARGBToColor(0xFF, 0xFF, 0xFF, 0xFF);
TextColorData *normal = g_gui.theme()->getTextColorData(kTextColorNormal);
uint32 fg = wm->_pixelformat.RGBToColor(normal->r, normal->g, normal->b);
@@ -290,9 +293,12 @@ void RichTextWidget::drawWidget() {
g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x + _w, _y + _h), ThemeEngine::kWidgetBackgroundPlain);
- uint32 themedBg = g_gui.getWM()->_pixelformat.ARGBToColor(255, 0xFB, 0xF1, 0xCE);
- uint32 fallbackBg = g_gui.getWM()->_pixelformat.ARGBToColor(0, 0xFF, 0xFF, 0xFF);
- uint32 bg = themedBg ? themedBg : fallbackBg;
+ uint8 bgR, bgG, bgB;
+ uint32 bg;
+ if (g_gui.theme()->getDrawDataColor(kDDWidgetBackgroundDefault, bgR, bgG, bgB))
+ bg = g_gui.getWM()->_pixelformat.ARGBToColor(255, bgR, bgG, bgB);
+ else
+ bg = g_gui.getWM()->_pixelformat.ARGBToColor(0xFF, 0xFF, 0xFF, 0xFF);
_surface->clear(bg);
Commit: 448e8b3b6259f3e52ac8423b4238dbdf07a882ba
https://github.com/scummvm/scummvm/commit/448e8b3b6259f3e52ac8423b4238dbdf07a882ba
Author: Mohit Bankar (mohitbankar1212 at gmail.com)
Date: 2026-03-05T00:43:03+01:00
Commit Message:
GUI: Fix anti-aliased font rendering for RichTextWidget
Add configurable TTFRenderMode to MacFontManager
(default monochrome).
RichTextWidget temporarily uses
kTTFRenderModeLight when creating MacText,
then restores the previous mode.
Changed paths:
graphics/macgui/macfontmanager.cpp
graphics/macgui/macfontmanager.h
gui/widgets/richtext.cpp
diff --git a/graphics/macgui/macfontmanager.cpp b/graphics/macgui/macfontmanager.cpp
index dbae867cf63..531534f51b4 100644
--- a/graphics/macgui/macfontmanager.cpp
+++ b/graphics/macgui/macfontmanager.cpp
@@ -576,15 +576,15 @@ const Font *MacFontManager::getFont(MacFont *macFont) {
if (macFont->getSize() <= 0) {
debugC(1, kDebugLevelMacGUI, "MacFontManager::getFont() - Font size <= 0!");
}
- font = Graphics::loadTTFFontFromArchive("LiberationSans-Regular.ttf", macFont->getSize(), Graphics::kTTFSizeModeCharacter, 0, 0, Graphics::kTTFRenderModeMonochrome);
+ font = Graphics::loadTTFFontFromArchive("LiberationSans-Regular.ttf", macFont->getSize(), Graphics::kTTFSizeModeCharacter, 0, 0, _ttfRenderMode);
_uniFontRegistry.setVal(macFont->getName(), font);
} else if (_fontInfo.contains(familyId)) {
- font = Graphics::loadTTFFontFromArchive(_fontInfo[familyId]->name, macFont->getSize(), Graphics::kTTFSizeModeCharacter, 0, 0, Graphics::kTTFRenderModeMonochrome);
+ font = Graphics::loadTTFFontFromArchive(_fontInfo[familyId]->name, macFont->getSize(), Graphics::kTTFSizeModeCharacter, 0, 0, _ttfRenderMode);
// We may get nullptr from here, so storing it to avoid multiple tries
_uniFontRegistry.setVal(macFont->getName(), font);
} else {
- font = Graphics::loadTTFFontFromArchive("LiberationSans-Regular.ttf", macFont->getSize(), Graphics::kTTFSizeModeCharacter, 0, 0, Graphics::kTTFRenderModeMonochrome);
+ font = Graphics::loadTTFFontFromArchive("LiberationSans-Regular.ttf", macFont->getSize(), Graphics::kTTFSizeModeCharacter, 0, 0, _ttfRenderMode);
_uniFontRegistry.setVal(macFont->getName(), font);
}
}
@@ -947,7 +947,7 @@ void MacFontManager::generateTTFFont(MacFont &toFont, Common::SeekableReadStream
// TODO: Handle getSlant() flags
stream->seek(0);
- Font *font = Graphics::loadTTFFont(stream, DisposeAfterUse::NO, toFont.getSize(), Graphics::kTTFSizeModeCharacter, 0, 0, Graphics::kTTFRenderModeMonochrome);
+ Font *font = Graphics::loadTTFFont(stream, DisposeAfterUse::NO, toFont.getSize(), Graphics::kTTFSizeModeCharacter, 0, 0, _ttfRenderMode);
if (!font) {
warning("Failed to generate font '%s'", toPrintable(getFontName(toFont)).c_str());
diff --git a/graphics/macgui/macfontmanager.h b/graphics/macgui/macfontmanager.h
index be26d9b6b9e..6ee6490fc40 100644
--- a/graphics/macgui/macfontmanager.h
+++ b/graphics/macgui/macfontmanager.h
@@ -26,6 +26,10 @@
#include "graphics/fonts/bdf.h"
#include "graphics/fontman.h"
+#ifdef USE_FREETYPE2
+#include "graphics/fonts/ttf.h"
+#endif
+
namespace Common {
class SeekableReadStream;
class MacResManager;
@@ -205,6 +209,16 @@ public:
int getFamilyId(int newId, int newSlant);
+#ifdef USE_FREETYPE2
+ /**
+ * Set the TTF rendering mode used when loading TTF fonts.
+ * Defaults to kTTFRenderModeMonochrome for classic Mac look.
+ * Set to kTTFRenderModeLight for anti-aliased text.
+ */
+ void setTTFRenderMode(TTFRenderMode mode) { _ttfRenderMode = mode; }
+ TTFRenderMode getTTFRenderMode() const { return _ttfRenderMode; }
+#endif
+
private:
void loadFontsBDF();
void loadFonts();
@@ -215,6 +229,7 @@ private:
#ifdef USE_FREETYPE2
void generateTTFFont(MacFont &toFront, Common::SeekableReadStream *stream);
+ TTFRenderMode _ttfRenderMode = Graphics::kTTFRenderModeMonochrome;
#endif
private:
diff --git a/gui/widgets/richtext.cpp b/gui/widgets/richtext.cpp
index 4e5fd556468..faa96af919d 100644
--- a/gui/widgets/richtext.cpp
+++ b/gui/widgets/richtext.cpp
@@ -23,6 +23,7 @@
#include "common/unicode-bidi.h"
#include "graphics/macgui/mactext.h"
+#include "graphics/macgui/macfontmanager.h"
#include "gui/gui-manager.h"
@@ -175,6 +176,7 @@ void RichTextWidget::recalc() {
// } else {
// createWidget();
// }
+
if (!_surface || _surface->w != _textWidth) {
if (_surface) {
_surface->free();
@@ -229,6 +231,12 @@ void RichTextWidget::createWidget() {
else
newId = Graphics::kMacFontNewYork;
+#ifdef USE_FREETYPE2
+ // Use anti-aliased (light) rendering for the GUI help text.
+ Graphics::TTFRenderMode prevRenderMode = wm->_fontMan->getTTFRenderMode();
+ wm->_fontMan->setTTFRenderMode(Graphics::kTTFRenderModeLight);
+#endif
+
Graphics::MacFont macFont(newId, fontHeight, Graphics::kMacFontRegular);
_txtWnd = new Graphics::MacText(Common::U32String(), wm, &macFont, fg, bg, _textWidth, Graphics::kTextAlignLeft);
@@ -237,6 +245,11 @@ void RichTextWidget::createWidget() {
_txtWnd->setMarkdownText(_text);
+#ifdef USE_FREETYPE2
+ // Restore previous render mode now that all fonts have been loaded
+ wm->_fontMan->setTTFRenderMode(prevRenderMode);
+#endif
+
int textHeight = _txtWnd->getTextHeight();
if (textHeight > 0) {
@@ -253,7 +266,7 @@ void RichTextWidget::createWidget() {
if (!_surface || _surface->w != _textWidth || _surface->h != _textHeight) {
if (_surface)
- _surface->create(_textWidth, _textHeight, g_gui.getWM()->_pixelformat);
+ _surface->create(_textWidth, _textHeight, wm->_pixelformat);
else
_surface = new Graphics::ManagedSurface(_textWidth, _textHeight, wm->_pixelformat);
}
Commit: 52220346a947ea9a5ed574d4a95bb2653b78625c
https://github.com/scummvm/scummvm/commit/52220346a947ea9a5ed574d4a95bb2653b78625c
Author: Mohit Bankar (mohitbankar1212 at gmail.com)
Date: 2026-03-05T00:43:03+01:00
Commit Message:
GUI: Use Graphics::ALPHA_OPAQUE for faster drawing in RichText
Changed paths:
gui/widgets/richtext.cpp
diff --git a/gui/widgets/richtext.cpp b/gui/widgets/richtext.cpp
index faa96af919d..cf0e5717410 100644
--- a/gui/widgets/richtext.cpp
+++ b/gui/widgets/richtext.cpp
@@ -324,7 +324,7 @@ void RichTextWidget::drawWidget() {
} else
_txtWnd->draw(_surface, 0, _scrolledY, _textWidth, _textHeight, 0, 0);
- g_gui.theme()->drawManagedSurface(Common::Point(_x + _innerMargin, _y + _innerMargin), *_surface, Graphics::ALPHA_FULL);
+ g_gui.theme()->drawManagedSurface(Common::Point(_x + _innerMargin, _y + _innerMargin), *_surface, Graphics::ALPHA_OPAQUE);
}
void RichTextWidget::draw() {
More information about the Scummvm-git-logs
mailing list