Commit 75ccd7a4 authored by nanahira's avatar nanahira

use miniaudio

parent c5650a69
...@@ -1898,6 +1898,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) { ...@@ -1898,6 +1898,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
return true; return true;
break; break;
} }
#ifdef YGOPRO_USE_AUDIO
case CHECKBOX_ENABLE_MUSIC: { case CHECKBOX_ENABLE_MUSIC: {
if(!mainGame->chkEnableMusic->isChecked()) if(!mainGame->chkEnableMusic->isChecked())
soundManager.StopBGM(); soundManager.StopBGM();
...@@ -1996,6 +1997,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) { ...@@ -1996,6 +1997,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
return true; return true;
break; break;
} }
#ifdef YGOPRO_USE_AUDIO
case SCROLL_VOLUME: { case SCROLL_VOLUME: {
mainGame->gameConf.sound_volume = (double)mainGame->scrSoundVolume->getPos() / 100; mainGame->gameConf.sound_volume = (double)mainGame->scrSoundVolume->getPos() / 100;
mainGame->gameConf.music_volume = (double)mainGame->scrMusicVolume->getPos() / 100; mainGame->gameConf.music_volume = (double)mainGame->scrMusicVolume->getPos() / 100;
...@@ -2004,6 +2006,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) { ...@@ -2004,6 +2006,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
return true; return true;
break; break;
} }
#endif
case SCROLL_TAB_HELPER: { case SCROLL_TAB_HELPER: {
rect<s32> pos = mainGame->tabHelper->getRelativePosition(); rect<s32> pos = mainGame->tabHelper->getRelativePosition();
mainGame->tabHelper->setRelativePosition(recti(0, mainGame->scrTabHelper->getPos() * -1, pos.LowerRightCorner.X, pos.LowerRightCorner.Y)); mainGame->tabHelper->setRelativePosition(recti(0, mainGame->scrTabHelper->getPos() * -1, pos.LowerRightCorner.X, pos.LowerRightCorner.Y));
......
...@@ -1423,7 +1423,7 @@ void Game::LoadConfig() { ...@@ -1423,7 +1423,7 @@ void Game::LoadConfig() {
gameConf.window_height = strtol(valbuf, nullptr, 10); gameConf.window_height = strtol(valbuf, nullptr, 10);
} else if(!std::strcmp(strbuf, "resize_popup_menu")) { } else if(!std::strcmp(strbuf, "resize_popup_menu")) {
gameConf.resize_popup_menu = strtol(valbuf, nullptr, 10) > 0; gameConf.resize_popup_menu = strtol(valbuf, nullptr, 10) > 0;
#ifdef YGOPRO_USE_IRRKLANG #ifdef YGOPRO_USE_AUDIO
} else if(!std::strcmp(strbuf, "enable_sound")) { } else if(!std::strcmp(strbuf, "enable_sound")) {
gameConf.enable_sound = strtol(valbuf, nullptr, 10) > 0; gameConf.enable_sound = strtol(valbuf, nullptr, 10) > 0;
} else if(!std::strcmp(strbuf, "sound_volume")) { } else if(!std::strcmp(strbuf, "sound_volume")) {
...@@ -1528,7 +1528,7 @@ void Game::SaveConfig() { ...@@ -1528,7 +1528,7 @@ void Game::SaveConfig() {
fprintf(fp, "window_width = %d\n", gameConf.window_width); fprintf(fp, "window_width = %d\n", gameConf.window_width);
fprintf(fp, "window_height = %d\n", gameConf.window_height); fprintf(fp, "window_height = %d\n", gameConf.window_height);
fprintf(fp, "resize_popup_menu = %d\n", gameConf.resize_popup_menu ? 1 : 0); fprintf(fp, "resize_popup_menu = %d\n", gameConf.resize_popup_menu ? 1 : 0);
#ifdef YGOPRO_USE_IRRKLANG #ifdef YGOPRO_USE_AUDIO
fprintf(fp, "enable_sound = %d\n", (chkEnableSound->isChecked() ? 1 : 0)); fprintf(fp, "enable_sound = %d\n", (chkEnableSound->isChecked() ? 1 : 0));
fprintf(fp, "enable_music = %d\n", (chkEnableMusic->isChecked() ? 1 : 0)); fprintf(fp, "enable_music = %d\n", (chkEnableMusic->isChecked() ? 1 : 0));
fprintf(fp, "#Volume of sound and music, between 0 and 100\n"); fprintf(fp, "#Volume of sound and music, between 0 and 100\n");
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
project "cminiaudio"
kind "StaticLib"
files { "*.c", "*.h" }
filter "system:linux"
links { "dl", "pthread", "m" }
include "lzma/." include "lzma/."
include "spmemvfs/." include "spmemvfs/."
if USE_AUDIO then
include "miniaudio/."
end
project "YGOPro" project "YGOPro"
kind "WindowedApp" kind "WindowedApp"
...@@ -8,10 +11,6 @@ project "YGOPro" ...@@ -8,10 +11,6 @@ project "YGOPro"
includedirs { "../ocgcore" } includedirs { "../ocgcore" }
links { "ocgcore", "clzma", "cspmemvfs", LUA_LIB_NAME, "sqlite3", "irrlicht", "freetype", "event" } links { "ocgcore", "clzma", "cspmemvfs", LUA_LIB_NAME, "sqlite3", "irrlicht", "freetype", "event" }
if BUILD_IKPMP3 then
links { "ikpmp3" }
end
if BUILD_EVENT then if BUILD_EVENT then
includedirs { "../event/include" } includedirs { "../event/include" }
else else
...@@ -40,29 +39,15 @@ project "YGOPro" ...@@ -40,29 +39,15 @@ project "YGOPro"
libdirs { SQLITE_LIB_DIR } libdirs { SQLITE_LIB_DIR }
end end
if USE_IRRKLANG then if USE_AUDIO then
defines { "YGOPRO_USE_IRRKLANG" } defines { "YGOPRO_USE_AUDIO" }
includedirs { IRRKLANG_INCLUDE_DIR } links { "cminiaudio" }
if not IRRKLANG_PRO then
libdirs { IRRKLANG_LIB_DIR }
end
end end
filter "system:windows" filter "system:windows"
defines { "_IRR_WCHAR_FILESYSTEM" } defines { "_IRR_WCHAR_FILESYSTEM" }
files "ygopro.rc" files "ygopro.rc"
libdirs { "$(DXSDK_DIR)Lib/x86" } libdirs { "$(DXSDK_DIR)Lib/x86" }
if USE_IRRKLANG then
links { "irrKlang" }
if IRRKLANG_PRO then
defines { "IRRKLANG_STATIC" }
filter { "not configurations:Debug" }
libdirs { IRRKLANG_PRO_RELEASE_LIB_DIR }
filter { "configurations:Debug" }
libdirs { IRRKLANG_PRO_DEBUG_LIB_DIR }
filter {}
end
end
links { "opengl32", "ws2_32", "winmm", "gdi32", "kernel32", "user32", "imm32" } links { "opengl32", "ws2_32", "winmm", "gdi32", "kernel32", "user32", "imm32" }
filter "not action:vs*" filter "not action:vs*"
buildoptions { "-std=c++14", "-fno-rtti" } buildoptions { "-std=c++14", "-fno-rtti" }
...@@ -75,12 +60,5 @@ project "YGOPro" ...@@ -75,12 +60,5 @@ project "YGOPro"
buildoptions { "--target=arm64-apple-macos12" } buildoptions { "--target=arm64-apple-macos12" }
linkoptions { "-arch arm64" } linkoptions { "-arch arm64" }
end end
if USE_IRRKLANG then
links { "irrklang" }
end
filter "system:linux" filter "system:linux"
links { "GL", "X11", "Xxf86vm" } links { "GL", "X11", "Xxf86vm" }
if USE_IRRKLANG then
links { "IrrKlang" }
linkoptions{ IRRKLANG_LINK_RPATH }
end
#include "sound_manager.h" #include "sound_manager.h"
#include "myfilesystem.h" #include "myfilesystem.h"
#ifdef IRRKLANG_STATIC
#include "../ikpmp3/ikpMP3.h"
#endif
namespace ygo { namespace ygo {
SoundManager soundManager; SoundManager soundManager;
bool SoundManager::Init() { bool SoundManager::Init() {
#ifdef YGOPRO_USE_IRRKLANG #ifdef YGOPRO_USE_AUDIO
bgm_scene = -1; bgm_scene = -1;
RefreshBGMList(); RefreshBGMList();
rnd.reset((unsigned int)std::time(nullptr)); rnd.reset((unsigned int)std::time(nullptr));
engineSound = irrklang::createIrrKlangDevice(); if(ma_engine_init(nullptr, &engineSound) || ma_engine_init(nullptr, &engineMusic)) {
engineMusic = irrklang::createIrrKlangDevice();
if(!engineSound || !engineMusic) {
return false; return false;
} else { } else {
#ifdef IRRKLANG_STATIC
irrklang::ikpMP3Init(engineMusic);
#endif
return true; return true;
} }
#endif // YGOPRO_USE_IRRKLANG #endif // YGOPRO_USE_AUDIO
// TODO: Implement other sound engines
return false; return false;
} }
void SoundManager::RefreshBGMList() { void SoundManager::RefreshBGMList() {
#ifdef YGOPRO_USE_AUDIO
RefershBGMDir(L"", BGM_DUEL); RefershBGMDir(L"", BGM_DUEL);
RefershBGMDir(L"duel", BGM_DUEL); RefershBGMDir(L"duel", BGM_DUEL);
RefershBGMDir(L"menu", BGM_MENU); RefershBGMDir(L"menu", BGM_MENU);
...@@ -36,6 +28,7 @@ void SoundManager::RefreshBGMList() { ...@@ -36,6 +28,7 @@ void SoundManager::RefreshBGMList() {
RefershBGMDir(L"disadvantage", BGM_DISADVANTAGE); RefershBGMDir(L"disadvantage", BGM_DISADVANTAGE);
RefershBGMDir(L"win", BGM_WIN); RefershBGMDir(L"win", BGM_WIN);
RefershBGMDir(L"lose", BGM_LOSE); RefershBGMDir(L"lose", BGM_LOSE);
#endif
} }
void SoundManager::RefershBGMDir(std::wstring path, int scene) { void SoundManager::RefershBGMDir(std::wstring path, int scene) {
std::wstring search = L"./sound/BGM/" + path; std::wstring search = L"./sound/BGM/" + path;
...@@ -48,134 +41,138 @@ void SoundManager::RefershBGMDir(std::wstring path, int scene) { ...@@ -48,134 +41,138 @@ void SoundManager::RefershBGMDir(std::wstring path, int scene) {
}); });
} }
void SoundManager::PlaySoundEffect(int sound) { void SoundManager::PlaySoundEffect(int sound) {
#ifdef YGOPRO_USE_IRRKLANG
if(!mainGame->chkEnableSound->isChecked()) if(!mainGame->chkEnableSound->isChecked())
return; return;
engineSound->setSoundVolume(mainGame->gameConf.sound_volume); char soundName[32];
switch(sound) { switch(sound) {
case SOUND_SUMMON: { case SOUND_SUMMON: {
engineSound->play2D("./sound/summon.wav"); strcpy(soundName, "summon");
break; break;
} }
case SOUND_SPECIAL_SUMMON: { case SOUND_SPECIAL_SUMMON: {
engineSound->play2D("./sound/specialsummon.wav"); strcpy(soundName, "specialsummon");
break; break;
} }
case SOUND_ACTIVATE: { case SOUND_ACTIVATE: {
engineSound->play2D("./sound/activate.wav"); strcpy(soundName, "activate");
break; break;
} }
case SOUND_SET: { case SOUND_SET: {
engineSound->play2D("./sound/set.wav"); strcpy(soundName, "set");
break; break;
} }
case SOUND_FILP: { case SOUND_FILP: {
engineSound->play2D("./sound/flip.wav"); strcpy(soundName, "flip");
break; break;
} }
case SOUND_REVEAL: { case SOUND_REVEAL: {
engineSound->play2D("./sound/reveal.wav"); strcpy(soundName, "reveal");
break; break;
} }
case SOUND_EQUIP: { case SOUND_EQUIP: {
engineSound->play2D("./sound/equip.wav"); strcpy(soundName, "equip");
break; break;
} }
case SOUND_DESTROYED: { case SOUND_DESTROYED: {
engineSound->play2D("./sound/destroyed.wav"); strcpy(soundName, "destroyed");
break; break;
} }
case SOUND_BANISHED: { case SOUND_BANISHED: {
engineSound->play2D("./sound/banished.wav"); strcpy(soundName, "banished");
break; break;
} }
case SOUND_TOKEN: { case SOUND_TOKEN: {
engineSound->play2D("./sound/token.wav"); strcpy(soundName, "token");
break; break;
} }
case SOUND_ATTACK: { case SOUND_ATTACK: {
engineSound->play2D("./sound/attack.wav"); strcpy(soundName, "attack");
break; break;
} }
case SOUND_DIRECT_ATTACK: { case SOUND_DIRECT_ATTACK: {
engineSound->play2D("./sound/directattack.wav"); strcpy(soundName, "directattack");
break; break;
} }
case SOUND_DRAW: { case SOUND_DRAW: {
engineSound->play2D("./sound/draw.wav"); strcpy(soundName, "draw");
break; break;
} }
case SOUND_SHUFFLE: { case SOUND_SHUFFLE: {
engineSound->play2D("./sound/shuffle.wav"); strcpy(soundName, "shuffle");
break; break;
} }
case SOUND_DAMAGE: { case SOUND_DAMAGE: {
engineSound->play2D("./sound/damage.wav"); strcpy(soundName, "damage");
break; break;
} }
case SOUND_RECOVER: { case SOUND_RECOVER: {
engineSound->play2D("./sound/gainlp.wav"); strcpy(soundName, "recover");
break; break;
} }
case SOUND_COUNTER_ADD: { case SOUND_COUNTER_ADD: {
engineSound->play2D("./sound/addcounter.wav"); strcpy(soundName, "addcounter");
break; break;
} }
case SOUND_COUNTER_REMOVE: { case SOUND_COUNTER_REMOVE: {
engineSound->play2D("./sound/removecounter.wav"); strcpy(soundName, "removecounter");
break; break;
} }
case SOUND_COIN: { case SOUND_COIN: {
engineSound->play2D("./sound/coinflip.wav"); strcpy(soundName, "coin");
break; break;
} }
case SOUND_DICE: { case SOUND_DICE: {
engineSound->play2D("./sound/diceroll.wav"); strcpy(soundName, "dice");
break; break;
} }
case SOUND_NEXT_TURN: { case SOUND_NEXT_TURN: {
engineSound->play2D("./sound/nextturn.wav"); strcpy(soundName, "nextturn");
break; break;
} }
case SOUND_PHASE: { case SOUND_PHASE: {
engineSound->play2D("./sound/phase.wav"); strcpy(soundName, "phase");
break; break;
} }
case SOUND_MENU: { case SOUND_MENU: {
engineSound->play2D("./sound/menu.wav"); strcpy(soundName, "menu");
break; break;
} }
case SOUND_BUTTON: { case SOUND_BUTTON: {
engineSound->play2D("./sound/button.wav"); strcpy(soundName, "button");
break; break;
} }
case SOUND_INFO: { case SOUND_INFO: {
engineSound->play2D("./sound/info.wav"); strcpy(soundName, "info");
break; break;
} }
case SOUND_QUESTION: { case SOUND_QUESTION: {
engineSound->play2D("./sound/question.wav"); strcpy(soundName, "question");
break; break;
} }
case SOUND_CARD_PICK: { case SOUND_CARD_PICK: {
engineSound->play2D("./sound/cardpick.wav"); strcpy(soundName, "cardpick");
break; break;
} }
case SOUND_CARD_DROP: { case SOUND_CARD_DROP: {
engineSound->play2D("./sound/carddrop.wav"); strcpy(soundName, "carddrop");
break; break;
} }
case SOUND_PLAYER_ENTER: { case SOUND_PLAYER_ENTER: {
engineSound->play2D("./sound/playerenter.wav"); strcpy(soundName, "playerenter");
break; break;
} }
case SOUND_CHAT: { case SOUND_CHAT: {
engineSound->play2D("./sound/chatmessage.wav"); strcpy(soundName, "chat");
break; break;
} }
default: default:
break; break;
} }
char soundPath[40];
snprintf(soundPath, 40, "./sound/%s.wav", soundName);
#ifdef YGOPRO_USE_AUDIO
ma_engine_set_volume(&engineSound, mainGame->gameConf.sound_volume);
auto res = ma_engine_play_sound(&engineSound, soundPath, nullptr);
#endif #endif
} }
void SoundManager::PlayDialogSound(irr::gui::IGUIElement * element) { void SoundManager::PlayDialogSound(irr::gui::IGUIElement * element) {
...@@ -201,25 +198,39 @@ void SoundManager::PlayDialogSound(irr::gui::IGUIElement * element) { ...@@ -201,25 +198,39 @@ void SoundManager::PlayDialogSound(irr::gui::IGUIElement * element) {
PlaySoundEffect(SOUND_QUESTION); PlaySoundEffect(SOUND_QUESTION);
} }
} }
bool SoundManager::IsCurrentlyPlaying(char* song) {
#ifdef YGOPRO_USE_AUDIO
return currentPlayingMusic[0] && strcmp(currentPlayingMusic, song) == 0 && ma_sound_is_playing(&soundBGM);
#endif
return false;
}
void SoundManager::PlayMusic(char* song, bool loop) { void SoundManager::PlayMusic(char* song, bool loop) {
#ifdef YGOPRO_USE_IRRKLANG #ifdef YGOPRO_USE_AUDIO
if(!mainGame->chkEnableMusic->isChecked()) if(!mainGame->chkEnableMusic->isChecked())
return; return;
if(!engineMusic->isCurrentlyPlaying(song)) { if(!IsCurrentlyPlaying(song)) {
engineMusic->stopAllSounds(); StopBGM();
engineMusic->setSoundVolume(mainGame->gameConf.music_volume); strcpy(currentPlayingMusic, song);
soundBGM = engineMusic->play2D(song, loop, false, true); #ifdef _WIN32
wchar_t song_w[1024];
BufferIO::DecodeUTF8(song, song_w);
ma_sound_init_from_file_w(&engineMusic, song_w, MA_SOUND_FLAG_ASYNC | MA_SOUND_FLAG_STREAM, nullptr, nullptr, &soundBGM);
#else
ma_sound_init_from_file(&engineMusic, song, MA_SOUND_FLAG_ASYNC | MA_SOUND_FLAG_STREAM, nullptr, nullptr, &soundBGM);
#endif
ma_sound_set_looping(&soundBGM, loop);
ma_sound_start(&soundBGM);
} }
#endif #endif
} }
void SoundManager::PlayBGM(int scene) { void SoundManager::PlayBGM(int scene) {
#ifdef YGOPRO_USE_IRRKLANG #ifdef YGOPRO_USE_AUDIO
if(!mainGame->chkEnableMusic->isChecked()) if(!mainGame->chkEnableMusic->isChecked())
return; return;
if(!mainGame->chkMusicMode->isChecked()) if(!mainGame->chkMusicMode->isChecked())
scene = BGM_ALL; scene = BGM_ALL;
char BGMName[1024]; char BGMName[1024];
if(scene != bgm_scene || (soundBGM && soundBGM->isFinished())) { if(scene != bgm_scene || !IsCurrentlyPlaying(currentPlayingMusic)) {
int count = BGMList[scene].size(); int count = BGMList[scene].size();
if(count <= 0) if(count <= 0)
return; return;
...@@ -234,18 +245,21 @@ void SoundManager::PlayBGM(int scene) { ...@@ -234,18 +245,21 @@ void SoundManager::PlayBGM(int scene) {
#endif #endif
} }
void SoundManager::StopBGM() { void SoundManager::StopBGM() {
#ifdef YGOPRO_USE_IRRKLANG #ifdef YGOPRO_USE_AUDIO
engineMusic->stopAllSounds(); if(!currentPlayingMusic[0])
return;
memset(currentPlayingMusic, 0, sizeof(currentPlayingMusic));
ma_sound_uninit(&soundBGM);
#endif #endif
} }
void SoundManager::SetSoundVolume(double volume) { void SoundManager::SetSoundVolume(double volume) {
#ifdef YGOPRO_USE_IRRKLANG #ifdef YGOPRO_USE_AUDIO
engineSound->setSoundVolume(volume); ma_engine_set_volume(&engineSound, volume);
#endif #endif
} }
void SoundManager::SetMusicVolume(double volume) { void SoundManager::SetMusicVolume(double volume) {
#ifdef YGOPRO_USE_IRRKLANG #ifdef YGOPRO_USE_AUDIO
engineMusic->setSoundVolume(volume); ma_engine_set_volume(&engineMusic, volume);
#endif #endif
} }
} }
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
#include "game.h" #include "game.h"
#include "../ocgcore/mtrandom.h" #include "../ocgcore/mtrandom.h"
#ifdef YGOPRO_USE_IRRKLANG #ifdef YGOPRO_USE_AUDIO
#include <irrKlang.h> #define MINIAUDIO_IMPLEMENTATION
#include "miniaudio/miniaudio.h"
#endif #endif
namespace ygo { namespace ygo {
...@@ -14,10 +15,11 @@ private: ...@@ -14,10 +15,11 @@ private:
std::vector<std::wstring> BGMList[8]; std::vector<std::wstring> BGMList[8];
int bgm_scene; int bgm_scene;
mt19937 rnd; mt19937 rnd;
#ifdef YGOPRO_USE_IRRKLANG #ifdef YGOPRO_USE_AUDIO
irrklang::ISoundEngine* engineSound; ma_engine engineSound;
irrklang::ISoundEngine* engineMusic; ma_engine engineMusic;
irrklang::ISound* soundBGM; ma_sound soundBGM;
char currentPlayingMusic[1024]{};
#endif #endif
void RefershBGMDir(std::wstring path, int scene); void RefershBGMDir(std::wstring path, int scene);
...@@ -26,6 +28,7 @@ public: ...@@ -26,6 +28,7 @@ public:
void RefreshBGMList(); void RefreshBGMList();
void PlaySoundEffect(int sound); void PlaySoundEffect(int sound);
void PlayDialogSound(irr::gui::IGUIElement * element); void PlayDialogSound(irr::gui::IGUIElement * element);
bool IsCurrentlyPlaying(char* song);
void PlayMusic(char* song, bool loop); void PlayMusic(char* song, bool loop);
void PlayBGM(int scene); void PlayBGM(int scene);
void StopBGM(); void StopBGM();
......
Subproject commit fe48b4fbbf9c84c459eca432de494a5bcef1c276 Subproject commit 7b7b95c582fa71f01154a0afcdf0d85f4516e35a
...@@ -5,8 +5,6 @@ BUILD_EVENT = os.istarget("windows") ...@@ -5,8 +5,6 @@ BUILD_EVENT = os.istarget("windows")
BUILD_FREETYPE = os.istarget("windows") BUILD_FREETYPE = os.istarget("windows")
BUILD_SQLITE = os.istarget("windows") BUILD_SQLITE = os.istarget("windows")
BUILD_IRRLICHT = not os.istarget("macosx") BUILD_IRRLICHT = not os.istarget("macosx")
USE_IRRKLANG = true
IRRKLANG_PRO = false
LUA_LIB_NAME = "lua" LUA_LIB_NAME = "lua"
-- read settings from command line or environment variables -- read settings from command line or environment variables
...@@ -37,11 +35,6 @@ newoption { trigger = "no-build-irrlicht", category = "YGOPro - irrlicht", descr ...@@ -37,11 +35,6 @@ newoption { trigger = "no-build-irrlicht", category = "YGOPro - irrlicht", descr
newoption { trigger = "irrlicht-include-dir", category = "YGOPro - irrlicht", description = "", value = "PATH" } newoption { trigger = "irrlicht-include-dir", category = "YGOPro - irrlicht", description = "", value = "PATH" }
newoption { trigger = "irrlicht-lib-dir", category = "YGOPro - irrlicht", description = "", value = "PATH" } newoption { trigger = "irrlicht-lib-dir", category = "YGOPro - irrlicht", description = "", value = "PATH" }
newoption { trigger = "use-irrklang", category = "YGOPro - irrklang", description = "" }
newoption { trigger = "no-use-irrklang", category = "YGOPro - irrklang", description = "" }
newoption { trigger = "irrklang-include-dir", category = "YGOPro - irrklang", description = "", value = "PATH" }
newoption { trigger = "irrklang-lib-dir", category = "YGOPro - irrklang", description = "", value = "PATH" }
newoption { trigger = "irrklang-pro", category = "YGOPro - irrklang - pro", description = "" } newoption { trigger = "irrklang-pro", category = "YGOPro - irrklang - pro", description = "" }
newoption { trigger = "no-irrklang-pro", category = "YGOPro - irrklang - pro", description = "" } newoption { trigger = "no-irrklang-pro", category = "YGOPro - irrklang - pro", description = "" }
newoption { trigger = "irrklang-pro-release-lib-dir", category = "YGOPro - irrklang - pro", description = "", value = "PATH" } newoption { trigger = "irrklang-pro-release-lib-dir", category = "YGOPro - irrklang - pro", description = "", value = "PATH" }
...@@ -113,36 +106,7 @@ if not BUILD_IRRLICHT then ...@@ -113,36 +106,7 @@ if not BUILD_IRRLICHT then
IRRLICHT_LIB_DIR = GetParam("irrlicht-lib-dir") or "/usr/local/lib" IRRLICHT_LIB_DIR = GetParam("irrlicht-lib-dir") or "/usr/local/lib"
end end
if GetParam("use-irrklang") then USE_AUDIO = not GetParam("no-audio")
USE_IRRKLANG = true
elseif GetParam("no-use-irrklang") then
USE_IRRKLANG = false
end
if USE_IRRKLANG then
IRRKLANG_INCLUDE_DIR = GetParam("irrklang-include-dir") or "../irrklang/include"
if os.istarget("windows") then
IRRKLANG_LIB_DIR = "../irrklang/lib/Win32-visualStudio"
elseif os.istarget("linux") then
IRRKLANG_LIB_DIR = "../irrklang/bin/linux-gcc-64"
IRRKLANG_LINK_RPATH = "-Wl,-rpath=./irrklang/bin/linux-gcc-64/"
elseif os.istarget("macosx") then
IRRKLANG_LIB_DIR = "../irrklang/bin/macosx-gcc"
end
IRRKLANG_LIB_DIR = GetParam("irrklang-lib-dir") or IRRKLANG_LIB_DIR
end
if GetParam("irrklang-pro") and os.istarget("windows") then
IRRKLANG_PRO = true
elseif GetParam("no-irrklang-pro") then
IRRKLANG_PRO = false
end
if IRRKLANG_PRO then
-- irrklang pro can't use the pro lib to debug
IRRKLANG_PRO_RELEASE_LIB_DIR = GetParam("irrklang-pro-release-lib-dir") or "../irrklang/lib/Win32-vs2019"
IRRKLANG_PRO_DEBUG_LIB_DIR = GetParam("irrklang-pro-debug-lib-dir") or "../irrklang/lib/Win32-visualStudio-debug"
end
BUILD_IKPMP3 = USE_IRRKLANG and (GetParam("build-ikpmp3") or IRRKLANG_PRO)
if GetParam("winxp-support") and os.istarget("windows") then if GetParam("winxp-support") and os.istarget("windows") then
WINXP_SUPPORT = true WINXP_SUPPORT = true
...@@ -232,6 +196,6 @@ workspace "YGOPro" ...@@ -232,6 +196,6 @@ workspace "YGOPro"
if BUILD_SQLITE then if BUILD_SQLITE then
include "sqlite3" include "sqlite3"
end end
if BUILD_IKPMP3 then --if BUILD_IKPMP3 then
include "ikpmp3" -- include "ikpmp3"
end --end
Subproject commit 5d9d3779b34df5937ea9db039b68e6e440d461ec Subproject commit 4dfd94e07dfab9cbbc6f41ffa3043eda52181e34
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment