cleanup whitespaces
svn-id: r11217
This commit is contained in:
parent
9e7402e14b
commit
1f9e408e2f
25 changed files with 257 additions and 291 deletions
|
@ -605,8 +605,7 @@ void ScummDebugger::printBox(int box) {
|
|||
static int gfxPrimitivesCompareInt(const void *a, const void *b);
|
||||
|
||||
|
||||
static void hlineColor(ScummEngine *scumm, int x1, int x2, int y, byte color)
|
||||
{
|
||||
static void hlineColor(ScummEngine *scumm, int x1, int x2, int y, byte color) {
|
||||
VirtScreen *vs = &scumm->virtscr[0];
|
||||
byte *ptr;
|
||||
|
||||
|
@ -634,13 +633,11 @@ static void hlineColor(ScummEngine *scumm, int x1, int x2, int y, byte color)
|
|||
}
|
||||
}
|
||||
|
||||
static int gfxPrimitivesCompareInt(const void *a, const void *b)
|
||||
{
|
||||
static int gfxPrimitivesCompareInt(const void *a, const void *b) {
|
||||
return (*(const int *)a) - (*(const int *)b);
|
||||
}
|
||||
|
||||
static void fillQuad(ScummEngine *scumm, int16 vx[4], int16 vy[4], int color)
|
||||
{
|
||||
static void fillQuad(ScummEngine *scumm, int16 vx[4], int16 vy[4], int color) {
|
||||
const int N = 4;
|
||||
int i;
|
||||
int y;
|
||||
|
|
|
@ -246,7 +246,6 @@ void SaveLoadChooser::handleCommand(CommandSender *sender, uint32 cmd, uint32 da
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
Common::StringList generateSavegameList(ScummEngine *scumm, bool saveMode) {
|
||||
// Get savegame names
|
||||
Common::StringList l;
|
||||
|
@ -273,15 +272,15 @@ Common::StringList generateSavegameList(ScummEngine *scumm, bool saveMode) {
|
|||
enum {
|
||||
kRowHeight = 18,
|
||||
kBigButtonWidth = 90,
|
||||
kMainMenuWidth = (kBigButtonWidth + 2*8),
|
||||
kMainMenuHeight = 7*kRowHeight + 3*5 + 7 + 5
|
||||
kMainMenuWidth = (kBigButtonWidth + 2 * 8),
|
||||
kMainMenuHeight = 7 * kRowHeight + 3 * 5 + 7 + 5
|
||||
};
|
||||
|
||||
#define addBigButton(label, cmd, hotkey) \
|
||||
new ButtonWidget(this, x, y, kBigButtonWidth, 16, label, cmd, hotkey); y += kRowHeight
|
||||
|
||||
MainMenuDialog::MainMenuDialog(ScummEngine *scumm)
|
||||
: ScummDialog(scumm, (320 - kMainMenuWidth)/2, (200 - kMainMenuHeight)/2, kMainMenuWidth, kMainMenuHeight) {
|
||||
: ScummDialog(scumm, (320 - kMainMenuWidth) / 2, (200 - kMainMenuHeight)/2, kMainMenuWidth, kMainMenuHeight) {
|
||||
int y = 7;
|
||||
|
||||
const int x = (_w - kBigButtonWidth) / 2;
|
||||
|
@ -418,13 +417,13 @@ OptionsDialog::OptionsDialog(ScummEngine *scumm)
|
|||
// Add the buttons
|
||||
//
|
||||
#ifdef _WIN32_WCE
|
||||
addButton(_w-kButtonWidth-8, _h-24 - kButtonHeight - 4, "OK", kOKCmd, 'O');
|
||||
addButton(_w-2*kButtonWidth-12, _h-24 - kButtonHeight - 4, "Cancel", kCancelCmd, 'C');
|
||||
addButton(_w - kButtonWidth - 8, _h - 24 - kButtonHeight - 4, "OK", kOKCmd, 'O');
|
||||
addButton(_w - 2 * kButtonWidth - 12, _h - 24 - kButtonHeight - 4, "Cancel", kCancelCmd, 'C');
|
||||
|
||||
addButton(kButtonWidth+12, _h-24, "Keys", kKeysCmd, 'K');
|
||||
addButton(kButtonWidth+12, _h - 24, "Keys", kKeysCmd, 'K');
|
||||
#else
|
||||
addButton(_w-kButtonWidth-8, _h-24, "OK", kOKCmd, 'O');
|
||||
addButton(_w-2*kButtonWidth-12, _h-24, "Cancel", kCancelCmd, 'C');
|
||||
addButton(_w - kButtonWidth-8, _h - 24, "OK", kOKCmd, 'O');
|
||||
addButton(_w - 2 * kButtonWidth-12, _h - 24, "Cancel", kCancelCmd, 'C');
|
||||
#endif
|
||||
|
||||
//
|
||||
|
@ -433,7 +432,7 @@ OptionsDialog::OptionsDialog(ScummEngine *scumm)
|
|||
int yoffset = 8;
|
||||
|
||||
_masterVolumeSlider = new SliderWidget(this, 5, yoffset, 185, 12, "Master volume: ", 100, kMasterVolumeChanged);
|
||||
_masterVolumeLabel = new StaticTextWidget(this, 200, yoffset+2, 24, 16, "100%", kTextAlignLeft);
|
||||
_masterVolumeLabel = new StaticTextWidget(this, 200, yoffset + 2, 24, 16, "100%", kTextAlignLeft);
|
||||
_masterVolumeSlider->setMinValue(0); _masterVolumeSlider->setMaxValue(255);
|
||||
_masterVolumeLabel->setFlags(WIDGET_CLEARBG);
|
||||
yoffset += 16;
|
||||
|
@ -445,7 +444,7 @@ OptionsDialog::OptionsDialog(ScummEngine *scumm)
|
|||
yoffset += 16;
|
||||
|
||||
_sfxVolumeSlider = new SliderWidget(this, 5, yoffset, 185, 12, "SFX volume: ", 100, kSfxVolumeChanged);
|
||||
_sfxVolumeLabel = new StaticTextWidget(this, 200, yoffset+2, 24, 16, "100%", kTextAlignLeft);
|
||||
_sfxVolumeLabel = new StaticTextWidget(this, 200, yoffset + 2, 24, 16, "100%", kTextAlignLeft);
|
||||
_sfxVolumeSlider->setMinValue(0); _sfxVolumeSlider->setMaxValue(255);
|
||||
_sfxVolumeLabel->setFlags(WIDGET_CLEARBG);
|
||||
yoffset += 16;
|
||||
|
@ -641,7 +640,7 @@ void InfoDialog::setInfoText(const String& message) {
|
|||
_x = (_scumm->_screenWidth - width) >> 1;
|
||||
_w = width;
|
||||
|
||||
new StaticTextWidget(this, 4, 4, _w-8, _h, message, kTextAlignCenter);
|
||||
new StaticTextWidget(this, 4, 4, _w - 8, _h, message, kTextAlignCenter);
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
|
|
@ -1304,10 +1304,10 @@ StripTable *Gdi::generateStripTable(const byte *src, int width, int height, Stri
|
|||
for (x = 0 ; x < width; x++) {
|
||||
|
||||
if ((x % 8) == 0) {
|
||||
assert(x/8 < 160);
|
||||
table->run[x/8] = run;
|
||||
table->color[x/8] = color;
|
||||
table->offsets[x/8] = src - bitmapStart;
|
||||
assert(x / 8 < 160);
|
||||
table->run[x / 8] = run;
|
||||
table->color[x / 8] = color;
|
||||
table->offsets[x / 8] = src - bitmapStart;
|
||||
}
|
||||
|
||||
for (y = 0; y < height; y++) {
|
||||
|
@ -1761,7 +1761,7 @@ void Gdi::decompressMaskImgOr(byte *dst, const byte *src, int height) {
|
|||
}
|
||||
}
|
||||
|
||||
#define READ_BIT (cl--, bit = bits&1, bits>>=1,bit)
|
||||
#define READ_BIT (cl--, bit = bits & 1, bits >>= 1, bit)
|
||||
#define FILL_BITS do { \
|
||||
if (cl <= 8) { \
|
||||
bits |= (*src++ << cl); \
|
||||
|
|
|
@ -63,8 +63,7 @@ _queue_cleared(0),
|
|||
_master_volume(0),
|
||||
_music_volume(0),
|
||||
_trigger_count(0),
|
||||
_snm_trigger_index(0)
|
||||
{
|
||||
_snm_trigger_index(0) {
|
||||
memset(_channel_volume,0,sizeof(_channel_volume));
|
||||
memset(_channel_volume_eff,0,sizeof(_channel_volume_eff));
|
||||
memset(_volchan_table,0,sizeof(_volchan_table));
|
||||
|
@ -461,8 +460,7 @@ int IMuseInternal::get_queue_sound_status(int sound) const {
|
|||
|
||||
for (i = 0; i < ARRAYSIZE (_deferredCommands); ++i) {
|
||||
if (_deferredCommands[i].time_left && _deferredCommands[i].a == 8 &&
|
||||
_deferredCommands[i].b == sound)
|
||||
{
|
||||
_deferredCommands[i].b == sound) {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
@ -942,9 +940,7 @@ int32 IMuseInternal::ImClearTrigger(int sound, int id) {
|
|||
int i;
|
||||
ImTrigger *trig = _snm_triggers;
|
||||
for (i = ARRAYSIZE(_snm_triggers); i; --i, ++trig) {
|
||||
if ((sound == -1 || trig->sound == sound) &&
|
||||
trig->id && (id == -1 || trig->id == id))
|
||||
{
|
||||
if ((sound == -1 || trig->sound == sound) && trig->id && (id == -1 || trig->id == id)) {
|
||||
trig->sound = trig->id = 0;
|
||||
++count;
|
||||
}
|
||||
|
@ -957,8 +953,7 @@ int32 IMuseInternal::ImFireAllTriggers(int sound) {
|
|||
int count = 0;
|
||||
int i;
|
||||
for (i = 0; i < 16; ++i) {
|
||||
if (_snm_triggers [i].sound == sound)
|
||||
{
|
||||
if (_snm_triggers [i].sound == sound) {
|
||||
_snm_triggers [i].sound = _snm_triggers [i].id = 0;
|
||||
doCommand (8, _snm_triggers[i].command);
|
||||
++count;
|
||||
|
@ -1660,8 +1655,7 @@ void Part::sendPitchBend() {
|
|||
// so we'll do the scaling ourselves.
|
||||
if (_player->_se->isNativeMT32())
|
||||
bend = bend * _pitchbend_factor / 12;
|
||||
_mc->pitchBend(clamp(bend + (_detune_eff * 64 / 12) +
|
||||
(_transpose_eff * 8192 / 12), -8192, 8191));
|
||||
_mc->pitchBend(clamp(bend + (_detune_eff * 64 / 12) + (_transpose_eff * 8192 / 12), -8192, 8191));
|
||||
}
|
||||
|
||||
void Part::programChange(byte value) {
|
||||
|
@ -1710,8 +1704,7 @@ void IMuseInternal::reallocateMidiChannels(MidiDriver *midi) {
|
|||
for (i = 32, part = _parts; i; i--, part++) {
|
||||
if (part->_player && part->_player->getMidiDriver() == midi &&
|
||||
!part->_percussion && part->_on &&
|
||||
!part->_mc && part->_pri_eff >= hipri)
|
||||
{
|
||||
!part->_mc && part->_pri_eff >= hipri) {
|
||||
hipri = part->_pri_eff;
|
||||
hipart = part;
|
||||
}
|
||||
|
|
|
@ -58,30 +58,30 @@ uint16 Player::_active_notes[128];
|
|||
//////////////////////////////////////////////////
|
||||
|
||||
Player::Player() :
|
||||
_midi(0),
|
||||
_parser(0),
|
||||
_parts(0),
|
||||
_active(false),
|
||||
_scanning(false),
|
||||
_id(0),
|
||||
_priority(0),
|
||||
_volume(0),
|
||||
_pan(0),
|
||||
_transpose(0),
|
||||
_detune(0),
|
||||
_vol_eff(0),
|
||||
_track_index(0),
|
||||
_loop_to_beat(0),
|
||||
_loop_from_beat(0),
|
||||
_loop_counter(0),
|
||||
_loop_to_tick(0),
|
||||
_loop_from_tick(0),
|
||||
_speed(128),
|
||||
_isMT32(false),
|
||||
_isGM(false),
|
||||
_se(0),
|
||||
_vol_chan(0)
|
||||
{ }
|
||||
_midi(0),
|
||||
_parser(0),
|
||||
_parts(0),
|
||||
_active(false),
|
||||
_scanning(false),
|
||||
_id(0),
|
||||
_priority(0),
|
||||
_volume(0),
|
||||
_pan(0),
|
||||
_transpose(0),
|
||||
_detune(0),
|
||||
_vol_eff(0),
|
||||
_track_index(0),
|
||||
_loop_to_beat(0),
|
||||
_loop_from_beat(0),
|
||||
_loop_counter(0),
|
||||
_loop_to_tick(0),
|
||||
_loop_from_tick(0),
|
||||
_speed(128),
|
||||
_isMT32(false),
|
||||
_isGM(false),
|
||||
_se(0),
|
||||
_vol_chan(0){
|
||||
}
|
||||
|
||||
Player::~Player() {
|
||||
if (_parser) {
|
||||
|
@ -142,8 +142,7 @@ bool Player::isFadingOut() const {
|
|||
int i;
|
||||
for (i = 0; i < ARRAYSIZE(_parameterFaders); ++i) {
|
||||
if (_parameterFaders[i].param == ParameterFader::pfVolume &&
|
||||
_parameterFaders[i].end == 0)
|
||||
{
|
||||
_parameterFaders[i].end == 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -325,8 +325,7 @@ protected:
|
|||
File _hFileTable[17];
|
||||
|
||||
public:
|
||||
ScummEngine_v6(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine(detector, syst, gs)
|
||||
{
|
||||
ScummEngine_v6(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine(detector, syst, gs) {
|
||||
VAR_VIDEONAME = 0xFF;
|
||||
|
||||
VAR_TIMEDATE_YEAR = 0xFF;
|
||||
|
|
|
@ -72,13 +72,13 @@ void MidiParser_EUP::parseNextEvent (EventInfo &info) {
|
|||
// fits-all" sound until we actually support the
|
||||
// FM synthesis capabilities of FM Towns.
|
||||
for (; _presend < 12; ++_presend) {
|
||||
if (_instr_to_channel[_presend>>1] >= 16)
|
||||
if (_instr_to_channel[_presend >> 1] >= 16)
|
||||
continue;
|
||||
info.start = pos;
|
||||
info.delta = 0;
|
||||
if (_presend & 1) {
|
||||
byte *data = &_instruments[_presend>>1][0];
|
||||
data[1] = _instr_to_channel[_presend>>1];
|
||||
byte *data = &_instruments[_presend >> 1][0];
|
||||
data[1] = _instr_to_channel[_presend >> 1];
|
||||
info.event = 0xF0;
|
||||
info.ext.data = data;
|
||||
info.length = 48;
|
||||
|
|
|
@ -55,8 +55,7 @@ private:
|
|||
MOD_MAXCHANS = 16
|
||||
};
|
||||
|
||||
struct soundChan
|
||||
{
|
||||
struct soundChan {
|
||||
int id;
|
||||
uint8 vol;
|
||||
int8 pan;
|
||||
|
|
|
@ -262,7 +262,7 @@ void Player_V1::parsePCjrChunk() {
|
|||
set_mplex(3000);
|
||||
_forced_level = 0;
|
||||
|
||||
parse_again:
|
||||
parse_again:
|
||||
|
||||
_chunk_type = READ_LE_UINT16(_next_chunk);
|
||||
debug(6, "parsePCjrChunk: sound %d, offset %4x, chunk %x",
|
||||
|
@ -539,7 +539,7 @@ void Player_V1::generateSpkSamples(int16 *data, uint len) {
|
|||
} else {
|
||||
squareGenerator(0, _channels[0].freq, 0, 0, data, len);
|
||||
debug(9, "speaker: %8x: freq %d %.1f", _tick_len,
|
||||
_channels[0].freq, 1193000.0/_channels[0].freq);
|
||||
_channels[0].freq, 1193000.0 / _channels[0].freq);
|
||||
}
|
||||
lowPassFilter(data, len);
|
||||
}
|
||||
|
@ -588,7 +588,7 @@ void Player_V1::generatePCjrSamples(int16 *data, uint len) {
|
|||
hasdata = true;
|
||||
squareGenerator(i, freq, vol, 0, data, len);
|
||||
debug(9, "channel[%d]: %8x: freq %d %.1f ; volume %d",
|
||||
i, _tick_len, freq, 111860.0/freq, vol);
|
||||
i, _tick_len, freq, 111860.0 / freq, vol);
|
||||
} else {
|
||||
int noiseFB = (freq & 4) ? FB_WNOISE : FB_PNOISE;
|
||||
int n = (freq & 3);
|
||||
|
@ -597,7 +597,7 @@ void Player_V1::generatePCjrSamples(int16 *data, uint len) {
|
|||
hasdata = true;
|
||||
squareGenerator(i, freq, vol, noiseFB, data, len);
|
||||
debug(9, "channel[%d]: %x: noise freq %d %.1f ; volume %d",
|
||||
i, _tick_len, freq, 111860.0/freq, vol);
|
||||
i, _tick_len, freq, 111860.0 / freq, vol);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -447,7 +447,7 @@ void Player_V2::chainSound(int nr, byte *data) {
|
|||
|
||||
_channels[i].d.music_script_nr = nr;
|
||||
if (data) {
|
||||
_channels[i].d.next_cmd = READ_LE_UINT16(data+offset+2*i);
|
||||
_channels[i].d.next_cmd = READ_LE_UINT16(data + offset + 2 * i);
|
||||
if (_channels[i].d.next_cmd)
|
||||
_channels[i].d.time_left = 1;
|
||||
}
|
||||
|
@ -590,15 +590,15 @@ void Player_V2::execute_cmd(ChannelInfo *channel) {
|
|||
case 0xf8: // set hull curve
|
||||
debug(7, "channels[%d]: hull curve %2d",
|
||||
channel - _channels, *script_ptr);
|
||||
channel->d.hull_curve = hull_offsets[*script_ptr/2];
|
||||
channel->d.hull_curve = hull_offsets[*script_ptr / 2];
|
||||
script_ptr++;
|
||||
break;
|
||||
|
||||
case 0xf9: // set freqmod curve
|
||||
debug(7, "channels[%d]: freqmod curve %2d",
|
||||
channel - _channels, *script_ptr);
|
||||
channel->d.freqmod_table = freqmod_offsets[*script_ptr/4];
|
||||
channel->d.freqmod_modulo = freqmod_lengths[*script_ptr/4];
|
||||
channel->d.freqmod_table = freqmod_offsets[*script_ptr / 4];
|
||||
channel->d.freqmod_modulo = freqmod_lengths[*script_ptr / 4];
|
||||
script_ptr++;
|
||||
break;
|
||||
|
||||
|
@ -658,14 +658,14 @@ void Player_V2::execute_cmd(ChannelInfo *channel) {
|
|||
offset = READ_LE_UINT16 (script_ptr);
|
||||
script_ptr += 2;
|
||||
debug(7, "loop if %d to %d", opcode, offset);
|
||||
if (!channel->array[opcode/2] || --channel->array[opcode/2])
|
||||
if (!channel->array[opcode / 2] || --channel->array[opcode/2])
|
||||
script_ptr += offset;
|
||||
break;
|
||||
|
||||
case 0xff: // set parameter
|
||||
opcode = *script_ptr++;
|
||||
value = READ_LE_UINT16 (script_ptr);
|
||||
channel->array[opcode/2] = value;
|
||||
channel->array[opcode / 2] = value;
|
||||
debug(7, "channels[%d]: set param %2d = %5d",
|
||||
channel - &_channels[0], opcode, value);
|
||||
script_ptr += 2;
|
||||
|
@ -799,7 +799,7 @@ void Player_V2::next_freqs(ChannelInfo *channel) {
|
|||
if (channel->d.hull_counter && !--channel->d.hull_counter) {
|
||||
for (;;) {
|
||||
const int16 *hull_ptr = hulls
|
||||
+ channel->d.hull_curve + channel->d.hull_offset/2;
|
||||
+ channel->d.hull_curve + channel->d.hull_offset / 2;
|
||||
if (hull_ptr[1] == -1) {
|
||||
channel->d.volume = hull_ptr[0];
|
||||
if (hull_ptr[0] == 0)
|
||||
|
@ -854,7 +854,7 @@ void Player_V2::nextTick() {
|
|||
void Player_V2::lowPassFilter(int16 *sample, uint len) {
|
||||
for (uint i = 0; i < len; i++) {
|
||||
_level = (int) (_level * _decay
|
||||
+ sample[0] * (0x10000-_decay)) >> 16;
|
||||
+ sample[0] * (0x10000 - _decay)) >> 16;
|
||||
sample[0] = sample[1] = _level;
|
||||
sample += 2;
|
||||
}
|
||||
|
@ -896,7 +896,7 @@ void Player_V2::squareGenerator(int channel, int freq, int vol,
|
|||
duration -= _timer_count[channel];
|
||||
|
||||
nsample = *sample +
|
||||
(((signed long) (duration - (1 << (FIXP_SHIFT-1)))
|
||||
(((signed long) (duration - (1 << (FIXP_SHIFT - 1)))
|
||||
* (signed long) _volumetable[vol]) >> FIXP_SHIFT);
|
||||
/* overflow: clip value */
|
||||
if (nsample > 0x7fff)
|
||||
|
@ -978,7 +978,7 @@ void Player_V2::generatePCjrSamples(int16 *data, uint len) {
|
|||
}
|
||||
#if 0
|
||||
debug(9, "channel[%d]: freq %d %.1f ; volume %d",
|
||||
i, freq, 111860.0/freq, vol);
|
||||
i, freq, 111860.0 / freq, vol);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -752,7 +752,7 @@ public:
|
|||
}
|
||||
if (_curfreq >= _freq2)
|
||||
return true;
|
||||
const char steps[8] = {0,2,2,3,4,8,15,2};
|
||||
const char steps[8] = {0, 2, 2, 3, 4, 8, 15, 2};
|
||||
_curfreq = _freq1;
|
||||
_step = steps[++_loopnum];
|
||||
if (_loopnum == 7) {
|
||||
|
@ -818,10 +818,10 @@ public:
|
|||
}
|
||||
virtual bool update() {
|
||||
assert(_id);
|
||||
updatefreq(_freq1,_step1,0x00AA,0x00FA);
|
||||
updatefreq(_freq2,_step2,0x019A,0x03B6);
|
||||
updatefreq(_freq3,_step3,0x00AA,0x00FA);
|
||||
updatefreq(_freq4,_step4,0x019A,0x03B6);
|
||||
updatefreq(_freq1, _step1, 0x00AA, 0x00FA);
|
||||
updatefreq(_freq2, _step2, 0x019A, 0x03B6);
|
||||
updatefreq(_freq3, _step3, 0x00AA, 0x00FA);
|
||||
updatefreq(_freq4, _step4, 0x019A, 0x03B6);
|
||||
_mod->setChannelFreq(_id | 0x000, BASE_FREQUENCY / _freq1);
|
||||
_mod->setChannelFreq(_id | 0x100, BASE_FREQUENCY / _freq2);
|
||||
_mod->setChannelFreq(_id | 0x200, BASE_FREQUENCY / _freq3);
|
||||
|
@ -987,7 +987,8 @@ private:
|
|||
};
|
||||
|
||||
#define CRCToSound(CRC, SOUND) \
|
||||
if (crc == CRC) return new SOUND
|
||||
if (crc == CRC) \
|
||||
return new SOUND
|
||||
|
||||
static V2A_Sound *findSound (unsigned long crc) {
|
||||
CRCToSound(0x8FAB08C4, V2A_Sound_SingleLooped(0x006C,0x2B58,0x016E,0x3F)); // Maniac 17
|
||||
|
@ -1165,7 +1166,7 @@ void Player_V2A::startSound(int nr) {
|
|||
assert(_scumm);
|
||||
byte *data = _scumm->getResourceAddress(rtSound, nr);
|
||||
assert(data);
|
||||
uint32 crc = GetCRC(data + 0x0A,READ_BE_UINT16(data + 0x08));
|
||||
uint32 crc = GetCRC(data + 0x0A, READ_BE_UINT16(data + 0x08));
|
||||
V2A_Sound *snd = findSound(crc);
|
||||
if (snd == NULL) {
|
||||
warning("player_v2a - sound %i not recognized yet (crc %08X)",nr,crc);
|
||||
|
|
|
@ -55,8 +55,7 @@ private:
|
|||
V2A_MAXSLOTS = 8
|
||||
};
|
||||
|
||||
struct soundSlot
|
||||
{
|
||||
struct soundSlot {
|
||||
int id;
|
||||
V2A_Sound *sound;
|
||||
};
|
||||
|
|
|
@ -28,10 +28,10 @@
|
|||
namespace Scumm {
|
||||
|
||||
static const uint16 note_freqs[4][12] = {
|
||||
{0x06B0,0x0650,0x05F4,0x05A0,0x054C,0x0500,0x04B8,0x0474,0x0434,0x03F8,0x03C0,0x0388},
|
||||
{0x0358,0x0328,0x02FA,0x02D0,0x02A6,0x0280,0x025C,0x023A,0x021A,0x01FC,0x01E0,0x01C4},
|
||||
{0x01AC,0x0194,0x017D,0x0168,0x0153,0x0140,0x012E,0x011D,0x010D,0x00FE,0x00F0,0x00E2},
|
||||
{0x00D6,0x00CA,0x00BE,0x00B4,0x00A9,0x00A0,0x0097,0x008E,0x0086,0x007F,0x00F0,0x00E2}
|
||||
{0x06B0, 0x0650, 0x05F4, 0x05A0, 0x054C, 0x0500, 0x04B8, 0x0474, 0x0434, 0x03F8, 0x03C0, 0x0388},
|
||||
{0x0358, 0x0328, 0x02FA, 0x02D0, 0x02A6, 0x0280, 0x025C, 0x023A, 0x021A, 0x01FC, 0x01E0, 0x01C4},
|
||||
{0x01AC, 0x0194, 0x017D, 0x0168, 0x0153, 0x0140, 0x012E, 0x011D, 0x010D, 0x00FE, 0x00F0, 0x00E2},
|
||||
{0x00D6, 0x00CA, 0x00BE, 0x00B4, 0x00A9, 0x00A0, 0x0097, 0x008E, 0x0086, 0x007F, 0x00F0, 0x00E2}
|
||||
};
|
||||
|
||||
Player_V3A::Player_V3A(ScummEngine *scumm) {
|
||||
|
|
|
@ -55,21 +55,18 @@ private:
|
|||
V3A_MAXSFX = 8
|
||||
};
|
||||
|
||||
struct musChan
|
||||
{
|
||||
struct musChan {
|
||||
int id;
|
||||
int dur;
|
||||
};
|
||||
|
||||
struct sfxChan
|
||||
{
|
||||
struct sfxChan {
|
||||
int id;
|
||||
int dur;
|
||||
// SFX will eventually have pitch bends
|
||||
};
|
||||
|
||||
struct instData
|
||||
{
|
||||
struct instData {
|
||||
char *_idat[6];
|
||||
uint16 _ilen[6];
|
||||
char *_ldat[6];
|
||||
|
|
|
@ -1297,11 +1297,9 @@ void ScummEngine::convertADResource(int type, int idx, byte *src_ptr, int size)
|
|||
if (instr[i*16 + 13])
|
||||
warning("Sound %d instrument %d uses percussion", idx, i);
|
||||
|
||||
debug(4, "Sound %d: instrument %d on channel %d.",
|
||||
idx, i, ch);
|
||||
debug(4, "Sound %d: instrument %d on channel %d.", idx, i, ch);
|
||||
|
||||
memcpy(ptr, ADLIB_INSTR_MIDI_HACK,
|
||||
sizeof(ADLIB_INSTR_MIDI_HACK));
|
||||
memcpy(ptr, ADLIB_INSTR_MIDI_HACK, sizeof(ADLIB_INSTR_MIDI_HACK));
|
||||
|
||||
ptr[5] += ch;
|
||||
ptr[28] += ch;
|
||||
|
@ -1463,7 +1461,6 @@ void ScummEngine::convertADResource(int type, int idx, byte *src_ptr, int size)
|
|||
src_ptr = track_data[ch];
|
||||
chunk_type = *src_ptr;
|
||||
|
||||
|
||||
if (current_note[ch] >= 0) {
|
||||
delay = mintime - curtime;
|
||||
curtime = mintime;
|
||||
|
@ -1474,11 +1471,10 @@ void ScummEngine::convertADResource(int type, int idx, byte *src_ptr, int size)
|
|||
current_note[ch] = -1;
|
||||
}
|
||||
|
||||
|
||||
switch (chunk_type) {
|
||||
case 1:
|
||||
/* Instrument definition */
|
||||
memcpy(current_instr[ch], src_ptr+1, 14);
|
||||
memcpy(current_instr[ch], src_ptr + 1, 14);
|
||||
src_ptr += 15;
|
||||
break;
|
||||
|
||||
|
@ -1645,8 +1641,7 @@ int ScummEngine::readSoundResourceSmallHeader(int type, int idx) {
|
|||
} else {
|
||||
total_size = size = _fileHandle.readUint32LE();
|
||||
tag = _fileHandle.readUint16LE();
|
||||
debug(4, " tag='%c%c', size=%d",
|
||||
(char) (tag & 0xff),
|
||||
debug(4, " tag='%c%c', size=%d", (char) (tag & 0xff),
|
||||
(char) ((tag >> 8) & 0xff), size);
|
||||
|
||||
if (tag == 0x4F52) { // RO
|
||||
|
@ -1657,8 +1652,7 @@ int ScummEngine::readSoundResourceSmallHeader(int type, int idx) {
|
|||
while (pos < total_size) {
|
||||
size = _fileHandle.readUint32LE();
|
||||
tag = _fileHandle.readUint16LE();
|
||||
debug(4, " tag='%c%c', size=%d",
|
||||
(char) (tag & 0xff),
|
||||
debug(4, " tag='%c%c', size=%d", (char) (tag & 0xff),
|
||||
(char) ((tag >> 8) & 0xff), size);
|
||||
pos += size;
|
||||
|
||||
|
@ -1725,7 +1719,6 @@ int ScummEngine::readSoundResourceSmallHeader(int type, int idx) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int ScummEngine::getResourceRoomNr(int type, int idx) {
|
||||
if (type == rtRoom)
|
||||
return idx;
|
||||
|
@ -1888,16 +1881,12 @@ void ScummEngine::lock(int type, int i) {
|
|||
if (!validateResource("Locking", type, i))
|
||||
return;
|
||||
res.flags[type][i] |= RF_LOCK;
|
||||
|
||||
// debug(1, "locking %d,%d", type, i);
|
||||
}
|
||||
|
||||
void ScummEngine::unlock(int type, int i) {
|
||||
if (!validateResource("Unlocking", type, i))
|
||||
return;
|
||||
res.flags[type][i] &= ~RF_LOCK;
|
||||
|
||||
// debug(1, "unlocking %d,%d", type, i);
|
||||
}
|
||||
|
||||
bool ScummEngine::isResourceInUse(int type, int i) const {
|
||||
|
@ -1940,8 +1929,6 @@ void ScummEngine::expireResources(uint32 size) {
|
|||
int best_type, best_res = 0;
|
||||
uint32 oldAllocatedSize;
|
||||
|
||||
// return;
|
||||
|
||||
if (_expire_counter != 0xFF) {
|
||||
_expire_counter = 0xFF;
|
||||
increaseResourceCounter();
|
||||
|
|
|
@ -960,7 +960,7 @@ void ScummEngine_v2::o2_drawSentence() {
|
|||
Common::Rect sentenceline;
|
||||
static char sentence[256];
|
||||
const byte *temp;
|
||||
int slot = getVerbSlot(VAR(VAR_SENTENCE_VERB),0);
|
||||
int slot = getVerbSlot(VAR(VAR_SENTENCE_VERB), 0);
|
||||
|
||||
if (!(_userState & 32))
|
||||
return;
|
||||
|
@ -983,7 +983,7 @@ void ScummEngine_v2::o2_drawSentence() {
|
|||
if (_verbs[slot].prep == 0xFF) {
|
||||
byte *ptr = getOBCDFromObject(VAR(VAR_SENTENCE_OBJECT1));
|
||||
assert(ptr);
|
||||
VAR(VAR_SENTENCE_PREPOSITION) = (*(ptr+12) >> 5);
|
||||
VAR(VAR_SENTENCE_PREPOSITION) = (*(ptr + 12) >> 5);
|
||||
} else
|
||||
VAR(VAR_SENTENCE_PREPOSITION) = _verbs[slot].prep;
|
||||
}
|
||||
|
|
|
@ -664,8 +664,7 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS
|
|||
warning("Sound mixer initialization failed");
|
||||
if (_midiDriver == MD_ADLIB ||
|
||||
_midiDriver == MD_PCSPK ||
|
||||
_midiDriver == MD_PCJR)
|
||||
{
|
||||
_midiDriver == MD_PCJR) {
|
||||
_midiDriver = MD_NULL;
|
||||
warning("MIDI driver depends on sound mixer, switching to null MIDI driver");
|
||||
}
|
||||
|
|
|
@ -1680,8 +1680,7 @@ int VorbisTrackInfo::play(SoundMixer *mixer, PlayingSoundHandle *handle, int sta
|
|||
ov_time_seek(&_ov_file, startFrame / 75.0);
|
||||
#endif
|
||||
return mixer->playVorbis(handle, &_ov_file,
|
||||
duration * ov_info(&_ov_file, -1)->rate / 75,
|
||||
true);
|
||||
duration * ov_info(&_ov_file, -1)->rate / 75, true);
|
||||
}
|
||||
|
||||
VorbisTrackInfo::~VorbisTrackInfo() {
|
||||
|
|
|
@ -592,8 +592,7 @@ void ScummEngine::addIntToStack(int var) {
|
|||
_msgPtrToAdd += sprintf((char *)_msgPtrToAdd, "%d", num);
|
||||
}
|
||||
|
||||
void ScummEngine::addVerbToStack(int var)
|
||||
{
|
||||
void ScummEngine::addVerbToStack(int var) {
|
||||
int num, k;
|
||||
|
||||
num = readVar(var);
|
||||
|
@ -611,8 +610,7 @@ void ScummEngine::addVerbToStack(int var)
|
|||
}
|
||||
}
|
||||
|
||||
void ScummEngine::addNameToStack(int var)
|
||||
{
|
||||
void ScummEngine::addNameToStack(int var) {
|
||||
int num;
|
||||
const byte *ptr = 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue