From 570e60a48797efa08ae5a6c7102f16678704bae8 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Wed, 24 Sep 2003 06:33:59 +0000 Subject: Whitespace changes svn-id: r10390 --- simon/midi.cpp | 204 +++++++++++++++++++++++------------------------ simon/midiparser_s1d.cpp | 16 ++-- simon/res.cpp | 1 - simon/simon.cpp | 191 ++++++++++++++++++++------------------------ simon/vga.cpp | 8 +- 5 files changed, 202 insertions(+), 218 deletions(-) (limited to 'simon') diff --git a/simon/midi.cpp b/simon/midi.cpp index 038e42e471..04bf64c4da 100644 --- a/simon/midi.cpp +++ b/simon/midi.cpp @@ -49,7 +49,7 @@ static const byte mt32_to_gm[128] = { -MidiPlayer::MidiPlayer (OSystem *system) { +MidiPlayer::MidiPlayer(OSystem *system) { // Since initialize() is called every time the music changes, // this is where we'll initialize stuff that must persist // between songs. @@ -72,10 +72,10 @@ MidiPlayer::MidiPlayer (OSystem *system) { } MidiPlayer::~MidiPlayer() { - _system->lock_mutex (_mutex); + _system->lock_mutex(_mutex); close(); - _system->unlock_mutex (_mutex); - _system->delete_mutex (_mutex); + _system->unlock_mutex(_mutex); + _system->delete_mutex(_mutex); } int MidiPlayer::open() { @@ -86,7 +86,7 @@ int MidiPlayer::open() { int ret = _driver->open(); if (ret) return ret; - _driver->setTimerCallback (this, &onTimer); + _driver->setTimerCallback(this, &onTimer); return 0; } @@ -100,7 +100,7 @@ void MidiPlayer::close() { // _system->unlock_mutex (_mutex); } -void MidiPlayer::send (uint32 b) { +void MidiPlayer::send(uint32 b) { if (!_current) return; @@ -108,22 +108,22 @@ void MidiPlayer::send (uint32 b) { if ((b & 0xFFF0) == 0x07B0) { // Adjust volume changes by master volume. byte volume = (byte) ((b >> 16) & 0x7F); - _current->volume [channel] = volume; + _current->volume[channel] = volume; volume = volume * _masterVolume / 255; b = (b & 0xFF00FFFF) | (volume << 16); } else if ((b & 0xF0) == 0xC0 && _map_mt32_to_gm) { - b = (b & 0xFFFF00FF) | (mt32_to_gm [(b >> 8) & 0xFF] << 8); + b = (b & 0xFFFF00FF) | (mt32_to_gm[(b >> 8) & 0xFF] << 8); } else if ((b & 0xFFF0) == 0x007BB0) { // Only respond to an All Notes Off if this channel // has already been allocated. - if (!_current->channel [b & 0x0F]) + if (!_current->channel[b & 0x0F]) return; } - if (!_current->channel [channel]) + if (!_current->channel[channel]) _current->channel[channel] = (channel == 9) ? _driver->getPercussionChannel() : _driver->allocateChannel(); - if (_current->channel [channel]) - _current->channel[channel]->send (b); + if (_current->channel[channel]) + _current->channel[channel]->send(b); } void MidiPlayer::metaEvent (byte type, byte *data, uint16 length) { @@ -131,9 +131,9 @@ void MidiPlayer::metaEvent (byte type, byte *data, uint16 length) { if (!_current || type != 0x2F) { return; } else if (_current == &_sfx) { - clearConstructs (_sfx); + clearConstructs(_sfx); } else if (_loopTrack) { - _current->parser->jumpToTick (0); + _current->parser->jumpToTick(0); } else if (_queuedTrack != 255) { _currentTrack = 255; byte destination = _queuedTrack; @@ -145,9 +145,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->unlock_mutex(_mutex); startTrack (destination); - _system->lock_mutex (_mutex); + _system->lock_mutex(_mutex); } else { stop(); } @@ -155,7 +155,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->lock_mutex(p->_mutex); if (!p->_paused) { if (p->_music.parser && p->_currentTrack != 255) { p->_current = &p->_music; @@ -167,7 +167,7 @@ void MidiPlayer::onTimer (void *data) { p->_sfx.parser->onTimer(); } p->_current = 0; - p->_system->unlock_mutex (p->_mutex); + p->_system->unlock_mutex(p->_mutex); } void MidiPlayer::startTrack (int track) { @@ -178,7 +178,7 @@ void MidiPlayer::startTrack (int track) { if (track >= _music.num_songs) return; - _system->lock_mutex (_mutex); + _system->lock_mutex(_mutex); if (_music.parser) { _current = &_music; @@ -200,29 +200,29 @@ 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); - if (!_music.parser->setTrack (track)) { - _system->unlock_mutex (_mutex); + _system->lock_mutex(_mutex); + if (!_music.parser->setTrack(track)) { + _system->unlock_mutex(_mutex); return; } _currentTrack = (byte) track; _current = &_music; - _music.parser->jumpToTick (0); + _music.parser->jumpToTick(0); _current = 0; } - _system->unlock_mutex (_mutex); + _system->unlock_mutex(_mutex); } void MidiPlayer::stop() { - _system->lock_mutex (_mutex); + _system->lock_mutex(_mutex); if (_music.parser) { _current = &_music; _music.parser->jumpToTick(0); } _current = 0; _currentTrack = 255; - _system->unlock_mutex (_mutex); + _system->unlock_mutex(_mutex); } void MidiPlayer::pause (bool b) { @@ -230,14 +230,14 @@ void MidiPlayer::pause (bool b) { return; _paused = b; - _system->lock_mutex (_mutex); + _system->lock_mutex(_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->unlock_mutex(_mutex); } void MidiPlayer::set_volume (int volume) { @@ -255,9 +255,9 @@ void MidiPlayer::set_volume (int volume) { if (_driver && !_paused) { for (int i = 0; i < 16; ++i) { if (_music.channel[i]) - _music.channel[i]->volume (_music.volume[i] * _masterVolume / 255); + _music.channel[i]->volume(_music.volume[i] * _masterVolume / 255); if (_sfx.channel[i]) - _sfx.channel[i]->volume (_sfx.volume[i] * _masterVolume / 255); + _sfx.channel[i]->volume(_sfx.volume[i] * _masterVolume / 255); } } _system->unlock_mutex (_mutex); @@ -271,45 +271,45 @@ void MidiPlayer::set_driver(MidiDriver *md) { } void MidiPlayer::mapMT32toGM (bool map) { - _system->lock_mutex (_mutex); + _system->lock_mutex(_mutex); _map_mt32_to_gm = map; - _system->unlock_mutex (_mutex); + _system->unlock_mutex(_mutex); } void MidiPlayer::setLoop (bool loop) { - _system->lock_mutex (_mutex); + _system->lock_mutex(_mutex); _loopTrack = loop; - _system->unlock_mutex (_mutex); + _system->unlock_mutex(_mutex); } void MidiPlayer::queueTrack (int track, bool loop) { - _system->lock_mutex (_mutex); + _system->lock_mutex(_mutex); if (_currentTrack == 255) { - _system->unlock_mutex (_mutex); - setLoop (loop); - startTrack (track); + _system->unlock_mutex(_mutex); + setLoop(loop); + startTrack(track); } else { _queuedTrack = track; _loopQueuedTrack = loop; - _system->unlock_mutex (_mutex); + _system->unlock_mutex(_mutex); } } void MidiPlayer::clearConstructs() { - clearConstructs (_music); - clearConstructs (_sfx); + clearConstructs(_music); + clearConstructs(_sfx); } -void MidiPlayer::clearConstructs (MusicInfo &info) { +void MidiPlayer::clearConstructs(MusicInfo &info) { int i; if (info.num_songs > 0) { for (i = 0; i < info.num_songs; ++i) - free (info.songs [i]); + free (info.songs[i]); info.num_songs = 0; } if (info.data) { - free (info.data); + free(info.data); info.data = 0; } // end if @@ -346,15 +346,15 @@ static int simon1_gmf_size[] = { }; void MidiPlayer::loadSMF (File *in, int song, bool sfx) { - _system->lock_mutex (_mutex); + _system->lock_mutex(_mutex); MusicInfo *p = sfx ? &_sfx : &_music; clearConstructs (*p); uint32 startpos = in->pos(); byte header[4]; - in->read (header, 4); + in->read(header, 4); bool isGMF = !memcmp (header, "GMF\x1", 4); - in->seek (startpos, SEEK_SET); + in->seek(startpos, SEEK_SET); uint32 size = in->size() - in->pos(); if (isGMF) { @@ -363,29 +363,29 @@ void MidiPlayer::loadSMF (File *in, int song, bool sfx) { // but each one is referenced by a pointer at the // beginning of the file. Those pointers can be used // to determine file size. - in->seek (0, SEEK_SET); + in->seek(0, SEEK_SET); uint16 value = in->readUint16LE() >> 2; // Number of resources if (song != value - 1) { - in->seek (song * 2 + 2, SEEK_SET); + in->seek(song * 2 + 2, SEEK_SET); value = in->readUint16LE(); size = value - startpos; } - in->seek (startpos, SEEK_SET); + in->seek(startpos, SEEK_SET); } else if (size >= 64000) { // For GMF resources not in separate // files, we're going to have to use // hardcoded size tables. - size = simon1_gmf_size [song]; + size = simon1_gmf_size[song]; } } // When allocating space, add 4 bytes in case // this is a GMF and we have to tack on our own // End of Track event. - p->data = (byte *) calloc (size + 4, 1); - in->read (p->data, size); + p->data = (byte *) calloc(size + 4, 1); + in->read(p->data, size); - if (!memcmp (p->data, "GMF\x1", 4)) { + if (!memcmp(p->data, "GMF\x1", 4)) { // BTW, here's what we know about the GMF header, // the 7 bytes preceding the actual MIDI events. // 3 BYTES: 'GMF' @@ -394,15 +394,15 @@ void MidiPlayer::loadSMF (File *in, int song, bool sfx) { // 1 BYTE : Ranges from 0x02 to 0x08 (always 0x02 for SFX, though) // 1 BYTE : Loop control. 0 = no loop, 1 = loop if (!sfx) - setLoop (p->data[6] != 0); + setLoop(p->data[6] != 0); } MidiParser *parser = MidiParser::createParser_SMF(); - parser->property (MidiParser::mpMalformedPitchBends, 1); - parser->setMidiDriver (this); - parser->setTimerRate (_driver->getBaseTempo()); - if (!parser->loadMusic (p->data, size)) { + parser->property(MidiParser::mpMalformedPitchBends, 1); + parser->setMidiDriver(this); + parser->setTimerRate(_driver->getBaseTempo()); + if (!parser->loadMusic(p->data, size)) { printf ("Error reading track!\n"); delete parser; parser = 0; @@ -413,7 +413,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->unlock_mutex(_mutex); } void MidiPlayer::loadMultipleSMF (File *in, bool sfx) { @@ -426,14 +426,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->lock_mutex(_mutex); MusicInfo *p = sfx ? &_sfx : &_music; - clearConstructs (*p); + 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->unlock_mutex(_mutex); return; } @@ -443,27 +443,27 @@ void MidiPlayer::loadMultipleSMF (File *in, bool sfx) { uint32 pos = in->pos(); // Make sure there's a MThd - in->read (buf, 4); + 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); return; } - in->seek (in->readUint32BE() + in->pos(), SEEK_SET); + in->seek(in->readUint32BE() + in->pos(), SEEK_SET); // Now skip all the MTrk blocks while (true) { in->read (buf, 4); - if (memcmp (buf, "MTrk", 4)) + if (memcmp(buf, "MTrk", 4)) break; - in->seek (in->readUint32BE() + in->pos(), SEEK_SET); + in->seek(in->readUint32BE() + in->pos(), SEEK_SET); } uint32 pos2 = in->pos() - 4; uint32 size = pos2 - pos; - p->songs[i] = (byte *) calloc (size, 1); - in->seek (pos, SEEK_SET); - in->read (p->songs[i], size); + p->songs[i] = (byte *) calloc(size, 1); + in->seek(pos, SEEK_SET); + in->read(p->songs[i], size); p->song_sizes[i] = size; } @@ -471,47 +471,47 @@ void MidiPlayer::loadMultipleSMF (File *in, bool sfx) { _currentTrack = 255; resetVolumeTable(); } - _system->unlock_mutex (_mutex); + _system->unlock_mutex(_mutex); } -void MidiPlayer::loadXMIDI (File *in, bool sfx) { - _system->lock_mutex (_mutex); +void MidiPlayer::loadXMIDI(File *in, bool sfx) { + _system->lock_mutex(_mutex); MusicInfo *p = sfx ? &_sfx : &_music; - clearConstructs (*p); + clearConstructs(*p); char buf[4]; uint32 pos = in->pos(); uint32 size = 4; - in->read (buf, 4); - if (!memcmp (buf, "FORM", 4)) { + in->read(buf, 4); + if (!memcmp(buf, "FORM", 4)) { int i; for (i = 0; i < 16; ++i) { - if (!memcmp (buf, "CAT ", 4)) + if (!memcmp(buf, "CAT ", 4)) break; size += 2; - memcpy (buf, &buf[2], 2); - in->read (&buf[2], 2); + memcpy(buf, &buf[2], 2); + in->read(&buf[2], 2); } - if (memcmp (buf, "CAT ", 4)) { - printf ("ERROR! Could not find 'CAT ' tag to determine resource size!\n"); + if (memcmp(buf, "CAT ", 4)) { + warning("Could not find 'CAT ' tag to determine resource size!"); _system->unlock_mutex (_mutex); return; } size += 4 + in->readUint32BE(); - in->seek (pos, 0); - p->data = (byte *) calloc (size, 1); - in->read (p->data, size); + in->seek(pos, 0); + p->data = (byte *) calloc(size, 1); + in->read(p->data, size); } else { - printf ("ERROR! Expected 'FORM' tag but found '%c%c%c%c' instead!\n", buf[0], buf[1], buf[2], buf[3]); - _system->unlock_mutex (_mutex); + warning("Expected 'FORM' tag but found '%c%c%c%c' instead!", buf[0], buf[1], buf[2], buf[3]); + _system->unlock_mutex(_mutex); return; } MidiParser *parser = MidiParser::createParser_XMIDI(); - parser->setMidiDriver (this); - parser->setTimerRate (_driver->getBaseTempo()); - if (!parser->loadMusic (p->data, size)) { - printf ("Error reading track!\n"); + parser->setMidiDriver(this); + parser->setTimerRate(_driver->getBaseTempo()); + if (!parser->loadMusic(p->data, size)) { + warning("Error reading track!"); delete parser; parser = 0; } @@ -521,29 +521,29 @@ void MidiPlayer::loadXMIDI (File *in, bool sfx) { resetVolumeTable(); } p->parser = parser; // That plugs the power cord into the wall - _system->unlock_mutex (_mutex); + _system->unlock_mutex(_mutex); } void MidiPlayer::loadS1D (File *in, bool sfx) { - _system->lock_mutex (_mutex); + _system->lock_mutex(_mutex); MusicInfo *p = sfx ? &_sfx : &_music; - clearConstructs (*p); + clearConstructs(*p); uint16 size = in->readUint16LE(); if (size != in->size() - 2) { - printf ("ERROR! Size mismatch in simon1demo MUS file (%ld versus reported %d)\n", (long) in->size() - 2, (int) size); - _system->unlock_mutex (_mutex); + warning("Size mismatch in simon1demo MUS file (%ld versus reported %d)", (long) in->size() - 2, (int) size); + _system->unlock_mutex(_mutex); return; } - p->data = (byte *) calloc (size, 1); - in->read (p->data, size); + p->data = (byte *) calloc(size, 1); + in->read(p->data, size); MidiParser *parser = MidiParser_createS1D(); - parser->setMidiDriver (this); - parser->setTimerRate (_driver->getBaseTempo()); - if (!parser->loadMusic (p->data, size)) { - printf ("Error reading track!\n"); + parser->setMidiDriver(this); + parser->setTimerRate(_driver->getBaseTempo()); + if (!parser->loadMusic(p->data, size)) { + warning("Error reading track!"); delete parser; parser = 0; } @@ -553,5 +553,5 @@ void MidiPlayer::loadS1D (File *in, bool sfx) { resetVolumeTable(); } p->parser = parser; // That plugs the power cord into the wall - _system->unlock_mutex (_mutex); + _system->unlock_mutex(_mutex); } diff --git a/simon/midiparser_s1d.cpp b/simon/midiparser_s1d.cpp index a8ac5ae603..ffe51cd441 100644 --- a/simon/midiparser_s1d.cpp +++ b/simon/midiparser_s1d.cpp @@ -40,12 +40,12 @@ protected: protected: void parseNextEvent (EventInfo &info); void resetTracking(); - uint32 readVLQ2 (byte * &data); + uint32 readVLQ2(byte * &data); public: MidiParser_S1D() : _data(0), _no_delta(false) {} - bool loadMusic (byte *data, uint32 size); + bool loadMusic(byte *data, uint32 size); }; @@ -64,7 +64,7 @@ public: // The VLQs for simon1demo seem to be // in Little Endian format. -uint32 MidiParser_S1D::readVLQ2 (byte * &data) { +uint32 MidiParser_S1D::readVLQ2(byte * &data) { byte str; uint32 value = 0; int i; @@ -79,9 +79,9 @@ uint32 MidiParser_S1D::readVLQ2 (byte * &data) { return value; } -void MidiParser_S1D::parseNextEvent (EventInfo &info) { +void MidiParser_S1D::parseNextEvent(EventInfo &info) { info.start = _position._play_pos; - info.delta = _no_delta ? 0 : readVLQ2 (_position._play_pos); + info.delta = _no_delta ? 0 : readVLQ2(_position._play_pos); _no_delta = false; info.event = *(_position._play_pos++); @@ -127,7 +127,7 @@ void MidiParser_S1D::parseNextEvent (EventInfo &info) { } } -bool MidiParser_S1D::loadMusic (byte *data, uint32 size) { +bool MidiParser_S1D::loadMusic(byte *data, uint32 size) { unloadMusic(); byte *pos = data; @@ -149,8 +149,8 @@ bool MidiParser_S1D::loadMusic (byte *data, uint32 size) { // will persist beyond this call, i.e. we do NOT // copy the data to our own buffer. Take warning.... resetTracking(); - setTempo (500000); - setTrack (0); + setTempo(500000); + setTrack(0); return true; } diff --git a/simon/res.cpp b/simon/res.cpp index 1c8a0926ca..2a9de5dd83 100644 --- a/simon/res.cpp +++ b/simon/res.cpp @@ -353,7 +353,6 @@ byte *SimonEngine::readSingleOpcode(File *in, byte *ptr) { *ptr++ = val >> 8; *ptr++ = val & 255; break; - default: error("Bad cmd table entry %c", l); } diff --git a/simon/simon.cpp b/simon/simon.cpp index 2d4f525219..bcfdf01396 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -3387,73 +3387,63 @@ bool SimonEngine::has_vgastruct_with_id(uint16 id, uint16 file) { void SimonEngine::processSpecialKeys() { switch (_key_pressed) { - case 27: // escape + case 27: // escape + _exit_cutscene = true; + break; + case 59: // F1 + vc_write_var(5, 50); + vc_write_var(86, 0); + break; + case 60: // F2 + vc_write_var(5, 75); + vc_write_var(86, 1); + break; + case 61: // F3 + vc_write_var(5, 125); + vc_write_var(86, 2); + break; + case 63: // F5 + if (_game & GF_SIMON2) _exit_cutscene = true; - break; - - case 59: // F1 - vc_write_var(5, 50); - vc_write_var(86, 0); - break; - case 60: // F2 - vc_write_var(5, 75); - vc_write_var(86, 1); - break; - case 61: // F3 - vc_write_var(5, 125); - vc_write_var(86, 2); - break; - case 63: // F5 - if (_game & GF_SIMON2) - _exit_cutscene = true; - break; - - case 't': - if (_game & GF_SIMON2 && _game & GF_TALKIE || _game & GF_TALKIE && _language > 1) - _subtitles ^= 1; - break; - - case '+': - midi.set_volume(midi.get_volume() + 16); - break; - - case '-': - midi.set_volume(midi.get_volume() - 16); - break; - - case 'm': - midi.pause(_music_paused ^= 1); - break; - - case 's': - if (_game == GAME_SIMON1DOS) - midi._enable_sfx ^= 1; - else - _sound->effectsPause(_effects_paused ^= 1); - break; - - case 'b': - _sound->ambientPause(_ambient_paused ^= 1); - break; - - case 'r': - if (_debugMode) - _start_mainscript ^= 1; - break; - - case 'o': - if (_debugMode) - _continous_mainscript ^= 1; - break; - - case 'v': - if (_debugMode) - _continous_vgascript ^= 1; - break; - case 'i': - if (_debugMode) - _draw_images_debug ^= 1; - break; + break; + case 't': + if (_game & GF_SIMON2 && _game & GF_TALKIE || _game & GF_TALKIE && _language > 1) + _subtitles ^= 1; + break; + case '+': + midi.set_volume(midi.get_volume() + 16); + break; + case '-': + midi.set_volume(midi.get_volume() - 16); + break; + case 'm': + midi.pause(_music_paused ^= 1); + break; + case 's': + if (_game == GAME_SIMON1DOS) + midi._enable_sfx ^= 1; + else + _sound->effectsPause(_effects_paused ^= 1); + break; + case 'b': + _sound->ambientPause(_ambient_paused ^= 1); + break; + case 'r': + if (_debugMode) + _start_mainscript ^= 1; + break; + case 'o': + if (_debugMode) + _continous_mainscript ^= 1; + break; + case 'v': + if (_debugMode) + _continous_vgascript ^= 1; + break; + case 'i': + if (_debugMode) + _draw_images_debug ^= 1; + break; } _key_pressed = 0; @@ -4565,45 +4555,40 @@ void SimonEngine::delay(uint amount) { while (_system->poll_event(&event)) { switch (event.event_code) { - case OSystem::EVENT_KEYDOWN: - if (event.kbd.flags==OSystem::KBD_CTRL) { - if (event.kbd.keycode == 'f') - _fast_mode ^= 1; - } - // Make sure backspace works right (this fixes a small issue on OS X) - if (event.kbd.keycode == 8) - _key_pressed = 8; - else - _key_pressed = (byte)event.kbd.ascii; - break; - - case OSystem::EVENT_MOUSEMOVE: - _sdl_mouse_x = event.mouse.x; - _sdl_mouse_y = event.mouse.y; - break; - - case OSystem::EVENT_LBUTTONDOWN: - _left_button_down++; + case OSystem::EVENT_KEYDOWN: + if (event.kbd.flags==OSystem::KBD_CTRL) { + if (event.kbd.keycode == 'f') + _fast_mode ^= 1; + } + // Make sure backspace works right (this fixes a small issue on OS X) + if (event.kbd.keycode == 8) + _key_pressed = 8; + else + _key_pressed = (byte)event.kbd.ascii; + break; + case OSystem::EVENT_MOUSEMOVE: + _sdl_mouse_x = event.mouse.x; + _sdl_mouse_y = event.mouse.y; + break; + case OSystem::EVENT_LBUTTONDOWN: + _left_button_down++; #ifdef _WIN32_WCE - _sdl_mouse_x = event.mouse.x; - _sdl_mouse_y = event.mouse.y; + _sdl_mouse_x = event.mouse.x; + _sdl_mouse_y = event.mouse.y; #endif - break; - - case OSystem::EVENT_RBUTTONDOWN: - if (_game & GF_SIMON2) - _skip_speech = true; - else - _exit_cutscene = true; - break; - - case OSystem::EVENT_QUIT: - shutdown(); - return; - break; - - default: - break; + break; + case OSystem::EVENT_RBUTTONDOWN: + if (_game & GF_SIMON2) + _skip_speech = true; + else + _exit_cutscene = true; + break; + case OSystem::EVENT_QUIT: + shutdown(); + return; + break; + default: + break; } } diff --git a/simon/vga.cpp b/simon/vga.cpp index 9d7fc54b4b..22d5c78ef1 100644 --- a/simon/vga.cpp +++ b/simon/vga.cpp @@ -1838,8 +1838,8 @@ void SimonEngine::vc_69_play_track() { // specifying a non-valid track number (999 or -1) // as a means of stopping what music is currently // playing. - midi.setLoop (loop != 0); - midi.startTrack (track); + midi.setLoop(loop != 0); + midi.startTrack(track); } void SimonEngine::vc_70_queue_music() { @@ -1853,9 +1853,9 @@ void SimonEngine::vc_70_queue_music() { // track and, if not, whether to switch to // a different track upon completion. if (track != 0xFFFF && track != 999) - midi.queueTrack (track, loop != 0); + midi.queueTrack(track, loop != 0); else - midi.setLoop (loop != 0); + midi.setLoop(loop != 0); } void SimonEngine::vc_71_check_music_queue() { -- cgit v1.2.3