aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2002-10-31 01:27:05 +0000
committerMax Horn2002-10-31 01:27:05 +0000
commitb43410e6f6d855f1a42b6ce783d0c76df8f6632b (patch)
tree97c7428b173db8abdd5ff361e4a1251b23143055
parent8d760a44ec72facbfc9c8f4b0740d3e905ee49ea (diff)
downloadscummvm-rg350-b43410e6f6d855f1a42b6ce783d0c76df8f6632b.tar.gz
scummvm-rg350-b43410e6f6d855f1a42b6ce783d0c76df8f6632b.tar.bz2
scummvm-rg350-b43410e6f6d855f1a42b6ce783d0c76df8f6632b.zip
some more cleanup
svn-id: r5360
-rw-r--r--simon/res.cpp2
-rw-r--r--simon/simon.cpp40
-rw-r--r--simon/verb.cpp99
3 files changed, 64 insertions, 77 deletions
diff --git a/simon/res.cpp b/simon/res.cpp
index 430bfca57f..7e5c832138 100644
--- a/simon/res.cpp
+++ b/simon/res.cpp
@@ -263,8 +263,6 @@ byte *SimonState::readSingleOpcode(File *in, byte *ptr)
table = opcode_arg_table_simon2win;
break;
case GAME_SIMON1DOS:
- table = opcode_arg_table_simon1dos;
- break;
case GAME_SIMON1DEMO:
table = opcode_arg_table_simon1dos;
break;
diff --git a/simon/simon.cpp b/simon/simon.cpp
index a3ef4a535b..529e5a2c2a 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -4936,42 +4936,32 @@ void SimonState::playMusic(uint music)
if (_game & GAME_WIN) {
_game_file->seek(_game_offsets_ptr[gss->MUSIC_INDEX_BASE + music], SEEK_SET);
- File *f = _game_file;
- midi.read_all_songs(f);
+ midi.read_all_songs(_game_file);
}
midi.initialize();
midi.play();
} else {
- if (_game == GAME_SIMON1DOS) {
-
midi.shutdown();
- char buf[50];
- File *f = new File();
- sprintf(buf, "MOD%d.MUS", music);
- f->open(buf, _gameDataPath);
- if (f->isOpen() == false) {
- warning("Cannot load music from '%s'", buf);
- return;
- }
- midi.read_all_songs_old(f);
- delete f;
-
- midi.initialize();
- midi.play();
+ if (_game == GAME_SIMON1DOS) {
+ char buf[50];
+ File *f = new File();
+ sprintf(buf, "MOD%d.MUS", music);
+ f->open(buf, _gameDataPath);
+ if (f->isOpen() == false) {
+ warning("Cannot load music from '%s'", buf);
+ return;
+ }
+ midi.read_all_songs_old(f);
+ delete f;
+ } else if (_game == GAME_SIMON1WIN) {
+ _game_file->seek(_game_offsets_ptr[gss->MUSIC_INDEX_BASE + music], SEEK_SET);
+ midi.read_all_songs_old(_game_file);
}
- if (_game == GAME_SIMON1WIN) {
-
- midi.shutdown();
-
- _game_file->seek(_game_offsets_ptr[gss->MUSIC_INDEX_BASE + music], SEEK_SET);
- File *f = _game_file;
- midi.read_all_songs_old(f);
midi.initialize();
midi.play();
- }
}
}
diff --git a/simon/verb.cpp b/simon/verb.cpp
index 91302881ce..563089a454 100644
--- a/simon/verb.cpp
+++ b/simon/verb.cpp
@@ -24,6 +24,30 @@
#include "simon/simon.h"
#include "simon/intern.h"
+static const char *const verb_names[] = {
+ "Walk to",
+ "Look at",
+ "Open",
+ "Move",
+
+ "Consume",
+ "Pick up",
+ "Close",
+ "Use",
+
+ "Talk to",
+ "Remove",
+ "Wear",
+ "Give"
+};
+
+static const char *const verb_prep_names[] = {
+ "", "", "", "",
+ "", "", "", "with what ?",
+ "", "", "", "to whom ?"
+};
+
+
void SimonState::defocusHitarea()
{
HitArea *last;
@@ -50,29 +74,6 @@ void SimonState::defocusHitarea()
focusVerb(last->id);
}
-static const char *const verb_names[] = {
- "Walk to",
- "Look at",
- "Open",
- "Move",
-
- "Consume",
- "Pick up",
- "Close",
- "Use",
-
- "Talk to",
- "Remove",
- "Wear",
- "Give"
-};
-
-static const char *const verb_prep_names[] = {
- "", "", "", "",
- "", "", "", "with what ?",
- "", "", "", "to whom ?"
-};
-
void SimonState::focusVerb(uint hitarea_id)
{
uint x;
@@ -318,42 +319,39 @@ void SimonState::handle_unk_hitarea(FillOrCopyStruct *fcs)
void SimonState::setup_hitarea_from_pos(uint x, uint y, uint mode)
{
- HitArea *best_ha;
-
if (_game & GAME_SIMON2) {
if (_bit_array[4] & 0x8000 || y < 134) {
x += _x_scroll * 8;
}
}
- {
- HitArea *ha = _hit_areas;
- uint count = ARRAYSIZE(_hit_areas);
- uint16 layer = 0;
- const uint16 x_ = x;
- const uint16 y_ = y;
-
- best_ha = NULL;
-
- do {
- if (ha->flags & 0x20) {
- if (!(ha->flags & 0x40)) {
- if (x_ >= ha->x && y_ >= ha->y &&
- x_ - ha->x < ha->width && y_ - ha->y < ha->height && layer <= ha->layer) {
- layer = ha->layer;
- best_ha = ha;
- } else {
- if (ha->flags & 2) {
- hitarea_leave(ha);
- ha->flags &= ~2;
- }
- }
+ HitArea *best_ha;
+ HitArea *ha = _hit_areas;
+ uint count = ARRAYSIZE(_hit_areas);
+ uint16 layer = 0;
+ const uint16 x_ = x;
+ const uint16 y_ = y;
+
+ best_ha = NULL;
+
+ do {
+ if (ha->flags & 0x20) {
+ if (!(ha->flags & 0x40)) {
+ if (x_ >= ha->x && y_ >= ha->y &&
+ x_ - ha->x < ha->width && y_ - ha->y < ha->height && layer <= ha->layer) {
+ layer = ha->layer;
+ best_ha = ha;
} else {
- ha->flags &= ~2;
+ if (ha->flags & 2) {
+ hitarea_leave(ha);
+ ha->flags &= ~2;
+ }
}
+ } else {
+ ha->flags &= ~2;
}
- } while (ha++, --count);
- }
+ }
+ } while (ha++, --count);
if (best_ha == NULL) {
defocusHitarea();
@@ -445,5 +443,6 @@ bool SimonState::hitarea_proc_3(Item *item)
else
x = 0;
showActionString(x, string_ptr);
+
return true;
}