Whitespace changes
svn-id: r10390
This commit is contained in:
parent
3854ce8f3d
commit
570e60a487
30 changed files with 1289 additions and 1356 deletions
|
@ -212,9 +212,7 @@ void ConsoleDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
|
|||
str[len] = '\0';
|
||||
|
||||
char *completion = 0;
|
||||
if ((*_completionCallbackProc)(this, str, completion,
|
||||
_callbackRefCon))
|
||||
{
|
||||
if ((*_completionCallbackProc)(this, str, completion, _callbackRefCon)) {
|
||||
if (_caretVisible)
|
||||
drawCaret(true);
|
||||
insertIntoPrompt(completion);
|
||||
|
@ -268,7 +266,6 @@ void ConsoleDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
|
|||
_currentPos--;
|
||||
draw();
|
||||
break;
|
||||
|
||||
default:
|
||||
if (ascii == '~' || ascii == '#') {
|
||||
close();
|
||||
|
|
|
@ -283,7 +283,6 @@ bool ScummDebugger::RunCommand(const char *inputOrig) {
|
|||
*(int *)_dvars[i].variable = atoi(param[1]);
|
||||
Debug_Printf("(int)%s = %d\n", param[0], *(int *)_dvars[i].variable);
|
||||
break;
|
||||
|
||||
// Integer Array
|
||||
case DVAR_INTARRAY: {
|
||||
char *chr = strchr(param[0], '[');
|
||||
|
@ -297,12 +296,10 @@ bool ScummDebugger::RunCommand(const char *inputOrig) {
|
|||
} else {
|
||||
var[element] = atoi(param[1]);
|
||||
Debug_Printf("(int)%s = %d\n", param[0], var[element]);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
Debug_Printf("Failed to set variable %s to %s - unknown type\n", _dvars[i].name, param[1]);
|
||||
break;
|
||||
|
@ -314,7 +311,6 @@ bool ScummDebugger::RunCommand(const char *inputOrig) {
|
|||
case DVAR_INT:
|
||||
Debug_Printf("(int)%s = %d\n", param[0], *(int *)_dvars[i].variable);
|
||||
break;
|
||||
|
||||
// Integer array
|
||||
case DVAR_INTARRAY: {
|
||||
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);
|
||||
} else {
|
||||
Debug_Printf("(int)%s = %d\n", param[0], var[element]);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
// String
|
||||
case DVAR_STRING:
|
||||
Debug_Printf("(string)%s = %s\n", param[0], *(char **)_dvars[i].variable);
|
||||
break;
|
||||
|
||||
default:
|
||||
Debug_Printf("%s = (unknown type)\n", param[0]);
|
||||
break;
|
||||
|
|
|
@ -695,7 +695,6 @@ void Scumm_v2::o2_actorSet() {
|
|||
case 1: // Actor Sound
|
||||
a->sound[0] = arg;
|
||||
break;
|
||||
|
||||
case 2: // Actor Set Color
|
||||
if (_version == 1)
|
||||
i = act;
|
||||
|
@ -705,15 +704,12 @@ void Scumm_v2::o2_actorSet() {
|
|||
a->palette[i] = arg;
|
||||
a->needRedraw = true;
|
||||
break;
|
||||
|
||||
case 3: // Actor Name
|
||||
loadPtrToResource(rtActorName, a->number, NULL);
|
||||
break;
|
||||
|
||||
case 4: // Actor Costume
|
||||
a->setActorCostume(arg);
|
||||
break;
|
||||
|
||||
case 5: // Talk Color
|
||||
if ((_gameId == GID_MANIAC) && (_version == 1))
|
||||
v1_mm_actor_speech_color[act] = arg;
|
||||
|
|
|
@ -881,7 +881,6 @@ void Scumm_v5::saveVars() {
|
|||
b = _resultVarNumber;
|
||||
warning("stub saveVars: vars %d -> %d", a, b);
|
||||
break;
|
||||
|
||||
case 0x02: // write a range of string variables
|
||||
a = getVarOrDirectByte(0x80);
|
||||
b = getVarOrDirectByte(0x40);
|
||||
|
@ -900,7 +899,6 @@ void Scumm_v5::saveVars() {
|
|||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -935,9 +933,7 @@ void Scumm_v5::loadVars() {
|
|||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Scumm_v5::o5_expression() {
|
||||
|
|
|
@ -54,8 +54,7 @@ bool SaudChannel::handleSubTags(int32 &offset) {
|
|||
if (available_size >= (size + 8)) {
|
||||
MemoryChunk c((byte *)_tbuffer + offset);
|
||||
handleStrk(c);
|
||||
}
|
||||
else
|
||||
} else
|
||||
return false;
|
||||
break;
|
||||
case TYPE_SMRK:
|
||||
|
@ -63,8 +62,7 @@ bool SaudChannel::handleSubTags(int32 &offset) {
|
|||
if (available_size >= (size + 8)) {
|
||||
MemoryChunk c((byte *)_tbuffer + offset);
|
||||
handleSmrk(c);
|
||||
}
|
||||
else
|
||||
} else
|
||||
return false;
|
||||
break;
|
||||
case TYPE_SHDR:
|
||||
|
@ -72,8 +70,7 @@ bool SaudChannel::handleSubTags(int32 &offset) {
|
|||
if (available_size >= (size + 8)) {
|
||||
MemoryChunk c((byte *)_tbuffer + offset);
|
||||
handleShdr(c);
|
||||
}
|
||||
else
|
||||
} else
|
||||
return false;
|
||||
break;
|
||||
case TYPE_SDAT:
|
||||
|
|
|
@ -347,9 +347,11 @@ void Sound::playSound(int soundID) {
|
|||
rate = 11025;
|
||||
int type = *(ptr + 0x0D);
|
||||
|
||||
int numInstruments;
|
||||
|
||||
switch(type) {
|
||||
case 0: { // Sound effect
|
||||
int numInstruments = *(ptr + 0x14);
|
||||
case 0: // Sound effect
|
||||
numInstruments = *(ptr + 0x14);
|
||||
ptr += 0x16;
|
||||
size -= 0x16;
|
||||
while (numInstruments--) {
|
||||
|
@ -381,31 +383,31 @@ void Sound::playSound(int soundID) {
|
|||
_scumm->_mixer->playRaw(NULL, sound, waveSize, rate, flags, soundID, 255, 0, loopStart, loopEnd);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case 1: { // Music (Euphony format)
|
||||
case 1:
|
||||
// Music (Euphony format)
|
||||
if (_scumm->_musicEngine)
|
||||
_scumm->_musicEngine->startSound (soundID);
|
||||
break;
|
||||
}
|
||||
|
||||
case 2: { // CD track resource
|
||||
case 2: // CD track resource
|
||||
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 (pollCD() == 1)
|
||||
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);
|
||||
}
|
||||
|
||||
_currentCDSound = soundID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((_scumm->_gameId == GID_LOOM) && (_scumm->_features & GF_MACINTOSH)) {
|
||||
// Mac version of Loom uses yet another sound format
|
||||
/*
|
||||
|
@ -1290,11 +1292,9 @@ void Sound::playBundleSound(char *sound, PlayingSoundHandle *handle) {
|
|||
case MKID_BE('SYNC'):
|
||||
size = READ_BE_UINT32(ptr); ptr += size + 4;
|
||||
break;
|
||||
|
||||
case MKID_BE('DATA'):
|
||||
size = READ_BE_UINT32(ptr); ptr += 4;
|
||||
break;
|
||||
|
||||
default:
|
||||
error("Unknown sound header %c%c%c%c",
|
||||
(byte)(tag >> 24),
|
||||
|
|
|
@ -493,7 +493,7 @@ void MidiPlayer::loadXMIDI (File *in, bool sfx) {
|
|||
in->read(&buf[2], 2);
|
||||
}
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
@ -502,7 +502,7 @@ void MidiPlayer::loadXMIDI (File *in, bool sfx) {
|
|||
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]);
|
||||
warning("Expected 'FORM' tag but found '%c%c%c%c' instead!", buf[0], buf[1], buf[2], buf[3]);
|
||||
_system->unlock_mutex(_mutex);
|
||||
return;
|
||||
}
|
||||
|
@ -511,7 +511,7 @@ void MidiPlayer::loadXMIDI (File *in, bool sfx) {
|
|||
parser->setMidiDriver(this);
|
||||
parser->setTimerRate(_driver->getBaseTempo());
|
||||
if (!parser->loadMusic(p->data, size)) {
|
||||
printf ("Error reading track!\n");
|
||||
warning("Error reading track!");
|
||||
delete parser;
|
||||
parser = 0;
|
||||
}
|
||||
|
@ -531,7 +531,7 @@ void MidiPlayer::loadS1D (File *in, bool sfx) {
|
|||
|
||||
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);
|
||||
warning("Size mismatch in simon1demo MUS file (%ld versus reported %d)", (long) in->size() - 2, (int) size);
|
||||
_system->unlock_mutex(_mutex);
|
||||
return;
|
||||
}
|
||||
|
@ -543,7 +543,7 @@ void MidiPlayer::loadS1D (File *in, bool sfx) {
|
|||
parser->setMidiDriver(this);
|
||||
parser->setTimerRate(_driver->getBaseTempo());
|
||||
if (!parser->loadMusic(p->data, size)) {
|
||||
printf ("Error reading track!\n");
|
||||
warning("Error reading track!");
|
||||
delete parser;
|
||||
parser = 0;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -3390,7 +3390,6 @@ void SimonEngine::processSpecialKeys() {
|
|||
case 27: // escape
|
||||
_exit_cutscene = true;
|
||||
break;
|
||||
|
||||
case 59: // F1
|
||||
vc_write_var(5, 50);
|
||||
vc_write_var(86, 0);
|
||||
|
@ -3407,45 +3406,36 @@ void SimonEngine::processSpecialKeys() {
|
|||
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;
|
||||
|
@ -4576,12 +4566,10 @@ void SimonEngine::delay(uint amount) {
|
|||
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
|
||||
|
@ -4589,19 +4577,16 @@ void SimonEngine::delay(uint amount) {
|
|||
_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;
|
||||
}
|
||||
|
|
|
@ -504,75 +504,58 @@ uint16 SkyControl::handleClick(SkyConResource *pButton) {
|
|||
switch(pButton->_onClick) {
|
||||
case DO_NOTHING:
|
||||
return 0;
|
||||
|
||||
case REST_GAME_PANEL:
|
||||
if (!loadSaveAllowed())
|
||||
return CANCEL_PRESSED; // can't save/restore while choosing
|
||||
animClick(pButton);
|
||||
return saveRestorePanel(false); // texts can't be edited
|
||||
|
||||
case SAVE_GAME_PANEL:
|
||||
if (!loadSaveAllowed())
|
||||
return CANCEL_PRESSED; // can't save/restore while choosing
|
||||
animClick(pButton);
|
||||
return saveRestorePanel(true); // texts can be edited
|
||||
|
||||
case SAVE_A_GAME:
|
||||
animClick(pButton);
|
||||
return saveGameToFile();
|
||||
|
||||
case RESTORE_A_GAME:
|
||||
animClick(pButton);
|
||||
return restoreGameFromFile(false);
|
||||
|
||||
case RESTORE_AUTO:
|
||||
animClick(pButton);
|
||||
return restoreGameFromFile(true);
|
||||
|
||||
case SP_CANCEL:
|
||||
animClick(pButton);
|
||||
return CANCEL_PRESSED;
|
||||
|
||||
case SHIFT_DOWN_FAST:
|
||||
animClick(pButton);
|
||||
return shiftDown(FAST);
|
||||
|
||||
case SHIFT_DOWN_SLOW:
|
||||
animClick(pButton);
|
||||
return shiftDown(SLOW);
|
||||
|
||||
case SHIFT_UP_FAST:
|
||||
animClick(pButton);
|
||||
return shiftUp(FAST);
|
||||
|
||||
case SHIFT_UP_SLOW:
|
||||
animClick(pButton);
|
||||
return shiftUp(SLOW);
|
||||
|
||||
case SPEED_SLIDE:
|
||||
_mouseClicked = true;
|
||||
return doSpeedSlide();
|
||||
|
||||
case MUSIC_SLIDE:
|
||||
_mouseClicked = true;
|
||||
return doMusicSlide();
|
||||
|
||||
case TOGGLE_FX:
|
||||
return toggleFx(pButton);
|
||||
|
||||
case TOGGLE_MS:
|
||||
animClick(pButton);
|
||||
toggleMusic();
|
||||
return TOGGLED;
|
||||
|
||||
case TOGGLE_TEXT:
|
||||
animClick(pButton);
|
||||
return toggleText();
|
||||
|
||||
case EXIT:
|
||||
animClick(pButton);
|
||||
return QUIT_PANEL;
|
||||
|
||||
case RESTART:
|
||||
animClick(pButton);
|
||||
if (getYesNo(NULL)) {
|
||||
|
@ -580,7 +563,6 @@ uint16 SkyControl::handleClick(SkyConResource *pButton) {
|
|||
return GAME_RESTORED;
|
||||
} else
|
||||
return 0;
|
||||
|
||||
case QUIT_TO_DOS:
|
||||
animClick(pButton);
|
||||
if (getYesNo(quitDos)) {
|
||||
|
@ -589,7 +571,6 @@ uint16 SkyControl::handleClick(SkyConResource *pButton) {
|
|||
_system->quit();
|
||||
}
|
||||
return 0;
|
||||
|
||||
default:
|
||||
error("SkyControl::handleClick: unknown routine: %X",pButton->_onClick);
|
||||
}
|
||||
|
@ -1695,12 +1676,10 @@ void SkyControl::delay(unsigned int amount) {
|
|||
else
|
||||
_keyPressed = (byte)event.kbd.ascii;
|
||||
break;
|
||||
|
||||
case OSystem::EVENT_MOUSEMOVE:
|
||||
_mouseX = event.mouse.x;
|
||||
_mouseY = event.mouse.y;
|
||||
break;
|
||||
|
||||
case OSystem::EVENT_LBUTTONDOWN:
|
||||
_mouseClicked = true;
|
||||
#ifdef _WIN32_WCE
|
||||
|
@ -1708,19 +1687,15 @@ void SkyControl::delay(unsigned int amount) {
|
|||
_mouseY = event.mouse.y;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case OSystem::EVENT_LBUTTONUP:
|
||||
_mouseClicked = false;
|
||||
break;
|
||||
|
||||
case OSystem::EVENT_RBUTTONDOWN:
|
||||
break;
|
||||
|
||||
case OSystem::EVENT_QUIT:
|
||||
if (!SkyState::_systemVars.quitting)
|
||||
showGameQuitMsg(false);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -435,14 +435,12 @@ void SkyState::delay(uint amount) { //copied and mutilated from Simon.cpp
|
|||
else
|
||||
_key_pressed = (byte)event.kbd.ascii;
|
||||
break;
|
||||
|
||||
case OSystem::EVENT_MOUSEMOVE:
|
||||
if (!(_systemVars.systemFlags & SF_MOUSE_LOCKED)) {
|
||||
_sdl_mouse_x = event.mouse.x;
|
||||
_sdl_mouse_y = event.mouse.y;
|
||||
}
|
||||
break;
|
||||
|
||||
case OSystem::EVENT_LBUTTONDOWN:
|
||||
_skyMouse->buttonPressed(2);
|
||||
#ifdef _WIN32_WCE
|
||||
|
@ -450,16 +448,13 @@ void SkyState::delay(uint amount) { //copied and mutilated from Simon.cpp
|
|||
_sdl_mouse_y = event.mouse.y;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case OSystem::EVENT_RBUTTONDOWN:
|
||||
_skyMouse->buttonPressed(1);
|
||||
break;
|
||||
|
||||
case OSystem::EVENT_QUIT:
|
||||
if (!SkyState::_systemVars.quitting)
|
||||
_skyControl->showGameQuitMsg(); // will call _system->quit()
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue