aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2016-04-19 13:13:32 -0400
committerPaul Gilbert2016-07-10 16:11:34 -0400
commitc74b975081b844f90c9d43230a31005934593ff4 (patch)
tree2e0d5fcfdfef4235d14cdec79f65006f8411aed5
parent9317035ab7736818afa65deda34a9f4f47cc4590 (diff)
downloadscummvm-rg350-c74b975081b844f90c9d43230a31005934593ff4.tar.gz
scummvm-rg350-c74b975081b844f90c9d43230a31005934593ff4.tar.bz2
scummvm-rg350-c74b975081b844f90c9d43230a31005934593ff4.zip
TITANIC: Implement CPetSection data table methods
-rw-r--r--engines/titanic/pet_control/pet_quit.cpp2
-rw-r--r--engines/titanic/pet_control/pet_section.cpp30
-rw-r--r--engines/titanic/pet_control/pet_section.h3
3 files changed, 35 insertions, 0 deletions
diff --git a/engines/titanic/pet_control/pet_quit.cpp b/engines/titanic/pet_control/pet_quit.cpp
index 912789e7c0..c31db26f54 100644
--- a/engines/titanic/pet_control/pet_quit.cpp
+++ b/engines/titanic/pet_control/pet_quit.cpp
@@ -46,6 +46,8 @@ bool CPetQuit::reset() {
return false;
setName("PetExit", pet);
+ uint v = getPetSection()->getDataIndex(0);
+
// TODO
return true;
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
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 122781341f..40a3151304 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -159,6 +159,9 @@ public:
* Get the PET control
*/
CPetControl *getPetControl() const { return _petControl; }
+
+ uint getDataIndex(int index);
+ const uint *getDataTable(int index = -1);
};
} // End of namespace Titanic