aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/pet_control/pet_section.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-04-19 13:13:32 -0400
committerPaul Gilbert2016-07-10 16:11:34 -0400
commitc74b975081b844f90c9d43230a31005934593ff4 (patch)
tree2e0d5fcfdfef4235d14cdec79f65006f8411aed5 /engines/titanic/pet_control/pet_section.cpp
parent9317035ab7736818afa65deda34a9f4f47cc4590 (diff)
downloadscummvm-rg350-c74b975081b844f90c9d43230a31005934593ff4.tar.gz
scummvm-rg350-c74b975081b844f90c9d43230a31005934593ff4.tar.bz2
scummvm-rg350-c74b975081b844f90c9d43230a31005934593ff4.zip
TITANIC: Implement CPetSection data table methods
Diffstat (limited to 'engines/titanic/pet_control/pet_section.cpp')
-rw-r--r--engines/titanic/pet_control/pet_section.cpp30
1 files changed, 30 insertions, 0 deletions
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