From ff72fc594bae10cd4ac5083d0cf2ca6c412d0f9f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 28 Apr 2016 20:30:13 -0400 Subject: TITANIC: Implement PET Conversations mouse up, and text addLine --- engines/titanic/pet_control/pet_text.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'engines/titanic/pet_control/pet_text.cpp') diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp index 67910dc18c..c31d4fd851 100644 --- a/engines/titanic/pet_control/pet_text.cpp +++ b/engines/titanic/pet_control/pet_text.cpp @@ -292,8 +292,20 @@ void CPetText::addLine(const CString &str, uint color) { } void CPetText::addLine(const CString &str, byte r, byte g, byte b) { - warning("TODO: CPetText::addLine"); -} + if (_lineCount == ((int)_array.size() - 1)) { + // Lines array is full + if (_array.size() > 1) { + // Delete the oldest line, and add a new entry at the end + _array.remove_at(0); + _array.resize(_array.size() + 1); + } + + --_lineCount; + } + setLineColor(_lineCount, r, g, b); + changeText(str); + ++_lineCount; +} } // End of namespace Titanic -- cgit v1.2.3