aboutsummaryrefslogtreecommitdiff
path: root/engines/macventure
diff options
context:
space:
mode:
authorBorja Lorente2016-08-15 12:45:21 +0200
committerBorja Lorente2016-08-19 16:30:23 +0200
commit9c0777efbf5a59df90728087276245208c13988f (patch)
tree7fc9536bdd0cc78fd3a472ae32ef0a15adf84f8f /engines/macventure
parent09fe00eb2a8f11e274901a4af4e19ec5275ff7e8 (diff)
downloadscummvm-rg350-9c0777efbf5a59df90728087276245208c13988f.tar.gz
scummvm-rg350-9c0777efbf5a59df90728087276245208c13988f.tar.bz2
scummvm-rg350-9c0777efbf5a59df90728087276245208c13988f.zip
MACVENTURE: Fix some compiler warnings
Diffstat (limited to 'engines/macventure')
-rw-r--r--engines/macventure/datafiles.cpp1
-rw-r--r--engines/macventure/detection.cpp4
-rw-r--r--engines/macventure/dialog.cpp1
-rw-r--r--engines/macventure/gui.cpp12
-rw-r--r--engines/macventure/image.cpp4
-rw-r--r--engines/macventure/macventure.cpp4
-rw-r--r--engines/macventure/script.cpp8
7 files changed, 15 insertions, 19 deletions
diff --git a/engines/macventure/datafiles.cpp b/engines/macventure/datafiles.cpp
index 496fa919c8..a86e922193 100644
--- a/engines/macventure/datafiles.cpp
+++ b/engines/macventure/datafiles.cpp
@@ -61,6 +61,7 @@ Common::String windowTypeName(MVWindowType windowType) {
case kRDoc10:
return "RDoc10";
}
+ return "";
}
void MacVentureEngine::loadDataBundle() {
diff --git a/engines/macventure/detection.cpp b/engines/macventure/detection.cpp
index 9bf94cfdd4..d0a2940269 100644
--- a/engines/macventure/detection.cpp
+++ b/engines/macventure/detection.cpp
@@ -93,8 +93,6 @@ SaveStateList MacVentureMetaEngine::listSaves(const char *target) const {
SaveStateList saveList;
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
int slotNum = atoi(file->c_str() + file->size() - 3);
- Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(*file);
-
SaveStateDescriptor desc;
// Do not allow save slot 0 (used for auto-saving) to be deleted or
// overwritten.
@@ -104,7 +102,7 @@ SaveStateList MacVentureMetaEngine::listSaves(const char *target) const {
if (slotNum >= 0 && slotNum <= getMaximumSaveSlot()) {
Common::InSaveFile *in = saveFileMan->openForLoading(*file);
if (in) {
- SaveStateDescriptor desc = loadMetaData(in, slotNum);
+ desc = loadMetaData(in, slotNum);
if (desc.getSaveSlot() != slotNum) {
// invalid
delete in;
diff --git a/engines/macventure/dialog.cpp b/engines/macventure/dialog.cpp
index ce420a25c3..043cd38a92 100644
--- a/engines/macventure/dialog.cpp
+++ b/engines/macventure/dialog.cpp
@@ -82,6 +82,7 @@ bool Dialog::processEvent(Common::Event event) {
for (Common::Array<DialogElement*>::iterator it = _elements.begin(); it != _elements.end(); it++) {
if ((*it)->processEvent(this, event)) return true;
}
+ return false;
}
void Dialog::addButton(Common::String title, MacVenture::DialogAction action, Common::Point position, uint width, uint height) {
diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp
index 8ced27957d..310cf92443 100644
--- a/engines/macventure/gui.cpp
+++ b/engines/macventure/gui.cpp
@@ -392,7 +392,6 @@ bool Gui::loadMenus() {
int i = 1;
for (iter = resArray.begin(); iter != resArray.end(); ++iter) {
res = _resourceManager->getResource(MKTAG('M', 'E', 'N', 'U'), *iter);
- bool enabled;
uint16 key;
uint16 style;
uint8 titleLength;
@@ -400,7 +399,6 @@ bool Gui::loadMenus() {
/* Skip menuID, width, height, resourceID, placeholder */
for (int skip = 0; skip < 5; skip++) { res->readUint16BE(); }
- enabled = res->readUint32BE();
titleLength = res->readByte();
title = new char[titleLength + 1];
res->read(title, titleLength);
@@ -410,7 +408,7 @@ bool Gui::loadMenus() {
_menu->addMenuItem(title);
// Read submenu items
- while (titleLength = res->readByte()) {
+ while ((titleLength = res->readByte())) {
title = new char[titleLength + 1];
res->read(title, titleLength);
title[titleLength] = '\0';
@@ -495,7 +493,6 @@ bool Gui::loadControls() {
if ((resArray = _resourceManager->getResIDArray(MKTAG('C', 'N', 'T', 'L'))).size() == 0)
return false;
- uint16 commandsBorder = borderBounds(kPlainDBox).topOffset;
uint32 id = kControlExitBox;
for (iter = resArray.begin(); iter != resArray.end(); ++iter) {
res = _resourceManager->getResource(MKTAG('C', 'N', 'T', 'L'), *iter);
@@ -553,7 +550,6 @@ void Gui::drawCommandsWindow() {
if (_engine->needsClickToContinue()) {
Graphics::ManagedSurface *srf = _controlsWindow->getSurface();
WindowData data = getWindowData(kCommandsWindow);
- uint16 border = borderBounds(data.type).topOffset;
srf->fillRect(Common::Rect(0, 0, srf->w, srf->h), kColorWhite);
getCurrentFont().drawString(
srf,
@@ -618,12 +614,10 @@ void Gui::drawInventories() {
Graphics::MacWindow *win = findWindow(data.refcon);
srf = win->getSurface();
srf->clear(kColorGreen);
- BorderBounds border = borderBounds(data.type);
srf->fillRect(srf->getBounds(), kColorWhite);
drawObjectsInWindow(data, srf);
if (DebugMan.isDebugChannelEnabled(kMVDebugGUI)) {
- Graphics::MacWindow *win = findWindow(data.refcon);
Common::Rect innerDims = win->getInnerDimensions();
int x = win->getDimensions().left;
int y = win->getDimensions().top;
@@ -988,13 +982,15 @@ Graphics::MacWindow * Gui::findWindow(WindowReference reference) {
return _exitsWindow;
case MacVenture::kDiplomaWindow:
return _diplomaWindow;
+ default:
+ return NULL;
}
return NULL;
}
void Gui::ensureInventoryOpen(WindowReference reference, ObjID id) {
assert(reference < 0x80 && reference >= kInventoryStart);
- if (reference - kInventoryStart == _inventoryWindows.size()) {
+ if (reference - kInventoryStart == (int)_inventoryWindows.size()) {
createInventoryWindow(id);
}
}
diff --git a/engines/macventure/image.cpp b/engines/macventure/image.cpp
index 1b0e59d565..a472c6880a 100644
--- a/engines/macventure/image.cpp
+++ b/engines/macventure/image.cpp
@@ -118,7 +118,7 @@ void ImageAsset::decodePPIC(ObjID id, Common::Array<byte> &data, uint &bitHeight
bitWidth = w;
bitHeight = h;
- for (int i = 0; i < rowBytes * h; i++) {
+ for (uint i = 0; i < rowBytes * h; i++) {
data.push_back(0);
}
@@ -300,7 +300,7 @@ void ImageAsset::decodeHuffGraphic(const PPICHuff & huff, Common::BitStream & st
if (flags & 2) delta *= 2;
pos = 0;
uint q = delta;
- for (int i = 0; i < bitHeight * rowBytes - delta; i++) {
+ for (uint i = 0; i < bitHeight * rowBytes - delta; i++) {
data[q] ^= data[pos];
q++;
pos++;
diff --git a/engines/macventure/macventure.cpp b/engines/macventure/macventure.cpp
index 76a4791572..0542665d3c 100644
--- a/engines/macventure/macventure.cpp
+++ b/engines/macventure/macventure.cpp
@@ -377,8 +377,6 @@ void MacVentureEngine::handleObjectSelect(ObjID objID, WindowReference win, bool
win = kMainGameWindow;
}
- bool canDrag = (objID && !_world->getObjAttr(objID, kAttrInvisible));
-
const WindowData &windata = _gui->getWindowData(win);
if (shiftPressed) {
@@ -802,7 +800,7 @@ void MacVentureEngine::openObject(ObjID objID) {
void MacVentureEngine::closeObject(ObjID objID) {
warning("closeObject: not fully implemented");
- bool success = _gui->tryCloseWindow(getObjWindow(objID));
+ _gui->tryCloseWindow(getObjWindow(objID));
return;
}
diff --git a/engines/macventure/script.cpp b/engines/macventure/script.cpp
index 3dc9509555..c743e49a55 100644
--- a/engines/macventure/script.cpp
+++ b/engines/macventure/script.cpp
@@ -119,7 +119,7 @@ bool ScriptEngine::execFrame(bool execAll) {
}
}
- uint highest = 0;
+ int highest = 0;
uint localHigh = 0;
do { // Saved function calls
highest = 0;
@@ -914,6 +914,7 @@ bool ScriptEngine::opbbFORK(EngineState * state, EngineFrame * frame) {
if (execFrame(true)) {
return true;
}
+ return false;
}
bool ScriptEngine::opbcCALL(EngineState * state, EngineFrame * frame, ScriptAsset &script) {
@@ -926,6 +927,7 @@ bool ScriptEngine::opbcCALL(EngineState * state, EngineFrame * frame, ScriptAsse
frame->scripts.pop_front();
script = frame->scripts.front();
debugC(2, kMVDebugScript, "SCRIPT: Return from fuction %d", id);
+ return false;
}
void ScriptEngine::opbdFOOB(EngineState * state, EngineFrame * frame) {
@@ -1072,9 +1074,9 @@ void ScriptEngine::opd4RELC(EngineState * state, EngineFrame * frame) {
void ScriptEngine::opd5DLOG(EngineState * state, EngineFrame * frame) {
word txt = state->pop();
if (_engine->showTextEntry(txt, frame->src, frame->dest)) {
- state->push(0xFFFF);
+ state->push(0xFF);
} else {
- state->push(0x0000);
+ state->push(0x00);
}
}