aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2016-04-18 23:13:19 -0400
committerPaul Gilbert2016-07-10 16:11:32 -0400
commit79c10ee30a5b4c8e41dc12806f432df88ff9af6f (patch)
treec33d3b78703a5b0a7749330f235ff4c17f4906be
parent225af470883f7e8e90ea18faf6b26b29342accb9 (diff)
downloadscummvm-rg350-79c10ee30a5b4c8e41dc12806f432df88ff9af6f.tar.gz
scummvm-rg350-79c10ee30a5b4c8e41dc12806f432df88ff9af6f.tar.bz2
scummvm-rg350-79c10ee30a5b4c8e41dc12806f432df88ff9af6f.zip
TITANIC: Rename CPetControlSub12 to CPetText
-rw-r--r--engines/titanic/module.mk4
-rw-r--r--engines/titanic/pet_control/pet_control_sub5.h4
-rw-r--r--engines/titanic/pet_control/pet_control_sub7.h6
-rw-r--r--engines/titanic/pet_control/pet_conversations.cpp4
-rw-r--r--engines/titanic/pet_control/pet_conversations.h6
-rw-r--r--engines/titanic/pet_control/pet_inventory.cpp8
-rw-r--r--engines/titanic/pet_control/pet_inventory.h4
-rw-r--r--engines/titanic/pet_control/pet_quit.cpp8
-rw-r--r--engines/titanic/pet_control/pet_quit.h4
-rw-r--r--engines/titanic/pet_control/pet_real_life.cpp2
-rw-r--r--engines/titanic/pet_control/pet_real_life.h4
-rw-r--r--engines/titanic/pet_control/pet_remote.h4
-rw-r--r--engines/titanic/pet_control/pet_rooms.h4
-rw-r--r--engines/titanic/pet_control/pet_sound.h2
-rw-r--r--engines/titanic/pet_control/pet_text.cpp (renamed from engines/titanic/pet_control/pet_control_sub12.cpp)32
-rw-r--r--engines/titanic/pet_control/pet_text.h (renamed from engines/titanic/pet_control/pet_control_sub12.h)20
16 files changed, 67 insertions, 49 deletions
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index fc2b4ef7fc..65afebab9a 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -370,7 +370,6 @@ MODULE_OBJS := \
pet_control/pet_control_sub5.o \
pet_control/pet_control_sub7.o \
pet_control/pet_control_sub11.o \
- pet_control/pet_control_sub12.o \
pet_control/pet_drag_chev.o \
pet_control/pet_graphic2.o \
pet_control/pet_graphic.o \
@@ -388,6 +387,7 @@ MODULE_OBJS := \
pet_control/pet_save.o \
pet_control/pet_slider.o \
pet_control/pet_sound.o \
+ pet_control/pet_text.o \
sound/auto_music_player.o \
sound/auto_music_player_base.o \
sound/auto_sound_player.o \
@@ -424,7 +424,7 @@ MODULE_OBJS := \
star_control/star_control_sub9.o \
star_control/star_control_sub10.o \
star_control/star_control_sub11.o \
- star_control/star_control_sub12.o \
+ star_control/star_control_text.o \
star_control/star_control_sub13.o \
star_control/star_control_sub14.o \
star_control/star_control_sub15.o \
diff --git a/engines/titanic/pet_control/pet_control_sub5.h b/engines/titanic/pet_control/pet_control_sub5.h
index 4997bf195d..560803d938 100644
--- a/engines/titanic/pet_control/pet_control_sub5.h
+++ b/engines/titanic/pet_control/pet_control_sub5.h
@@ -24,7 +24,7 @@
#define TITANIC_PET_CONTROL_SUB5_H
#include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_text.h"
#include "titanic/pet_control/pet_gfx_element.h"
namespace Titanic {
@@ -41,7 +41,7 @@ private:
CPetGfxElement _valArray1[6];
int _field17C;
int _field18C;
- CPetControlSub12 _sub12;
+ CPetText _text;
int _field20C;
int _field210;
public:
diff --git a/engines/titanic/pet_control/pet_control_sub7.h b/engines/titanic/pet_control/pet_control_sub7.h
index 5ad0ba793e..367ce840fc 100644
--- a/engines/titanic/pet_control/pet_control_sub7.h
+++ b/engines/titanic/pet_control/pet_control_sub7.h
@@ -24,14 +24,14 @@
#define TITANIC_PET_CONTROL_SUB7_H
#include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_text.h"
namespace Titanic {
class CPetControlSub7 : public CPetSection {
private:
- CPetControlSub12 _sub1;
- CPetControlSub12 _sub2;
+ CPetText _text1;
+ CPetText _text2;
public:
/**
* Returns true if the object is in a valid state
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index a4936e5703..2fbee9ed6e 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -33,8 +33,8 @@ void CPetConversations::save(SimpleFile *file, int indent) const {
}
void CPetConversations::load(SimpleFile *file, int param) {
- _sub2.load(file, param);
- _sub1.load(file, param);
+ _text2.load(file, param);
+ _text1.load(file, param);
for (int idx = 0; idx < 3; ++idx)
_valArray3[idx] = file->readNumber();
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index a511c3d991..a79a513037 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -24,7 +24,7 @@
#define TITANIC_PET_CONVERSATIONS_H
#include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_text.h"
#include "titanic/pet_control/pet_gfx_element.h"
namespace Titanic {
@@ -44,8 +44,8 @@ private:
CPetGfxElement _val9;
CPetGfxElement _valArray2[9];
int _field30C;
- CPetControlSub12 _sub1;
- CPetControlSub12 _sub2;
+ CPetText _text1;
+ CPetText _text2;
int _valArray3[3];
int _field414;
int _field418;
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index 2d11bc11b3..9a3ee83be2 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -40,7 +40,7 @@ bool CPetInventory::setup(CPetControl *petControl) {
bool CPetInventory::reset() {
_items.reset();
- _sub12.setup();
+ _text.setup();
// TODO
return true;
@@ -49,7 +49,7 @@ bool CPetInventory::reset() {
void CPetInventory::draw(CScreenManager *screenManager) {
_petControl->drawSquares(screenManager, 7);
_items.draw(screenManager);
- _sub12.draw(screenManager);
+ _text.draw(screenManager);
}
Rect CPetInventory::getBounds() {
@@ -97,8 +97,8 @@ bool CPetInventory::setPetControl(CPetControl *petControl) {
tempRect = Rect(0, 0, 580, 15);
tempRect.translate(32, 445);
- _sub12.setBounds(tempRect);
- _sub12.setHasBorder(false);
+ _text.setBounds(tempRect);
+ _text.setHasBorder(false);
return true;
}
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index fca9dede14..32cb47edf5 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -26,7 +26,7 @@
#include "titanic/support/simple_file.h"
#include "titanic/pet_control/pet_section.h"
#include "titanic/pet_control/pet_inventory_glyphs.h"
-#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_text.h"
namespace Titanic {
@@ -35,7 +35,7 @@ namespace Titanic {
*/
class CPetInventory : public CPetSection {
private:
- CPetControlSub12 _sub12;
+ CPetText _text;
CPetInventoryGlyphs _items;
CGameObject *_itemBackgrounds[46];
CGameObject *_itemGlyphs[46];
diff --git a/engines/titanic/pet_control/pet_quit.cpp b/engines/titanic/pet_control/pet_quit.cpp
index a68452dfd6..912789e7c0 100644
--- a/engines/titanic/pet_control/pet_quit.cpp
+++ b/engines/titanic/pet_control/pet_quit.cpp
@@ -30,10 +30,10 @@ void CPetQuit::setup(CPetControl *petControl, CPetGlyphs *owner) {
CPetGlyph::setup(petControl, owner);
Rect tempRect(0, 0, 280, 16);
tempRect.moveTo(32, 407);
- _sub12.setBounds(tempRect);
- _sub12.resize(3);
- _sub12.setHasBorder(true);
- _sub12.setup();
+ _text.setBounds(tempRect);
+ _text.resize(3);
+ _text.setHasBorder(true);
+ _text.setup();
Rect elementRect(0, 0, 496, 388);
elementRect.moveTo(496, 388);
diff --git a/engines/titanic/pet_control/pet_quit.h b/engines/titanic/pet_control/pet_quit.h
index 6c54abb626..c7843e239f 100644
--- a/engines/titanic/pet_control/pet_quit.h
+++ b/engines/titanic/pet_control/pet_quit.h
@@ -25,13 +25,13 @@
#include "titanic/pet_control/pet_gfx_element.h"
#include "titanic/pet_control/pet_glyphs.h"
-#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_text.h"
namespace Titanic {
class CPetQuit : public CPetGlyph {
private:
- CPetControlSub12 _sub12;
+ CPetText _text;
CPetGfxElement _element;
public:
/**
diff --git a/engines/titanic/pet_control/pet_real_life.cpp b/engines/titanic/pet_control/pet_real_life.cpp
index 3ec3317bb8..0c7c4bd51f 100644
--- a/engines/titanic/pet_control/pet_real_life.cpp
+++ b/engines/titanic/pet_control/pet_real_life.cpp
@@ -38,7 +38,7 @@ bool CPetRealLife::reset() {
void CPetRealLife::draw(CScreenManager *screenManager) {
_petControl->drawSquares(screenManager, 4);
_glyphs.draw(screenManager);
- _sub12.draw(screenManager);
+ _text.draw(screenManager);
}
bool CPetRealLife::setupControl(CPetControl *petControl) {
diff --git a/engines/titanic/pet_control/pet_real_life.h b/engines/titanic/pet_control/pet_real_life.h
index 57d0b317ba..6281735e33 100644
--- a/engines/titanic/pet_control/pet_real_life.h
+++ b/engines/titanic/pet_control/pet_real_life.h
@@ -25,7 +25,7 @@
#include "titanic/pet_control/pet_section.h"
#include "titanic/pet_control/pet_glyphs.h"
-#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_text.h"
namespace Titanic {
@@ -35,7 +35,7 @@ class CPetSaveGlyphs : public CPetGlyphs {
class CPetRealLife : public CPetSection {
private:
CPetGlyphs _glyphs;
- CPetSaveGlyphs _sub12;
+ CPetText _text;
private:
/**
* Does setup
diff --git a/engines/titanic/pet_control/pet_remote.h b/engines/titanic/pet_control/pet_remote.h
index 85cff3fe4f..70f6c3262c 100644
--- a/engines/titanic/pet_control/pet_remote.h
+++ b/engines/titanic/pet_control/pet_remote.h
@@ -25,7 +25,7 @@
#include "titanic/pet_control/pet_section.h"
#include "titanic/pet_control/pet_glyphs.h"
-#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_text.h"
#include "titanic/pet_control/pet_gfx_element.h"
namespace Titanic {
@@ -47,7 +47,7 @@ private:
CPetGfxElement _val9;
CPetGfxElement _val10;
CPetGfxElement _val11;
- CPetControlSub12 _sub12;
+ CPetText _text;
public:
/**
* Returns true if the object is in a valid state
diff --git a/engines/titanic/pet_control/pet_rooms.h b/engines/titanic/pet_control/pet_rooms.h
index a4bcefe09c..1e68873f93 100644
--- a/engines/titanic/pet_control/pet_rooms.h
+++ b/engines/titanic/pet_control/pet_rooms.h
@@ -25,7 +25,7 @@
#include "titanic/pet_control/pet_section.h"
#include "titanic/pet_control/pet_control_sub11.h"
-#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_text.h"
#include "titanic/pet_control/pet_control_list_item2.h"
namespace Titanic {
@@ -43,7 +43,7 @@ private:
int _field118;
int _field11C;
CPetGfxElement _val1;
- CPetControlSub12 _sub12;
+ CPetText _text;
int _field1C0;
int _field1C4;
int _field1C8;
diff --git a/engines/titanic/pet_control/pet_sound.h b/engines/titanic/pet_control/pet_sound.h
index 7607f95c62..d0a0fe19ae 100644
--- a/engines/titanic/pet_control/pet_sound.h
+++ b/engines/titanic/pet_control/pet_sound.h
@@ -25,7 +25,7 @@
#include "titanic/pet_control/pet_glyphs.h"
#include "titanic/pet_control/pet_gfx_element.h"
-#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_text.h"
namespace Titanic {
diff --git a/engines/titanic/pet_control/pet_control_sub12.cpp b/engines/titanic/pet_control/pet_text.cpp
index cc8d6ada10..ed297a8c69 100644
--- a/engines/titanic/pet_control/pet_control_sub12.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -20,11 +20,11 @@
*
*/
-#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_text.h"
namespace Titanic {
-CPetControlSub12::CPetControlSub12(int count) :
+CPetText::CPetText(uint count) :
_stringsMerged(false), _field30(-1), _lineCount(0), _field38(-1),
_field3C(0), _field40(0), _field44(0), _backR(0xff),
_backG(0xff), _backB(0xff), _field54(0), _field58(0),
@@ -34,18 +34,18 @@ CPetControlSub12::CPetControlSub12(int count) :
setupArrays(count);
}
-void CPetControlSub12::setupArrays(int count) {
+void CPetText::setupArrays(int count) {
freeArrays();
if (count < 10 || count > 60)
count = 10;
_array.resize(count);
}
-void CPetControlSub12::freeArrays() {
+void CPetText::freeArrays() {
_array.clear();
}
-void CPetControlSub12::setup() {
+void CPetText::setup() {
for (int idx = 0; idx < (int)_array.size(); ++idx) {
_array[idx]._string1.clear();
setArrayStr2(idx, _field54, _field58, _field5C);
@@ -56,7 +56,7 @@ void CPetControlSub12::setup() {
_stringsMerged = false;
}
-void CPetControlSub12::setArrayStr2(uint idx, int val1, int val2, int val3) {
+void CPetText::setArrayStr2(uint idx, int val1, int val2, int val3) {
char buffer[6];
if (!val1)
val1 = 1;
@@ -74,7 +74,7 @@ void CPetControlSub12::setArrayStr2(uint idx, int val1, int val2, int val3) {
_array[idx]._string2 = buffer;
}
-void CPetControlSub12::load(SimpleFile *file, int param) {
+void CPetText::load(SimpleFile *file, int param) {
if (!param) {
int var1 = file->readNumber();
int var2 = file->readNumber();
@@ -95,7 +95,7 @@ void CPetControlSub12::load(SimpleFile *file, int param) {
_hasBorder = file->readNumber() != 0;
_field74 = file->readNumber();
- warning("TODO: CPetControlSub12::load %d,%d", var1, var2);
+ warning("TODO: CPetText::load %d,%d", var1, var2);
assert(_array.size() >= count);
for (uint idx = 0; idx < count; ++idx) {
_array[idx]._string1 = file->readString();
@@ -105,7 +105,7 @@ void CPetControlSub12::load(SimpleFile *file, int param) {
}
}
-void CPetControlSub12::draw(CScreenManager *screenManager) {
+void CPetText::draw(CScreenManager *screenManager) {
Rect tempRect = _bounds;
if (_hasBorder) {
@@ -130,10 +130,10 @@ void CPetControlSub12::draw(CScreenManager *screenManager) {
screenManager->fillRect(SURFACE_BACKBUFFER, &tempRect, _backR, _backG, _backB);
}
- warning("TODO: CPetControlSub12::draw");
+ warning("TODO: CPetText::draw");
}
-void CPetControlSub12::mergeStrings() {
+void CPetText::mergeStrings() {
if (!_stringsMerged) {
_lines.clear();
@@ -148,12 +148,20 @@ void CPetControlSub12::mergeStrings() {
}
}
-void CPetControlSub12::resize(uint count) {
+void CPetText::resize(uint count) {
if (!count || _array.size() == count)
return;
_array.clear();
_array.resize(count);
}
+void CPetText::setText(const CString &str) {
+ setup();
+ changeText(str);
+}
+
+void CPetText::changeText(const CString &str) {
+ warning("TODO: CPetText::changeText");
+}
} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub12.h b/engines/titanic/pet_control/pet_text.h
index a5296ea62e..2cd45c68c2 100644
--- a/engines/titanic/pet_control/pet_control_sub12.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -20,15 +20,15 @@
*
*/
-#ifndef TITANIC_PET_CONTROL_SUB12_H
-#define TITANIC_PET_CONTROL_SUB12_H
+#ifndef TITANIC_PET_TEXT_H
+#define TITANIC_PET_TEXT_H
#include "titanic/support/simple_file.h"
#include "titanic/support/screen_manager.h"
namespace Titanic {
-class CPetControlSub12 {
+class CPetText {
struct ArrayEntry {
CString _string1;
CString _string2;
@@ -70,8 +70,13 @@ private:
* Merges the strings in the strings array
*/
void mergeStrings();
+
+ /**
+ * Change the text
+ */
+ void changeText(const CString &str);
public:
- CPetControlSub12(int count = 10);
+ CPetText(uint count = 10);
/**
* Set up the control
@@ -99,8 +104,13 @@ public:
void draw(CScreenManager *screenManager);
void resize(uint count);
+
+ /**
+ * Set the text
+ */
+ void setText(const CString &str);
};
} // End of namespace Titanic
-#endif /* TITANIC_PET_CONTROL_SUB12_H */
+#endif /* TITANIC_PET_TEXT_H */