aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBorja Lorente2016-06-20 08:59:53 +0200
committerBorja Lorente2016-08-14 18:29:57 +0200
commit2fbff0e6782759770048c9b9442832e525d001b6 (patch)
tree56678d73782ee1cf28d27d1c99c50d5eec5c1e7d
parent60d5ef5c5b875269f29cd817481de7e162f4966a (diff)
downloadscummvm-rg350-2fbff0e6782759770048c9b9442832e525d001b6.tar.gz
scummvm-rg350-2fbff0e6782759770048c9b9442832e525d001b6.tar.bz2
scummvm-rg350-2fbff0e6782759770048c9b9442832e525d001b6.zip
MACVENTURE: Fix some minor warnings
-rw-r--r--engines/macventure/gui.cpp14
-rw-r--r--engines/macventure/gui.h2
-rw-r--r--engines/macventure/macventure.cpp1
-rw-r--r--engines/macventure/script.cpp70
-rw-r--r--engines/macventure/script.h18
5 files changed, 58 insertions, 47 deletions
diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp
index 1a468eb93c..c5c6df30cb 100644
--- a/engines/macventure/gui.cpp
+++ b/engines/macventure/gui.cpp
@@ -94,6 +94,10 @@ void Gui::draw() {
_wm.draw();
}
+void Gui::drawMenu() {
+ _menu->draw(&_screen);
+}
+
bool Gui::processEvent(Common::Event &event) {
return _wm.processEvent(event);
}
@@ -271,7 +275,6 @@ bool Gui::loadMenus() {
uint8 titleLength;
char* title;
- int menunum = -1; // High level menus have level -1
/* Skip menuID, width, height, resourceID, placeholder */
for (int skip = 0; skip < 5; skip++) { res->readUint16BE(); }
enabled = res->readUint32BE();
@@ -320,8 +323,7 @@ bool Gui::loadWindows() {
for (iter = resArray.begin(); iter != resArray.end(); ++iter) {
res = _resourceManager->getResource(MKTAG('W', 'I', 'N', 'D'), *iter);
WindowData data;
- uint16 top, left, bottom, right;
- uint16 borderSize;
+ uint16 top, left, bottom, right;
top = res->readUint16BE();
left = res->readUint16BE();
bottom = res->readUint16BE();
@@ -512,7 +514,7 @@ bool diplomaWindowCallback(Graphics::WindowClick click, Common::Event &event, vo
bool inventoryWindowCallback(Graphics::WindowClick click, Common::Event &event, void *gui) {
Gui *g = (Gui*)gui;
- return true;
+ return g->processInventoryEvents(click, event);
}
void menuCommandsCallback(int action, Common::String &text, void *data) {
@@ -670,6 +672,10 @@ bool MacVenture::Gui::processDiplomaEvents(WindowClick click, Common::Event & ev
return getWindowData(kDiplomaWindow).visible;
}
+bool Gui::processInventoryEvents(WindowClick click, Common::Event & event) {
+ return false;
+}
+
/* Ugly switches */
BorderBounds Gui::borderBounds(MVWindowType type) {
diff --git a/engines/macventure/gui.h b/engines/macventure/gui.h
index b107b1584f..dc08a77cec 100644
--- a/engines/macventure/gui.h
+++ b/engines/macventure/gui.h
@@ -132,6 +132,7 @@ public:
~Gui();
void draw();
+ void drawMenu();
bool processEvent(Common::Event &event);
void handleMenuAction(MenuAction action);
void updateWindow(WindowReference winID, bool containerOpen);
@@ -145,6 +146,7 @@ public:
bool processSelfEvents(WindowClick click, Common::Event &event);
bool processExitsEvents(WindowClick click, Common::Event &event);
bool processDiplomaEvents(WindowClick click, Common::Event &event);
+ bool processInventoryEvents(WindowClick click, Common::Event &event);
const WindowData& getWindowData(WindowReference reference);
diff --git a/engines/macventure/macventure.cpp b/engines/macventure/macventure.cpp
index 6e477d4b05..23425d976f 100644
--- a/engines/macventure/macventure.cpp
+++ b/engines/macventure/macventure.cpp
@@ -137,6 +137,7 @@ Common::Error MacVentureEngine::run() {
}
}
+ _gui->drawMenu();
g_system->updateScreen();
g_system->delayMillis(50);
}
diff --git a/engines/macventure/script.cpp b/engines/macventure/script.cpp
index 5702c9f1ad..715249ca6d 100644
--- a/engines/macventure/script.cpp
+++ b/engines/macventure/script.cpp
@@ -337,7 +337,7 @@ bool ScriptEngine::runFunc(EngineFrame *frame) {
opbbFORK(state, frame);
break;
case 0xbc: //call
- opbcCALL(state, frame, &script);
+ opbcCALL(state, frame, script);
break;
case 0xbd: //focus object
opbdFOOB(state, frame);
@@ -537,14 +537,14 @@ void ScriptEngine::op87PUDY(EngineState * state, EngineFrame * frame) {
state->push(frame->y);
}
-void ScriptEngine::op88PUIB(EngineState * state, EngineFrame * frame, ScriptAsset *asset) {
- state->push(asset->fetch());
+void ScriptEngine::op88PUIB(EngineState * state, EngineFrame * frame, ScriptAsset *script) {
+ state->push(script->fetch());
}
-void ScriptEngine::op89PUI(EngineState * state, EngineFrame * frame, ScriptAsset * asset) {
- word val = asset->fetch();
+void ScriptEngine::op89PUI(EngineState * state, EngineFrame * frame, ScriptAsset * script) {
+ word val = script->fetch();
val <<= 8;
- val = val | asset->fetch();
+ val = val | script->fetch();
state->push(val);
}
@@ -798,50 +798,50 @@ void ScriptEngine::opafCONTW(EngineState * state, EngineFrame * frame) {
state->push(haystack.contains(needle) ? 1 : 0);
}
-void ScriptEngine::opb0BRA(EngineState * state, EngineFrame * frame, ScriptAsset *asset) {
- word val = asset->fetch();
+void ScriptEngine::opb0BRA(EngineState * state, EngineFrame * frame, ScriptAsset *script) {
+ word val = script->fetch();
val <<= 8;
- val = val | asset->fetch();
+ val = val | script->fetch();
val = neg16(val);
- asset->branch(val);
+ script->branch(val);
}
-void ScriptEngine::opb1BRAB(EngineState * state, EngineFrame * frame, ScriptAsset *asset) {
- word val = asset->fetch();
+void ScriptEngine::opb1BRAB(EngineState * state, EngineFrame * frame, ScriptAsset *script) {
+ word val = script->fetch();
val = neg8(val);
- asset->branch(val);
+ script->branch(val);
}
-void ScriptEngine::opb2BEQ(EngineState * state, EngineFrame * frame, ScriptAsset *asset) {
- word val = asset->fetch();
+void ScriptEngine::opb2BEQ(EngineState * state, EngineFrame * frame, ScriptAsset *script) {
+ word val = script->fetch();
val <<= 8;
- val = val | asset->fetch();
+ val = val | script->fetch();
val = neg16(val);
word b = state->pop();
- if (b != 0) asset->branch(val);
+ if (b != 0) script->branch(val);
}
-void ScriptEngine::opb3BEQB(EngineState * state, EngineFrame * frame, ScriptAsset *asset) {
- word val = asset->fetch();
+void ScriptEngine::opb3BEQB(EngineState * state, EngineFrame * frame, ScriptAsset *script) {
+ word val = script->fetch();
val = neg8(val);
word b = state->pop();
- if (b != 0) asset->branch(val);
+ if (b != 0) script->branch(val);
}
-void ScriptEngine::opb4BNE(EngineState * state, EngineFrame * frame, ScriptAsset *asset) {
- word val = asset->fetch();
+void ScriptEngine::opb4BNE(EngineState * state, EngineFrame * frame, ScriptAsset *script) {
+ word val = script->fetch();
val <<= 8;
- val = val | asset->fetch();
+ val = val | script->fetch();
val = neg16(val);
word b = state->pop();
- if (b == 0) asset->branch(val);
+ if (b == 0) script->branch(val);
}
-void ScriptEngine::opb5BNEB(EngineState * state, EngineFrame * frame, ScriptAsset *asset) {
- word val = asset->fetch();
+void ScriptEngine::opb5BNEB(EngineState * state, EngineFrame * frame, ScriptAsset *script) {
+ word val = script->fetch();
val = neg8(val);
word b = state->pop();
- if (b == 0) asset->branch(val);
+ if (b == 0) script->branch(val);
}
void ScriptEngine::opb6CLAT(EngineState * state, EngineFrame * frame) {
@@ -852,7 +852,7 @@ void ScriptEngine::opb6CLAT(EngineState * state, EngineFrame * frame) {
void ScriptEngine::opb7CCA(EngineState * state, EngineFrame * frame) {
word func = state->pop();
- for (int i = 0; i < frame->saves.size(); i++) {
+ for (uint i = 0; i < frame->saves.size(); i++) {
if (frame->saves[i].func == func)
frame->saves[i].rank = 0;
}
@@ -860,14 +860,14 @@ void ScriptEngine::opb7CCA(EngineState * state, EngineFrame * frame) {
void ScriptEngine::opb8CLOW(EngineState * state, EngineFrame * frame) {
word hi = state->pop();
- for (int i = 0;i<frame->saves.size();i++)
+ for (uint i = 0;i<frame->saves.size();i++)
if (frame->saves[i].rank <= hi)
frame->saves[i].rank = 0;
}
void ScriptEngine::opb9CHI(EngineState * state, EngineFrame * frame) {
word lo = state->pop();
- for (int i = 0;i<frame->saves.size();i++)
+ for (uint i = 0;i<frame->saves.size();i++)
if (frame->saves[i].rank >= lo)
frame->saves[i].rank = 0;
}
@@ -875,7 +875,7 @@ void ScriptEngine::opb9CHI(EngineState * state, EngineFrame * frame) {
void ScriptEngine::opbaCRAN(EngineState * state, EngineFrame * frame) {
word hi = state->pop();
word lo = state->pop();
- for (int i = 0;i<frame->saves.size();i++)
+ for (uint i = 0;i<frame->saves.size();i++)
if (frame->saves[i].rank >= lo &&
frame->saves[i].rank <= hi)
frame->saves[i].rank = 0;
@@ -891,12 +891,12 @@ void ScriptEngine::opbbFORK(EngineState * state, EngineFrame * frame) {
_frames.push_back(newframe);
}
-void ScriptEngine::opbcCALL(EngineState * state, EngineFrame * frame, ScriptAsset *script) {
+void ScriptEngine::opbcCALL(EngineState * state, EngineFrame * frame, ScriptAsset &script) {
word id = state->pop();
ScriptAsset newfun = ScriptAsset(id, _scripts);
frame->scripts.remove_at(0);
frame->scripts.insert_at(0, newfun);
- script = &frame->scripts.front();
+ script = frame->scripts.front();
}
void ScriptEngine::opbdFOOB(EngineState * state, EngineFrame * frame) {
@@ -962,7 +962,7 @@ void ScriptEngine::opc9WAIT(EngineState * state, EngineFrame * frame) {
}
void ScriptEngine::opcaTIME(EngineState * state, EngineFrame * frame) {
- for (int i = 0; i < 6; i++) // Dummy
+ for (uint i = 0; i < 6; i++) // Dummy
state->push(0x00);
op00NOOP(0xca);
}
@@ -1005,12 +1005,14 @@ void ScriptEngine::opd1GOBD(EngineState * state, EngineFrame * frame) {
Common::Rect bounds(0, 0, 1, 1); //= _world->getObjBounds(obj);
state->push(bounds.width());
state->push(bounds.height());
+ op00NOOP(0xd1);
}
void ScriptEngine::opd2GOVP(EngineState * state, EngineFrame * frame) {
word b = state->pop();
word a = state->pop();
state->push(0);//_world->getOverlapPercent(b, a));
+ op00NOOP(0xd2);
}
void ScriptEngine::opd3CAPC(EngineState * state, EngineFrame * frame) {
diff --git a/engines/macventure/script.h b/engines/macventure/script.h
index e56c6e7440..178e054e05 100644
--- a/engines/macventure/script.h
+++ b/engines/macventure/script.h
@@ -180,8 +180,8 @@ private:
void op85PUTA(EngineState *state, EngineFrame *frame); //push target
void op86PUDX(EngineState *state, EngineFrame *frame); //push deltax
void op87PUDY(EngineState *state, EngineFrame *frame); //push deltay
- void op88PUIB(EngineState *state, EngineFrame *frame, ScriptAsset *asset);//push immediate.b
- void op89PUI(EngineState *state, EngineFrame *frame, ScriptAsset *asset);//push immediate
+ void op88PUIB(EngineState *state, EngineFrame *frame, ScriptAsset *script);//push immediate.b
+ void op89PUI(EngineState *state, EngineFrame *frame, ScriptAsset *script);//push immediate
void op8aGGLO(EngineState *state, EngineFrame *frame); //get global
void op8bSGLO(EngineState *state, EngineFrame *frame); //set global
void op8cRAND(EngineState *state, EngineFrame *frame); //random
@@ -223,19 +223,19 @@ private:
void opaeCONT(EngineState *state, EngineFrame *frame); //contains
void opafCONTW(EngineState *state, EngineFrame *frame); //contains word
- void opb0BRA(EngineState *state, EngineFrame *frame, ScriptAsset *asset); //bra
- void opb1BRAB(EngineState *state, EngineFrame *frame, ScriptAsset *asset); //bra.b
- void opb2BEQ(EngineState *state, EngineFrame *frame, ScriptAsset *asset); //beq
- void opb3BEQB(EngineState *state, EngineFrame *frame, ScriptAsset *asset); //beq.b
- void opb4BNE(EngineState *state, EngineFrame *frame, ScriptAsset *asset); //bne
- void opb5BNEB(EngineState *state, EngineFrame *frame, ScriptAsset *asset); //bne.b
+ void opb0BRA(EngineState *state, EngineFrame *frame, ScriptAsset *script); //bra
+ void opb1BRAB(EngineState *state, EngineFrame *frame, ScriptAsset *script); //bra.b
+ void opb2BEQ(EngineState *state, EngineFrame *frame, ScriptAsset *script); //beq
+ void opb3BEQB(EngineState *state, EngineFrame *frame, ScriptAsset *script); //beq.b
+ void opb4BNE(EngineState *state, EngineFrame *frame, ScriptAsset *script); //bne
+ void opb5BNEB(EngineState *state, EngineFrame *frame, ScriptAsset *script); //bne.b
void opb6CLAT(EngineState *state, EngineFrame *frame); //call later
void opb7CCA(EngineState *state, EngineFrame *frame); //cancel call
void opb8CLOW(EngineState *state, EngineFrame *frame); //cancel low priority
void opb9CHI(EngineState *state, EngineFrame *frame); //cancel high priority
void opbaCRAN(EngineState *state, EngineFrame *frame); //cancel priority range
void opbbFORK(EngineState *state, EngineFrame *frame); //fork
- void opbcCALL(EngineState *state, EngineFrame *frame, ScriptAsset *script); //call
+ void opbcCALL(EngineState *state, EngineFrame *frame, ScriptAsset &script); //call
void opbdFOOB(EngineState *state, EngineFrame *frame); //focus object
void opbeSWOB(EngineState *state, EngineFrame *frame); //swap objects
void opbfSNOB(EngineState *state, EngineFrame *frame); //snap object