diff options
author | Littleboy | 2012-07-14 14:02:44 -0400 |
---|---|---|
committer | Littleboy | 2012-07-14 14:26:00 -0400 |
commit | 0635d99ec74ad431146e14aba4ad07a5f9e7e221 (patch) | |
tree | 8b4958d1c162be31c93b0d700cf56192f264dfed /engines/lastexpress/game | |
parent | 732a2c80ddde4cf0ffd1b1742f514ae940c5301d (diff) | |
download | scummvm-rg350-0635d99ec74ad431146e14aba4ad07a5f9e7e221.tar.gz scummvm-rg350-0635d99ec74ad431146e14aba4ad07a5f9e7e221.tar.bz2 scummvm-rg350-0635d99ec74ad431146e14aba4ad07a5f9e7e221.zip |
LASTEXPRESS: Cleanup
- Add missing initializer/destructors
- Add some const modifiers
- Remove some unneeded casts
- Use enumeration values in switch constructs
Diffstat (limited to 'engines/lastexpress/game')
-rw-r--r-- | engines/lastexpress/game/inventory.cpp | 14 | ||||
-rw-r--r-- | engines/lastexpress/game/inventory.h | 12 |
2 files changed, 13 insertions, 13 deletions
diff --git a/engines/lastexpress/game/inventory.cpp b/engines/lastexpress/game/inventory.cpp index 7b803bb1ca..bb382ea38e 100644 --- a/engines/lastexpress/game/inventory.cpp +++ b/engines/lastexpress/game/inventory.cpp @@ -259,7 +259,7 @@ void Inventory::handleMouseEvent(const Common::Event &ev) { // Change item highlight on list if (getFlags()->mouseLeftPressed) { - uint32 index = ev.mouse.y / 40; + uint32 index = (unsigned) (int) ev.mouse.y / 40; if (_highlightedItemIndex && _highlightedItemIndex != index) drawHighlight(_highlightedItemIndex, true); @@ -416,12 +416,12 @@ void Inventory::show() { drawEgg(); } -void Inventory::setPortrait(InventoryItem item) { +void Inventory::setPortrait(InventoryItem item) const { getProgress().portrait = item; drawItem((CursorStyle)getProgress().portrait, 0, 0); } -void Inventory::showHourGlass(){ +void Inventory::showHourGlass() const { if (!getMenu()->isShown()) drawItem(kCursorHourGlass, 608, 448); @@ -611,7 +611,7 @@ void Inventory::examine(InventoryItem item) { } } -void Inventory::drawEgg() { +void Inventory::drawEgg() const { if (!getMenu()->isShown()) drawItem((CursorStyle)(getMenu()->getGameId() + 39), 608, 448, _eggHightlighted ? 0 : 1); @@ -652,7 +652,7 @@ void Inventory::drawBlinkingEgg() { askForRedraw(); } -void Inventory::drawItem(CursorStyle id, uint16 x, uint16 y, int16 brightnessIndex) { +void Inventory::drawItem(CursorStyle id, uint16 x, uint16 y, int16 brightnessIndex) const { Icon icon(id); icon.setPosition(x, y); @@ -676,7 +676,7 @@ void Inventory::drawSelectedItem() { } } -void Inventory::clearSelectedItem() { +void Inventory::clearSelectedItem() const { _engine->getGraphicsManager()->clear(GraphicsManager::kBackgroundInventory, Common::Rect(44, 0, 44 + 32, 32)); } @@ -731,7 +731,7 @@ void Inventory::drawHighlight(uint32 currentIndex, bool reset) { } } -uint32 Inventory::getItemIndex(uint32 currentIndex) { +uint32 Inventory::getItemIndex(uint32 currentIndex) const { uint32 count = 0; for (uint32 i = 1; i < ARRAYSIZE(_entries); i++) { diff --git a/engines/lastexpress/game/inventory.h b/engines/lastexpress/game/inventory.h index b1995adce3..15dd29053d 100644 --- a/engines/lastexpress/game/inventory.h +++ b/engines/lastexpress/game/inventory.h @@ -107,9 +107,9 @@ public: // UI Control void show(); void blinkEgg(bool enabled); - void showHourGlass(); - void setPortrait(InventoryItem item); - void drawEgg(); + void showHourGlass() const; + void setPortrait(InventoryItem item) const; + void drawEgg() const; void drawBlinkingEgg(); // Handle inventory UI events. @@ -168,14 +168,14 @@ private: void close(); void examine(InventoryItem item); void drawHighlight(uint32 currentIndex, bool reset); - uint32 getItemIndex(uint32 currentIndex); + uint32 getItemIndex(uint32 currentIndex) const; bool isItemSceneParameter(InventoryItem item) const; - void drawItem(CursorStyle id, uint16 x, uint16 y, int16 brighnessIndex = -1); + void drawItem(CursorStyle id, uint16 x, uint16 y, int16 brighnessIndex = -1) const; void drawSelectedItem(); - void clearSelectedItem(); + void clearSelectedItem() const; }; } // End of namespace LastExpress |