[Scummvm-git-logs] scummvm master -> 3203346dfb06416e4fd5b9519ceba5e875844112
sev-
sev at scummvm.org
Sun Aug 1 15:22:17 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:
ec06d940a2 BACKENDS: Explicitly use ellipsis for OSD text if needed
4fa0f7c9ba BACKENDS: Explicitly use ellipsis for the virtual keybord if needed
bb98ce92f2 MACGUI: Explicitly use ellipsis to draw text when needed
3203346dfb GRAPHICS: Do not use ellipsis by default when drawing text
Commit: ec06d940a2a59014fe78daff8af43536cb7dbf91
https://github.com/scummvm/scummvm/commit/ec06d940a2a59014fe78daff8af43536cb7dbf91
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-08-01T17:22:13+02:00
Commit Message:
BACKENDS: Explicitly use ellipsis for OSD text if needed
This is the default, so this commit does not change the behaviour.
But this will allow to change the default at a later stage.
Changed paths:
backends/graphics/opengl/opengl-graphics.cpp
backends/graphics/surfacesdl/surfacesdl-graphics.cpp
backends/platform/3ds/osystem-graphics.cpp
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index 5ea120252d..95ece2b1c3 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -849,7 +849,7 @@ void OpenGLGraphicsManager::osdMessageUpdateSurface() {
for (uint i = 0; i < osdLines.size(); ++i) {
font->drawString(dst, osdLines[i],
0, i * lineHeight + vOffset + lineSpacing, width,
- white, Graphics::kTextAlignCenter);
+ white, Graphics::kTextAlignCenter, 0, true);
}
_osdMessageSurface->updateGLTexture();
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index d320649575..3a9ab0cfd3 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -2217,7 +2217,7 @@ void SurfaceSdlGraphicsManager::displayMessageOnOSD(const Common::U32String &msg
font->drawString(&dst, lines[i],
0, 0 + i * lineHeight + vOffset + lineSpacing, width,
SDL_MapRGB(_osdMessageSurface->format, 255, 255, 255),
- Graphics::kTextAlignCenter);
+ Graphics::kTextAlignCenter, 0, true);
}
// Finished drawing, so unlock the OSD message surface
diff --git a/backends/platform/3ds/osystem-graphics.cpp b/backends/platform/3ds/osystem-graphics.cpp
index fe584522ac..ddd9704f4a 100644
--- a/backends/platform/3ds/osystem-graphics.cpp
+++ b/backends/platform/3ds/osystem-graphics.cpp
@@ -690,7 +690,7 @@ void OSystem_3DS::displayMessageOnOSD(const Common::U32String &msg) {
font->drawString(&_osdMessage, lines[i],
0, 0 + i * lineHeight + vOffset + lineSpacing, width,
_pfDefaultTexture.RGBToColor(255, 255, 255),
- Graphics::kTextAlignCenter);
+ Graphics::kTextAlignCenter, 0, true);
}
_osdMessageEndTime = getMillis(true) + kOSDMessageDuration;
Commit: 4fa0f7c9ba6d6326b88ba1edd09696ba9d2581dc
https://github.com/scummvm/scummvm/commit/4fa0f7c9ba6d6326b88ba1edd09696ba9d2581dc
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-08-01T17:22:13+02:00
Commit Message:
BACKENDS: Explicitly use ellipsis for the virtual keybord if needed
This is the default, so this commit does not change the behaviour.
But this will allow to change the default at a later stage.
Changed paths:
backends/vkeybd/virtual-keyboard-gui.cpp
diff --git a/backends/vkeybd/virtual-keyboard-gui.cpp b/backends/vkeybd/virtual-keyboard-gui.cpp
index ffef3efac3..bd0d41d820 100644
--- a/backends/vkeybd/virtual-keyboard-gui.cpp
+++ b/backends/vkeybd/virtual-keyboard-gui.cpp
@@ -441,7 +441,7 @@ void VirtualKeyboardGUI::updateDisplay() {
// draw to display surface
_dispSurface.fillRect(Rect(_dispSurface.w, _dispSurface.h), _dispBackColor);
- _dispFont->drawString(&_dispSurface, dispText, 0, 0, _dispSurface.w, _dispForeColor);
+ _dispFont->drawString(&_dispSurface, dispText, 0, 0, _dispSurface.w, _dispForeColor, Graphics::kTextAlignLeft, 0, true);
String beforeCaret(wholeText.c_str() + _dispI, wholeText.c_str() + cursorPos);
_caretX = _dispFont->getStringWidth(beforeCaret);
Commit: bb98ce92f21401069c45c65cf1e0da74cf330ef3
https://github.com/scummvm/scummvm/commit/bb98ce92f21401069c45c65cf1e0da74cf330ef3
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-08-01T17:22:13+02:00
Commit Message:
MACGUI: Explicitly use ellipsis to draw text when needed
This is the default, so this commit does not change the behaviour.
But this will allow to change the default at a later stage.
Changed paths:
graphics/macgui/macmenu.cpp
graphics/macgui/mactext.cpp
diff --git a/graphics/macgui/macmenu.cpp b/graphics/macgui/macmenu.cpp
index 05f5b95374..fc22fd939f 100644
--- a/graphics/macgui/macmenu.cpp
+++ b/graphics/macgui/macmenu.cpp
@@ -1037,12 +1037,12 @@ bool MacMenu::draw(ManagedSurface *g, bool forceRedraw) {
int accOff = _align == kTextAlignRight ? it->bbox.width() - _font->getStringWidth(it->unicodeText) : 0;
Common::UnicodeBiDiText utxt(it->unicodeText);
- _font->drawString(&_screen, utxt.visual, x, y, it->bbox.width(), color, _align);
+ _font->drawString(&_screen, utxt.visual, x, y, it->bbox.width(), color, _align, 0, true);
underlineAccelerator(&_screen, _font, utxt, x + accOff, y, it->shortcutPos, color);
} else {
const Font *font = getMenuFont(it->style);
- font->drawString(&_screen, it->text, x, y, it->bbox.width(), color);
+ font->drawString(&_screen, it->text, x, y, it->bbox.width(), color, Graphics::kTextAlignLeft, 0, true);
}
}
@@ -1121,12 +1121,12 @@ void MacMenu::renderSubmenu(MacMenuSubMenu *menu, bool recursive) {
if (menu->items[i]->unicode) {
Common::UnicodeBiDiText utxt(unicodeText);
- _font->drawString(s, utxt.visual, tx, ty, r->width(), color, _align);
+ _font->drawString(s, utxt.visual, tx, ty, r->width(), color, _align, 0, true);
underlineAccelerator(s, _font, utxt, tx + accOff, ty, shortcutPos, color);
} else {
const Font *font = getMenuFont(menu->items[i]->style);
- font->drawString(s, text, tx, ty, r->width(), color);
+ font->drawString(s, text, tx, ty, r->width(), color, Graphics::kTextAlignLeft, 0, true);
}
if (menu->items[i]->checked) {
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 2dad943032..70b80193bb 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -914,10 +914,10 @@ void MacText::render(int from, int to, int shadow) {
if (_textLines[i].chunks[j].plainByteMode()) {
Common::String str = _textLines[i].chunks[j].getEncodedText();
- _textLines[i].chunks[j].getFont()->drawString(surface, str, xOffset, _textLines[i].y + yOffset, w, shadow ? _wm->_colorBlack : _textLines[i].chunks[j].fgcolor);
+ _textLines[i].chunks[j].getFont()->drawString(surface, str, xOffset, _textLines[i].y + yOffset, w, shadow ? _wm->_colorBlack : _textLines[i].chunks[j].fgcolor, Graphics::kTextAlignLeft, 0, true);
xOffset += _textLines[i].chunks[j].getFont()->getStringWidth(str);
} else {
- _textLines[i].chunks[j].getFont()->drawString(surface, convertBiDiU32String(_textLines[i].chunks[j].text), xOffset, _textLines[i].y + yOffset, w, shadow ? _wm->_colorBlack : _textLines[i].chunks[j].fgcolor);
+ _textLines[i].chunks[j].getFont()->drawString(surface, convertBiDiU32String(_textLines[i].chunks[j].text), xOffset, _textLines[i].y + yOffset, w, shadow ? _wm->_colorBlack : _textLines[i].chunks[j].fgcolor, Graphics::kTextAlignLeft, 0, true);
xOffset += _textLines[i].chunks[j].getFont()->getStringWidth(_textLines[i].chunks[j].text);
}
}
Commit: 3203346dfb06416e4fd5b9519ceba5e875844112
https://github.com/scummvm/scummvm/commit/3203346dfb06416e4fd5b9519ceba5e875844112
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-08-01T17:22:13+02:00
Commit Message:
GRAPHICS: Do not use ellipsis by default when drawing text
This makes the default for drawString consistent with the default
for getBoundingBox.
This should also fix ellipsis being used by mistake in some games
(this was reported in Myst Masterpiece Edition for the menu screen).
Changed paths:
graphics/font.h
diff --git a/graphics/font.h b/graphics/font.h
index 4fa231aa58..69fb64d088 100644
--- a/graphics/font.h
+++ b/graphics/font.h
@@ -206,13 +206,13 @@ public:
* @param useEllipsis Use ellipsis if needed to fit the string in the area.
*
*/
- void drawString(Surface *dst, const Common::String &str, int x, int y, int w, uint32 color, TextAlign align = kTextAlignLeft, int deltax = 0, bool useEllipsis = true) const;
+ void drawString(Surface *dst, const Common::String &str, int x, int y, int w, uint32 color, TextAlign align = kTextAlignLeft, int deltax = 0, bool useEllipsis = false) const;
/** @overload */
- void drawString(Surface *dst, const Common::U32String &str, int x, int y, int w, uint32 color, TextAlign align = kTextAlignLeft, int deltax = 0, bool useEllipsis = true) const;
+ void drawString(Surface *dst, const Common::U32String &str, int x, int y, int w, uint32 color, TextAlign align = kTextAlignLeft, int deltax = 0, bool useEllipsis = false) const;
/** @overload */
- void drawString(ManagedSurface *dst, const Common::String &str, int x, int _y, int w, uint32 color, TextAlign align = kTextAlignLeft, int deltax = 0, bool useEllipsis = true) const;
+ void drawString(ManagedSurface *dst, const Common::String &str, int x, int _y, int w, uint32 color, TextAlign align = kTextAlignLeft, int deltax = 0, bool useEllipsis = false) const;
/** @overload */
- void drawString(ManagedSurface *dst, const Common::U32String &str, int x, int y, int w, uint32 color, TextAlign align = kTextAlignLeft, int deltax = 0, bool useEllipsis = true) const;
+ void drawString(ManagedSurface *dst, const Common::U32String &str, int x, int y, int w, uint32 color, TextAlign align = kTextAlignLeft, int deltax = 0, bool useEllipsis = false) const;
/**
* Compute and return the width of the string @p str when rendered using this font.
More information about the Scummvm-git-logs
mailing list