mirror of
https://github.com/libretro/libretro-chailove.git
synced 2024-11-30 11:40:44 +00:00
Add sound
This commit is contained in:
parent
fbbffabbf2
commit
6285b85801
@ -24,6 +24,7 @@ Application* Application::getInstance() {
|
||||
|
||||
void Application::quit(void) {
|
||||
filesystem.unload();
|
||||
sound.unload();
|
||||
image.unload();
|
||||
// Tell SDL to quit.
|
||||
SDL_Quit();
|
||||
@ -57,6 +58,7 @@ bool Application::load(const std::string& file) {
|
||||
keyboard.load();
|
||||
graphics.load();
|
||||
image.load();
|
||||
sound.load();
|
||||
filesystem.load(file);
|
||||
|
||||
// ChaiScript.
|
||||
|
@ -17,6 +17,7 @@ public:
|
||||
chaigame::graphics graphics;
|
||||
chaigame::image image;
|
||||
chaigame::system system;
|
||||
chaigame::sound sound;
|
||||
|
||||
void quit(void);
|
||||
bool load(const std::string& file);
|
||||
|
@ -6,7 +6,9 @@
|
||||
#include "image.h"
|
||||
#include "keyboard.h"
|
||||
#include "script.h"
|
||||
#include "sound.h"
|
||||
#include "system.h"
|
||||
#include "sound.h"
|
||||
#include "src/Image.h"
|
||||
#include "src/ImageData.h"
|
||||
|
||||
|
26
chaigame/sound.cpp
Normal file
26
chaigame/sound.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
#include <SDL.h>
|
||||
//#include <SDL_mixer.h>
|
||||
|
||||
#include "sound.h"
|
||||
|
||||
namespace chaigame {
|
||||
bool sound::load() {
|
||||
/*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");
|
||||
printf("Mix_Init: %s\n", Mix_GetError());
|
||||
return false;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
15
chaigame/sound.h
Normal file
15
chaigame/sound.h
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef _SOUND_H_INCLUDED_
|
||||
#define _SOUND_H_INCLUDED_
|
||||
|
||||
#include <SDL.h>
|
||||
#include <SDL_mixer.h>
|
||||
|
||||
namespace chaigame {
|
||||
class sound {
|
||||
public:
|
||||
bool load();
|
||||
bool unload();
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user