Whitespace changes

svn-id: r10390
This commit is contained in:
Torbjörn Andersson 2003-09-24 06:33:59 +00:00
parent 3854ce8f3d
commit 570e60a487
30 changed files with 1289 additions and 1356 deletions

View file

@ -212,9 +212,7 @@ void ConsoleDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
str[len] = '\0'; str[len] = '\0';
char *completion = 0; char *completion = 0;
if ((*_completionCallbackProc)(this, str, completion, if ((*_completionCallbackProc)(this, str, completion, _callbackRefCon)) {
_callbackRefCon))
{
if (_caretVisible) if (_caretVisible)
drawCaret(true); drawCaret(true);
insertIntoPrompt(completion); insertIntoPrompt(completion);
@ -268,7 +266,6 @@ void ConsoleDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
_currentPos--; _currentPos--;
draw(); draw();
break; break;
default: default:
if (ascii == '~' || ascii == '#') { if (ascii == '~' || ascii == '#') {
close(); close();

View file

@ -147,7 +147,7 @@ void NewGui::runLoop() {
uint32 time = get_time(); uint32 time = get_time();
while (_system->poll_event(&event)) { while (_system->poll_event(&event)) {
switch(event.event_code) { switch (event.event_code) {
case OSystem::EVENT_KEYDOWN: case OSystem::EVENT_KEYDOWN:
#if !defined(_WIN32_WCE) && !defined(__PALM_OS__) #if !defined(_WIN32_WCE) && !defined(__PALM_OS__)
// init continuous event stream // init continuous event stream

View file

@ -283,7 +283,6 @@ bool ScummDebugger::RunCommand(const char *inputOrig) {
*(int *)_dvars[i].variable = atoi(param[1]); *(int *)_dvars[i].variable = atoi(param[1]);
Debug_Printf("(int)%s = %d\n", param[0], *(int *)_dvars[i].variable); Debug_Printf("(int)%s = %d\n", param[0], *(int *)_dvars[i].variable);
break; break;
// Integer Array // Integer Array
case DVAR_INTARRAY: { case DVAR_INTARRAY: {
char *chr = strchr(param[0], '['); char *chr = strchr(param[0], '[');
@ -297,12 +296,10 @@ bool ScummDebugger::RunCommand(const char *inputOrig) {
} else { } else {
var[element] = atoi(param[1]); var[element] = atoi(param[1]);
Debug_Printf("(int)%s = %d\n", param[0], var[element]); Debug_Printf("(int)%s = %d\n", param[0], var[element]);
} }
} }
} }
break; break;
default: default:
Debug_Printf("Failed to set variable %s to %s - unknown type\n", _dvars[i].name, param[1]); Debug_Printf("Failed to set variable %s to %s - unknown type\n", _dvars[i].name, param[1]);
break; break;
@ -314,7 +311,6 @@ bool ScummDebugger::RunCommand(const char *inputOrig) {
case DVAR_INT: case DVAR_INT:
Debug_Printf("(int)%s = %d\n", param[0], *(int *)_dvars[i].variable); Debug_Printf("(int)%s = %d\n", param[0], *(int *)_dvars[i].variable);
break; break;
// Integer array // Integer array
case DVAR_INTARRAY: { case DVAR_INTARRAY: {
char *chr = strchr(param[0], '['); char *chr = strchr(param[0], '[');
@ -327,17 +323,14 @@ bool ScummDebugger::RunCommand(const char *inputOrig) {
Debug_Printf("%s is out of range (array is %d elements big)\n", param[0], _dvars[i].optional); Debug_Printf("%s is out of range (array is %d elements big)\n", param[0], _dvars[i].optional);
} else { } else {
Debug_Printf("(int)%s = %d\n", param[0], var[element]); Debug_Printf("(int)%s = %d\n", param[0], var[element]);
} }
} }
} }
break; break;
// String // String
case DVAR_STRING: case DVAR_STRING:
Debug_Printf("(string)%s = %s\n", param[0], *(char **)_dvars[i].variable); Debug_Printf("(string)%s = %s\n", param[0], *(char **)_dvars[i].variable);
break; break;
default: default:
Debug_Printf("%s = (unknown type)\n", param[0]); Debug_Printf("%s = (unknown type)\n", param[0]);
break; break;

View file

@ -907,7 +907,7 @@ void Scumm::runInputScript(int a, int cmd, int mode) {
if (_version <= 2) { if (_version <= 2) {
verbScript = 4; verbScript = 4;
_scummVars[VAR_CLICK_AREA] = a; _scummVars[VAR_CLICK_AREA] = a;
switch(a) { switch (a) {
case 1: // Verb clicked case 1: // Verb clicked
_scummVars[33] = cmd; _scummVars[33] = cmd;
break; break;

View file

@ -695,7 +695,6 @@ void Scumm_v2::o2_actorSet() {
case 1: // Actor Sound case 1: // Actor Sound
a->sound[0] = arg; a->sound[0] = arg;
break; break;
case 2: // Actor Set Color case 2: // Actor Set Color
if (_version == 1) if (_version == 1)
i = act; i = act;
@ -705,15 +704,12 @@ void Scumm_v2::o2_actorSet() {
a->palette[i] = arg; a->palette[i] = arg;
a->needRedraw = true; a->needRedraw = true;
break; break;
case 3: // Actor Name case 3: // Actor Name
loadPtrToResource(rtActorName, a->number, NULL); loadPtrToResource(rtActorName, a->number, NULL);
break; break;
case 4: // Actor Costume case 4: // Actor Costume
a->setActorCostume(arg); a->setActorCostume(arg);
break; break;
case 5: // Talk Color case 5: // Talk Color
if ((_gameId == GID_MANIAC) && (_version == 1)) if ((_gameId == GID_MANIAC) && (_version == 1))
v1_mm_actor_speech_color[act] = arg; v1_mm_actor_speech_color[act] = arg;

View file

@ -881,7 +881,6 @@ void Scumm_v5::saveVars() {
b = _resultVarNumber; b = _resultVarNumber;
warning("stub saveVars: vars %d -> %d", a, b); warning("stub saveVars: vars %d -> %d", a, b);
break; break;
case 0x02: // write a range of string variables case 0x02: // write a range of string variables
a = getVarOrDirectByte(0x80); a = getVarOrDirectByte(0x80);
b = getVarOrDirectByte(0x40); b = getVarOrDirectByte(0x40);
@ -900,7 +899,6 @@ void Scumm_v5::saveVars() {
return; return;
break; break;
} }
} }
} }
@ -935,9 +933,7 @@ void Scumm_v5::loadVars() {
return; return;
break; break;
} }
} }
} }
void Scumm_v5::o5_expression() { void Scumm_v5::o5_expression() {

View file

@ -54,8 +54,7 @@ bool SaudChannel::handleSubTags(int32 &offset) {
if (available_size >= (size + 8)) { if (available_size >= (size + 8)) {
MemoryChunk c((byte *)_tbuffer + offset); MemoryChunk c((byte *)_tbuffer + offset);
handleStrk(c); handleStrk(c);
} } else
else
return false; return false;
break; break;
case TYPE_SMRK: case TYPE_SMRK:
@ -63,8 +62,7 @@ bool SaudChannel::handleSubTags(int32 &offset) {
if (available_size >= (size + 8)) { if (available_size >= (size + 8)) {
MemoryChunk c((byte *)_tbuffer + offset); MemoryChunk c((byte *)_tbuffer + offset);
handleSmrk(c); handleSmrk(c);
} } else
else
return false; return false;
break; break;
case TYPE_SHDR: case TYPE_SHDR:
@ -72,8 +70,7 @@ bool SaudChannel::handleSubTags(int32 &offset) {
if (available_size >= (size + 8)) { if (available_size >= (size + 8)) {
MemoryChunk c((byte *)_tbuffer + offset); MemoryChunk c((byte *)_tbuffer + offset);
handleShdr(c); handleShdr(c);
} } else
else
return false; return false;
break; break;
case TYPE_SDAT: case TYPE_SDAT:

View file

@ -542,7 +542,7 @@ void SmushPlayer::handleTextResource(Chunk &b) {
} }
while (str[0] == '^') { while (str[0] == '^') {
switch(str[1]) { switch (str[1]) {
case 'f': case 'f':
{ {
int id = str[3] - '0'; int id = str[3] - '0';
@ -753,7 +753,7 @@ void SmushPlayer::handleFrame(Chunk &b) {
while (!b.eof()) { while (!b.eof()) {
Chunk *sub = b.subBlock(); Chunk *sub = b.subBlock();
if (sub->getSize() & 1) b.seek(1); if (sub->getSize() & 1) b.seek(1);
switch(sub->getType()) { switch (sub->getType()) {
case TYPE_NPAL: case TYPE_NPAL:
handleNewPalette(*sub); handleNewPalette(*sub);
break; break;
@ -854,7 +854,7 @@ void SmushPlayer::parseNextFrame() {
} }
Chunk *sub = _base->subBlock(); Chunk *sub = _base->subBlock();
switch(sub->getType()) { switch (sub->getType()) {
case TYPE_FRME: case TYPE_FRME:
handleFrame(*sub); handleFrame(*sub);
break; break;

View file

@ -347,9 +347,11 @@ void Sound::playSound(int soundID) {
rate = 11025; rate = 11025;
int type = *(ptr + 0x0D); int type = *(ptr + 0x0D);
int numInstruments;
switch(type) { switch(type) {
case 0: { // Sound effect case 0: // Sound effect
int numInstruments = *(ptr + 0x14); numInstruments = *(ptr + 0x14);
ptr += 0x16; ptr += 0x16;
size -= 0x16; size -= 0x16;
while (numInstruments--) { while (numInstruments--) {
@ -381,31 +383,31 @@ void Sound::playSound(int soundID) {
_scumm->_mixer->playRaw(NULL, sound, waveSize, rate, flags, soundID, 255, 0, loopStart, loopEnd); _scumm->_mixer->playRaw(NULL, sound, waveSize, rate, flags, soundID, 255, 0, loopStart, loopEnd);
} }
break; break;
} case 1:
// Music (Euphony format)
case 1: { // Music (Euphony format)
if (_scumm->_musicEngine) if (_scumm->_musicEngine)
_scumm->_musicEngine->startSound (soundID); _scumm->_musicEngine->startSound (soundID);
break; break;
} case 2: // CD track resource
case 2: { // CD track resource
ptr += 0x16; ptr += 0x16;
int track = ptr[0];
int loops = ptr[1];
int start = (ptr[2] * 60 + ptr[3]) * 75 + ptr[4];
int end = (ptr[5] * 60 + ptr[6]) * 75 + ptr[7];
if (soundID == _currentCDSound) if (soundID == _currentCDSound)
if (pollCD() == 1) if (pollCD() == 1)
return; return;
{
int track = ptr[0];
int loops = ptr[1];
int start = (ptr[2] * 60 + ptr[3]) * 75 + ptr[4];
int end = (ptr[5] * 60 + ptr[6]) * 75 + ptr[7];
playCDTrack(track, loops == 0xff ? -1 : loops, start, end - start); playCDTrack(track, loops == 0xff ? -1 : loops, start, end - start);
}
_currentCDSound = soundID; _currentCDSound = soundID;
break; break;
} }
} }
}
else if ((_scumm->_gameId == GID_LOOM) && (_scumm->_features & GF_MACINTOSH)) { else if ((_scumm->_gameId == GID_LOOM) && (_scumm->_features & GF_MACINTOSH)) {
// Mac version of Loom uses yet another sound format // Mac version of Loom uses yet another sound format
/* /*
@ -1290,11 +1292,9 @@ void Sound::playBundleSound(char *sound, PlayingSoundHandle *handle) {
case MKID_BE('SYNC'): case MKID_BE('SYNC'):
size = READ_BE_UINT32(ptr); ptr += size + 4; size = READ_BE_UINT32(ptr); ptr += size + 4;
break; break;
case MKID_BE('DATA'): case MKID_BE('DATA'):
size = READ_BE_UINT32(ptr); ptr += 4; size = READ_BE_UINT32(ptr); ptr += 4;
break; break;
default: default:
error("Unknown sound header %c%c%c%c", error("Unknown sound header %c%c%c%c",
(byte)(tag >> 24), (byte)(tag >> 24),

View file

@ -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, // Since initialize() is called every time the music changes,
// this is where we'll initialize stuff that must persist // this is where we'll initialize stuff that must persist
// between songs. // between songs.
@ -72,10 +72,10 @@ MidiPlayer::MidiPlayer (OSystem *system) {
} }
MidiPlayer::~MidiPlayer() { MidiPlayer::~MidiPlayer() {
_system->lock_mutex (_mutex); _system->lock_mutex(_mutex);
close(); close();
_system->unlock_mutex (_mutex); _system->unlock_mutex(_mutex);
_system->delete_mutex (_mutex); _system->delete_mutex(_mutex);
} }
int MidiPlayer::open() { int MidiPlayer::open() {
@ -86,7 +86,7 @@ int MidiPlayer::open() {
int ret = _driver->open(); int ret = _driver->open();
if (ret) if (ret)
return ret; return ret;
_driver->setTimerCallback (this, &onTimer); _driver->setTimerCallback(this, &onTimer);
return 0; return 0;
} }
@ -100,7 +100,7 @@ void MidiPlayer::close() {
// _system->unlock_mutex (_mutex); // _system->unlock_mutex (_mutex);
} }
void MidiPlayer::send (uint32 b) { void MidiPlayer::send(uint32 b) {
if (!_current) if (!_current)
return; return;
@ -108,22 +108,22 @@ void MidiPlayer::send (uint32 b) {
if ((b & 0xFFF0) == 0x07B0) { if ((b & 0xFFF0) == 0x07B0) {
// Adjust volume changes by master volume. // Adjust volume changes by master volume.
byte volume = (byte) ((b >> 16) & 0x7F); byte volume = (byte) ((b >> 16) & 0x7F);
_current->volume [channel] = volume; _current->volume[channel] = volume;
volume = volume * _masterVolume / 255; volume = volume * _masterVolume / 255;
b = (b & 0xFF00FFFF) | (volume << 16); b = (b & 0xFF00FFFF) | (volume << 16);
} else if ((b & 0xF0) == 0xC0 && _map_mt32_to_gm) { } 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) { } else if ((b & 0xFFF0) == 0x007BB0) {
// Only respond to an All Notes Off if this channel // Only respond to an All Notes Off if this channel
// has already been allocated. // has already been allocated.
if (!_current->channel [b & 0x0F]) if (!_current->channel[b & 0x0F])
return; return;
} }
if (!_current->channel [channel]) if (!_current->channel[channel])
_current->channel[channel] = (channel == 9) ? _driver->getPercussionChannel() : _driver->allocateChannel(); _current->channel[channel] = (channel == 9) ? _driver->getPercussionChannel() : _driver->allocateChannel();
if (_current->channel [channel]) if (_current->channel[channel])
_current->channel[channel]->send (b); _current->channel[channel]->send(b);
} }
void MidiPlayer::metaEvent (byte type, byte *data, uint16 length) { 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) { if (!_current || type != 0x2F) {
return; return;
} else if (_current == &_sfx) { } else if (_current == &_sfx) {
clearConstructs (_sfx); clearConstructs(_sfx);
} else if (_loopTrack) { } else if (_loopTrack) {
_current->parser->jumpToTick (0); _current->parser->jumpToTick(0);
} else if (_queuedTrack != 255) { } else if (_queuedTrack != 255) {
_currentTrack = 255; _currentTrack = 255;
byte destination = _queuedTrack; byte destination = _queuedTrack;
@ -145,9 +145,9 @@ void MidiPlayer::metaEvent (byte type, byte *data, uint16 length) {
// Have to unlock it before calling jump() // Have to unlock it before calling jump()
// (which locks it itself), and then relock it // (which locks it itself), and then relock it
// upon returning. // upon returning.
_system->unlock_mutex (_mutex); _system->unlock_mutex(_mutex);
startTrack (destination); startTrack (destination);
_system->lock_mutex (_mutex); _system->lock_mutex(_mutex);
} else { } else {
stop(); stop();
} }
@ -155,7 +155,7 @@ void MidiPlayer::metaEvent (byte type, byte *data, uint16 length) {
void MidiPlayer::onTimer (void *data) { void MidiPlayer::onTimer (void *data) {
MidiPlayer *p = (MidiPlayer *) data; MidiPlayer *p = (MidiPlayer *) data;
p->_system->lock_mutex (p->_mutex); p->_system->lock_mutex(p->_mutex);
if (!p->_paused) { if (!p->_paused) {
if (p->_music.parser && p->_currentTrack != 255) { if (p->_music.parser && p->_currentTrack != 255) {
p->_current = &p->_music; p->_current = &p->_music;
@ -167,7 +167,7 @@ void MidiPlayer::onTimer (void *data) {
p->_sfx.parser->onTimer(); p->_sfx.parser->onTimer();
} }
p->_current = 0; p->_current = 0;
p->_system->unlock_mutex (p->_mutex); p->_system->unlock_mutex(p->_mutex);
} }
void MidiPlayer::startTrack (int track) { void MidiPlayer::startTrack (int track) {
@ -178,7 +178,7 @@ void MidiPlayer::startTrack (int track) {
if (track >= _music.num_songs) if (track >= _music.num_songs)
return; return;
_system->lock_mutex (_mutex); _system->lock_mutex(_mutex);
if (_music.parser) { if (_music.parser) {
_current = &_music; _current = &_music;
@ -200,29 +200,29 @@ void MidiPlayer::startTrack (int track) {
_currentTrack = (byte) track; _currentTrack = (byte) track;
_music.parser = parser; // That plugs the power cord into the wall _music.parser = parser; // That plugs the power cord into the wall
} else if (_music.parser) { } else if (_music.parser) {
_system->lock_mutex (_mutex); _system->lock_mutex(_mutex);
if (!_music.parser->setTrack (track)) { if (!_music.parser->setTrack(track)) {
_system->unlock_mutex (_mutex); _system->unlock_mutex(_mutex);
return; return;
} }
_currentTrack = (byte) track; _currentTrack = (byte) track;
_current = &_music; _current = &_music;
_music.parser->jumpToTick (0); _music.parser->jumpToTick(0);
_current = 0; _current = 0;
} }
_system->unlock_mutex (_mutex); _system->unlock_mutex(_mutex);
} }
void MidiPlayer::stop() { void MidiPlayer::stop() {
_system->lock_mutex (_mutex); _system->lock_mutex(_mutex);
if (_music.parser) { if (_music.parser) {
_current = &_music; _current = &_music;
_music.parser->jumpToTick(0); _music.parser->jumpToTick(0);
} }
_current = 0; _current = 0;
_currentTrack = 255; _currentTrack = 255;
_system->unlock_mutex (_mutex); _system->unlock_mutex(_mutex);
} }
void MidiPlayer::pause (bool b) { void MidiPlayer::pause (bool b) {
@ -230,14 +230,14 @@ void MidiPlayer::pause (bool b) {
return; return;
_paused = b; _paused = b;
_system->lock_mutex (_mutex); _system->lock_mutex(_mutex);
for (int i = 0; i < 16; ++i) { for (int i = 0; i < 16; ++i) {
if (_music.channel[i]) if (_music.channel[i])
_music.channel[i]->volume (_paused ? 0 : (_music.volume[i] * _masterVolume / 255)); _music.channel[i]->volume (_paused ? 0 : (_music.volume[i] * _masterVolume / 255));
if (_sfx.channel[i]) if (_sfx.channel[i])
_sfx.channel[i]->volume (_paused ? 0 : (_sfx.volume[i] * _masterVolume / 255)); _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) { void MidiPlayer::set_volume (int volume) {
@ -255,9 +255,9 @@ void MidiPlayer::set_volume (int volume) {
if (_driver && !_paused) { if (_driver && !_paused) {
for (int i = 0; i < 16; ++i) { for (int i = 0; i < 16; ++i) {
if (_music.channel[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]) 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); _system->unlock_mutex (_mutex);
@ -271,45 +271,45 @@ void MidiPlayer::set_driver(MidiDriver *md) {
} }
void MidiPlayer::mapMT32toGM (bool map) { void MidiPlayer::mapMT32toGM (bool map) {
_system->lock_mutex (_mutex); _system->lock_mutex(_mutex);
_map_mt32_to_gm = map; _map_mt32_to_gm = map;
_system->unlock_mutex (_mutex); _system->unlock_mutex(_mutex);
} }
void MidiPlayer::setLoop (bool loop) { void MidiPlayer::setLoop (bool loop) {
_system->lock_mutex (_mutex); _system->lock_mutex(_mutex);
_loopTrack = loop; _loopTrack = loop;
_system->unlock_mutex (_mutex); _system->unlock_mutex(_mutex);
} }
void MidiPlayer::queueTrack (int track, bool loop) { void MidiPlayer::queueTrack (int track, bool loop) {
_system->lock_mutex (_mutex); _system->lock_mutex(_mutex);
if (_currentTrack == 255) { if (_currentTrack == 255) {
_system->unlock_mutex (_mutex); _system->unlock_mutex(_mutex);
setLoop (loop); setLoop(loop);
startTrack (track); startTrack(track);
} else { } else {
_queuedTrack = track; _queuedTrack = track;
_loopQueuedTrack = loop; _loopQueuedTrack = loop;
_system->unlock_mutex (_mutex); _system->unlock_mutex(_mutex);
} }
} }
void MidiPlayer::clearConstructs() { void MidiPlayer::clearConstructs() {
clearConstructs (_music); clearConstructs(_music);
clearConstructs (_sfx); clearConstructs(_sfx);
} }
void MidiPlayer::clearConstructs (MusicInfo &info) { void MidiPlayer::clearConstructs(MusicInfo &info) {
int i; int i;
if (info.num_songs > 0) { if (info.num_songs > 0) {
for (i = 0; i < info.num_songs; ++i) for (i = 0; i < info.num_songs; ++i)
free (info.songs [i]); free (info.songs[i]);
info.num_songs = 0; info.num_songs = 0;
} }
if (info.data) { if (info.data) {
free (info.data); free(info.data);
info.data = 0; info.data = 0;
} // end if } // end if
@ -346,15 +346,15 @@ static int simon1_gmf_size[] = {
}; };
void MidiPlayer::loadSMF (File *in, int song, bool sfx) { void MidiPlayer::loadSMF (File *in, int song, bool sfx) {
_system->lock_mutex (_mutex); _system->lock_mutex(_mutex);
MusicInfo *p = sfx ? &_sfx : &_music; MusicInfo *p = sfx ? &_sfx : &_music;
clearConstructs (*p); clearConstructs (*p);
uint32 startpos = in->pos(); uint32 startpos = in->pos();
byte header[4]; byte header[4];
in->read (header, 4); in->read(header, 4);
bool isGMF = !memcmp (header, "GMF\x1", 4); bool isGMF = !memcmp (header, "GMF\x1", 4);
in->seek (startpos, SEEK_SET); in->seek(startpos, SEEK_SET);
uint32 size = in->size() - in->pos(); uint32 size = in->size() - in->pos();
if (isGMF) { 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 // but each one is referenced by a pointer at the
// beginning of the file. Those pointers can be used // beginning of the file. Those pointers can be used
// to determine file size. // to determine file size.
in->seek (0, SEEK_SET); in->seek(0, SEEK_SET);
uint16 value = in->readUint16LE() >> 2; // Number of resources uint16 value = in->readUint16LE() >> 2; // Number of resources
if (song != value - 1) { if (song != value - 1) {
in->seek (song * 2 + 2, SEEK_SET); in->seek(song * 2 + 2, SEEK_SET);
value = in->readUint16LE(); value = in->readUint16LE();
size = value - startpos; size = value - startpos;
} }
in->seek (startpos, SEEK_SET); in->seek(startpos, SEEK_SET);
} else if (size >= 64000) { } else if (size >= 64000) {
// For GMF resources not in separate // For GMF resources not in separate
// files, we're going to have to use // files, we're going to have to use
// hardcoded size tables. // hardcoded size tables.
size = simon1_gmf_size [song]; size = simon1_gmf_size[song];
} }
} }
// When allocating space, add 4 bytes in case // When allocating space, add 4 bytes in case
// this is a GMF and we have to tack on our own // this is a GMF and we have to tack on our own
// End of Track event. // End of Track event.
p->data = (byte *) calloc (size + 4, 1); p->data = (byte *) calloc(size + 4, 1);
in->read (p->data, size); 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, // BTW, here's what we know about the GMF header,
// the 7 bytes preceding the actual MIDI events. // the 7 bytes preceding the actual MIDI events.
// 3 BYTES: 'GMF' // 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 : Ranges from 0x02 to 0x08 (always 0x02 for SFX, though)
// 1 BYTE : Loop control. 0 = no loop, 1 = loop // 1 BYTE : Loop control. 0 = no loop, 1 = loop
if (!sfx) if (!sfx)
setLoop (p->data[6] != 0); setLoop(p->data[6] != 0);
} }
MidiParser *parser = MidiParser::createParser_SMF(); MidiParser *parser = MidiParser::createParser_SMF();
parser->property (MidiParser::mpMalformedPitchBends, 1); parser->property(MidiParser::mpMalformedPitchBends, 1);
parser->setMidiDriver (this); parser->setMidiDriver(this);
parser->setTimerRate (_driver->getBaseTempo()); parser->setTimerRate(_driver->getBaseTempo());
if (!parser->loadMusic (p->data, size)) { if (!parser->loadMusic(p->data, size)) {
printf ("Error reading track!\n"); printf ("Error reading track!\n");
delete parser; delete parser;
parser = 0; parser = 0;
@ -413,7 +413,7 @@ void MidiPlayer::loadSMF (File *in, int song, bool sfx) {
resetVolumeTable(); resetVolumeTable();
} }
p->parser = parser; // That plugs the power cord into the wall 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) { 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 // We need to load ALL the songs and then
// treat them as separate tracks -- for the // treat them as separate tracks -- for the
// purpose of jumps, anyway. // purpose of jumps, anyway.
_system->lock_mutex (_mutex); _system->lock_mutex(_mutex);
MusicInfo *p = sfx ? &_sfx : &_music; MusicInfo *p = sfx ? &_sfx : &_music;
clearConstructs (*p); clearConstructs(*p);
p->num_songs = in->readByte(); p->num_songs = in->readByte();
if (p->num_songs > 16) { if (p->num_songs > 16) {
printf ("playMultipleSMF: %d is too many songs to keep track of!\n", (int) p->num_songs); 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; return;
} }
@ -443,27 +443,27 @@ void MidiPlayer::loadMultipleSMF (File *in, bool sfx) {
uint32 pos = in->pos(); uint32 pos = in->pos();
// Make sure there's a MThd // Make sure there's a MThd
in->read (buf, 4); in->read(buf, 4);
if (memcmp (buf, "MThd", 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]); printf ("Expected MThd but found '%c%c%c%c' instead!\n", buf[0], buf[1], buf[2], buf[3]);
_system->unlock_mutex (_mutex); _system->unlock_mutex (_mutex);
return; return;
} }
in->seek (in->readUint32BE() + in->pos(), SEEK_SET); in->seek(in->readUint32BE() + in->pos(), SEEK_SET);
// Now skip all the MTrk blocks // Now skip all the MTrk blocks
while (true) { while (true) {
in->read (buf, 4); in->read (buf, 4);
if (memcmp (buf, "MTrk", 4)) if (memcmp(buf, "MTrk", 4))
break; break;
in->seek (in->readUint32BE() + in->pos(), SEEK_SET); in->seek(in->readUint32BE() + in->pos(), SEEK_SET);
} }
uint32 pos2 = in->pos() - 4; uint32 pos2 = in->pos() - 4;
uint32 size = pos2 - pos; uint32 size = pos2 - pos;
p->songs[i] = (byte *) calloc (size, 1); p->songs[i] = (byte *) calloc(size, 1);
in->seek (pos, SEEK_SET); in->seek(pos, SEEK_SET);
in->read (p->songs[i], size); in->read(p->songs[i], size);
p->song_sizes[i] = size; p->song_sizes[i] = size;
} }
@ -471,47 +471,47 @@ void MidiPlayer::loadMultipleSMF (File *in, bool sfx) {
_currentTrack = 255; _currentTrack = 255;
resetVolumeTable(); resetVolumeTable();
} }
_system->unlock_mutex (_mutex); _system->unlock_mutex(_mutex);
} }
void MidiPlayer::loadXMIDI (File *in, bool sfx) { void MidiPlayer::loadXMIDI(File *in, bool sfx) {
_system->lock_mutex (_mutex); _system->lock_mutex(_mutex);
MusicInfo *p = sfx ? &_sfx : &_music; MusicInfo *p = sfx ? &_sfx : &_music;
clearConstructs (*p); clearConstructs(*p);
char buf[4]; char buf[4];
uint32 pos = in->pos(); uint32 pos = in->pos();
uint32 size = 4; uint32 size = 4;
in->read (buf, 4); in->read(buf, 4);
if (!memcmp (buf, "FORM", 4)) { if (!memcmp(buf, "FORM", 4)) {
int i; int i;
for (i = 0; i < 16; ++i) { for (i = 0; i < 16; ++i) {
if (!memcmp (buf, "CAT ", 4)) if (!memcmp(buf, "CAT ", 4))
break; break;
size += 2; size += 2;
memcpy (buf, &buf[2], 2); memcpy(buf, &buf[2], 2);
in->read (&buf[2], 2); in->read(&buf[2], 2);
} }
if (memcmp (buf, "CAT ", 4)) { if (memcmp(buf, "CAT ", 4)) {
printf ("ERROR! Could not find 'CAT ' tag to determine resource size!\n"); warning("Could not find 'CAT ' tag to determine resource size!");
_system->unlock_mutex (_mutex); _system->unlock_mutex (_mutex);
return; return;
} }
size += 4 + in->readUint32BE(); size += 4 + in->readUint32BE();
in->seek (pos, 0); in->seek(pos, 0);
p->data = (byte *) calloc (size, 1); p->data = (byte *) calloc(size, 1);
in->read (p->data, size); in->read(p->data, size);
} else { } else {
printf ("ERROR! Expected 'FORM' tag but found '%c%c%c%c' instead!\n", buf[0], buf[1], buf[2], buf[3]); warning("Expected 'FORM' tag but found '%c%c%c%c' instead!", buf[0], buf[1], buf[2], buf[3]);
_system->unlock_mutex (_mutex); _system->unlock_mutex(_mutex);
return; return;
} }
MidiParser *parser = MidiParser::createParser_XMIDI(); MidiParser *parser = MidiParser::createParser_XMIDI();
parser->setMidiDriver (this); parser->setMidiDriver(this);
parser->setTimerRate (_driver->getBaseTempo()); parser->setTimerRate(_driver->getBaseTempo());
if (!parser->loadMusic (p->data, size)) { if (!parser->loadMusic(p->data, size)) {
printf ("Error reading track!\n"); warning("Error reading track!");
delete parser; delete parser;
parser = 0; parser = 0;
} }
@ -521,29 +521,29 @@ void MidiPlayer::loadXMIDI (File *in, bool sfx) {
resetVolumeTable(); resetVolumeTable();
} }
p->parser = parser; // That plugs the power cord into the wall 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) { void MidiPlayer::loadS1D (File *in, bool sfx) {
_system->lock_mutex (_mutex); _system->lock_mutex(_mutex);
MusicInfo *p = sfx ? &_sfx : &_music; MusicInfo *p = sfx ? &_sfx : &_music;
clearConstructs (*p); clearConstructs(*p);
uint16 size = in->readUint16LE(); uint16 size = in->readUint16LE();
if (size != in->size() - 2) { if (size != in->size() - 2) {
printf ("ERROR! Size mismatch in simon1demo MUS file (%ld versus reported %d)\n", (long) in->size() - 2, (int) size); warning("Size mismatch in simon1demo MUS file (%ld versus reported %d)", (long) in->size() - 2, (int) size);
_system->unlock_mutex (_mutex); _system->unlock_mutex(_mutex);
return; return;
} }
p->data = (byte *) calloc (size, 1); p->data = (byte *) calloc(size, 1);
in->read (p->data, size); in->read(p->data, size);
MidiParser *parser = MidiParser_createS1D(); MidiParser *parser = MidiParser_createS1D();
parser->setMidiDriver (this); parser->setMidiDriver(this);
parser->setTimerRate (_driver->getBaseTempo()); parser->setTimerRate(_driver->getBaseTempo());
if (!parser->loadMusic (p->data, size)) { if (!parser->loadMusic(p->data, size)) {
printf ("Error reading track!\n"); warning("Error reading track!");
delete parser; delete parser;
parser = 0; parser = 0;
} }
@ -553,5 +553,5 @@ void MidiPlayer::loadS1D (File *in, bool sfx) {
resetVolumeTable(); resetVolumeTable();
} }
p->parser = parser; // That plugs the power cord into the wall p->parser = parser; // That plugs the power cord into the wall
_system->unlock_mutex (_mutex); _system->unlock_mutex(_mutex);
} }

View file

@ -40,12 +40,12 @@ protected:
protected: protected:
void parseNextEvent (EventInfo &info); void parseNextEvent (EventInfo &info);
void resetTracking(); void resetTracking();
uint32 readVLQ2 (byte * &data); uint32 readVLQ2(byte * &data);
public: public:
MidiParser_S1D() : _data(0), _no_delta(false) {} 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 // The VLQs for simon1demo seem to be
// in Little Endian format. // in Little Endian format.
uint32 MidiParser_S1D::readVLQ2 (byte * &data) { uint32 MidiParser_S1D::readVLQ2(byte * &data) {
byte str; byte str;
uint32 value = 0; uint32 value = 0;
int i; int i;
@ -79,9 +79,9 @@ uint32 MidiParser_S1D::readVLQ2 (byte * &data) {
return value; return value;
} }
void MidiParser_S1D::parseNextEvent (EventInfo &info) { void MidiParser_S1D::parseNextEvent(EventInfo &info) {
info.start = _position._play_pos; 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; _no_delta = false;
info.event = *(_position._play_pos++); 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(); unloadMusic();
byte *pos = data; 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 // will persist beyond this call, i.e. we do NOT
// copy the data to our own buffer. Take warning.... // copy the data to our own buffer. Take warning....
resetTracking(); resetTracking();
setTempo (500000); setTempo(500000);
setTrack (0); setTrack(0);
return true; return true;
} }

View file

@ -353,7 +353,6 @@ byte *SimonEngine::readSingleOpcode(File *in, byte *ptr) {
*ptr++ = val >> 8; *ptr++ = val >> 8;
*ptr++ = val & 255; *ptr++ = val & 255;
break; break;
default: default:
error("Bad cmd table entry %c", l); error("Bad cmd table entry %c", l);
} }

View file

@ -3390,7 +3390,6 @@ void SimonEngine::processSpecialKeys() {
case 27: // escape case 27: // escape
_exit_cutscene = true; _exit_cutscene = true;
break; break;
case 59: // F1 case 59: // F1
vc_write_var(5, 50); vc_write_var(5, 50);
vc_write_var(86, 0); vc_write_var(86, 0);
@ -3407,45 +3406,36 @@ void SimonEngine::processSpecialKeys() {
if (_game & GF_SIMON2) if (_game & GF_SIMON2)
_exit_cutscene = true; _exit_cutscene = true;
break; break;
case 't': case 't':
if (_game & GF_SIMON2 && _game & GF_TALKIE || _game & GF_TALKIE && _language > 1) if (_game & GF_SIMON2 && _game & GF_TALKIE || _game & GF_TALKIE && _language > 1)
_subtitles ^= 1; _subtitles ^= 1;
break; break;
case '+': case '+':
midi.set_volume(midi.get_volume() + 16); midi.set_volume(midi.get_volume() + 16);
break; break;
case '-': case '-':
midi.set_volume(midi.get_volume() - 16); midi.set_volume(midi.get_volume() - 16);
break; break;
case 'm': case 'm':
midi.pause(_music_paused ^= 1); midi.pause(_music_paused ^= 1);
break; break;
case 's': case 's':
if (_game == GAME_SIMON1DOS) if (_game == GAME_SIMON1DOS)
midi._enable_sfx ^= 1; midi._enable_sfx ^= 1;
else else
_sound->effectsPause(_effects_paused ^= 1); _sound->effectsPause(_effects_paused ^= 1);
break; break;
case 'b': case 'b':
_sound->ambientPause(_ambient_paused ^= 1); _sound->ambientPause(_ambient_paused ^= 1);
break; break;
case 'r': case 'r':
if (_debugMode) if (_debugMode)
_start_mainscript ^= 1; _start_mainscript ^= 1;
break; break;
case 'o': case 'o':
if (_debugMode) if (_debugMode)
_continous_mainscript ^= 1; _continous_mainscript ^= 1;
break; break;
case 'v': case 'v':
if (_debugMode) if (_debugMode)
_continous_vgascript ^= 1; _continous_vgascript ^= 1;
@ -4576,12 +4566,10 @@ void SimonEngine::delay(uint amount) {
else else
_key_pressed = (byte)event.kbd.ascii; _key_pressed = (byte)event.kbd.ascii;
break; break;
case OSystem::EVENT_MOUSEMOVE: case OSystem::EVENT_MOUSEMOVE:
_sdl_mouse_x = event.mouse.x; _sdl_mouse_x = event.mouse.x;
_sdl_mouse_y = event.mouse.y; _sdl_mouse_y = event.mouse.y;
break; break;
case OSystem::EVENT_LBUTTONDOWN: case OSystem::EVENT_LBUTTONDOWN:
_left_button_down++; _left_button_down++;
#ifdef _WIN32_WCE #ifdef _WIN32_WCE
@ -4589,19 +4577,16 @@ void SimonEngine::delay(uint amount) {
_sdl_mouse_y = event.mouse.y; _sdl_mouse_y = event.mouse.y;
#endif #endif
break; break;
case OSystem::EVENT_RBUTTONDOWN: case OSystem::EVENT_RBUTTONDOWN:
if (_game & GF_SIMON2) if (_game & GF_SIMON2)
_skip_speech = true; _skip_speech = true;
else else
_exit_cutscene = true; _exit_cutscene = true;
break; break;
case OSystem::EVENT_QUIT: case OSystem::EVENT_QUIT:
shutdown(); shutdown();
return; return;
break; break;
default: default:
break; break;
} }

View file

@ -1838,8 +1838,8 @@ void SimonEngine::vc_69_play_track() {
// specifying a non-valid track number (999 or -1) // specifying a non-valid track number (999 or -1)
// as a means of stopping what music is currently // as a means of stopping what music is currently
// playing. // playing.
midi.setLoop (loop != 0); midi.setLoop(loop != 0);
midi.startTrack (track); midi.startTrack(track);
} }
void SimonEngine::vc_70_queue_music() { void SimonEngine::vc_70_queue_music() {
@ -1853,9 +1853,9 @@ void SimonEngine::vc_70_queue_music() {
// track and, if not, whether to switch to // track and, if not, whether to switch to
// a different track upon completion. // a different track upon completion.
if (track != 0xFFFF && track != 999) if (track != 0xFFFF && track != 999)
midi.queueTrack (track, loop != 0); midi.queueTrack(track, loop != 0);
else else
midi.setLoop (loop != 0); midi.setLoop(loop != 0);
} }
void SimonEngine::vc_71_check_music_queue() { void SimonEngine::vc_71_check_music_queue() {

View file

@ -504,75 +504,58 @@ uint16 SkyControl::handleClick(SkyConResource *pButton) {
switch(pButton->_onClick) { switch(pButton->_onClick) {
case DO_NOTHING: case DO_NOTHING:
return 0; return 0;
case REST_GAME_PANEL: case REST_GAME_PANEL:
if (!loadSaveAllowed()) if (!loadSaveAllowed())
return CANCEL_PRESSED; // can't save/restore while choosing return CANCEL_PRESSED; // can't save/restore while choosing
animClick(pButton); animClick(pButton);
return saveRestorePanel(false); // texts can't be edited return saveRestorePanel(false); // texts can't be edited
case SAVE_GAME_PANEL: case SAVE_GAME_PANEL:
if (!loadSaveAllowed()) if (!loadSaveAllowed())
return CANCEL_PRESSED; // can't save/restore while choosing return CANCEL_PRESSED; // can't save/restore while choosing
animClick(pButton); animClick(pButton);
return saveRestorePanel(true); // texts can be edited return saveRestorePanel(true); // texts can be edited
case SAVE_A_GAME: case SAVE_A_GAME:
animClick(pButton); animClick(pButton);
return saveGameToFile(); return saveGameToFile();
case RESTORE_A_GAME: case RESTORE_A_GAME:
animClick(pButton); animClick(pButton);
return restoreGameFromFile(false); return restoreGameFromFile(false);
case RESTORE_AUTO: case RESTORE_AUTO:
animClick(pButton); animClick(pButton);
return restoreGameFromFile(true); return restoreGameFromFile(true);
case SP_CANCEL: case SP_CANCEL:
animClick(pButton); animClick(pButton);
return CANCEL_PRESSED; return CANCEL_PRESSED;
case SHIFT_DOWN_FAST: case SHIFT_DOWN_FAST:
animClick(pButton); animClick(pButton);
return shiftDown(FAST); return shiftDown(FAST);
case SHIFT_DOWN_SLOW: case SHIFT_DOWN_SLOW:
animClick(pButton); animClick(pButton);
return shiftDown(SLOW); return shiftDown(SLOW);
case SHIFT_UP_FAST: case SHIFT_UP_FAST:
animClick(pButton); animClick(pButton);
return shiftUp(FAST); return shiftUp(FAST);
case SHIFT_UP_SLOW: case SHIFT_UP_SLOW:
animClick(pButton); animClick(pButton);
return shiftUp(SLOW); return shiftUp(SLOW);
case SPEED_SLIDE: case SPEED_SLIDE:
_mouseClicked = true; _mouseClicked = true;
return doSpeedSlide(); return doSpeedSlide();
case MUSIC_SLIDE: case MUSIC_SLIDE:
_mouseClicked = true; _mouseClicked = true;
return doMusicSlide(); return doMusicSlide();
case TOGGLE_FX: case TOGGLE_FX:
return toggleFx(pButton); return toggleFx(pButton);
case TOGGLE_MS: case TOGGLE_MS:
animClick(pButton); animClick(pButton);
toggleMusic(); toggleMusic();
return TOGGLED; return TOGGLED;
case TOGGLE_TEXT: case TOGGLE_TEXT:
animClick(pButton); animClick(pButton);
return toggleText(); return toggleText();
case EXIT: case EXIT:
animClick(pButton); animClick(pButton);
return QUIT_PANEL; return QUIT_PANEL;
case RESTART: case RESTART:
animClick(pButton); animClick(pButton);
if (getYesNo(NULL)) { if (getYesNo(NULL)) {
@ -580,7 +563,6 @@ uint16 SkyControl::handleClick(SkyConResource *pButton) {
return GAME_RESTORED; return GAME_RESTORED;
} else } else
return 0; return 0;
case QUIT_TO_DOS: case QUIT_TO_DOS:
animClick(pButton); animClick(pButton);
if (getYesNo(quitDos)) { if (getYesNo(quitDos)) {
@ -589,7 +571,6 @@ uint16 SkyControl::handleClick(SkyConResource *pButton) {
_system->quit(); _system->quit();
} }
return 0; return 0;
default: default:
error("SkyControl::handleClick: unknown routine: %X",pButton->_onClick); error("SkyControl::handleClick: unknown routine: %X",pButton->_onClick);
} }
@ -1695,12 +1676,10 @@ void SkyControl::delay(unsigned int amount) {
else else
_keyPressed = (byte)event.kbd.ascii; _keyPressed = (byte)event.kbd.ascii;
break; break;
case OSystem::EVENT_MOUSEMOVE: case OSystem::EVENT_MOUSEMOVE:
_mouseX = event.mouse.x; _mouseX = event.mouse.x;
_mouseY = event.mouse.y; _mouseY = event.mouse.y;
break; break;
case OSystem::EVENT_LBUTTONDOWN: case OSystem::EVENT_LBUTTONDOWN:
_mouseClicked = true; _mouseClicked = true;
#ifdef _WIN32_WCE #ifdef _WIN32_WCE
@ -1708,19 +1687,15 @@ void SkyControl::delay(unsigned int amount) {
_mouseY = event.mouse.y; _mouseY = event.mouse.y;
#endif #endif
break; break;
case OSystem::EVENT_LBUTTONUP: case OSystem::EVENT_LBUTTONUP:
_mouseClicked = false; _mouseClicked = false;
break; break;
case OSystem::EVENT_RBUTTONDOWN: case OSystem::EVENT_RBUTTONDOWN:
break; break;
case OSystem::EVENT_QUIT: case OSystem::EVENT_QUIT:
if (!SkyState::_systemVars.quitting) if (!SkyState::_systemVars.quitting)
showGameQuitMsg(false); showGameQuitMsg(false);
break; break;
default: default:
break; break;
} }

View file

@ -435,14 +435,12 @@ void SkyState::delay(uint amount) { //copied and mutilated from Simon.cpp
else else
_key_pressed = (byte)event.kbd.ascii; _key_pressed = (byte)event.kbd.ascii;
break; break;
case OSystem::EVENT_MOUSEMOVE: case OSystem::EVENT_MOUSEMOVE:
if (!(_systemVars.systemFlags & SF_MOUSE_LOCKED)) { if (!(_systemVars.systemFlags & SF_MOUSE_LOCKED)) {
_sdl_mouse_x = event.mouse.x; _sdl_mouse_x = event.mouse.x;
_sdl_mouse_y = event.mouse.y; _sdl_mouse_y = event.mouse.y;
} }
break; break;
case OSystem::EVENT_LBUTTONDOWN: case OSystem::EVENT_LBUTTONDOWN:
_skyMouse->buttonPressed(2); _skyMouse->buttonPressed(2);
#ifdef _WIN32_WCE #ifdef _WIN32_WCE
@ -450,16 +448,13 @@ void SkyState::delay(uint amount) { //copied and mutilated from Simon.cpp
_sdl_mouse_y = event.mouse.y; _sdl_mouse_y = event.mouse.y;
#endif #endif
break; break;
case OSystem::EVENT_RBUTTONDOWN: case OSystem::EVENT_RBUTTONDOWN:
_skyMouse->buttonPressed(1); _skyMouse->buttonPressed(1);
break; break;
case OSystem::EVENT_QUIT: case OSystem::EVENT_QUIT:
if (!SkyState::_systemVars.quitting) if (!SkyState::_systemVars.quitting)
_skyControl->showGameQuitMsg(); // will call _system->quit() _skyControl->showGameQuitMsg(); // will call _system->quit()
break; break;
default: default:
break; break;
} }