cleanups
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1756 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -50,19 +50,24 @@ typedef struct {
|
|||||||
void fill_audio(void *u, Uint8 *stream, int len);
|
void fill_audio(void *u, Uint8 *stream, int len);
|
||||||
|
|
||||||
unsigned long clocks_per_sec = 1000;
|
unsigned long clocks_per_sec = 1000;
|
||||||
unsigned long get_clock()
|
|
||||||
|
unsigned long
|
||||||
|
get_clock()
|
||||||
{
|
{
|
||||||
return (SDL_GetTicks());
|
return (SDL_GetTicks());
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_sound ()
|
void
|
||||||
|
init_sound ()
|
||||||
{
|
{
|
||||||
if (SDL_Init(SDL_INIT_AUDIO) < 0) {
|
if (SDL_Init(SDL_INIT_AUDIO) < 0) {
|
||||||
fprintf(stderr,"could not initialize SDL audio\n");
|
fprintf(stderr,"could not initialize SDL audio\n");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WAVESTRUCT *play_sound(AUDIOHDR *audiohdr)
|
|
||||||
|
WAVESTRUCT *
|
||||||
|
play_sound(AUDIOHDR *audiohdr)
|
||||||
{
|
{
|
||||||
WAVESTRUCT *WaveData = new WAVESTRUCT;
|
WAVESTRUCT *WaveData = new WAVESTRUCT;
|
||||||
/*
|
/*
|
||||||
@@ -89,19 +94,22 @@ WAVESTRUCT *play_sound(AUDIOHDR *audiohdr)
|
|||||||
return (WaveData);
|
return (WaveData);
|
||||||
}
|
}
|
||||||
|
|
||||||
void pause_sound(WAVESTRUCT *WaveData)
|
void
|
||||||
|
pause_sound(WAVESTRUCT *WaveData)
|
||||||
{
|
{
|
||||||
if (WaveData)
|
if (WaveData)
|
||||||
SDL_PauseAudio(1);
|
SDL_PauseAudio(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void unpause_sound (WAVESTRUCT *WaveData)
|
void
|
||||||
|
unpause_sound (WAVESTRUCT *WaveData)
|
||||||
{
|
{
|
||||||
if (WaveData)
|
if (WaveData)
|
||||||
SDL_PauseAudio(0);
|
SDL_PauseAudio(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void reset_sound (WAVESTRUCT *WaveData)
|
void
|
||||||
|
reset_sound (WAVESTRUCT *WaveData)
|
||||||
{
|
{
|
||||||
if (WaveData) {
|
if (WaveData) {
|
||||||
SDL_CloseAudio();
|
SDL_CloseAudio();
|
||||||
@@ -109,6 +117,7 @@ void reset_sound (WAVESTRUCT *WaveData)
|
|||||||
delete WaveData;
|
delete WaveData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
void fill_audio (void *u, Uint8 *stream, int len)
|
void fill_audio (void *u, Uint8 *stream, int len)
|
||||||
{
|
{
|
||||||
@@ -129,7 +138,8 @@ void fill_audio (void *u, Uint8 *stream, int len)
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void fill_audio (void *u, Uint8 *stream, int len)
|
void
|
||||||
|
fill_audio (void *u, Uint8 *stream, int len)
|
||||||
{
|
{
|
||||||
Sint16 *b;
|
Sint16 *b;
|
||||||
int l, i;
|
int l, i;
|
||||||
@@ -144,3 +154,4 @@ void fill_audio (void *u, Uint8 *stream, int len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user