[Scummvm-git-logs] scummvm master -> d9e2420e905840c5bc8f1ff1b7002cbd0ecfde28

npjg nathanael.gentrydb8 at gmail.com
Thu Jul 30 18:00:50 UTC 2020


This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
abfe896a62 DIRECTOR: Add renderSprites debug line
7bddd91bb8 DIRECTOR: LINGO: Implement kTheSelection
4907aae05e GRAPHICS: MACGUI: MacText: Add selection index getter
0e359d0b7b DIRECTOR: LINGO: Implement kTheSel* getters
d9e2420e90 GRAPHICS: MACGUI: Fix warnings


Commit: abfe896a626ac433b63b2955309ae6873a99ec69
    https://github.com/scummvm/scummvm/commit/abfe896a626ac433b63b2955309ae6873a99ec69
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-07-30T13:54:07-04:00

Commit Message:
DIRECTOR: Add renderSprites debug line

Changed paths:
    engines/director/score.cpp


diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 2bb2a29137..7e83ea5d46 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -475,6 +475,7 @@ void Score::renderSprites(uint16 frameId, RenderMode mode) {
 
 			channel->setClean(nextSprite, i);
 			_stage->addDirtyRect(channel->getBbox());
+			debugC(2, kDebugImages, "Score::renderSprites(): CH: %-3d castId: %03d(%s) [ink: %x, puppet: %d, moveable: %d, visible: %d] [bbox: %d,%d,%d,%d] [type: %d fg: %d bg: %d] [script: %d]", i, currentSprite->_castId, numToCastNum(currentSprite->_castId), currentSprite->_ink, currentSprite->_puppet, currentSprite->_moveable, channel->_visible, PRINT_RECT(channel->getBbox()), currentSprite->_spriteType, currentSprite->_foreColor, currentSprite->_backColor, currentSprite->_scriptId);
 		} else {
 			channel->setClean(nextSprite, i, true);
 		}


Commit: 7bddd91bb80a47f7a463c2dc6bc6c94c9c1d7eb0
    https://github.com/scummvm/scummvm/commit/7bddd91bb80a47f7a463c2dc6bc6c94c9c1d7eb0
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-07-30T13:54:11-04:00

Commit Message:
DIRECTOR: LINGO: Implement kTheSelection

Changed paths:
    engines/director/lingo/lingo-the.cpp


diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index 264a36fe91..f235eeeaba 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -683,7 +683,14 @@ Datum Lingo::getTheEntity(int entity, Datum &id, int field) {
 		getTheEntitySTUB(kTheSearchPath);
 		break;
 	case kTheSelection:
-		getTheEntitySTUB(kTheSelection);
+		if (_vm->getCurrentMovie()->_currentEditableTextChannel) {
+			Channel *channel = _vm->getCurrentMovie()->getScore()->_channels[_vm->getCurrentMovie()->_currentEditableTextChannel];
+
+			if (channel->_widget) {
+				d.type = STRING;
+				d.u.s = new Common::String(Common::convertFromU32String(((Graphics::MacText *)channel->_widget)->getSelection()));
+			}
+		}
 		break;
 	case kTheSelEnd:
 		getTheEntitySTUB(kTheSelEnd);


Commit: 4907aae05e49b06f7ccc33d6261d88ee5cef59a2
    https://github.com/scummvm/scummvm/commit/4907aae05e49b06f7ccc33d6261d88ee5cef59a2
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-07-30T13:54:11-04:00

Commit Message:
GRAPHICS: MACGUI: MacText: Add selection index getter

Changed paths:
    graphics/macgui/mactext.cpp
    graphics/macgui/mactext.h


diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 805336c51b..44ed0f8a16 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -1012,6 +1012,27 @@ void MacText::clearSelection() {
 	_selectedText.endY = _selectedText.startY = -1;
 }
 
+uint MacText::getSelectionIndex(bool start) {
+	int pos = 0;
+
+	if (!_inTextSelection && (_selectedText.startY < 0 && _selectedText.endY < 0))
+		return pos;
+
+	if (start) {
+		for (int row = 0; row < _selectedText.startRow; row++)
+			pos += getLineCharWidth(row);
+
+		pos += _selectedText.startCol;
+		return pos;
+	} else {
+		for (int row = 0; row < _selectedText.endRow; row++)
+			pos += getLineCharWidth(row);
+
+		pos += _selectedText.endCol;
+		return pos;
+	}
+}
+
 void MacText::setSelection(int pos, bool start) {
 	int row = 0, col = 0;
 	int colX = 0;
diff --git a/graphics/macgui/mactext.h b/graphics/macgui/mactext.h
index 0a5a52a2d3..15e09dedb9 100644
--- a/graphics/macgui/mactext.h
+++ b/graphics/macgui/mactext.h
@@ -187,6 +187,7 @@ public:
 	Common::U32String getTextChunk(int startRow, int startCol, int endRow, int endCol, bool formatted = false, bool newlines = true);
 
 	Common::U32String getSelection(bool formatted = false, bool newlines = true);
+	uint getSelectionIndex(bool start);
 	void clearSelection();
 	Common::U32String cutSelection();
 	const SelectedText *getSelectedText() { return &_selectedText; }


Commit: 0e359d0b7b0cf9378e502d3edfe46527a03a1e1c
    https://github.com/scummvm/scummvm/commit/0e359d0b7b0cf9378e502d3edfe46527a03a1e1c
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-07-30T13:54:11-04:00

Commit Message:
DIRECTOR: LINGO: Implement kTheSel* getters

Changed paths:
    engines/director/lingo/lingo-the.cpp


diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index f235eeeaba..8cb82bde4e 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -693,10 +693,15 @@ Datum Lingo::getTheEntity(int entity, Datum &id, int field) {
 		}
 		break;
 	case kTheSelEnd:
-		getTheEntitySTUB(kTheSelEnd);
-		break;
 	case kTheSelStart:
-		getTheEntitySTUB(kTheSelStart);
+		if (_vm->getCurrentMovie()->_currentEditableTextChannel) {
+			Channel *channel = _vm->getCurrentMovie()->getScore()->_channels[_vm->getCurrentMovie()->_currentEditableTextChannel];
+
+			if (channel->_widget) {
+				d.type = INT;
+				d.u.i = ((Graphics::MacText *)channel->_widget)->getSelectionIndex(entity == kTheSelStart);
+			}
+		}
 		break;
 	case kTheShiftDown:
 		d.type = INT;


Commit: d9e2420e905840c5bc8f1ff1b7002cbd0ecfde28
    https://github.com/scummvm/scummvm/commit/d9e2420e905840c5bc8f1ff1b7002cbd0ecfde28
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-07-30T13:54:11-04:00

Commit Message:
GRAPHICS: MACGUI: Fix warnings

Changed paths:
    graphics/macgui/mactext.cpp


diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 44ed0f8a16..681a9eb5ed 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -1039,8 +1039,8 @@ void MacText::setSelection(int pos, bool start) {
 
 	while (pos > 0) {
 		if (pos < getLineCharWidth(row)) {
-			for (int i = 0; i < _textLines[row].chunks.size(); i++) {
-				if (pos < _textLines[row].chunks[i].text.size()) {
+			for (uint i = 0; i < _textLines[row].chunks.size(); i++) {
+				if ((uint)pos < _textLines[row].chunks[i].text.size()) {
 					colX += _textLines[row].chunks[i].getFont()->getStringWidth(Common::U32String(_textLines[row].chunks[i].text.c_str(), pos));
 					col += pos;
 					pos = 0;
@@ -1057,7 +1057,7 @@ void MacText::setSelection(int pos, bool start) {
 		}
 
 		row++;
-		if (row >= _textLines.size()) {
+		if ((uint)row >= _textLines.size()) {
 			colX = _surface->w;
 			col = getLineCharWidth(row);
 




More information about the Scummvm-git-logs mailing list