X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2FSound.c;h=4a79925e1603ecd943b1d88f1114eb2bc552b1a8;hb=98d421667c21a07ab69dd881f1435c2f595ddd4c;hp=b17c41936a5ce69cdec7cc7254a22f3a7c9c5a15;hpb=315fd934929b6f1dbb70a6ae3cda097cdbc7d9c0;p=rocksndiamonds.git diff --git a/src/game_sp/Sound.c b/src/game_sp/Sound.c index b17c4193..4a79925e 100644 --- a/src/game_sp/Sound.c +++ b/src/game_sp/Sound.c @@ -4,210 +4,11 @@ #include "Sound.h" -// static char *VB_Name = "modSound"; -// --- Option Explicit - -int MusicOnFlag; -int FXOnFlag; - -#if 0 - -DirectSoundBuffer ZonkFX[1 + 1]; -DirectSoundBuffer InfotronFX[1 + 1]; -DirectSoundBuffer BugFX[1 + 1]; -DirectSoundBuffer ExplosionFX[1 + 1]; -DirectSoundBuffer PushFX; -DirectSoundBuffer ExitFX; -DirectSoundBuffer BaseFX; - -#endif - -void LoadSoundFX() -{ - -#if 0 - - DSBUFFERDESC bufferDesc; - WAVEFORMATEX waveFormat; - char *FName; - int i; - - bufferDesc.lFlags = DSBCAPS_CTRLFREQUENCY | DSBCAPS_CTRLPAN | DSBCAPS_CTRLVOLUME | DSBCAPS_STATIC; - waveFormat.nFormatTag = WAVE_FORMAT_PCM; - waveFormat.nChannels = 1; - waveFormat.lSamplesPerSec = 8000; - waveFormat.nBitsPerSample = 8; - waveFormat.nBlockAlign = waveFormat.nBitsPerSample / 8 * waveFormat.nChannels; - waveFormat.lAvgBytesPerSec = waveFormat.lSamplesPerSec * waveFormat.nBlockAlign; - FName = CAT(App.Path, "/Sound/"); - for (i = 0; i <= 1; i++) - { - ZonkFX[i] = DSound.CreateSoundBufferFromFile(CAT(FName, "Zonk.wav"), bufferDesc, waveFormat); - InfotronFX[i] = DSound.CreateSoundBufferFromFile(CAT(FName, "Infotron.wav"), bufferDesc, waveFormat); - BugFX[i] = DSound.CreateSoundBufferFromFile(CAT(FName, "Bug.wav"), bufferDesc, waveFormat); - ExplosionFX[i] = DSound.CreateSoundBufferFromFile(CAT(FName, "Explosion.wav"), bufferDesc, waveFormat); - } - - BaseFX = DSound.CreateSoundBufferFromFile(CAT(FName, "Base.wav"), bufferDesc, waveFormat); - ExitFX = DSound.CreateSoundBufferFromFile(CAT(FName, "Exit.wav"), bufferDesc, waveFormat); - PushFX = DSound.CreateSoundBufferFromFile(CAT(FName, "Push.wav"), bufferDesc, waveFormat); - // FXOnFlag = 0 - -#endif - -} - -void subSoundFXZonk() -{ -#if 0 - - int i; - - if (FXOnFlag == 0) - return; - - for (i = 0; i <= 1; i++) - { - if (! IS_NOTHING(&ZonkFX[i], sizeof(ZonkFX[i]))) - { - if (ZonkFX[i].GetStatus() != DSBSTATUS_PLAYING) - { - ZonkFX[i].Play DSBPLAY_DEFAULT; - break; - } - } - } - -#endif -} - -void subSoundFXBug() -{ -#if 0 - - int i; - - if (FXOnFlag == 0) - return; - - for (i = 0; i <= 1; i++) - { - if (! IS_NOTHING(&BugFX[i], sizeof(BugFX[i]))) - { - if (BugFX[i].GetStatus() != DSBSTATUS_PLAYING) - { - BugFX[i].Play DSBPLAY_DEFAULT; - break; - } - } - } - -#endif -} - -void subSoundFXInfotron() -{ -#if 0 - - int i; - - if (FXOnFlag == 0) - return; - - for (i = 0; i <= 1; i++) - { - if (! IS_NOTHING(&InfotronFX[i], sizeof(InfotronFX[i]))) - { - if (InfotronFX[i].GetStatus() != DSBSTATUS_PLAYING) - { - InfotronFX[i].Play DSBPLAY_DEFAULT; - break; - } - } - } - -#endif -} - -void subSoundFXExplosion() -{ -#if 0 - - int i; - - if (FXOnFlag == 0) - return; - - for (i = 0; i <= 1; i++) - { - if (! IS_NOTHING(&ExplosionFX[i], sizeof(ExplosionFX[i]))) - { - if (ExplosionFX[i].GetStatus() != DSBSTATUS_PLAYING) - { - ExplosionFX[i].Play DSBPLAY_DEFAULT; - break; - } - } - } - -#endif -} - -void subSoundFXBase() +void subSoundFX(int si, int element, int action) { -#if 0 - - if (FXOnFlag == 0) - return; - - if (IS_NOTHING(&BaseFX, sizeof(BaseFX))) - return; - - if (BaseFX.GetStatus() != DSBSTATUS_PLAYING) - { - BaseFX.Play DSBPLAY_DEFAULT; - } - -#endif -} + int x = GetX(si); + int y = GetY(si); -void subSoundFXPush() -{ -#if 0 - - if (FXOnFlag == 0) - return; - - if (IS_NOTHING(&PushFX, sizeof(PushFX))) - return; - - if (PushFX.GetStatus() != DSBSTATUS_PLAYING) - { - PushFX.Play DSBPLAY_DEFAULT; - } - -#endif -} - -void subSoundFXExit() -{ -#if 0 - - if (FXOnFlag == 0) - return; - - if (IS_NOTHING(&ExitFX, sizeof(ExitFX))) - return; - - if (ExitFX.GetStatus() != DSBSTATUS_PLAYING) - { - ExitFX.Play DSBPLAY_DEFAULT; - } - -#endif -} - -void subMusicInit() -{ + PlayLevelSound_SP(x, y, element, action); }