aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2019-05-27 14:22:04 +0300
committerFilippos Karapetis2019-05-27 14:53:39 +0300
commite94026e8000243333a1ca594d91ad5eda4e6930a (patch)
tree3f8830395e5787bfb4c90169cdd3edf6e402dc1c
parentea39214f7a252ad60d686a7dac44a50dc2cbad1d (diff)
downloadscummvm-rg350-e94026e8000243333a1ca594d91ad5eda4e6930a.tar.gz
scummvm-rg350-e94026e8000243333a1ca594d91ad5eda4e6930a.tar.bz2
scummvm-rg350-e94026e8000243333a1ca594d91ad5eda4e6930a.zip
MACVENTURE: Fix MSVC warnings
- Added a CHECKME for a code which is never used at the moment - Add default cases to switch statements - Remove unused variables - Fix integer variable assignments from booleans
-rw-r--r--engines/macventure/gui.cpp6
-rw-r--r--engines/macventure/macventure.cpp17
2 files changed, 14 insertions, 9 deletions
diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp
index 0008e34afa..34aa2c90cb 100644
--- a/engines/macventure/gui.cpp
+++ b/engines/macventure/gui.cpp
@@ -802,6 +802,7 @@ void Gui::updateWindow(WindowReference winID, bool containerOpen) {
ObjID child = children[i].obj;
BlitMode mode = kBlitDirect;
bool off = !_engine->isObjVisible(child);
+ // CHECKME: Since flag = 0, this always evaluates to false
if (flag || !off || !_engine->isObjClickable(child)) {
mode = kBlitBIC;
if (off || flag) {
@@ -1021,9 +1022,8 @@ WindowReference Gui::getObjWindow(ObjID objID) {
case 0xfffd: return kSelfWindow;
case 0xfffe: return kOutConsoleWindow;
case 0xffff: return kCommandsWindow;
+ default: return findObjWindow(objID);
}
-
- return findObjWindow(objID);
}
WindowReference Gui::findObjWindow(ObjID objID) {
@@ -1250,7 +1250,7 @@ void Gui::invertWindowColors(WindowReference winID) {
}
bool Gui::tryCloseWindow(WindowReference winID) {
- WindowData data = findWindowData(winID);
+ //WindowData data = findWindowData(winID);
Graphics::MacWindow *win = findWindow(winID);
_wm.removeWindow(win);
if (winID < 0x80) {
diff --git a/engines/macventure/macventure.cpp b/engines/macventure/macventure.cpp
index 907349d41b..39740fdd6c 100644
--- a/engines/macventure/macventure.cpp
+++ b/engines/macventure/macventure.cpp
@@ -614,6 +614,8 @@ void MacVentureEngine::runObjQueue() {
case 0xe:
zoomObject(obj.object);
break;
+ default:
+ break;
}
}
}
@@ -635,6 +637,8 @@ void MacVentureEngine::printTexts() {
_gui->printText(_world->getText(text.asset, text.source, text.destination));
gameChanged();
break;
+ default:
+ break;
}
}
}
@@ -654,6 +658,8 @@ void MacVentureEngine::playSounds(bool pause) {
case kSoundWait:
// Empty in the original.
break;
+ default:
+ break;
}
}
if (pause && delay > 0) {
@@ -804,7 +810,6 @@ void MacVentureEngine::openObject(ObjID objID) {
void MacVentureEngine::closeObject(ObjID objID) {
warning("closeObject: not fully implemented");
_gui->tryCloseWindow(getObjWindow(objID));
- return;
}
void MacVentureEngine::checkObject(QueuedObject old) {
@@ -819,8 +824,8 @@ void MacVentureEngine::checkObject(QueuedObject old) {
if (old.parent != _world->getObjAttr(id, kAttrParentObject)) {
enqueueObject(kSetToPlayerParent, id);
}
- if (old.offscreen != _world->getObjAttr(id, kAttrInvisible) ||
- old.invisible != _world->getObjAttr(id, kAttrUnclickable)) {
+ if (old.offscreen != !!_world->getObjAttr(id, kAttrInvisible) ||
+ old.invisible != !!_world->getObjAttr(id, kAttrUnclickable)) {
updateWindow(findParentWindow(id));
}
} else if (old.parent != _world->getObjAttr(id, kAttrParentObject) ||
@@ -837,14 +842,14 @@ void MacVentureEngine::checkObject(QueuedObject old) {
_gui->addChild(newWin, id);
hasChanged = true;
}
- } else if (old.offscreen != _world->getObjAttr(id, kAttrInvisible) ||
- old.invisible != _world->getObjAttr(id, kAttrUnclickable)) {
+ } else if (old.offscreen != !!_world->getObjAttr(id, kAttrInvisible) ||
+ old.invisible != !!_world->getObjAttr(id, kAttrUnclickable)) {
updateWindow(findParentWindow(id));
}
if (_world->getObjAttr(id, kAttrIsExit)) {
if (hasChanged ||
- old.hidden != _world->getObjAttr(id, kAttrHiddenExit) ||
+ old.hidden != !!_world->getObjAttr(id, kAttrHiddenExit) ||
old.exitx != _world->getObjAttr(id, kAttrExitX) ||
old.exity != _world->getObjAttr(id, kAttrExitY))
_gui->updateExit(id);