[Scummvm-git-logs] scummvm branch-2-8 -> 1216d4ad8857f69a0d991263e9c41b434a226ae2
moralrecordings
noreply at scummvm.org
Sun Jan 21 01:56:31 UTC 2024
This automated email contains information about 15 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
51be503e12 DIRECTOR: LINGO: Add more precise behaviour for b_clearGlobals
920b6477c5 DIRECTOR: Only load frame data if frame has changed
918845ae8d DIRECTOR: Allow b_editableText for D4 and up
3db0c6f380 DIRECTOR: Force editable text boxes to be rendered in front
3b8a86d3ee GRAPHICS: MACGUI: Remove pseudotransparency workaround in MacText
c801b0b493 GRAPHICS: MACGUI: Fix fgcolor conversion in MacText
33d371e062 DIRECTOR: Set default TextCastMember fgcolor from Stxt
0324b34190 DIRECTOR: LINGO: Fix missing null check in b_spriteBox
91c14b4d62 DIRECTOR: Disable Windows keycode table for D4 and up
57655621ed DIRECTOR: Use Shift-JIS text decoder when g_lingo->_romanLingo is false
5ee82e91ce GRAPHICS: MACGUI: Stop MacTextCanvas::chopChunk from removing last chunk
511fab5aab GRAPHICS: MACGUI: Move paragraph end marker when merging rows
06ca499351 DIRECTOR: Fix TextCastMember::setRawText for editable fields
15ff1c584e DIRECTOR: Adjust freezing logic in func_goto
1216d4ad88 DIRECTOR: Score: restrict _curFrameNumber updates
Commit: 51be503e1237ee4cd76037b98854c1b12aef3c0c
https://github.com/scummvm/scummvm/commit/51be503e1237ee4cd76037b98854c1b12aef3c0c
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-21T09:34:42+08:00
Commit Message:
DIRECTOR: LINGO: Add more precise behaviour for b_clearGlobals
>From testing in D4 with showGlobals, original Director will not delete a
global if it contains a factory object.
Fixes ck_data/opening/id_input.dxr in Cosmology of Kyoto, which creates
a global factory object, calls clearGlobals, then inexplicably expects the
object to still be there.
Changed paths:
engines/director/lingo/lingo-builtins.cpp
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 78f5a440177..af9f667e53a 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -1890,6 +1890,10 @@ void LB::b_alert(int nargs) {
void LB::b_clearGlobals(int nargs) {
for (auto &it : g_lingo->_globalvars) {
if (!it._value.ignoreGlobal) {
+ // For some reason, factory objects are not removed
+ // by this command.
+ if (it._value.type == OBJECT && it._value.u.obj->getObjType() & (kFactoryObj | kScriptObj))
+ continue;
g_lingo->_globalvars.erase(it._key);
}
}
Commit: 920b6477c536a74c7ebee8d281e1d7d41da6bfc6
https://github.com/scummvm/scummvm/commit/920b6477c536a74c7ebee8d281e1d7d41da6bfc6
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-21T09:34:42+08:00
Commit Message:
DIRECTOR: Only load frame data if frame has changed
Loading the frame data wipes out e.g. sprites that have been changed
while playback has been paused.
Fixes the buttons on the opening menu screen of Cosmology of Kyoto.
Changed paths:
engines/director/score.cpp
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 7b99bbc96b2..2848c7314a8 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -400,6 +400,8 @@ void Score::update() {
for (uint ch = 0; ch < _channels.size(); ch++)
*_currentFrame->_sprites[ch] = *_channels[ch]->_sprite;
+ bool frameChanged = false;
+
if (!_vm->_playbackPaused) {
if (_nextFrame) {
// With the advent of demand loading frames and due to partial updates, we rebuild our channel data
@@ -408,6 +410,7 @@ void Score::update() {
}
else if (!_window->_newMovieStarted)
_curFrameNumber++;
+ frameChanged = true;
}
_nextFrame = 0;
@@ -435,6 +438,7 @@ void Score::update() {
_curFrameNumber = 1;
}
+ frameChanged = true;
}
if (_labels != nullptr) {
@@ -445,7 +449,9 @@ void Score::update() {
}
}
- loadFrame(_curFrameNumber, true);
+ if (frameChanged) {
+ loadFrame(_curFrameNumber, true);
+ }
byte tempo = _currentFrame->_mainChannels.scoreCachedTempo;
// puppetTempo is overridden by changes in score tempo
@@ -1541,8 +1547,8 @@ bool Score::readOneFrame() {
_currentFrame->readChannel(*_framesStream, channelOffset, channelSize, _version);
}
- if (debugChannelSet(4, kDebugLoading)) {
- debugC(4, kDebugLoading, "%s", _currentFrame->formatChannelInfo().c_str());
+ if (debugChannelSet(9, kDebugLoading)) {
+ debugC(9, kDebugLoading, "%s", _currentFrame->formatChannelInfo().c_str());
}
debugC(8, kDebugLoading, "Score::readOneFrame(): Frame %d actionId: %s", _curFrameNumber, _currentFrame->_mainChannels.actionId.asString().c_str());
Commit: 918845ae8df8a33d675c07e7e5125b37ce9ea4f4
https://github.com/scummvm/scummvm/commit/918845ae8df8a33d675c07e7e5125b37ce9ea4f4
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-21T09:34:42+08:00
Commit Message:
DIRECTOR: Allow b_editableText for D4 and up
Fixes text widget selection in Cosmology of Kyoto.
Changed paths:
engines/director/lingo/lingo-builtins.cpp
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index af9f667e53a..00dae5fe901 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -166,7 +166,7 @@ static BuiltinProto builtins[] = {
{ "constrainV", LB::b_constrainV, 2, 2, 200, FBLTIN }, // D2 f
{ "copyToClipBoard",LB::b_copyToClipBoard,1,1, 400, CBLTIN }, // D4 c
{ "duplicate", LB::b_duplicate, 1, 2, 400, CBLTIN }, // D4 c
- { "editableText", LB::b_editableText, 0, 0, 200, CBLTIN }, // D2, FIXME: the field in D4+
+ { "editableText", LB::b_editableText, 0, 0, 200, CBLTIN }, // D2
{ "erase", LB::b_erase, 1, 1, 400, CBLTIN }, // D4 c
{ "findEmpty", LB::b_findEmpty, 1, 1, 400, FBLTIN }, // D4 f
// go // D2
@@ -2001,6 +2001,8 @@ void LB::b_duplicate(int nargs) {
}
void LB::b_editableText(int nargs) {
+ // editableText is deprecated in D4+ with the addition of "the editableText",
+ // but is still a valid function call.
Score *sc = g_director->getCurrentMovie()->getScore();
if (!sc) {
warning("b_editableText: no score");
@@ -2017,7 +2019,7 @@ void LB::b_editableText(int nargs) {
} else {
warning("b_editableText: sprite index out of bounds");
}
- } else if (nargs == 0 && g_director->getVersion() < 400) {
+ } else if (nargs == 0) {
g_lingo->dropStack(nargs);
if (g_lingo->_currentChannelId == -1) {
Commit: 3db0c6f380ba979e8c54100d6e96723759c8338e
https://github.com/scummvm/scummvm/commit/3db0c6f380ba979e8c54100d6e96723759c8338e
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-21T09:34:42+08:00
Commit Message:
DIRECTOR: Force editable text boxes to be rendered in front
Editable text boxes don't seem to abide by the channel rendering order;
you can have a bitmap in a higher channel that entirely obscures a text
entry widget, and the widget will still be visible.
Fixes the visibility of the name entry text box in Cosmology of Kyoto.
Changed paths:
engines/director/channel.cpp
engines/director/channel.h
engines/director/score.cpp
diff --git a/engines/director/channel.cpp b/engines/director/channel.cpp
index 943165ef670..06ea905cc62 100644
--- a/engines/director/channel.cpp
+++ b/engines/director/channel.cpp
@@ -470,6 +470,15 @@ void Channel::updateTextCast() {
}
}
+bool Channel::getEditable() {
+ if (_sprite->_cast && _sprite->_cast->_type == kCastText) {
+ if (_widget && (Graphics::MacText *)_widget->isEditable()) {
+ return true;
+ }
+ }
+ return false;
+}
+
void Channel::setEditable(bool editable) {
if (_sprite->_cast && _sprite->_cast->_type == kCastText) {
// if the sprite is editable, then we refresh the selEnd and setStart
diff --git a/engines/director/channel.h b/engines/director/channel.h
index 92d1c786160..ab01d24ad0d 100644
--- a/engines/director/channel.h
+++ b/engines/director/channel.h
@@ -63,6 +63,7 @@ public:
void setPosition(int x, int y, bool force = false);
void setCast(CastMemberID memberID);
void setClean(Sprite *nextSprite, int spriteId, bool partial = false);
+ bool getEditable();
void setEditable(bool editable);
void replaceSprite(Sprite *nextSprite);
void replaceWidget(CastMemberID previousCastId = CastMemberID(0, 0), bool force = false);
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 2848c7314a8..4d6e875a413 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -1325,11 +1325,22 @@ bool Score::checkSpriteIntersection(uint16 spriteId, Common::Point pos) {
}
Common::List<Channel *> Score::getSpriteIntersections(const Common::Rect &r) {
- Common::List<Channel *>intersections;
+ Common::List<Channel *> intersections;
+ Common::List<Channel *> appendix;
for (uint i = 0; i < _channels.size(); i++) {
- if (!_channels[i]->isEmpty() && !r.findIntersectingRect(_channels[i]->getBbox()).isEmpty())
- intersections.push_back(_channels[i]);
+ if (!_channels[i]->isEmpty() && !r.findIntersectingRect(_channels[i]->getBbox()).isEmpty()) {
+ // Editable text sprites will (more or less) always be rendered in front of other sprites,
+ // regardless of their order in the channel list.
+ if (_channels[i]->getEditable()) {
+ appendix.push_back(_channels[i]);
+ } else {
+ intersections.push_back(_channels[i]);
+ }
+ }
+ }
+ for (auto &ch : appendix) {
+ intersections.push_back(ch);
}
return intersections;
Commit: 3b8a86d3ee22abb8175ce7242749e56cf64b5355
https://github.com/scummvm/scummvm/commit/3b8a86d3ee22abb8175ce7242749e56cf64b5355
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-21T09:34:42+08:00
Commit Message:
GRAPHICS: MACGUI: Remove pseudotransparency workaround in MacText
Needed in order to e.g. print white text on a black background in
Director.
This reverts 457b09cb4eabab4516230ec4a46d9340bd040bf4
Changed paths:
graphics/macgui/mactext.cpp
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 0b6b169a8dc..cec83b5e895 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -826,8 +826,7 @@ void MacText::draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int
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));
- uint32 bgcolor = _canvas._tbgcolor < 0xff ? _canvas._tbgcolor : 0;
- g->transBlitFrom(*_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), bgcolor);
+ g->transBlitFrom(*_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), _canvas._tbgcolor);
_contentIsDirty = false;
_cursorDirty = false;
Commit: c801b0b4937ca534f3af62ac32c1799d891619b7
https://github.com/scummvm/scummvm/commit/c801b0b4937ca534f3af62ac32c1799d891619b7
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-21T09:34:42+08:00
Commit Message:
GRAPHICS: MACGUI: Fix fgcolor conversion in MacText
Changed paths:
graphics/macgui/mactext-canvas.cpp
graphics/macgui/mactext.cpp
diff --git a/graphics/macgui/mactext-canvas.cpp b/graphics/macgui/mactext-canvas.cpp
index 0226ebfa091..4db3502ba67 100644
--- a/graphics/macgui/mactext-canvas.cpp
+++ b/graphics/macgui/mactext-canvas.cpp
@@ -429,7 +429,7 @@ const Common::U32String::value_type *MacTextCanvas::splitString(const Common::U3
D(9, "** splitString[i]: %d%% fname: '%s' alt: '%s' title: '%s' ext: '%s'",
_text[curLine].picpercent,
- _text[curLine].picfname.c_str(), _text[curLine].picalt.encode().c_str(),
+ _text[curLine].picfname.toString().c_str(), _text[curLine].picalt.encode().c_str(),
_text[curLine].pictitle.encode().c_str(), _text[curLine].picext.encode().c_str());
break;
}
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index cec83b5e895..87f43b15155 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -125,7 +125,11 @@ MacText::MacText(MacWidget *parent, int x, int y, int w, int h, MacWindowManager
_defaultFormatting = MacFontRun(_wm);
_defaultFormatting.font = wm->_fontMan->getFont(*macFont);
byte r, g, b;
- _wm->_pixelformat.colorToRGB(fgcolor, r, g, b);
+ if (_wm->_pixelformat.bytesPerPixel == 4) {
+ _wm->decomposeColor<uint32>(fgcolor, r, g, b);
+ } else {
+ _wm->decomposeColor<byte>(fgcolor, r, g, b);
+ }
_defaultFormatting.setValues(_wm, macFont->getId(), macFont->getSlant(), macFont->getSize(), r, g, b);
} else {
_defaultFormatting.font = NULL;
Commit: 33d371e0627ad74324a62ef703db74f01f6ae3d1
https://github.com/scummvm/scummvm/commit/33d371e0627ad74324a62ef703db74f01f6ae3d1
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-21T09:34:42+08:00
Commit Message:
DIRECTOR: Set default TextCastMember fgcolor from Stxt
Needed to e.g. display a white blinking cursor on a black background.
Changed paths:
engines/director/castmember/text.cpp
diff --git a/engines/director/castmember/text.cpp b/engines/director/castmember/text.cpp
index d75037a0849..86641274eea 100644
--- a/engines/director/castmember/text.cpp
+++ b/engines/director/castmember/text.cpp
@@ -225,6 +225,9 @@ void TextCastMember::importStxt(const Stxt *stxt) {
_fgpalinfo1 = stxt->_style.r;
_fgpalinfo2 = stxt->_style.g;
_fgpalinfo3 = stxt->_style.b;
+ // The default color in the Stxt will override the fgcolor,
+ // e.g. empty editable text boxes will use the Stxt color
+ _fgcolor = g_director->_wm->findBestColor(_fgpalinfo1 >> 8, _fgpalinfo2 >> 8, _fgpalinfo3 >> 8);
_ftext = stxt->_ftext;
_ptext = stxt->_ptext;
_rtext = stxt->_rtext;
Commit: 0324b3419074ad25c22eda851f824c77078b9287
https://github.com/scummvm/scummvm/commit/0324b3419074ad25c22eda851f824c77078b9287
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-21T09:34:42+08:00
Commit Message:
DIRECTOR: LINGO: Fix missing null check in b_spriteBox
Changed paths:
engines/director/lingo/lingo-builtins.cpp
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 00dae5fe901..a1ae67f0d78 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -2716,7 +2716,8 @@ void LB::b_spriteBox(int nargs) {
g_director->getCurrentWindow()->addDirtyRect(channel->getBbox());
channel->setBbox(l, t, r, b);
- channel->_sprite->_cast->setModified(true);
+ if (channel->_sprite->_cast)
+ channel->_sprite->_cast->setModified(true);
channel->_dirty = true;
}
Commit: 91c14b4d629bbaf4d7dc87f244a039d0936a5108
https://github.com/scummvm/scummvm/commit/91c14b4d629bbaf4d7dc87f244a039d0936a5108
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-21T09:34:42+08:00
Commit Message:
DIRECTOR: Disable Windows keycode table for D4 and up
Fixes keyboard entry in Cosmology of Kyoto for Windows.
Changed paths:
engines/director/util.cpp
diff --git a/engines/director/util.cpp b/engines/director/util.cpp
index 9e4f67e339e..4bb111adc48 100644
--- a/engines/director/util.cpp
+++ b/engines/director/util.cpp
@@ -276,7 +276,9 @@ static struct WinKeyCodeMapping {
};
void DirectorEngine::loadKeyCodes() {
- if (g_director->getPlatform() == Common::kPlatformWindows) {
+ if ((g_director->getPlatform() == Common::kPlatformWindows) && (g_director->getVersion() < 400)) {
+ // Allegedly this keykode list applies for the Windows version of D3.
+ // D4 and D5 for Windows are both confirmed to use the Mac keycode table.
for (WinKeyCodeMapping *k = WinkeyCodeMappings; k->scummvm != Common::KEYCODE_INVALID; k++)
_KeyCodes[k->scummvm] = k->win;
} else {
Commit: 57655621edbf28791fad3be21fa64dc1639ade62
https://github.com/scummvm/scummvm/commit/57655621edbf28791fad3be21fa64dc1639ade62
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-21T09:34:42+08:00
Commit Message:
DIRECTOR: Use Shift-JIS text decoder when g_lingo->_romanLingo is false
Fixes most of the dialogue interaction scripts in the English version of
Cosmology of Kyoto, which contain plenty of Shift-JIS text.
Changed paths:
engines/director/lingo/lingo.cpp
engines/director/util.cpp
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index f908ae9cf4d..fe3fc6f004c 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -186,7 +186,7 @@ Lingo::Lingo(DirectorEngine *vm) : _vm(vm) {
_itemDelimiter = ',';
_exitLock = false;
_preLoadEventAbort = false;
- _romanLingo = (_vm->getLanguage() != Common::JA_JPN); // Japanrdr gamrs typically require 3-byte encodings
+ _romanLingo = (_vm->getLanguage() != Common::JA_JPN); // Japanese games typically require double-byte encoding
_searchPath.type = ARRAY;
_searchPath.u.farr = new FArray;
diff --git a/engines/director/util.cpp b/engines/director/util.cpp
index 4bb111adc48..46d00fc156c 100644
--- a/engines/director/util.cpp
+++ b/engines/director/util.cpp
@@ -1202,6 +1202,12 @@ Common::CodePage getEncoding(Common::Platform platform, Common::Language languag
default:
break;
}
+ // If there's no language override, but there is a Lingo
+ // request for a double-byte interpreter, assume this means
+ // the text cast members contain Shift-JIS.
+ if (!g_lingo->_romanLingo)
+ return Common::kWindows932; // Shift JIS
+
return (platform == Common::kPlatformWindows)
? Common::kWindows1252
: Common::kMacRoman;
Commit: 5ee82e91ce1947117aa641987d3a267ff2b9ff05
https://github.com/scummvm/scummvm/commit/5ee82e91ce1947117aa641987d3a267ff2b9ff05
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-21T09:34:42+08:00
Commit Message:
GRAPHICS: MACGUI: Stop MacTextCanvas::chopChunk from removing last chunk
There needs to be at least one chunk per line of text, or else many
basic text operations will cause a crash.
Changed paths:
graphics/macgui/mactext-canvas.cpp
graphics/macgui/mactext.cpp
diff --git a/graphics/macgui/mactext-canvas.cpp b/graphics/macgui/mactext-canvas.cpp
index 4db3502ba67..ec7cee2c8e9 100644
--- a/graphics/macgui/mactext-canvas.cpp
+++ b/graphics/macgui/mactext-canvas.cpp
@@ -60,7 +60,7 @@ void MacTextCanvas::chopChunk(const Common::U32String &str, int *curLinePtr, int
// Check if there is nothing to add, then remove the last chunk
// This happens when the previous run is finished only with
// empty formatting, or when we were adding text for the first time
- if (chunk->text.empty() && str.empty()) {
+ if (chunk->text.empty() && str.empty() && (_text[curLine].chunks.size() > 1)) {
D(9, "** chopChunk, replaced formatting, line %d", curLine);
_text[curLine].chunks.pop_back();
@@ -1109,7 +1109,7 @@ void MacTextCanvas::reshuffleParagraph(int *row, int *col, MacFontRun &defaultFo
bool paragraphEnd = _text[end].paragraphEnd;
#if DEBUG
- D(9, "MacTextCanvas::reshuffleParagraph: ppos: %d", ppos);
+ D(9, "MacTextCanvas::reshuffleParagraph: ppos: %d, start: %d, end: %d", ppos, start, end);
debugPrint("MacTextCanvas::reshuffleParagraph(1)");
#endif
@@ -1168,8 +1168,14 @@ void MacTextCanvas::reshuffleParagraph(int *row, int *col, MacFontRun &defaultFo
#if DEBUG
debugPrint("MacTextCanvas::reshuffleParagraph(3)");
+ D(9, "Chunks: ");
+ for (auto &ch : _text[curLine].chunks)
+ ch.debugPrint();
+
+ D(9, "");
#endif
+
// Restore the paragraph marker
_text[curLine].paragraphEnd = paragraphEnd;
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 87f43b15155..b2533d8d0e1 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -1850,6 +1850,13 @@ void MacText::deletePreviousCharInternal(int *row, int *col) {
*col = _canvas.getLineCharWidth(*row - 1);
(*row)--;
+#if DEBUG
+ D(9, "MacText::deletePreviousCharInternal: Chunks: ");
+ for (auto &ch : _canvas._text[*row].chunks)
+ ch.debugPrint();
+
+ D(9, "");
+#endif
// formatting matches, glue texts as normal
if (_canvas._text[*row].lastChunk().equals(_canvas._text[*row + 1].firstChunk())) {
_canvas._text[*row].lastChunk().text += _canvas._text[*row + 1].firstChunk().text;
@@ -1911,6 +1918,15 @@ void MacText::addNewLine(int *row, int *col) {
MacTextLine *line = &_canvas._text[*row];
int pos = *col;
uint ch = line->getChunkNum(&pos);
+
+#if DEBUG
+ D(9, "MacText::addNewLine: Chunks: ");
+ for (auto &c : line->chunks)
+ c.debugPrint();
+
+ D(9, "");
+#endif
+
MacFontRun newchunk = line->chunks[ch];
MacTextLine newline;
Commit: 511fab5aabef54d45f4cf81c91b1633bd47ff460
https://github.com/scummvm/scummvm/commit/511fab5aabef54d45f4cf81c91b1633bd47ff460
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-21T09:34:42+08:00
Commit Message:
GRAPHICS: MACGUI: Move paragraph end marker when merging rows
Fixes issue where removing an empty line with backspace would remove the
previous empty line also.
Changed paths:
graphics/macgui/mactext.cpp
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index b2533d8d0e1..3ffee345752 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -1866,7 +1866,7 @@ void MacText::deletePreviousCharInternal(int *row, int *col) {
_canvas._text[*row].chunks.push_back(MacFontRun(_canvas._text[*row + 1].firstChunk()));
_canvas._text[*row].firstChunk().text.clear();
}
- _canvas._text[*row].paragraphEnd = false;
+ _canvas._text[*row].paragraphEnd = _canvas._text[*row + 1].paragraphEnd;
for (uint i = 1; i < _canvas._text[*row + 1].chunks.size(); i++)
_canvas._text[*row].chunks.push_back(MacFontRun(_canvas._text[*row + 1].chunks[i]));
Commit: 06ca499351e5f59c0c3f02e458b2016d5034af39
https://github.com/scummvm/scummvm/commit/06ca499351e5f59c0c3f02e458b2016d5034af39
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-21T09:34:42+08:00
Commit Message:
DIRECTOR: Fix TextCastMember::setRawText for editable fields
Fixes pressing enter on the password entry screen in Cosmology of Kyoto.
Changed paths:
engines/director/castmember/text.cpp
diff --git a/engines/director/castmember/text.cpp b/engines/director/castmember/text.cpp
index 86641274eea..13b4e79120b 100644
--- a/engines/director/castmember/text.cpp
+++ b/engines/director/castmember/text.cpp
@@ -338,7 +338,7 @@ void TextCastMember::importRTE(byte *text) {
void TextCastMember::setRawText(const Common::String &text) {
// Do nothing if text did not change
- if (_rtext.equals(text))
+ if (_ptext.equals(Common::U32String(text)))
return;
_rtext = text;
Commit: 15ff1c584e18b1742a1745db7c36ecc0011d3c11
https://github.com/scummvm/scummvm/commit/15ff1c584e18b1742a1745db7c36ecc0011d3c11
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-21T09:34:42+08:00
Commit Message:
DIRECTOR: Adjust freezing logic in func_goto
- GADGET: Invention Travel and Adventure (D3) has a race condition
where the intro movie won't transition to the title screen if the script
doesn't freeze on frame change.
- Cosmology of Kyoto (D4) has a race condition where the restore game
password screen won't allow a second attempt if the script freezes on
frame change.
>From testing, it would seem that D4 doesn't do a script freeze on a "go
to frame" command. Both D3 and D4 do a script freeze if the target is a
different movie.
Changed paths:
engines/director/lingo/lingo-funcs.cpp
diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp
index b3f19d1d494..a4dcb3706b3 100644
--- a/engines/director/lingo/lingo-funcs.cpp
+++ b/engines/director/lingo/lingo-funcs.cpp
@@ -53,11 +53,11 @@ void Lingo::func_goto(Datum &frame, Datum &movie, bool calledfromgo) {
_vm->_skipFrameAdvance = true;
- // If there isn't already frozen Lingo (e.g. from a previous func_goto we haven't yet unfrozen),
- // freeze this script context. We'll return to it after entering the next frame.
- g_lingo->_freezeState = true;
if (movie.type != VOID) {
+ // If there isn't already frozen Lingo (e.g. from a previous func_goto we haven't yet unfrozen),
+ // freeze this script context. We'll return to it after entering the next movie.
+ g_lingo->_freezeState = true;
Common::String movieFilenameRaw = movie.asString();
if (!stage->setNextMovie(movieFilenameRaw))
@@ -95,6 +95,11 @@ void Lingo::func_goto(Datum &frame, Datum &movie, bool calledfromgo) {
return;
}
+ if (g_director->getVersion() < 400)
+ // If there isn't already frozen Lingo (e.g. from a previous func_goto we haven't yet unfrozen),
+ // freeze this script context. We'll return to it after entering the next frame.
+ g_lingo->_freezeState = true;
+
if (frame.type == STRING) {
debugC(3, kDebugLingoExec, "Lingo::func_goto(): going to frame \"%s\"", frame.u.s->c_str());
score->setStartToLabel(*frame.u.s);
Commit: 1216d4ad8857f69a0d991263e9c41b434a226ae2
https://github.com/scummvm/scummvm/commit/1216d4ad8857f69a0d991263e9c41b434a226ae2
Author: threefins (threefins at gardenizr.com)
Date: 2024-01-21T09:34:42+08:00
Commit Message:
DIRECTOR: Score: restrict _curFrameNumber updates
When `Score::loadFrame(frameNum)` is called with frameNum <=
_curFrameNumber it will start by resetting frame state, then loading
previous n-l frames and then updating `_curFrameNumber to` `frameNum`.
This is by design, to allow abribtrary script-based frame jumping and debug console commands.
Previous to this change `Score::update()` incrementing `_curFrameNumber` directly before
calling `Score::loadFrame(_curFrameNumber)`. In effect, this meant that
every time the playhead moved forward one frame, all previous frames
would first be loaded from the stream first. Any state built
up by previous scripting is lost and perhaps impacts performance at
suitably high frame counts and debug levels.
In this change, `Score::update()` instead makes changes to a local
variable and passes the result to `Score::loadFrame()`.
Changed paths:
engines/director/score.cpp
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 4d6e875a413..47d73002a32 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -400,22 +400,21 @@ void Score::update() {
for (uint ch = 0; ch < _channels.size(); ch++)
*_currentFrame->_sprites[ch] = *_channels[ch]->_sprite;
- bool frameChanged = false;
+ uint32 nextFrameNumberToLoad = _curFrameNumber;
if (!_vm->_playbackPaused) {
if (_nextFrame) {
// With the advent of demand loading frames and due to partial updates, we rebuild our channel data
// when jumping.
- _curFrameNumber = _nextFrame;
+ nextFrameNumberToLoad = _nextFrame;
}
else if (!_window->_newMovieStarted)
- _curFrameNumber++;
- frameChanged = true;
+ nextFrameNumberToLoad = (_curFrameNumber+1);
}
_nextFrame = 0;
- if (_curFrameNumber >= getFramesNum()) {
+ if (nextFrameNumberToLoad >= getFramesNum()) {
Window *window = _vm->getCurrentWindow();
if (!window->_movieStack.empty()) {
MovieReference ref = window->_movieStack.back();
@@ -427,8 +426,7 @@ void Score::update() {
processFrozenScripts();
return;
}
-
- _curFrameNumber = ref.frameI;
+ nextFrameNumberToLoad = ref.frameI;
} else {
if (debugChannelSet(-1, kDebugNoLoop)) {
_playState = kPlayStopped;
@@ -436,21 +434,21 @@ void Score::update() {
return;
}
- _curFrameNumber = 1;
+ nextFrameNumberToLoad = 1;
}
- frameChanged = true;
}
if (_labels != nullptr) {
for (auto &i : *_labels) {
- if (i->number == _curFrameNumber) {
- _currentLabel = _curFrameNumber;
+ if (i->number == nextFrameNumberToLoad) {
+ _currentLabel = nextFrameNumberToLoad;
}
}
}
- if (frameChanged) {
- loadFrame(_curFrameNumber, true);
+ if (_curFrameNumber != nextFrameNumberToLoad) {
+ // this updates _curFrameNumber
+ loadFrame(nextFrameNumberToLoad, true);
}
byte tempo = _currentFrame->_mainChannels.scoreCachedTempo;
@@ -1489,7 +1487,7 @@ void Score::loadFrames(Common::SeekableReadStreamEndian &stream, uint16 version)
}
bool Score::loadFrame(int frameNum, bool loadCast) {
- debugC(7, kDebugLoading, "****** Frame request %d, current pos: %ld", frameNum, _framesStream->pos());
+ debugC(7, kDebugLoading, "****** Frame request %d, current pos: %ld, current frame number: %d", frameNum, _framesStream->pos(), _curFrameNumber);
int sourceFrame = _curFrameNumber;
int targetFrame = frameNum;
More information about the Scummvm-git-logs
mailing list