mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-23 20:51:14 +00:00
TITANIC: Rename CPetControlSub12 to CPetText
This commit is contained in:
parent
225af47088
commit
79c10ee30a
@ -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 \
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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];
|
||||
|
@ -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);
|
||||
|
@ -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:
|
||||
/**
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -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
|
@ -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 */
|
Loading…
x
Reference in New Issue
Block a user