diff --git a/SourceX/sound.cpp b/SourceX/sound.cpp index 2346a0c45..ccc3baa89 100644 --- a/SourceX/sound.cpp +++ b/SourceX/sound.cpp @@ -52,7 +52,7 @@ BOOL __fastcall snd_playing(TSnd *pSnd) void __fastcall snd_play_snd(TSnd *pSnd, int lVolume, int lPan) { - Mix_PlayChannel(-1, pSnd->chunk, 0); + Mix_PlayChannel(-1, (void*)(pSnd->DSB), 0); } TSnd *__fastcall sound_file_load(char *path) @@ -72,7 +72,8 @@ TSnd *__fastcall sound_file_load(char *path) Mix_Chunk *SoundFX = Mix_LoadWAV_RW(rw, 1); TSnd *fx = malloc(sizeof(TSnd)); - fx->chunk = SoundFX; + memset(fx, 0, sizeof(TSnd)); + fx->DSB = (void*)SoundFX; fx->start_tc = 0; fx->sound_path = NULL; diff --git a/structs.h b/structs.h index 2068b2b5e..0293485e9 100644 --- a/structs.h +++ b/structs.h @@ -443,7 +443,6 @@ typedef struct CKINFO { DWORD dwOffset; } CKINFO; -#ifndef DEVILUTION_STUB // Hack for SDL_mixer typedef struct TSnd { WAVEFORMATEX fmt; CKINFO chunk; @@ -451,14 +450,6 @@ typedef struct TSnd { LPDIRECTSOUNDBUFFER DSB; int start_tc; } TSnd; -#else -struct Mix_Chunk; -typedef struct TSnd { - char *sound_path; - Mix_Chunk *chunk; - int start_tc; -} TSnd; -#endif #pragma pack(push, 1) typedef struct TSFX {