From 8bb9679be0877f728628609f218832bea3c103d4 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 29 Mar 2016 21:03:34 -0400 Subject: TITANIC: Renaming for PET inventory section --- engines/titanic/pet_control/pet_section.cpp | 60 +++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 engines/titanic/pet_control/pet_section.cpp (limited to 'engines/titanic/pet_control/pet_section.cpp') diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp new file mode 100644 index 0000000000..321f1fb94f --- /dev/null +++ b/engines/titanic/pet_control/pet_section.cpp @@ -0,0 +1,60 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "common/textconsole.h" +#include "titanic/pet_control/pet_section.h" + +namespace Titanic { + +void CPetSection::proc4() { + error("TODO"); +} + +void CPetSection::proc16() { + error("TODO"); +} + +void CPetSection::proc25() { + error("TODO"); +} + +void CPetSection::proc27() { + error("TODO"); +} + +void CPetSection::proc28() { + error("TODO"); +} + +void CPetSection::proc29() { + error("TODO"); +} + +void CPetSection::proc30() { + error("TODO"); +} + +void CPetSection::proc31() { + error("TODO"); +} + +} // End of namespace Titanic -- cgit v1.2.3 From 7d819f71f7d9fdd794b12ac55bd2177f12069c1b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 31 Mar 2016 21:40:36 -0400 Subject: TITANIC: PET frame is now showing --- engines/titanic/pet_control/pet_section.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'engines/titanic/pet_control/pet_section.cpp') diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp index 321f1fb94f..d531b5d0d7 100644 --- a/engines/titanic/pet_control/pet_section.cpp +++ b/engines/titanic/pet_control/pet_section.cpp @@ -25,10 +25,6 @@ namespace Titanic { -void CPetSection::proc4() { - error("TODO"); -} - void CPetSection::proc16() { error("TODO"); } -- cgit v1.2.3 From 18a38c84e9ddeeb063621c290b8be6dce72daaf1 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 13 Apr 2016 22:45:32 -0400 Subject: TITANIC: Implementing CCarry classes msg handlers --- engines/titanic/pet_control/pet_section.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/pet_control/pet_section.cpp') diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp index d531b5d0d7..349fa40fcf 100644 --- a/engines/titanic/pet_control/pet_section.cpp +++ b/engines/titanic/pet_control/pet_section.cpp @@ -25,7 +25,7 @@ namespace Titanic { -void CPetSection::proc16() { +void CPetSection::displayMessage(const CString &msg) { error("TODO"); } -- cgit v1.2.3 From 47024115941c125452bb787758091686c91fc4fb Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 18 Apr 2016 11:36:39 -0400 Subject: TITANIC: Further cleanup of pet element setups --- engines/titanic/pet_control/pet_section.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'engines/titanic/pet_control/pet_section.cpp') diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp index 349fa40fcf..f913ac6b50 100644 --- a/engines/titanic/pet_control/pet_section.cpp +++ b/engines/titanic/pet_control/pet_section.cpp @@ -49,8 +49,4 @@ void CPetSection::proc30() { error("TODO"); } -void CPetSection::proc31() { - error("TODO"); -} - } // End of namespace Titanic -- cgit v1.2.3 From c74b975081b844f90c9d43230a31005934593ff4 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 19 Apr 2016 13:13:32 -0400 Subject: TITANIC: Implement CPetSection data table methods --- engines/titanic/pet_control/pet_section.cpp | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'engines/titanic/pet_control/pet_section.cpp') diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp index f913ac6b50..3d26fc444a 100644 --- a/engines/titanic/pet_control/pet_section.cpp +++ b/engines/titanic/pet_control/pet_section.cpp @@ -22,9 +22,22 @@ #include "common/textconsole.h" #include "titanic/pet_control/pet_section.h" +#include "titanic/pet_control/pet_control.h" namespace Titanic { +static const uint ARRAY1[6] = { + 0xA7C0DB, 0x9CFFFE, 0x73AEFF, 0xA7C0DB, 0x9CFFFE, 0 +}; + +static const uint ARRAY2[6] = { + 0x10101, 0x1013C, 0xC80101, 0x10101, 0x800101, 0 +}; + +static const uint ARRAY3[5] = { + 0x10101, 0x1013C, 0xC80101, 0x10101, 0x800101 +}; + void CPetSection::displayMessage(const CString &msg) { error("TODO"); } @@ -49,4 +62,21 @@ void CPetSection::proc30() { error("TODO"); } +uint CPetSection::getDataIndex(int index) { + return getDataTable()[index]; +} + +const uint *CPetSection::getDataTable(int index) { + if (index == -1) { + CPetControl *pet = getPetControl(); + index = pet ? pet->getState8() : 3; + } + + switch (index) { + case 1: return ARRAY1; + case 2: return ARRAY2; + default: return ARRAY3; + } +} + } // End of namespace Titanic -- cgit v1.2.3 From a8f8e4b69eab768f38d5cd73ceecce03bd096a4d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 19 Apr 2016 22:00:47 -0400 Subject: TITANIC: Clarified UI color methods & tables --- engines/titanic/pet_control/pet_section.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'engines/titanic/pet_control/pet_section.cpp') diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp index 3d26fc444a..a41118bf76 100644 --- a/engines/titanic/pet_control/pet_section.cpp +++ b/engines/titanic/pet_control/pet_section.cpp @@ -26,15 +26,15 @@ namespace Titanic { -static const uint ARRAY1[6] = { +static const uint PALETTE1[6] = { 0xA7C0DB, 0x9CFFFE, 0x73AEFF, 0xA7C0DB, 0x9CFFFE, 0 }; -static const uint ARRAY2[6] = { +static const uint PALETTE2[6] = { 0x10101, 0x1013C, 0xC80101, 0x10101, 0x800101, 0 }; -static const uint ARRAY3[5] = { +static const uint PALETTE3[5] = { 0x10101, 0x1013C, 0xC80101, 0x10101, 0x800101 }; @@ -62,20 +62,20 @@ void CPetSection::proc30() { error("TODO"); } -uint CPetSection::getDataIndex(int index) { - return getDataTable()[index]; +uint CPetSection::getColor(uint index) { + return getColorTable()[index]; } -const uint *CPetSection::getDataTable(int index) { - if (index == -1) { +const uint *CPetSection::getColorTable(int tableNum) { + if (tableNum == -1) { CPetControl *pet = getPetControl(); - index = pet ? pet->getState8() : 3; + tableNum = pet ? pet->getState8() : 3; } - switch (index) { - case 1: return ARRAY1; - case 2: return ARRAY2; - default: return ARRAY3; + switch (tableNum) { + case 1: return PALETTE1; + case 2: return PALETTE2; + default: return PALETTE3; } } -- cgit v1.2.3 From 23f5691b97cb53fd45ef411f051b7f10f0523a24 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 28 Apr 2016 21:34:22 -0400 Subject: TITANIC: Implement summoning NPCs --- engines/titanic/pet_control/pet_section.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/pet_control/pet_section.cpp') diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp index a41118bf76..afdbc9fdd8 100644 --- a/engines/titanic/pet_control/pet_section.cpp +++ b/engines/titanic/pet_control/pet_section.cpp @@ -69,7 +69,7 @@ uint CPetSection::getColor(uint index) { const uint *CPetSection::getColorTable(int tableNum) { if (tableNum == -1) { CPetControl *pet = getPetControl(); - tableNum = pet ? pet->getState8() : 3; + tableNum = pet ? pet->getPassengerClass() : 3; } switch (tableNum) { -- cgit v1.2.3 From 6ec129d188a2b5b86dba6540b38a959bbf8b2491 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 29 Apr 2016 19:29:28 -0400 Subject: TITANIC: Added PET Conversations enter, PET Timers, and Text Cursor show --- engines/titanic/pet_control/pet_section.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'engines/titanic/pet_control/pet_section.cpp') diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp index afdbc9fdd8..213c93e78d 100644 --- a/engines/titanic/pet_control/pet_section.cpp +++ b/engines/titanic/pet_control/pet_section.cpp @@ -46,8 +46,11 @@ void CPetSection::proc25() { error("TODO"); } -void CPetSection::proc27() { - error("TODO"); +void CPetSection::proc27(int duration) { + if (duration > 0) + _petControl->startPetTimer(0, duration, 0, this); + else + proc28(); } void CPetSection::proc28() { -- cgit v1.2.3 From 287a9f6ef2ceb1cac4fef74832b3fdee9987ecf1 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 30 Apr 2016 07:35:04 -0400 Subject: TITANIC: Implement display of tooltips in RealLife --- engines/titanic/pet_control/pet_section.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engines/titanic/pet_control/pet_section.cpp') diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp index 213c93e78d..8cd9207316 100644 --- a/engines/titanic/pet_control/pet_section.cpp +++ b/engines/titanic/pet_control/pet_section.cpp @@ -54,11 +54,13 @@ void CPetSection::proc27(int duration) { } void CPetSection::proc28() { - error("TODO"); + CPetText *text = getText(); + if (text) + text->setup(); } void CPetSection::proc29() { - error("TODO"); + _petControl->stopPetTimer(0); } void CPetSection::proc30() { -- cgit v1.2.3 From 6691dfa408b05d2cb01fb879bc1b2466bf757738 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 30 Apr 2016 22:14:22 -0400 Subject: TITANIC: Implement PET Conversations dial logic --- engines/titanic/pet_control/pet_section.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'engines/titanic/pet_control/pet_section.cpp') diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp index 8cd9207316..7f0a0005e5 100644 --- a/engines/titanic/pet_control/pet_section.cpp +++ b/engines/titanic/pet_control/pet_section.cpp @@ -42,8 +42,11 @@ void CPetSection::displayMessage(const CString &msg) { error("TODO"); } -void CPetSection::proc25() { - error("TODO"); +void CPetSection::proc25(int val) { + if (!val) { + proc28(); + _petControl->makeDirty(); + } } void CPetSection::proc27(int duration) { -- cgit v1.2.3 From 8a6a5ad5c10b682bef145b414ebed386aa7df842 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 1 May 2016 19:09:21 -0400 Subject: TITANIC: In progress implementation of PET Remote --- engines/titanic/pet_control/pet_section.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'engines/titanic/pet_control/pet_section.cpp') diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp index 7f0a0005e5..116fd94ddb 100644 --- a/engines/titanic/pet_control/pet_section.cpp +++ b/engines/titanic/pet_control/pet_section.cpp @@ -66,10 +66,6 @@ void CPetSection::proc29() { _petControl->stopPetTimer(0); } -void CPetSection::proc30() { - error("TODO"); -} - uint CPetSection::getColor(uint index) { return getColorTable()[index]; } -- cgit v1.2.3 From 4ed93ca8f175d7a43c6a0de72ad02b42827938b7 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 25 Jun 2016 16:41:31 -0400 Subject: TITANIC: Cleanup of PET section classes methods to match original --- engines/titanic/pet_control/pet_section.cpp | 35 ++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'engines/titanic/pet_control/pet_section.cpp') 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 -- cgit v1.2.3 From 0146a3c6b6bdb16eef6f46e116b0d9fe9883858f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 26 Jun 2016 07:23:15 -0400 Subject: TITANIC: Added remaining CPetControl methods --- engines/titanic/pet_control/pet_section.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/pet_control/pet_section.cpp') diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp index a29a8f8115..50d6c7615c 100644 --- a/engines/titanic/pet_control/pet_section.cpp +++ b/engines/titanic/pet_control/pet_section.cpp @@ -48,7 +48,7 @@ void CPetSection::displayMessage(const CString &msg) { } } -void CPetSection::proc25(int val) { +void CPetSection::timerExpired(int val) { if (!val) { removeText(); _petControl->makeDirty(); -- cgit v1.2.3