diff options
author | Paul Gilbert | 2016-06-25 16:41:31 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-15 19:24:56 -0400 |
commit | 4ed93ca8f175d7a43c6a0de72ad02b42827938b7 (patch) | |
tree | 448c2cd5021192692041c967fc6571b29cd56f7f /engines/titanic/pet_control/pet_section.cpp | |
parent | 42c8ac1c880076c181071922aff3b923a185af98 (diff) | |
download | scummvm-rg350-4ed93ca8f175d7a43c6a0de72ad02b42827938b7.tar.gz scummvm-rg350-4ed93ca8f175d7a43c6a0de72ad02b42827938b7.tar.bz2 scummvm-rg350-4ed93ca8f175d7a43c6a0de72ad02b42827938b7.zip |
TITANIC: Cleanup of PET section classes methods to match original
Diffstat (limited to 'engines/titanic/pet_control/pet_section.cpp')
-rw-r--r-- | engines/titanic/pet_control/pet_section.cpp | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp index 116fd94ddb..a29a8f8115 100644 --- a/engines/titanic/pet_control/pet_section.cpp +++ b/engines/titanic/pet_control/pet_section.cpp @@ -39,30 +39,36 @@ static const uint PALETTE3[5] = { }; void CPetSection::displayMessage(const CString &msg) { - error("TODO"); + CPetText *text = getText(); + + if (text) { + text->setColor(getColor(1)); + _petControl->makeDirty(); + removeText(5000); + } } void CPetSection::proc25(int val) { if (!val) { - proc28(); + removeText(); _petControl->makeDirty(); } } -void CPetSection::proc27(int duration) { +void CPetSection::removeText(int duration) { if (duration > 0) _petControl->startPetTimer(0, duration, 0, this); else - proc28(); + removeText(); } -void CPetSection::proc28() { +void CPetSection::removeText() { CPetText *text = getText(); if (text) text->setup(); } -void CPetSection::proc29() { +void CPetSection::stopTextTimer() { _petControl->stopPetTimer(0); } @@ -83,4 +89,21 @@ const uint *CPetSection::getColorTable(int tableNum) { } } +void CPetSection::areaChanged(PetArea area) { + if (_petControl && _petControl->_currentArea == area) + _petControl->makeDirty(); +} + +CString CPetSection::getActiveNPCName() const { + if (_petControl && _petControl->_activeNPC) + return _petControl->_activeNPC->getName(); + else + return CString(); +} + +void CPetSection::copyColors(uint tableNum, uint colors[5]) { + const uint *src = getColorTable(tableNum); + Common::copy(src, src + 5, colors); +} + } // End of namespace Titanic |