aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2016-04-23 17:02:22 -0400
committerPaul Gilbert2016-07-10 16:11:50 -0400
commitfc3f2952b097cd0d465efe0216b11602c5ab0191 (patch)
tree4a7288a548b6249e4caff9108cef817aa43bf9af /engines
parentd11a95068c2566564e0372bad0ad5c656af79298 (diff)
downloadscummvm-rg350-fc3f2952b097cd0d465efe0216b11602c5ab0191.tar.gz
scummvm-rg350-fc3f2952b097cd0d465efe0216b11602c5ab0191.tar.bz2
scummvm-rg350-fc3f2952b097cd0d465efe0216b11602c5ab0191.zip
TITANIC: Define Glyph flags enum
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/pet_control/pet_glyphs.cpp14
-rw-r--r--engines/titanic/pet_control/pet_glyphs.h6
-rw-r--r--engines/titanic/pet_control/pet_inventory.cpp2
-rw-r--r--engines/titanic/pet_control/pet_quit.cpp2
-rw-r--r--engines/titanic/pet_control/pet_real_life.cpp2
5 files changed, 14 insertions, 12 deletions
diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index 20f864d456..6c5454844a 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -67,7 +67,7 @@ void CPetGlyph::setName(const CString &name, CPetControl *petControl) {
/*------------------------------------------------------------------------*/
CPetGlyphs::CPetGlyphs() : _firstVisibleIndex(0), _numVisibleGlyphs(TOTAL_GLYPHS),
- _highlightIndex(-1), _field1C(-1), _field20(0),
+ _highlightIndex(-1), _field1C(-1), _flags(0),
_field94(nullptr), _owner(nullptr) {
}
@@ -159,7 +159,7 @@ void CPetGlyphs::draw(CScreenManager *screenManager) {
}
// Draw scrolling arrows if more than a screen's worth of items are showing
- if (listSize > _numVisibleGlyphs || _field20 != 16) {
+ if (listSize > _numVisibleGlyphs || (_flags & GFLAG_16)) {
_scrollLeft.draw(screenManager);
_scrollRight.draw(screenManager);
}
@@ -186,7 +186,7 @@ void CPetGlyphs::changeHighlight(int index) {
if (index == _highlightIndex)
return;
- if (_highlightIndex >= 0 && (_field20 & 4)) {
+ if (_highlightIndex >= 0 && (_flags & GFLAG_4)) {
CPetGlyph *glyph = getGlyph(_highlightIndex);
if (glyph)
glyph->unhighlightCurrent();
@@ -197,7 +197,7 @@ void CPetGlyphs::changeHighlight(int index) {
CPetGlyph *glyph = getGlyph(_highlightIndex);
if (glyph) {
- if (_field20 & 4) {
+ if (_flags & GFLAG_4) {
Point pt;
int idx = getHighlightedIndex(_highlightIndex);
if (idx >= 0)
@@ -243,7 +243,7 @@ void CPetGlyphs::setFirstVisible(int index) {
if (index != _firstVisibleIndex) {
_firstVisibleIndex = index;
- if ((_field20 & 8) && _highlightIndex != -1) {
+ if ((_flags & GFLAG_8) && _highlightIndex != -1) {
CPetGlyph *glyph = getGlyph(_highlightIndex);
if (glyph) {
@@ -328,7 +328,7 @@ bool CPetGlyphs::MouseButtonDownMsg(const Point &pt) {
if (glyph->checkHighlight(pt))
return true;
- if (!(_field20 & 2)) {
+ if (!(_flags & GFLAG_2)) {
changeHighlight(-1);
makePetDirty();
}
@@ -351,7 +351,7 @@ bool CPetGlyphs::MouseButtonUpMsg(const Point &pt) {
}
bool CPetGlyphs::MouseDragStartMsg(CMouseDragStartMsg *msg) {
- if (!(_field20 & 1) && _highlightIndex >= 0) {
+ if (!(_flags & GFLAG_1) && _highlightIndex >= 0) {
CPetGlyph *glyph = getGlyph(_highlightIndex);
int index = getHighlightedIndex(_highlightIndex);
Rect glyphRect = getRect(index);
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 80c2153a1a..c7966e5e6a 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -38,6 +38,8 @@ class CPetText;
enum GlyphActionMode { ACTION_REMOVE = 0, ACTION_REMOVED = 1, ACTION_CHANGE = 2 };
+enum GlyphFlag { GFLAG_1 = 1, GFLAG_2 = 2, GFLAG_4 = 4, GFLAG_8 = 8, GFLAG_16 = 16 };
+
class CGlyphAction {
protected:
GlyphActionMode _mode;
@@ -242,7 +244,7 @@ protected:
int _numVisibleGlyphs;
int _highlightIndex;
int _field1C;
- int _field20;
+ int _flags;
void *_field94;
CPetSection *_owner;
CPetGfxElement _selection;
@@ -287,7 +289,7 @@ public:
*/
virtual bool leave();
- void set20(int val) { _field20 = val; }
+ void setFlags(int flags) { _flags = flags; }
/**
* Draw the control
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index 621bf2df0d..c7c6dfdf7c 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -100,7 +100,7 @@ bool CPetInventory::setPetControl(CPetControl *petControl) {
_petControl = petControl;
_items.setup(7, this);
- _items.set20(28);
+ _items.setFlags(28);
Rect tempRect(0, 0, 52, 52);
for (uint idx = 0; idx < TOTAL_ITEMS; ++idx) {
diff --git a/engines/titanic/pet_control/pet_quit.cpp b/engines/titanic/pet_control/pet_quit.cpp
index e6c354a129..c191e30ceb 100644
--- a/engines/titanic/pet_control/pet_quit.cpp
+++ b/engines/titanic/pet_control/pet_quit.cpp
@@ -62,7 +62,7 @@ bool CPetQuit::reset() {
}
void CPetQuit::draw2(CScreenManager *screenManager) {
- _text.draw(screenManager);
+// _text.draw(screenManager);
_btnYes.draw(screenManager);
}
diff --git a/engines/titanic/pet_control/pet_real_life.cpp b/engines/titanic/pet_control/pet_real_life.cpp
index 59702046ba..27a5c22b01 100644
--- a/engines/titanic/pet_control/pet_real_life.cpp
+++ b/engines/titanic/pet_control/pet_real_life.cpp
@@ -100,7 +100,7 @@ bool CPetRealLife::setupControl(CPetControl *petControl) {
if (petControl) {
_petControl = petControl;
_glyphs.setup(4, this);
- _glyphs.set20(6);
+ _glyphs.setFlags(6);
addButton(new CPetLoad());
addButton(new CPetSave());