Commit 1375e5f0 authored by mercury233's avatar mercury233

test ikpmp3 static

parent 9d87b675
...@@ -47,13 +47,18 @@ install: ...@@ -47,13 +47,18 @@ install:
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name -u %irrklang_pro_user% %irrklang_pro% ; exit 0" - bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name -u %irrklang_pro_user% %irrklang_pro% ; exit 0"
- 7z x irrKlang-pro-1.5.0.zip - 7z x irrKlang-pro-1.5.0.zip
- move irrKlang-pro-1.5.0 irrklang - move irrKlang-pro-1.5.0 irrklang
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name http://www.ambiera.at/downloads/irrKlang-32bit-1.5.0.zip ; exit 0"
- 7z x irrKlang-32bit-1.5.0.zip
- move irrKlang-1.5.0\plugins\ikpMP3 ikpmp3
# let premake happy # let premake happy
- xcopy /E premake\* . - xcopy /E premake\* .
# patch irrlicht # patch irrlicht
- patch -p0 < irrlicht\irrlicht.patch - patch -p0 < irrlicht\irrlicht.patch
- patch -p0 < ikpmp3\ikpmp3.patch
# premake # premake
- premake5 vs2015 - premake5 vs2015
......
...@@ -49,6 +49,9 @@ inline int _wtoi(const wchar_t * s) { ...@@ -49,6 +49,9 @@ inline int _wtoi(const wchar_t * s) {
#include <irrlicht.h> #include <irrlicht.h>
#include <irrKlang.h> #include <irrKlang.h>
#ifdef IRRKLANG_STATIC
#include "../ikpMP3/ikpMP3.h"
#endif
#include <GL/gl.h> #include <GL/gl.h>
#include <GL/glu.h> #include <GL/glu.h>
#include "CGUITTFont.h" #include "CGUITTFont.h"
......
...@@ -679,6 +679,12 @@ bool Game::Initialize() { ...@@ -679,6 +679,12 @@ bool Game::Initialize() {
} }
engineSound = irrklang::createIrrKlangDevice(); engineSound = irrklang::createIrrKlangDevice();
engineMusic = irrklang::createIrrKlangDevice(); engineMusic = irrklang::createIrrKlangDevice();
#ifdef IRRKLANG_STATIC
if(engineMusic) {
irrklang::ikpMP3Init(engineSound);
irrklang::ikpMP3Init(engineMusic);
}
#endif
if(!engineSound || !engineMusic) { if(!engineSound || !engineMusic) {
chkEnableSound->setChecked(false); chkEnableSound->setChecked(false);
chkEnableSound->setEnabled(false); chkEnableSound->setEnabled(false);
......
...@@ -14,7 +14,7 @@ project "ygopro" ...@@ -14,7 +14,7 @@ project "ygopro"
includedirs { "../irrlicht/include", "../freetype/include", "../event/include", "../sqlite3" } includedirs { "../irrlicht/include", "../freetype/include", "../event/include", "../sqlite3" }
if USE_IRRKLANG then if USE_IRRKLANG then
defines { "YGOPRO_USE_IRRKLANG" } defines { "YGOPRO_USE_IRRKLANG" }
links { "irrKlang" } links { "irrKlang", "ikpMP3" }
includedirs { "../irrklang/include" } includedirs { "../irrklang/include" }
if IRRKLANG_PRO then if IRRKLANG_PRO then
defines { "IRRKLANG_STATIC" } defines { "IRRKLANG_STATIC" }
......
#include <irrKlang.h>
namespace irrklang
{
#ifdef WIN32
// Windows version
extern "C" __declspec(dllexport) void ikpMP3Init(ISoundEngine* engine);
#else
// Linux version
extern "C" void ikpMP3Init(ISoundEngine* engine);
#endif
}
\ No newline at end of file
diff -r ikpmp3/CIrrKlangAudioStreamMP3.cpp ikpmp3-static/CIrrKlangAudioStreamMP3.cpp
10a11
> #include <algorithm>
diff -r ikpmp3/ikpMP3.cpp ikpmp3-static/ikpMP3.cpp
9,14d8
< // this is the only function needed to be implemented for the plugin, it gets
< // called by irrKlang when loaded.
< // In this plugin, we create an audiostream loader class and register
< // it at the engine, but a plugin can do anything.
< // Be sure to name the function 'irrKlangPluginInit' and let the dll start with 'ikp'.
<
17c11
< __declspec(dllexport) void __stdcall irrKlangPluginInit(ISoundEngine* engine, const char* version)
---
> extern "C" __declspec(dllexport) void ikpMP3Init(ISoundEngine* engine)
20c14
< void irrKlangPluginInit(ISoundEngine* engine, const char* version)
---
> extern "C" void ikpMP3Init(ISoundEngine* engine)
23,32d16
< // do some version security check to be sure that this plugin isn't begin used
< // by some newer irrKlang version with changed interfaces which could possibily
< // cause crashes.
<
< if (strcmp(version, IRR_KLANG_VERSION))
< {
< printf("This MP3 plugin only supports irrKlang version %s, mp3 playback disabled.\n", IRR_KLANG_VERSION);
< return;
< }
<
...@@ -70,4 +70,7 @@ solution "ygo" ...@@ -70,4 +70,7 @@ solution "ygo"
include "irrlicht" include "irrlicht"
include "lua" include "lua"
include "sqlite3" include "sqlite3"
if IRRKLANG_PRO then
include "ikpmp3"
end
end end
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