[Scummvm-git-logs] scummvm master -> f614128b5d3aaee615c9b3f69ce9cdb448136d9a
sev-
noreply at scummvm.org
Tue Apr 14 12:49:38 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:
d6810bb49e GRAPHICS: MACGUI: Fixes for masked MacText scrollbar rendering
81ed190f96 WAGE: Properly deinit ImGui on engine exit
ff7fac3644 GRAPHICS: MACGUI: Do not override getSurface() in MacText
bcf02841b6 DIRECTOR: DT: Query full MacText surface for displaying Text Castmembers
f614128b5d GRAPHICS: MACGUI: Final fixes for drawing masked MacText with scrollbar
Commit: d6810bb49e76266a902ae6070f94dfe7b7270e91
https://github.com/scummvm/scummvm/commit/d6810bb49e76266a902ae6070f94dfe7b7270e91
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-04-14T14:49:11+02:00
Commit Message:
GRAPHICS: MACGUI: Fixes for masked MacText scrollbar rendering
Changed paths:
graphics/macgui/mactext.cpp
graphics/macgui/mactext.h
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 8690275fd8a..f83f3d95793 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -223,6 +223,11 @@ void MacText::init(uint32 fgcolor, uint32 bgcolor, int maxWidth, TextAlign textA
}
}
+ _charMaskSurface = new ManagedSurface(_dims.width(), _dims.height(), Graphics::PixelFormat::createFormatCLUT8());
+ _charMaskSurface->clear(0);
+ _glyphMaskSurface = new ManagedSurface(_dims.width(), _dims.height(), Graphics::PixelFormat::createFormatCLUT8());
+ _glyphMaskSurface->clear(0);
+
_selEnd = -1;
_selStart = -1;
@@ -288,10 +293,14 @@ MacText::~MacText() {
_borderSurface.free();
_borderMaskSurface.free();
+ _charMaskSurface->free();
+ _glyphMaskSurface->free();
delete _cursorRect;
delete _cursorSurface;
delete _cursorSurface2;
+ delete _charMaskSurface;
+ delete _glyphMaskSurface;
}
WindowClick MacText::isInScrollBar(int x, int y) const {
@@ -945,26 +954,32 @@ void MacText::removeLastLine() {
_canvas._textMaxHeight -= h;
}
-void MacText::draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int yoff) {
- if (_canvas._text.empty())
- return;
-
- render();
-
- if (x + w < _canvas._surface->w || y + h < _canvas._surface->h)
- g->fillRect(Common::Rect(x + xoff, y + yoff, x + w + xoff, y + h + yoff), _canvas._tbgcolor);
+void MacText::drawStep(ManagedSurface *g, ManagedSurface *src, ManagedSurface *border, int x, int y, int w, int h, int xoff, int yoff, uint32 tcolor) {
+ if (x + w < src->w || y + h < src->h)
+ g->fillRect(Common::Rect(x + xoff, y + yoff, x + w + xoff, y + h + yoff), tcolor);
// blit shadow surface first
if (_canvas._textShadow)
- g->blitFrom(*_canvas._shadowSurface, Common::Rect(MIN<int>(_canvas._surface->w, x), MIN<int>(_canvas._surface->h, y), MIN<int>(_canvas._surface->w, x + w), MIN<int>(_canvas._surface->h, y + h)), Common::Point(xoff + _canvas._textShadow, yoff + _canvas._textShadow));
+ g->blitFrom(*src, Common::Rect(MIN<int>(src->w, x), MIN<int>(src->h, y), MIN<int>(src->w, x + w), MIN<int>(src->h, y + h)), Common::Point(xoff + _canvas._textShadow, yoff + _canvas._textShadow));
- g->simpleBlitFrom(*_canvas._surface, Common::Rect(MIN<int>(_canvas._surface->w, x), MIN<int>(_canvas._surface->h, y), MIN<int>(_canvas._surface->w, x + w), MIN<int>(_canvas._surface->h, y + h)), Common::Point(xoff, yoff));
+ g->simpleBlitFrom(*_canvas._surface, Common::Rect(MIN<int>(src->w, x), MIN<int>(src->h, y), MIN<int>(src->w, x + w), MIN<int>(src->h, y + h)), Common::Point(xoff, yoff));
if (_scrollBar && _scrollBorder.hasBorder(kWindowBorderScrollbar)) {
uint32 transcolor = (_wm->_pixelformat.bytesPerPixel == 1) ? _wm->_colorGreen : 0;
- g->transBlitFrom(_borderSurface, Common::Rect(0, 0, _borderSurface.w, _borderSurface.h), Common::Point(0, 0), transcolor);
+ g->transBlitFrom(*border, Common::Rect(0, 0, border->w, border->h), Common::Point(0, 0), transcolor);
}
+}
+
+void MacText::draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int yoff) {
+ if (_canvas._text.empty())
+ return;
+
+ render();
+
+ drawStep(g, _canvas._surface, &_borderSurface, x, y, w, h, xoff, yoff, _canvas._tbgcolor);
+ drawStep(_glyphMaskSurface, _canvas._glyphMask, &_borderMaskSurface, x, y, w, h, xoff, yoff, 0);
+ drawStep(_charMaskSurface, _canvas._charBoxMask, &_borderMaskSurface, x, y, w, h, xoff, yoff, 0);
_contentIsDirty = false;
_cursorDirty = false;
diff --git a/graphics/macgui/mactext.h b/graphics/macgui/mactext.h
index 9249732950c..9caf0c866d5 100644
--- a/graphics/macgui/mactext.h
+++ b/graphics/macgui/mactext.h
@@ -68,6 +68,7 @@ public:
void render();
void undrawCursor();
+ void drawStep(ManagedSurface *g, ManagedSurface *src, ManagedSurface *border, int x, int y, int w, int h, int xoff, int yoff, uint32 transcolor);
void draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int yoff);
bool draw(ManagedSurface *g, bool forceRedraw = false) override;
bool draw(bool forceRedraw = false) override;
@@ -75,8 +76,8 @@ public:
void drawToPoint(ManagedSurface *g, Common::Point dstPoint);
ManagedSurface *getSurface() { return _canvas._surface; }
- ManagedSurface *getGlyphMask() { return _canvas._glyphMask; }
- ManagedSurface *getCharBoxMask() { return _canvas._charBoxMask; }
+ ManagedSurface *getGlyphMask() { return _glyphMaskSurface; }
+ ManagedSurface *getCharBoxMask() { return _charMaskSurface; }
int getInterLinear() { return _canvas._interLinear; }
void setInterLinear(int interLinear);
@@ -249,6 +250,9 @@ private:
ManagedSurface *_cursorSurface;
ManagedSurface *_cursorSurface2;
+ ManagedSurface *_glyphMaskSurface;
+ ManagedSurface *_charMaskSurface;
+
int _editableRow;
bool _addInputPadding;
Commit: 81ed190f96c02fd72026c7f2f1e4e9c97b64af89
https://github.com/scummvm/scummvm/commit/81ed190f96c02fd72026c7f2f1e4e9c97b64af89
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-04-14T14:49:11+02:00
Commit Message:
WAGE: Properly deinit ImGui on engine exit
Changed paths:
engines/wage/wage.cpp
diff --git a/engines/wage/wage.cpp b/engines/wage/wage.cpp
index 499298d4225..df55944beb7 100644
--- a/engines/wage/wage.cpp
+++ b/engines/wage/wage.cpp
@@ -200,6 +200,10 @@ Common::Error WageEngine::run() {
}
}
+#ifdef USE_IMGUI
+ _system->setImGuiCallbacks(ImGuiCallbacks());
+#endif
+
return Common::kNoError;
}
@@ -534,7 +538,7 @@ void WageEngine::processTurnInternal(Common::String *textInput, Designed *clickI
_temporarilyHidden = true;
_gui->clearOutput();
_gui->_consoleWindow->setTextWindowFont(_world->_player->_currentScene->getFont());
- _world->_commandsMenu = _world->_commandsMenuDefault;
+ _world->_commandsMenu = _world->_commandsMenuDefault;
_gui->regenCommandsMenu();
regen();
sayText(playerScene->_name, Common::TextToSpeechManager::QUEUE);
Commit: ff7fac3644e417d25a823aa893a80d9e17ca76cf
https://github.com/scummvm/scummvm/commit/ff7fac3644e417d25a823aa893a80d9e17ca76cf
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-04-14T14:49:11+02:00
Commit Message:
GRAPHICS: MACGUI: Do not override getSurface() in MacText
Changed paths:
graphics/macgui/mactext.h
graphics/macgui/macwidget.h
diff --git a/graphics/macgui/mactext.h b/graphics/macgui/mactext.h
index 9caf0c866d5..2eaf1f02f9c 100644
--- a/graphics/macgui/mactext.h
+++ b/graphics/macgui/mactext.h
@@ -75,7 +75,7 @@ public:
void drawToPoint(ManagedSurface *g, Common::Rect srcRect, Common::Point dstPoint);
void drawToPoint(ManagedSurface *g, Common::Point dstPoint);
- ManagedSurface *getSurface() { return _canvas._surface; }
+ ManagedSurface *getRawSurface() { return _canvas._surface; }
ManagedSurface *getGlyphMask() { return _glyphMaskSurface; }
ManagedSurface *getCharBoxMask() { return _charMaskSurface; }
diff --git a/graphics/macgui/macwidget.h b/graphics/macgui/macwidget.h
index edba41dd1b3..d08860eaac1 100644
--- a/graphics/macgui/macwidget.h
+++ b/graphics/macgui/macwidget.h
@@ -86,7 +86,7 @@ public:
void removeWidget(MacWidget *child, bool del = true);
- Graphics::ManagedSurface *getSurface() { return _composeSurface; }
+ virtual Graphics::ManagedSurface *getSurface() final { return _composeSurface; }
protected:
uint16 _border;
Commit: bcf02841b6b3f7cf7cf4450067dff422e5bfac7b
https://github.com/scummvm/scummvm/commit/bcf02841b6b3f7cf7cf4450067dff422e5bfac7b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-04-14T14:49:12+02:00
Commit Message:
DIRECTOR: DT: Query full MacText surface for displaying Text Castmembers
Changed paths:
engines/director/debugger/debugtools.cpp
diff --git a/engines/director/debugger/debugtools.cpp b/engines/director/debugger/debugtools.cpp
index f64822a6aac..ed093b5baad 100644
--- a/engines/director/debugger/debugtools.cpp
+++ b/engines/director/debugger/debugtools.cpp
@@ -421,9 +421,9 @@ ImGuiImage getTextID(CastMember *castMember) {
// Make a temporary channel to blit the shape from
Channel *channel = new Channel(nullptr, sprite);
- Graphics::MacWidget *widget = castMember->createWidget(bbox, channel, kTextSprite);
+ Graphics::MacText *widget = (Graphics::MacText *)castMember->createWidget(bbox, channel, kTextSprite);
Graphics::Surface surface;
- surface.copyFrom(*widget->getSurface());
+ surface.copyFrom(*widget->getRawSurface());
if (debugChannelSet(8, kDebugImages)) {
Common::String prepend = "text";
@@ -947,7 +947,7 @@ void setSelectedChannel(int channel) {
_state->_selectedChannel = channel;
if (channel > 0) {
- _state->_scrollToChannel = true;
+ _state->_scrollToChannel = true;
_state->_w.channels = true;
}
}
Commit: f614128b5d3aaee615c9b3f69ce9cdb448136d9a
https://github.com/scummvm/scummvm/commit/f614128b5d3aaee615c9b3f69ce9cdb448136d9a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-04-14T14:49:12+02:00
Commit Message:
GRAPHICS: MACGUI: Final fixes for drawing masked MacText with scrollbar
Changed paths:
graphics/macgui/mactext.cpp
graphics/macgui/mactext.h
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index f83f3d95793..682ad7bf91a 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -223,8 +223,8 @@ void MacText::init(uint32 fgcolor, uint32 bgcolor, int maxWidth, TextAlign textA
}
}
- _charMaskSurface = new ManagedSurface(_dims.width(), _dims.height(), Graphics::PixelFormat::createFormatCLUT8());
- _charMaskSurface->clear(0);
+ _charBoxMaskSurface = new ManagedSurface(_dims.width(), _dims.height(), Graphics::PixelFormat::createFormatCLUT8());
+ _charBoxMaskSurface->clear(0);
_glyphMaskSurface = new ManagedSurface(_dims.width(), _dims.height(), Graphics::PixelFormat::createFormatCLUT8());
_glyphMaskSurface->clear(0);
@@ -293,13 +293,13 @@ MacText::~MacText() {
_borderSurface.free();
_borderMaskSurface.free();
- _charMaskSurface->free();
+ _charBoxMaskSurface->free();
_glyphMaskSurface->free();
delete _cursorRect;
delete _cursorSurface;
delete _cursorSurface2;
- delete _charMaskSurface;
+ delete _charBoxMaskSurface;
delete _glyphMaskSurface;
}
@@ -347,10 +347,9 @@ void MacText::resizeScrollBar(int w, int h) {
_scrollBorder.blitBorderInto(_borderSurface, kWindowBorderScrollbar | kWindowBorderActive);
_borderMaskSurface.free();
- _borderMaskSurface.create(w, h, _wm->_pixelformat);
- if (_wm->_pixelformat.bytesPerPixel == 1) {
- _borderMaskSurface.clear(_wm->_colorGreen);
- }
+ _borderMaskSurface.create(w, h, Graphics::PixelFormat::createFormatCLUT8());
+ _borderMaskSurface.clear(0);
+
_scrollBorder.blitBorderInto(_borderMaskSurface, kWindowBorderScrollbar | kWindowBorderActive, true, 0xff);
}
@@ -660,41 +659,6 @@ void MacText::render() {
_canvas.render(0, _canvas._text.size());
_fullRefresh = false;
-
-#if 0
- byte pal[256 * 3];
- Common::DumpFile out;
- Common::Path filename(Common::String::format("z-%p-1-image.png", (void *)this));
- if (out.open(filename)) {
- warning("Wrote: %s", filename.toString().c_str());
- _canvas._surface->grabPalette(pal, 0, 256);
- Image::writePNG(out, _canvas._surface->rawSurface(), pal);
- out.flush();
- out.close();
- }
-
- // set b/w palette for mask
- memset(pal, 0, sizeof(pal));
- pal[0xff * 3 + 0] = 0xff;
- pal[0xff * 3 + 1] = 0xff;
- pal[0xff * 3 + 2] = 0xff;
-
- filename = Common::Path(Common::String::format("z-%p-2-glyphMask.png", (void *)this));
- if (out.open(filename)) {
- warning("Wrote: %s", filename.toString().c_str());
- Image::writePNG(out, _canvas._glyphMask->rawSurface(), pal);
- out.flush();
- out.close();
- }
-
- filename = Common::Path(Common::String::format("z-%p-3-charBoxMask.png", (void *)this));
- if (out.open(filename)) {
- warning("Wrote: %s", filename.toString().c_str());
- Image::writePNG(out, _canvas._charBoxMask->rawSurface(), pal);
- out.flush();
- out.close();
- }
-#endif
}
}
@@ -954,7 +918,7 @@ void MacText::removeLastLine() {
_canvas._textMaxHeight -= h;
}
-void MacText::drawStep(ManagedSurface *g, ManagedSurface *src, ManagedSurface *border, int x, int y, int w, int h, int xoff, int yoff, uint32 tcolor) {
+void MacText::drawStep(ManagedSurface *g, ManagedSurface *src, ManagedSurface *border, int x, int y, int w, int h, int xoff, int yoff, uint32 tcolor, uint32 btcolor) {
if (x + w < src->w || y + h < src->h)
g->fillRect(Common::Rect(x + xoff, y + yoff, x + w + xoff, y + h + yoff), tcolor);
@@ -962,13 +926,10 @@ void MacText::drawStep(ManagedSurface *g, ManagedSurface *src, ManagedSurface *b
if (_canvas._textShadow)
g->blitFrom(*src, Common::Rect(MIN<int>(src->w, x), MIN<int>(src->h, y), MIN<int>(src->w, x + w), MIN<int>(src->h, y + h)), Common::Point(xoff + _canvas._textShadow, yoff + _canvas._textShadow));
- g->simpleBlitFrom(*_canvas._surface, Common::Rect(MIN<int>(src->w, x), MIN<int>(src->h, y), MIN<int>(src->w, x + w), MIN<int>(src->h, y + h)), Common::Point(xoff, yoff));
-
- if (_scrollBar && _scrollBorder.hasBorder(kWindowBorderScrollbar)) {
- uint32 transcolor = (_wm->_pixelformat.bytesPerPixel == 1) ? _wm->_colorGreen : 0;
+ g->simpleBlitFrom(*src, Common::Rect(MIN<int>(src->w, x), MIN<int>(src->h, y), MIN<int>(src->w, x + w), MIN<int>(src->h, y + h)), Common::Point(xoff, yoff));
- g->transBlitFrom(*border, Common::Rect(0, 0, border->w, border->h), Common::Point(0, 0), transcolor);
- }
+ if (_scrollBar && _scrollBorder.hasBorder(kWindowBorderScrollbar))
+ g->transBlitFrom(*border, Common::Rect(0, 0, border->w, border->h), Common::Point(0, 0), btcolor);
}
void MacText::draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int yoff) {
@@ -977,12 +938,75 @@ void MacText::draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int
render();
- drawStep(g, _canvas._surface, &_borderSurface, x, y, w, h, xoff, yoff, _canvas._tbgcolor);
- drawStep(_glyphMaskSurface, _canvas._glyphMask, &_borderMaskSurface, x, y, w, h, xoff, yoff, 0);
- drawStep(_charMaskSurface, _canvas._charBoxMask, &_borderMaskSurface, x, y, w, h, xoff, yoff, 0);
+ drawStep(g, _canvas._surface, &_borderSurface, x, y, w, h, xoff, yoff, _canvas._tbgcolor, (_wm->_pixelformat.bytesPerPixel == 1) ? _wm->_colorGreen : 0);
+
+ drawStep(_glyphMaskSurface, _canvas._glyphMask, &_borderMaskSurface, x, y, w, h, xoff, yoff, 0, 0);
+ drawStep(_charBoxMaskSurface, _canvas._charBoxMask, &_borderMaskSurface, x, y, w, h, xoff, yoff, 0, 0);
_contentIsDirty = false;
_cursorDirty = false;
+
+#if 0
+ byte pal[256 * 3];
+ Common::DumpFile out;
+ Common::Path filename(Common::String::format("z-%p-1-image.png", (void *)this));
+ if (out.open(filename)) {
+ warning("Wrote: %s", filename.toString().c_str());
+ _canvas._surface->grabPalette(pal, 0, 256);
+ Image::writePNG(out, _composeSurface->rawSurface(), pal);
+ out.flush();
+ out.close();
+ }
+
+ // set b/w palette for mask
+ for (int i = 0; i < 256; i++) {
+ pal[i * 3 + 0] = i;
+ pal[i * 3 + 1] = i;
+ pal[i * 3 + 2] = i;
+ }
+
+ filename = Common::Path(Common::String::format("z-%p-2-glyphMask.png", (void *)this));
+ if (out.open(filename)) {
+ warning("Wrote: %s", filename.toString().c_str());
+ Image::writePNG(out, _glyphMaskSurface->rawSurface(), pal);
+ out.flush();
+ out.close();
+ }
+
+ filename = Common::Path(Common::String::format("z-%p-2-charBoxMask.png", (void *)this));
+ if (out.open(filename)) {
+ warning("Wrote: %s", filename.toString().c_str());
+ Image::writePNG(out, _charBoxMaskSurface->rawSurface(), pal);
+ out.flush();
+ out.close();
+ }
+
+ if (_scrollBar) {
+ filename = Common::Path(Common::String::format("z-%p-2-borderMask.png", (void *)this));
+ if (out.open(filename)) {
+ warning("Wrote: %s", filename.toString().c_str());
+ Image::writePNG(out, _borderMaskSurface.rawSurface(), pal);
+ out.flush();
+ out.close();
+ }
+ }
+
+ filename = Common::Path(Common::String::format("z-%p-3-c-glyphMask.png", (void *)this));
+ if (out.open(filename)) {
+ warning("Wrote: %s", filename.toString().c_str());
+ Image::writePNG(out, _canvas._glyphMask->rawSurface(), pal);
+ out.flush();
+ out.close();
+ }
+
+ filename = Common::Path(Common::String::format("z-%p-3-c-charBoxMask.png", (void *)this));
+ if (out.open(filename)) {
+ warning("Wrote: %s", filename.toString().c_str());
+ Image::writePNG(out, _canvas._charBoxMask->rawSurface(), pal);
+ out.flush();
+ out.close();
+ }
+#endif
}
bool MacText::draw(bool forceRedraw) {
diff --git a/graphics/macgui/mactext.h b/graphics/macgui/mactext.h
index 2eaf1f02f9c..34220103092 100644
--- a/graphics/macgui/mactext.h
+++ b/graphics/macgui/mactext.h
@@ -68,7 +68,7 @@ public:
void render();
void undrawCursor();
- void drawStep(ManagedSurface *g, ManagedSurface *src, ManagedSurface *border, int x, int y, int w, int h, int xoff, int yoff, uint32 transcolor);
+ void drawStep(ManagedSurface *g, ManagedSurface *src, ManagedSurface *border, int x, int y, int w, int h, int xoff, int yoff, uint32 transcolor, uint32 btcolor);
void draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int yoff);
bool draw(ManagedSurface *g, bool forceRedraw = false) override;
bool draw(bool forceRedraw = false) override;
@@ -77,7 +77,7 @@ public:
ManagedSurface *getRawSurface() { return _canvas._surface; }
ManagedSurface *getGlyphMask() { return _glyphMaskSurface; }
- ManagedSurface *getCharBoxMask() { return _charMaskSurface; }
+ ManagedSurface *getCharBoxMask() { return _charBoxMaskSurface; }
int getInterLinear() { return _canvas._interLinear; }
void setInterLinear(int interLinear);
@@ -251,7 +251,7 @@ private:
ManagedSurface *_cursorSurface2;
ManagedSurface *_glyphMaskSurface;
- ManagedSurface *_charMaskSurface;
+ ManagedSurface *_charBoxMaskSurface;
int _editableRow;
More information about the Scummvm-git-logs
mailing list