aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/pet_control/pet_text.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-04-28 20:30:13 -0400
committerPaul Gilbert2016-07-10 16:22:36 -0400
commitff72fc594bae10cd4ac5083d0cf2ca6c412d0f9f (patch)
treefc70218725ad20467ff8fd027b7210620284a9e0 /engines/titanic/pet_control/pet_text.cpp
parentde7329619612514e8fd3e9ba1f3e6d7389fd199d (diff)
downloadscummvm-rg350-ff72fc594bae10cd4ac5083d0cf2ca6c412d0f9f.tar.gz
scummvm-rg350-ff72fc594bae10cd4ac5083d0cf2ca6c412d0f9f.tar.bz2
scummvm-rg350-ff72fc594bae10cd4ac5083d0cf2ca6c412d0f9f.zip
TITANIC: Implement PET Conversations mouse up, and text addLine
Diffstat (limited to 'engines/titanic/pet_control/pet_text.cpp')
-rw-r--r--engines/titanic/pet_control/pet_text.cpp16
1 files changed, 14 insertions, 2 deletions
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