Browse Source

Finish removing SDL dependency from engine

pull/25/head
Xadhoom 7 years ago committed by Anders Jenbo
parent
commit
0cf61cff5c
  1. 5
      SourceX/sound.cpp
  2. 9
      structs.h

5
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;

9
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 {

Loading…
Cancel
Save