This commit is contained in:
nukeykt 2019-09-19 22:38:28 +09:00 committed by Christoph Oelckers
parent 6c9e6a3bfc
commit bf07930b8c
5 changed files with 23 additions and 15 deletions

View file

@ -502,7 +502,11 @@ int32_t MV_GetFrequency(int32_t handle, int32_t *frequency)
if (voice == NULL || !frequency)
return MV_Error;
if (voice->SamplingRate == 0)
voice->GetSound(voice);
*frequency = voice->SamplingRate;
MV_EndService();
return MV_Ok;
}

View file

@ -1860,6 +1860,8 @@ int app_main(int argc, char const* const* argv)
SetupInput();
InitView();
myloadconfig();
InitFX();
LoadFX();
setCDaudiovolume(gMusicVolume);
seq_LoadSequences();
InitStatus();
@ -1877,9 +1879,6 @@ int app_main(int argc, char const* const* argv)
ResetEngine();
EraseScreen(overscanindex);
InitFX();
LoadFX();
ResetView();
GrabPalette();

View file

@ -191,6 +191,8 @@ int seq_ReadSequence(const char *seqName)
SeqBase[sequences + i] += frames;
}
short vdi = frames;
int16_t nFrames;
kread(hFile, &nFrames, sizeof(nFrames));
@ -269,10 +271,9 @@ int seq_ReadSequence(const char *seqName)
kread(hFile, &var_28, sizeof(var_28));
kread(hFile, &var_2C, sizeof(var_2C));
int hSound = 0;
// int hSound = LoadSound();
int hSound = LoadSound(&buffer[(var_2C&0x1FF)*10]);
FrameSound[frames + var_28] = hSound | (var_2C & 0xFE00);
FrameSound[vdi + var_28] = hSound | (var_2C & 0xFE00);
}
}

View file

@ -746,8 +746,8 @@ void UpdateSounds()
}
else
{
dx = sprite[nSoundSprite].x-pASound->f_1e;
dy = sprite[nSoundSprite].y-pASound->f_22;
dx = x-sprite[nSoundSprite].x;
dy = y-sprite[nSoundSprite].y;
}
dx >>= 8;
@ -815,14 +815,17 @@ void UpdateSounds()
if (nCreaturesLeft > 0 && !(SectFlag[nPlayerViewSect[nLocalPlayer]]&0x2000))
{
int vsi = seq_GetFrameSound(SeqOffsets[kSeqCreepy], totalmoves%SeqSize[SeqOffsets[kSeqCreepy]]);
int vdx = (totalmoves+32)&31;
if (totalmoves & 1)
vdx = -vdx;
int vax = (totalmoves+32)&63;
if (totalmoves & 2)
vax = -vax;
if (vsi >= 0 && (vsi&0x1ff) < kMaxSounds)
{
int vdx = (totalmoves+32)&31;
if (totalmoves & 1)
vdx = -vdx;
int vax = (totalmoves+32)&63;
if (totalmoves & 2)
vax = -vax;
PlayFXAtXYZ(vsi, pSprite->x+vdx, pSprite->y+vax, pSprite->z, pSprite->sectnum);
PlayFXAtXYZ(vsi, pSprite->x+vdx, pSprite->y+vax, pSprite->z, pSprite->sectnum);
}
}
nCreepyTimer = 450;
}

View file

@ -103,6 +103,7 @@ int GetLocalSound();
void UpdateLocalSound();
void StopLocalSound();
void PlayLocalSound(short nSound, short val);
int LoadSound(const char* sound);
void BendAmbientSound();
void CheckAmbience(short nSector);