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

dreammaster dreammaster at scummvm.org
Sat Nov 5 23:57:18 CET 2016


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

Summary:
db1ed6db3e TITANIC: Correct naming usage for PET Text ending character index


Commit: db1ed6db3e44720a7efcfe62b77e166bb8809e1f
    https://github.com/scummvm/scummvm/commit/db1ed6db3e44720a7efcfe62b77e166bb8809e1f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-11-05T18:57:10-04:00

Commit Message:
TITANIC: Correct naming usage for PET Text ending character index

Changed paths:
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/pet_control/pet_text.h



diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index 57076fe..9b7e08a 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -116,9 +116,9 @@ void CPetConversations::draw(CScreenManager *screenManager) {
 	_textInput.draw(screenManager);
 
 	if (_logChanged) {
-		int startIndex = _log.getLinesStart();
-		if (startIndex >= 0) {
-			int npcNum = _log.getNPCNum(1, startIndex);
+		int endIndex = _log.displayEndIndex();
+		if (endIndex >= 0) {
+			int npcNum = _log.getNPCNum(1, endIndex);
 			if (npcNum > 0 && npcNum < 10)
 				_npcNum = npcNum - 1;
 		}
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index 97bb0be..3ad14d0 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 CPetText::CPetText(uint count) :
 		_stringsMerged(false), _maxCharsPerLine(-1), _lineCount(0),
-		_linesStart(-1), _unused1(0), _unused2(0), _unused3(0),
+		_displayEndCharIndex(-1), _unused1(0), _unused2(0), _unused3(0),
 		_backR(0xff), _backG(0xff), _backB(0xff),
 		_textR(0), _textG(0), _textB(200),
 		_fontNumber(0), _npcFlag(0), _npcId(0), _hasBorder(true),
@@ -173,7 +173,7 @@ void CPetText::draw(CScreenManager *screenManager) {
 	tempRect.grow(-2);
 	int oldFontNumber = screenManager->setFontNumber(_fontNumber);
 
-	_linesStart = screenManager->writeString(SURFACE_BACKBUFFER, tempRect, _scrollTop, _lines, _textCursor);
+	_displayEndCharIndex = screenManager->writeString(SURFACE_BACKBUFFER, tempRect, _scrollTop, _lines, _textCursor);
 
 	screenManager->setFontNumber(oldFontNumber);
 }
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
index a48ab91..671ab4b 100644
--- a/engines/titanic/pet_control/pet_text.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -43,7 +43,7 @@ private:
 	Rect _bounds;
 	int _maxCharsPerLine;
 	int _lineCount;
-	int _linesStart;
+	int _displayEndCharIndex;
 	int _unused1;
 	int _unused2;
 	int _unused3;
@@ -176,9 +176,10 @@ public:
 	void setNPC(int npcFlag, int npcId);
 
 	/**
-	 * Get the index into _lines where on-screen text starts
+	 * Returns the character index into _lines of the last
+	 * character to be displayed on-screen
 	 */
-	int getLinesStart() const { return _linesStart; }
+	int displayEndIndex() const { return _displayEndCharIndex; }
 
 	/**
 	 * Scroll the text up
@@ -246,6 +247,9 @@ public:
 	/**
 	 * Get an NPC Number embedded within on-screen text.
 	 * Used by the PET log to encode which NPC spoke
+	 * @param ident			Npc Type. Always passed as 1
+	 * @param startIndex	Starting index to scan backwards
+	 *		through the log text to find an NPC ident sequence
 	 */
 	int getNPCNum(uint ident, uint startIndex);
 





More information about the Scummvm-git-logs mailing list