[Scummvm-git-logs] scummvm master -> faa88c8f51e441934b3d869aa23a416b69adb5b3
npjg
nathanael.gentrydb8 at gmail.com
Wed Aug 19 20:33:48 UTC 2020
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
73c970421f DIRECTOR: Re-render changed cursors on new frame
7b82dcd8ac GRAPHICS: MACGUI: Add colour to text render debug
faa88c8f51 DIRECTOR: Preserve text formatting on setText
Commit: 73c970421fb2a07adeccc18c9073dd08fffb2612
https://github.com/scummvm/scummvm/commit/73c970421fb2a07adeccc18c9073dd08fffb2612
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-08-19T16:31:36-04:00
Commit Message:
DIRECTOR: Re-render changed cursors on new frame
Changed paths:
engines/director/lingo/lingo-the.cpp
engines/director/score.cpp
engines/director/score.h
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index fab7e62a12..addb9e728d 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -1306,12 +1306,19 @@ void Lingo::setTheSprite(Datum &id1, int field, Datum &d) {
}
break;
case kTheCursor:
- if (d.type == INT) {
+ if (d.type == INT && channel->_cursor._cursorResId != d.asInt()) {
channel->_cursor.readFromResource(d.asInt());
+ score->_cursorDirty = true;
} else if (d.type == ARRAY && d.u.farr->size() == 2) {
uint cursorId = d.u.farr->operator[](0).asCastId();
uint maskId = d.u.farr->operator[](1).asCastId();
+
+ if (cursorId == channel->_cursor._cursorCastId &&
+ maskId == channel->_cursor._cursorMaskId)
+ return;
+
channel->_cursor.readFromCast(cursorId, maskId);
+ score->_cursorDirty = true;
}
break;
case kTheEditableText:
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 528cb1c477..10b1db4aee 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -68,6 +68,7 @@ Score::Score(Movie *movie) {
_currentLabel = 0;
_nextFrameTime = 0;
_waitForChannel = 0;
+ _cursorDirty = false;
_waitForClick = false;
_waitForClickCursor = false;
_activeFade = 0;
@@ -455,6 +456,11 @@ void Score::renderFrame(uint16 frameId, RenderMode mode) {
if (_frames[frameId]->_sound1 || _frames[frameId]->_sound2)
playSoundChannel(frameId);
+
+ if (_cursorDirty) {
+ renderCursor(_movie->getWindow()->getMousePos());
+ _cursorDirty = false;
+ }
}
bool Score::renderTransition(uint16 frameId) {
diff --git a/engines/director/score.h b/engines/director/score.h
index a3c6078c5e..edf5f07d08 100644
--- a/engines/director/score.h
+++ b/engines/director/score.h
@@ -137,6 +137,7 @@ public:
int _waitForChannel;
bool _waitForClick;
bool _waitForClickCursor;
+ bool _cursorDirty;
int _activeFade;
Cursor *_currentCursor;
Commit: 7b82dcd8acb1fee39998bb39b25dbd25a4a278f7
https://github.com/scummvm/scummvm/commit/7b82dcd8acb1fee39998bb39b25dbd25a4a278f7
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-08-19T16:32:45-04:00
Commit Message:
GRAPHICS: MACGUI: Add colour to text render debug
Changed paths:
graphics/macgui/mactext.cpp
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index bbacaa1b08..31695be8e5 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -564,9 +564,9 @@ void MacText::render(int from, int to) {
// TODO: _textMaxWidth, when -1, was not rendering ANY text.
for (uint j = 0; j < _textLines[i].chunks.size(); j++) {
- debug(9, "MacText::render: line %d[%d] h:%d at %d,%d (%s) fontid: %d on %dx%d",
+ debug(9, "MacText::render: line %d[%d] h:%d at %d,%d (%s) fontid: %d on %dx%d, color: %d",
i, j, xOffset, _textLines[i].y, _textLines[i].height, _textLines[i].chunks[j].text.encode().c_str(),
- _textLines[i].chunks[j].fontId, _surface->w, _surface->h);
+ _textLines[i].chunks[j].fontId, _surface->w, _surface->h, _textLines[i].chunks[j].fgcolor);
if (_textLines[i].chunks[j].text.empty())
continue;
Commit: faa88c8f51e441934b3d869aa23a416b69adb5b3
https://github.com/scummvm/scummvm/commit/faa88c8f51e441934b3d869aa23a416b69adb5b3
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-08-19T16:32:45-04:00
Commit Message:
DIRECTOR: Preserve text formatting on setText
Changed paths:
engines/director/castmember.cpp
diff --git a/engines/director/castmember.cpp b/engines/director/castmember.cpp
index eba1742109..105145b465 100644
--- a/engines/director/castmember.cpp
+++ b/engines/director/castmember.cpp
@@ -645,10 +645,14 @@ void TextCastMember::importRTE(byte *text) {
void TextCastMember::setText(const char *text) {
// Do nothing if text did not change
- if (_ftext.equals(text))
+ if (_ptext.equals(text))
return;
- _ptext = _ftext = text;
+ // If text has changed, use the cached formatting from first STXT in this castmember.
+ Common::String formatting = Common::String::format("\001\016%04x%02x%04x%04x%04x%04x", _fontId, _textSlant, _fontSize, _fgpalinfo1, _fgpalinfo2, _fgpalinfo3);
+ _ptext = text;
+ _ftext = formatting + text;
+
_modified = true;
}
More information about the Scummvm-git-logs
mailing list