Miniaudio Implementation (+stb_vorbis) (#624)
* Miniaudio Implementation * Do not link miles + remove miles lib
This commit is contained in:
@@ -4,6 +4,8 @@ class Options;
|
||||
using namespace std;
|
||||
#include "..\..\Minecraft.World\SoundTypes.h"
|
||||
|
||||
#include "miniaudio.h"
|
||||
|
||||
enum eMUSICFILES
|
||||
{
|
||||
eStream_Overworld_Calm1 = 0,
|
||||
@@ -76,7 +78,11 @@ enum MUSIC_STREAMSTATE
|
||||
|
||||
typedef struct
|
||||
{
|
||||
#ifndef _WINDOWS64
|
||||
F32 x,y,z,volume,pitch;
|
||||
#else
|
||||
float x,y,z,volume,pitch;
|
||||
#endif
|
||||
int iSound;
|
||||
bool bIs3D;
|
||||
bool bUseSoundsPitchVal;
|
||||
@@ -86,6 +92,17 @@ typedef struct
|
||||
}
|
||||
AUDIO_INFO;
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
struct MiniAudioSound
|
||||
{
|
||||
ma_sound sound;
|
||||
AUDIO_INFO info;
|
||||
bool active;
|
||||
};
|
||||
|
||||
extern std::vector<MiniAudioSound*> m_activeSounds;
|
||||
#endif
|
||||
|
||||
class SoundEngine : public ConsoleSoundEngine
|
||||
{
|
||||
static const int MAX_SAME_SOUNDS_PLAYING = 8; // 4J added
|
||||
@@ -112,7 +129,7 @@ public:
|
||||
int getMusicID(int iDomain);
|
||||
int getMusicID(const wstring& name);
|
||||
void SetStreamingSounds(int iOverworldMin, int iOverWorldMax, int iNetherMin, int iNetherMax, int iEndMin, int iEndMax, int iCD1);
|
||||
void updateMiles(); // AP added so Vita can update all the Miles functions during the mixer callback
|
||||
void updateMiniAudio();
|
||||
void playMusicUpdate();
|
||||
|
||||
private:
|
||||
@@ -126,9 +143,10 @@ private:
|
||||
|
||||
int GetRandomishTrack(int iStart,int iEnd);
|
||||
|
||||
HMSOUNDBANK m_hBank;
|
||||
HDIGDRIVER m_hDriver;
|
||||
HSTREAM m_hStream;
|
||||
ma_engine m_engine;
|
||||
ma_engine_config m_engineConfig;
|
||||
ma_sound m_musicStream;
|
||||
bool m_musicStreamActive;
|
||||
|
||||
static char m_szSoundPath[];
|
||||
static char m_szMusicPath[];
|
||||
@@ -165,4 +183,4 @@ private:
|
||||
#ifdef __ORBIS__
|
||||
int32_t m_hBGMAudio;
|
||||
#endif
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user