aboutsummaryrefslogtreecommitdiff
path: root/simon
diff options
context:
space:
mode:
authorMax Horn2004-02-28 12:58:13 +0000
committerMax Horn2004-02-28 12:58:13 +0000
commitc6752cccf5186fb04c97e2bb4a64c52fc9447073 (patch)
tree91f3f0264b1542a839cc3504b52603a8034547cb /simon
parent56102a1d02925abbe9fc0504751de1a270a34ff3 (diff)
downloadscummvm-rg350-c6752cccf5186fb04c97e2bb4a64c52fc9447073.tar.gz
scummvm-rg350-c6752cccf5186fb04c97e2bb4a64c52fc9447073.tar.bz2
scummvm-rg350-c6752cccf5186fb04c97e2bb4a64c52fc9447073.zip
renamed more OSystem methods to follow our naming scheme; renamed NewGuiColor to OverlayColor; fixed some calls to error() in the SDL backend
svn-id: r13087
Diffstat (limited to 'simon')
-rw-r--r--simon/midi.cpp80
-rw-r--r--simon/simon.cpp12
-rw-r--r--simon/vga.cpp4
3 files changed, 48 insertions, 48 deletions
diff --git a/simon/midi.cpp b/simon/midi.cpp
index b658bd1f54..a9d04d411d 100644
--- a/simon/midi.cpp
+++ b/simon/midi.cpp
@@ -56,7 +56,7 @@ MidiPlayer::MidiPlayer(OSystem *system) {
// this is where we'll initialize stuff that must persist
// between songs.
_system = system;
- _mutex = system->create_mutex();
+ _mutex = system->createMutex();
_driver = 0;
_map_mt32_to_gm = false;
@@ -74,10 +74,10 @@ MidiPlayer::MidiPlayer(OSystem *system) {
}
MidiPlayer::~MidiPlayer() {
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
close();
- _system->unlock_mutex(_mutex);
- _system->delete_mutex(_mutex);
+ _system->unlockMutex(_mutex);
+ _system->deleteMutex(_mutex);
}
int MidiPlayer::open() {
@@ -94,12 +94,12 @@ int MidiPlayer::open() {
void MidiPlayer::close() {
stop();
-// _system->lock_mutex (_mutex);
+// _system->lockMutex (_mutex);
if (_driver)
_driver->close();
_driver = NULL;
clearConstructs();
-// _system->unlock_mutex (_mutex);
+// _system->unlockMutex (_mutex);
}
void MidiPlayer::send(uint32 b) {
@@ -150,9 +150,9 @@ void MidiPlayer::metaEvent (byte type, byte *data, uint16 length) {
// Have to unlock it before calling jump()
// (which locks it itself), and then relock it
// upon returning.
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
startTrack (destination);
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
} else {
stop();
}
@@ -160,7 +160,7 @@ void MidiPlayer::metaEvent (byte type, byte *data, uint16 length) {
void MidiPlayer::onTimer (void *data) {
MidiPlayer *p = (MidiPlayer *) data;
- p->_system->lock_mutex(p->_mutex);
+ p->_system->lockMutex(p->_mutex);
if (!p->_paused) {
if (p->_music.parser && p->_currentTrack != 255) {
p->_current = &p->_music;
@@ -172,7 +172,7 @@ void MidiPlayer::onTimer (void *data) {
p->_sfx.parser->onTimer();
}
p->_current = 0;
- p->_system->unlock_mutex(p->_mutex);
+ p->_system->unlockMutex(p->_mutex);
}
void MidiPlayer::startTrack (int track) {
@@ -183,7 +183,7 @@ void MidiPlayer::startTrack (int track) {
if (track >= _music.num_songs)
return;
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
if (_music.parser) {
_current = &_music;
@@ -205,9 +205,9 @@ void MidiPlayer::startTrack (int track) {
_currentTrack = (byte) track;
_music.parser = parser; // That plugs the power cord into the wall
} else if (_music.parser) {
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
if (!_music.parser->setTrack(track)) {
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
return;
}
_currentTrack = (byte) track;
@@ -216,18 +216,18 @@ void MidiPlayer::startTrack (int track) {
_current = 0;
}
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
}
void MidiPlayer::stop() {
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
if (_music.parser) {
_current = &_music;
_music.parser->jumpToTick(0);
}
_current = 0;
_currentTrack = 255;
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
}
void MidiPlayer::pause (bool b) {
@@ -235,14 +235,14 @@ void MidiPlayer::pause (bool b) {
return;
_paused = b;
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
for (int i = 0; i < 16; ++i) {
if (_music.channel[i])
_music.channel[i]->volume (_paused ? 0 : (_music.volume[i] * _masterVolume / 255));
if (_sfx.channel[i])
_sfx.channel[i]->volume (_paused ? 0 : (_sfx.volume[i] * _masterVolume / 255));
}
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
}
void MidiPlayer::set_volume (int volume) {
@@ -256,7 +256,7 @@ void MidiPlayer::set_volume (int volume) {
_masterVolume = volume;
// Now tell all the channels this.
- _system->lock_mutex (_mutex);
+ _system->lockMutex (_mutex);
if (_driver && !_paused) {
for (int i = 0; i < 16; ++i) {
if (_music.channel[i])
@@ -265,7 +265,7 @@ void MidiPlayer::set_volume (int volume) {
_sfx.channel[i]->volume(_sfx.volume[i] * _masterVolume / 255);
}
}
- _system->unlock_mutex (_mutex);
+ _system->unlockMutex (_mutex);
}
void MidiPlayer::set_driver(MidiDriver *md) {
@@ -276,27 +276,27 @@ void MidiPlayer::set_driver(MidiDriver *md) {
}
void MidiPlayer::mapMT32toGM (bool map) {
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
_map_mt32_to_gm = map;
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
}
void MidiPlayer::setLoop (bool loop) {
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
_loopTrack = loop;
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
}
void MidiPlayer::queueTrack (int track, bool loop) {
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
if (_currentTrack == 255) {
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
setLoop(loop);
startTrack(track);
} else {
_queuedTrack = track;
_loopQueuedTrack = loop;
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
}
}
@@ -351,7 +351,7 @@ static int simon1_gmf_size[] = {
};
void MidiPlayer::loadSMF (File *in, int song, bool sfx) {
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
MusicInfo *p = sfx ? &_sfx : &_music;
clearConstructs (*p);
@@ -418,7 +418,7 @@ void MidiPlayer::loadSMF (File *in, int song, bool sfx) {
resetVolumeTable();
}
p->parser = parser; // That plugs the power cord into the wall
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
}
void MidiPlayer::loadMultipleSMF (File *in, bool sfx) {
@@ -431,14 +431,14 @@ void MidiPlayer::loadMultipleSMF (File *in, bool sfx) {
// We need to load ALL the songs and then
// treat them as separate tracks -- for the
// purpose of jumps, anyway.
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
MusicInfo *p = sfx ? &_sfx : &_music;
clearConstructs(*p);
p->num_songs = in->readByte();
if (p->num_songs > 16) {
printf ("playMultipleSMF: %d is too many songs to keep track of!\n", (int) p->num_songs);
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
return;
}
@@ -451,7 +451,7 @@ void MidiPlayer::loadMultipleSMF (File *in, bool sfx) {
in->read(buf, 4);
if (memcmp (buf, "MThd", 4)) {
printf ("Expected MThd but found '%c%c%c%c' instead!\n", buf[0], buf[1], buf[2], buf[3]);
- _system->unlock_mutex (_mutex);
+ _system->unlockMutex (_mutex);
return;
}
in->seek(in->readUint32BE() + in->pos(), SEEK_SET);
@@ -476,11 +476,11 @@ void MidiPlayer::loadMultipleSMF (File *in, bool sfx) {
_currentTrack = 255;
resetVolumeTable();
}
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
}
void MidiPlayer::loadXMIDI(File *in, bool sfx) {
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
MusicInfo *p = sfx ? &_sfx : &_music;
clearConstructs(*p);
@@ -499,7 +499,7 @@ void MidiPlayer::loadXMIDI(File *in, bool sfx) {
}
if (memcmp(buf, "CAT ", 4)) {
warning("Could not find 'CAT ' tag to determine resource size!");
- _system->unlock_mutex (_mutex);
+ _system->unlockMutex (_mutex);
return;
}
size += 4 + in->readUint32BE();
@@ -508,7 +508,7 @@ void MidiPlayer::loadXMIDI(File *in, bool sfx) {
in->read(p->data, size);
} else {
warning("Expected 'FORM' tag but found '%c%c%c%c' instead!", buf[0], buf[1], buf[2], buf[3]);
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
return;
}
@@ -526,18 +526,18 @@ void MidiPlayer::loadXMIDI(File *in, bool sfx) {
resetVolumeTable();
}
p->parser = parser; // That plugs the power cord into the wall
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
}
void MidiPlayer::loadS1D (File *in, bool sfx) {
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
MusicInfo *p = sfx ? &_sfx : &_music;
clearConstructs(*p);
uint16 size = in->readUint16LE();
if (size != in->size() - 2) {
warning("Size mismatch in simon1demo MUS file (%ld versus reported %d)", (long) in->size() - 2, (int) size);
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
return;
}
@@ -558,7 +558,7 @@ void MidiPlayer::loadS1D (File *in, bool sfx) {
resetVolumeTable();
}
p->parser = parser; // That plugs the power cord into the wall
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
}
} // End of namespace Simon
diff --git a/simon/simon.cpp b/simon/simon.cpp
index 364ef19043..982e9ae8ff 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -2477,9 +2477,9 @@ void SimonEngine::o_fade_to_black() {
palette_fadeout((uint32 *)_video_buf_1 + 32 + 16, 144);
palette_fadeout((uint32 *)_video_buf_1 + 32 + 16 + 144 + 16, 48);
- _system->set_palette(_video_buf_1, 0, 256);
+ _system->setPalette(_video_buf_1, 0, 256);
if (_fade)
- _system->update_screen();
+ _system->updateScreen();
delay(5);
} while (--i);
@@ -4666,12 +4666,12 @@ void SimonEngine::dx_update_screen_and_palette() {
_video_var_9 = 0;
if (memcmp(_palette, _palette_backup, 256 * 4) != 0) {
memcpy(_palette_backup, _palette, 256 * 4);
- _system->set_palette(_palette, 0, 256);
+ _system->setPalette(_palette, 0, 256);
}
}
_system->copy_rect(_sdl_buf_attached, 320, 0, 0, 320, 200);
- _system->update_screen();
+ _system->updateScreen();
memcpy(_sdl_buf_attached, _sdl_buf, 320 * 200);
@@ -4691,7 +4691,7 @@ void SimonEngine::realizePalette() {
if (_palette_color_count & 0x8000) {
fadeUpPalette();
} else {
- _system->set_palette(_palette, 0, _palette_color_count);
+ _system->setPalette(_palette, 0, _palette_color_count);
}
_palette_color_count = 0;
@@ -4750,7 +4750,7 @@ void SimonEngine::fadeUpPalette() {
src += 4;
}
- _system->set_palette(_video_buf_1, 0, _video_num_pal_colors);
+ _system->setPalette(_video_buf_1, 0, _video_num_pal_colors);
delay(5);
} while (!done);
}
diff --git a/simon/vga.cpp b/simon/vga.cpp
index 43468373d1..b1a1bece94 100644
--- a/simon/vga.cpp
+++ b/simon/vga.cpp
@@ -1727,9 +1727,9 @@ void SimonEngine::vc_62_palette_thing() {
memcpy(_video_buf_1, _palette_backup, _video_num_pal_colors * sizeof(uint32));
for (i = NUM_PALETTE_FADEOUT; i != 0; --i) {
palette_fadeout((uint32 *)_video_buf_1, _video_num_pal_colors);
- _system->set_palette(_video_buf_1, 0, _video_num_pal_colors);
+ _system->setPalette(_video_buf_1, 0, _video_num_pal_colors);
if (_fade)
- _system->update_screen();
+ _system->updateScreen();
delay(5);
}