[Scummvm-git-logs] scummvm master -> e8aa1057794bea4dc711a2555924f90ff0dfa5fd
sev-
sev at scummvm.org
Sat Aug 8 09:33:34 UTC 2020
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
ffed05f498 GRAPHICS: MACGUI: Clear surface before full refresh
e8aa105779 GRAPHICS: MACGUI: Make sure we always undraw cursor
Commit: ffed05f498e1af55316920246d26b5ad3d7c3cdf
https://github.com/scummvm/scummvm/commit/ffed05f498e1af55316920246d26b5ad3d7c3cdf
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-08T11:04:42+02:00
Commit Message:
GRAPHICS: MACGUI: Clear surface before full refresh
Changed paths:
graphics/macgui/mactext.cpp
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 7dc1eb182a..e9c5fb7bd6 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -525,6 +525,7 @@ void MacText::reallocSurface() {
void MacText::render() {
if (_fullRefresh) {
+ _surface->clear(_bgcolor);
render(0, _textLines.size());
_fullRefresh = false;
Commit: e8aa1057794bea4dc711a2555924f90ff0dfa5fd
https://github.com/scummvm/scummvm/commit/e8aa1057794bea4dc711a2555924f90ff0dfa5fd
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-08T11:24:34+02:00
Commit Message:
GRAPHICS: MACGUI: Make sure we always undraw cursor
Changed paths:
graphics/macgui/mactext.cpp
graphics/macgui/mactext.h
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index e9c5fb7bd6..356b36096c 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -240,6 +240,8 @@ void MacText::init() {
_cursorSurface = new ManagedSurface(1, kCursorHeight);
_cursorSurface->clear(_wm->_colorBlack);
+ _cursorSurface2 = new ManagedSurface(1, kCursorHeight);
+ _cursorSurface2->clear(_bgcolor);
reallocSurface();
setAlignOffset(_textAlignment);
@@ -253,6 +255,7 @@ MacText::~MacText() {
delete _cursorRect;
delete _surface;
delete _cursorSurface;
+ delete _cursorSurface2;
}
void MacText::setMaxWidth(int maxWidth) {
@@ -871,6 +874,10 @@ bool MacText::draw(bool forceRedraw) {
_cursorDirty = false;
Common::Point offset(calculateOffset());
+
+ if (!_cursorState)
+ _composeSurface->blitFrom(*_cursorSurface2, *_cursorRect, Common::Point(_cursorX, _cursorY + offset.y + 1));
+
draw(_composeSurface, 0, _scrollPos, _surface->w, _scrollPos + _surface->h, offset.x, offset.y);
for (int bb = 0; bb < _shadow; bb ++) {
@@ -1680,6 +1687,8 @@ void MacText::updateCursorPos() {
if (_textLines.empty()) {
_cursorX = _cursorY = 0;
} else {
+ undrawCursor();
+
_cursorRow = MIN<int>(_cursorRow, _textLines.size() - 1);
Common::Point offset(calculateOffset());
@@ -1698,8 +1707,10 @@ void MacText::updateCursorPos() {
}
void MacText::undrawCursor() {
- _cursorState = false;
_cursorDirty = true;
+
+ Common::Point offset(calculateOffset());
+ _composeSurface->blitFrom(*_cursorSurface2, *_cursorRect, Common::Point(_cursorX, _cursorY + offset.y + 1));
}
} // End of namespace Graphics
diff --git a/graphics/macgui/mactext.h b/graphics/macgui/mactext.h
index 2f4e6b0547..41436d27a6 100644
--- a/graphics/macgui/mactext.h
+++ b/graphics/macgui/mactext.h
@@ -272,6 +272,7 @@ protected:
private:
ManagedSurface *_cursorSurface;
+ ManagedSurface *_cursorSurface2;
int _editableRow;
More information about the Scummvm-git-logs
mailing list