aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2016-04-17 22:30:18 -0400
committerPaul Gilbert2016-07-10 16:11:25 -0400
commitb6e093d668e9e782cc6a08a787d48c857cf53430 (patch)
tree40ff96848a194ec50bba0b868dba98d7c35874bd /engines
parentca68e85f3791aa35e5ccc0f3d6cc33a9f71f7f48 (diff)
downloadscummvm-rg350-b6e093d668e9e782cc6a08a787d48c857cf53430.tar.gz
scummvm-rg350-b6e093d668e9e782cc6a08a787d48c857cf53430.tar.bz2
scummvm-rg350-b6e093d668e9e782cc6a08a787d48c857cf53430.zip
TITANIC: Fix drawing glyph squares in PET inventory tab
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/pet_control/pet_control.cpp4
-rw-r--r--engines/titanic/pet_control/pet_control.h4
-rw-r--r--engines/titanic/pet_control/pet_frame.cpp24
-rw-r--r--engines/titanic/pet_control/pet_frame.h4
-rw-r--r--engines/titanic/pet_control/pet_glyphs.cpp2
-rw-r--r--engines/titanic/pet_control/pet_glyphs.h2
-rw-r--r--engines/titanic/pet_control/pet_inventory.cpp2
7 files changed, 23 insertions, 19 deletions
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 31f95d1a88..fed17d5b4b 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -345,8 +345,8 @@ bool CPetControl::TimerMsg(CTimerMsg *msg) {
return true;
}
-void CPetControl::drawIndent(CScreenManager *screenManager, int indent) {
- _frame.drawIndent(screenManager, indent);
+void CPetControl::drawSquares(CScreenManager *screenManager, int count) {
+ _frame.drawSquares(screenManager, count);
}
void CPetControl::displayMessage(const CString &msg) {
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 1e98e3f5d8..3726fc355f 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -179,9 +179,9 @@ public:
CRoomItem *getHiddenRoom();
/**
- * Draws the indent
+ * Draws squares for showing glyphs inside
*/
- void drawIndent(CScreenManager *screenManager, int indent);
+ void drawSquares(CScreenManager *screenManager, int count);
/**
* Returns true if the point is within the PET's draw bounds
diff --git a/engines/titanic/pet_control/pet_frame.cpp b/engines/titanic/pet_control/pet_frame.cpp
index ec604a2b5c..3269b9f837 100644
--- a/engines/titanic/pet_control/pet_frame.cpp
+++ b/engines/titanic/pet_control/pet_frame.cpp
@@ -54,9 +54,9 @@ bool CPetFrame::reset() {
_titles[idx].reset(resName, _petControl, MODE_UNSELECTED);
}
- for (int idx = 0; idx < 7; ++idx) {
- CString resName = Common::String::format("PetIndent%d", idx);
- _indent[idx].reset(resName, _petControl, MODE_UNSELECTED);
+ for (int idx = 0; idx < TOTAL_GLYPHS; ++idx) {
+ CString resName = Common::String::format("PetIndent%d", idx + 1);
+ _squares[idx].reset(resName, _petControl, MODE_UNSELECTED);
}
}
@@ -97,13 +97,15 @@ bool CPetFrame::setPetControl(CPetControl *petControl) {
// Set the bounds of the individual elements
_background.setBounds(Rect(20, 350, 620, 480));
_modeBackground.setBounds(Rect(590, 365, 611, 467));
-
+
+ // Squares used for holding glyphs in various tabs
Rect r(35, 373, 91, 429);
- for (int idx = 0, xp = 0; xp < 490; ++idx, xp += 70) {
- _indent[idx].setBounds(r);
- _indent[idx].translate(xp, 0);
+ for (int idx = 0, xp = 0; idx < TOTAL_GLYPHS; ++idx, xp += 70) {
+ _squares[idx].setBounds(r);
+ _squares[idx].translate(xp, 0);
}
+ // Draw the mode buttons vertically on the right edge of the PET
r = Rect(590, 365, 606, 381);
const int YLIST[] = { 7, 27, 45, 66, 84 };
for (int idx = 0; idx < 5; ++idx) {
@@ -143,10 +145,10 @@ void CPetFrame::drawFrame(CScreenManager *screenManager) {
_titles[_petControl->_currentArea].draw(screenManager);
}
-void CPetFrame::drawIndent(CScreenManager *screenManager, int indent) {
- indent = CLIP(indent, 0, 7);
- for (int idx = 0; idx < indent; ++idx)
- _indent[idx].draw(screenManager);
+void CPetFrame::drawSquares(CScreenManager *screenManager, int count) {
+ count = CLIP(count, 0, TOTAL_GLYPHS);
+ for (int idx = 0; idx < count; ++idx)
+ _squares[idx].draw(screenManager);
}
} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_frame.h b/engines/titanic/pet_control/pet_frame.h
index 0bc872a33d..d8924e83d3 100644
--- a/engines/titanic/pet_control/pet_frame.h
+++ b/engines/titanic/pet_control/pet_frame.h
@@ -40,7 +40,7 @@ private:
CPetGfxElement _val2;
CPetGfxElement _val3;
CPetGfxElement _background;
- CPetGfxElement _indent[7];
+ CPetGfxElement _squares[7];
private:
/**
* Called to set the owning PET instance and set some initial state
@@ -93,7 +93,7 @@ public:
/**
* Draws the indent
*/
- void drawIndent(CScreenManager *screenManager, int indent);
+ void drawSquares(CScreenManager *screenManager, int count);
};
} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index 196424121f..e38efdddbe 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -49,7 +49,7 @@ bool CPetGlyph::translateContains(const Point &delta, const Point &pt) {
/*------------------------------------------------------------------------*/
-CPetGlyphs::CPetGlyphs() : _firstVisibleIndex(0), _numVisibleGlyphs(7),
+CPetGlyphs::CPetGlyphs() : _firstVisibleIndex(0), _numVisibleGlyphs(TOTAL_GLYPHS),
_highlightIndex(-1), _field1C(-1), _field20(0), _owner(nullptr) {
}
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 88b6e40956..54abe9d72e 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -29,6 +29,8 @@
namespace Titanic {
+#define TOTAL_GLYPHS 7
+
class CPetGlyphs;
class CPetSection;
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index ff333ed79c..5dd2078bd2 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -47,7 +47,7 @@ bool CPetInventory::reset() {
}
void CPetInventory::draw(CScreenManager *screenManager) {
- _petControl->drawIndent(screenManager, 7);
+ _petControl->drawSquares(screenManager, 7);
_items.draw(screenManager);
_sub12.draw(screenManager);
}