Made AudioPlayer's play and init method static

This commit is contained in:
andreja6
2018-04-26 21:41:07 -07:00
parent 78cdb01ef1
commit 6d49e266dd
3 changed files with 19 additions and 14 deletions

View File

@@ -5,9 +5,19 @@
#include <malloc.h>
#include <string.h>
#define NUM_SOUNDS 10
SDL_AudioSpec fmt;
static SDL_AudioSpec fmt;
AudioPlayer::AudioPlayer(void)
{
}
AudioPlayer::~AudioPlayer(void)
{
SDL_CloseAudio();
}
void AudioPlayer::init()
{
extern void mixaudio(void *unused, Uint8 *stream, int len);
fmt.freq = 22050;
@@ -25,12 +35,7 @@ AudioPlayer::AudioPlayer(void)
SDL_PauseAudio(0);
}
AudioPlayer::~AudioPlayer(void)
{
SDL_CloseAudio();
}
struct sample {
static struct sample {
Uint8 *data;
Uint32 dpos;
Uint32 dlen;