aboutsummaryrefslogtreecommitdiff
path: root/engines/lastexpress/game/inventory.cpp
diff options
context:
space:
mode:
authorLittleboy2012-07-14 14:02:44 -0400
committerLittleboy2012-07-14 14:26:00 -0400
commit0635d99ec74ad431146e14aba4ad07a5f9e7e221 (patch)
tree8b4958d1c162be31c93b0d700cf56192f264dfed /engines/lastexpress/game/inventory.cpp
parent732a2c80ddde4cf0ffd1b1742f514ae940c5301d (diff)
downloadscummvm-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/inventory.cpp')
-rw-r--r--engines/lastexpress/game/inventory.cpp14
1 files changed, 7 insertions, 7 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++) {