Fixes in SDL_Mixer

This commit is contained in:
Rob Loach 2017-06-27 22:22:26 -04:00
parent 6285b85801
commit 174c2be736
No known key found for this signature in database
GPG Key ID: 627C60834A74A21A
3 changed files with 10 additions and 7 deletions

View File

@ -64,6 +64,7 @@ OBJECTS := libretro.o Application.o \
chaigame/script.o \
chaigame/filesystem.o \
chaigame/image.o \
chaigame/sound.o \
chaigame/system.o \
chaigame/src/ImageData.o \
chaigame/src/Image.o \
@ -78,11 +79,13 @@ else
endif
LDFLAGS += $(fpic) $(SHARED) \
vendor/sdl-libretro/libSDL_$(SDL_PREFIX).a \
vendor/sdl-libretro/libSDL_gfx_$(SDL_PREFIX).a \
vendor/sdl-libretro/SDL_image_$(SDL_PREFIX).a \
vendor/sdl-libretro/libSDL_mixer_$(SDL_PREFIX).a \
vendor/sdl-libretro/libSDL_$(SDL_PREFIX).a \
vendor/physfs/libphysfs.a \
-ldl -ljpeg -lpng \
-lmikmod -lvorbisfile -logg \
-lpthread $(EXTRA_LDF)
FLAGS += -I. \
-Ivendor/sdl-libretro/include \

View File

@ -1,11 +1,12 @@
#include <SDL.h>
//#include <SDL_mixer.h>
#include <SDL_mixer.h>
#include "sound.h"
namespace chaigame {
bool sound::load() {
/*int flags = MIX_INIT_OGG;// | MIX_INIT_MOD;
int flags = MIX_INIT_OGG | MIX_INIT_MOD;
int initted = Mix_Init(flags);
if (initted&flags != flags) {
printf("Mix_Init: Failed to init required ogg and mod support!\n");
@ -16,11 +17,11 @@ namespace chaigame {
if (Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 1024) == -1) {
printf("Mix_OpenAudio: %s\n", Mix_GetError());
return false;
}*/
}
return true;
}
bool sound::unload() {
//Mix_Quit();
Mix_CloseAudio();
Mix_Quit();
}
}

View File

@ -2,7 +2,6 @@
#define _SOUND_H_INCLUDED_
#include <SDL.h>
#include <SDL_mixer.h>
namespace chaigame {
class sound {