Commit 6b00efd9 authored by Momobako's avatar Momobako

Merge branch 'koishibuild' of https://github.com/purerosefallen/ygopro-7210srv into koishibuild

parents 61a03de2 09d6b3fe
/bak/
/bin/
/build/
/event/
/freetype/
/gframe/ygopro.ico
/gframe/ygopro.rc
/gframe/ygopro.aps
/gframe/__iob_func_fix.cpp
/irrlicht/
/lua/
/obj/
/sqlite3/
/irrklang/
/ikpmp3/
premake5.exe
version: '{build}'
environment:
irrklang_pro:
secure: l0At/QtuW8XgdROZSAt4b3/pIssTVQ+EDpisjFzaaTUiWwBVDwE10C1bWuNqxk6O0Q54H0ZTBq0ZUXLNEx+59tRNe2F/KAbPjlFELry7gFI=
irrklang_pro_user:
secure: TOWMXao5dXWg9MVdlEYaGjIeT6McnHodbNSO7DIJCfU=
install:
- git submodule update --init --recursive
......@@ -30,16 +36,25 @@ install:
- 7z x sqlite-amalgamation-3200100.zip
- move sqlite-amalgamation-3200100 sqlite3
#- 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 irrklang
- 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
- 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 irrklang
- move irrKlang-1.5.0\plugins\ikpMP3 ikpmp3
# let premake happy
- xcopy /E premake\* .
# patch irrlicht
- patch -p0 < irrlicht\irrlicht.patch
- patch -p0 < ikpmp3\ikpmp3.patch
# premake
- premake5 vs2015
......@@ -52,8 +67,6 @@ build:
after_build:
- git checkout master
- mv -f bin/release/ygopro.exe .
- mv -f irrklang\bin\win32-visualStudio\irrKlang.dll .
- mv -f irrklang\bin\win32-visualStudio\ikpMP3.dll .
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/purerosefallen/windbot/archive/master.zip ; exit 0"
- 7z x windbot-master.zip
......@@ -91,7 +104,7 @@ after_build:
- rm -rf pics/thumbnail pics/*.db
- mkdir replay
- 7z a -mx9 -xr!.git* YGOPro-by-Koishi.7z ygopro.exe LICENSE README.md lflist.conf strings.conf system.conf cards.cdb script textures deck single pics replay sound irrKlang.dll ikpMP3.dll WindBot Bot.exe bot.conf
- 7z a -mx9 -xr!.git* YGOPro-by-Koishi.7z ygopro.exe LICENSE README.md lflist.conf strings.conf system.conf cards.cdb script textures deck single pics replay sound WindBot Bot.exe bot.conf
test: off
......@@ -117,3 +130,7 @@ cache:
- lua-5.2.4.tar.gz
- sqlite-amalgamation-3200100.zip
- irrKlang-32bit-1.5.0.zip
- irrKlang-pro-1.5.0.zip
- sqlite-amalgamation-3150200.zip
- premake-5.0.0-alpha10-windows.zip
- Redis-x64-3.2.100.zip
......@@ -49,6 +49,9 @@ inline int _wtoi(const wchar_t * s) {
#include <irrlicht.h>
#include <irrKlang.h>
#ifdef IRRKLANG_STATIC
#include "../ikpMP3/ikpMP3.h"
#endif
#include <GL/gl.h>
#include <GL/glu.h>
#include "CGUITTFont.h"
......
......@@ -664,6 +664,12 @@ bool Game::Initialize() {
}
engineSound = irrklang::createIrrKlangDevice();
engineMusic = irrklang::createIrrKlangDevice();
#ifdef IRRKLANG_STATIC
if(engineMusic) {
irrklang::ikpMP3Init(engineSound);
irrklang::ikpMP3Init(engineMusic);
}
#endif
if(!engineSound || !engineMusic) {
chkEnableSound->setChecked(false);
chkEnableSound->setEnabled(false);
......@@ -1085,6 +1091,8 @@ void Game::LoadConfig() {
gameConf.separate_clear_button = 1;
gameConf.auto_search_limit = 0;
gameConf.chkIgnoreDeckChanges = 0;
gameConf.defaultOT = 1;
gameConf.enable_bot_mode = 1;
gameConf.enable_sound = true;
gameConf.sound_volume = 0.5;
gameConf.enable_music = true;
......
......@@ -6,13 +6,23 @@ project "ygopro"
files { "**.cpp", "**.cc", "**.c", "**.h" }
excludes "lzma/**"
includedirs { "../ocgcore" }
links { "ocgcore", "clzma", "Irrlicht", "freetype", "sqlite3", "lua" , "event", "irrKlang"}
links { "ocgcore", "clzma", "Irrlicht", "freetype", "sqlite3", "lua" , "event" }
configuration "windows"
files "ygopro.rc"
excludes "CGUIButton.cpp"
includedirs { "../irrlicht/include", "../freetype/include", "../event/include", "../sqlite3", "../irrklang/include" }
libdirs { "../irrklang/lib/Win32-visualStudio" }
includedirs { "../irrlicht/include", "../freetype/include", "../event/include", "../sqlite3" }
if USE_IRRKLANG then
defines { "YGOPRO_USE_IRRKLANG" }
links { "irrKlang", "ikpMP3" }
includedirs { "../irrklang/include" }
if IRRKLANG_PRO then
defines { "IRRKLANG_STATIC" }
libdirs { "../irrklang/bin/win32-visualstudio_lib" }
else
libdirs { "../irrklang/lib/Win32-visualStudio" }
end
end
links { "opengl32", "ws2_32", "winmm", "gdi32", "kernel32", "user32", "imm32" }
configuration {"windows", "not vs*"}
includedirs { "/mingw/include/irrlicht", "/mingw/include/freetype2" }
......
// fix irrklang static lib don't support VS2015
// http://blog.csdn.net/10km/article/details/50528908
#if _MSC_VER >= 1900
#include "stdio.h"
_ACRTIMP_ALT FILE* __cdecl __acrt_iob_func(unsigned);
#ifdef __cplusplus
extern "C"
#endif
FILE* __cdecl __iob_func(unsigned i) {
return __acrt_iob_func(i);
}
#endif // _MSC_VER >= 1900
#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 -ur ikpmp3/CIrrKlangAudioStreamMP3.cpp ikpmp3-static/CIrrKlangAudioStreamMP3.cpp
--- ikpmp3/CIrrKlangAudioStreamMP3.cpp 2009-01-02 07:33:40.000000000 +0800
+++ ikpmp3-static/CIrrKlangAudioStreamMP3.cpp 2017-11-27 19:18:34.295546800 +0800
@@ -8,6 +8,7 @@
#include <memory.h>
#include <stdlib.h> // free, malloc and realloc
#include <string.h>
+#include <algorithm>
namespace irrklang
{
diff -ur ikpmp3/ikpMP3.cpp ikpmp3-static/ikpMP3.cpp
--- ikpmp3/ikpMP3.cpp 2007-10-28 18:14:00.000000000 +0800
+++ ikpmp3-static/ikpMP3.cpp 2017-11-27 19:49:02.119092400 +0800
@@ -6,30 +6,14 @@
using namespace irrklang;
-// 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'.
-
#ifdef WIN32
// Windows version
-__declspec(dllexport) void __stdcall irrKlangPluginInit(ISoundEngine* engine, const char* version)
+extern "C" __declspec(dllexport) void ikpMP3Init(ISoundEngine* engine)
#else
// Linux version
-void irrKlangPluginInit(ISoundEngine* engine, const char* version)
+extern "C" void ikpMP3Init(ISoundEngine* engine)
#endif
{
- // 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;
- }
-
// create and register the loader
CIrrKlangAudioStreamLoaderMP3* loader = new CIrrKlangAudioStreamLoaderMP3();
project "ikpMP3"
kind "StaticLib"
files { "*.cpp", "*.h", "decoder/*.c", "decoder/*.h" }
includedirs { "../irrklang/include" }
......@@ -3,6 +3,12 @@ solution "ygo"
language "C++"
objdir "obj"
USE_IRRKLANG = true
if os.getenv("irrklang_pro") then
IRRKLANG_PRO = true
end
configurations { "Debug", "Release" }
configuration "windows"
......@@ -67,4 +73,7 @@ solution "ygo"
include "irrlicht"
include "lua"
include "sqlite3"
if IRRKLANG_PRO then
include "ikpmp3"
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