Commit 9b7f26b8 authored by nanahira's avatar nanahira Committed by GitHub

Merge branch 'master' into patch-miniaudio

parents c7d6b2a5 3415b1f5
name: Automated Test Build
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build-windows:
strategy:
fail-fast: false
matrix:
os: [windows-2019, windows-2022]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository with submodules
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: true
- name: Update submodules
run: |
cd ocgcore
git checkout master
git pull origin master
cd ..
# cd script
# git checkout master
# git pull origin master
# cd ..
- name: Download premake
id: premake
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://github.com/premake/premake-core/releases/download/v5.0.0-beta5/premake-5.0.0-beta5-windows.zip
filename: premake5.zip
- name: Extract premake
run: |
7z x ${{ steps.premake.outputs.filepath }}
- name: Download libevent
id: libevent
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
filename: libevent.tar.gz
- name: Extract libevent
run: |
tar xf ${{ steps.libevent.outputs.filepath }}
move libevent-2.0.22-stable event
xcopy /E event\WIN32-Code event\include
- name: Download freetype
id: freetype
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: http://downloads.sourceforge.net/freetype/freetype-2.13.3.tar.gz
- name: Extract freetype
run: |
tar xf ${{ steps.freetype.outputs.filepath }}
move freetype-2.13.3 freetype
- name: Download lua
id: lua
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://www.lua.org/ftp/lua-5.4.7.tar.gz
- name: Extract lua
run: |
tar xf ${{ steps.lua.outputs.filepath }}
move lua-5.4.7 lua
- name: Download sqlite
id: sqlite
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://www.sqlite.org/2025/sqlite-amalgamation-3490100.zip
- name: Extract sqlite
run: |
7z x ${{ steps.sqlite.outputs.filepath }}
move sqlite-amalgamation-3490100 sqlite3
- name: Download irrKlang
id: irrKlang
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://www.ambiera.at/downloads/irrKlang-32bit-1.6.0.zip
- name: Extract irrKlang
run: |
7z x ${{ steps.irrKlang.outputs.filepath }}
move irrKlang-1.6.0 irrKlang
- name: Download irrlicht
run: |
git clone --depth=1 https://github.com/mercury233/irrlicht
- name: Check DirectX SDK
id: dxsdk
uses: actions/cache@v4
with:
key: dxsdk
path: DXSDK
- name: Download DirectX SDK
if: steps.dxsdk.outputs.cache-hit != 'true'
id: dxsdk-download
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://download.microsoft.com/download/a/e/7/ae743f1f-632b-4809-87a9-aa1bb3458e31/DXSDK_Jun10.exe
- name: Install DirectX SDK
if: steps.dxsdk.outputs.cache-hit != 'true'
run: |
7z x ${{ steps.dxsdk-download.outputs.filepath }} -aoa
- name: Set DirectX SDK environment variable
run: |
$dxsdkPath = Resolve-Path 'DXSDK'
"DXSDK_DIR=$($dxsdkPath.ProviderPath)\" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Copy premake files
run: |
xcopy /E premake\* .
- name: Use premake to generate Visual Studio solution (2019)
if: matrix.os == 'windows-2019'
run: |
.\premake5.exe vs2019 --winxp-support
- name: Use premake to generate Visual Studio solution (2022)
if: matrix.os == 'windows-2022'
run: |
.\premake5.exe vs2022
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Build solution
run: |
MSBuild.exe build\YGOPro.sln /m /p:Configuration=Release
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: YGOPro-${{ matrix.os }}
path: |
bin/release/YGOPro.exe
build-linux:
strategy:
fail-fast: false
matrix:
os:
# - ubuntu-20.04
- ubuntu-22.04
- ubuntu-24.04
include:
# - os: ubuntu-20.04
# premake_version: 5.0.0-beta2
- os: ubuntu-22.04
premake_version: 5.0.0-beta4
- os: ubuntu-24.04
premake_version: 5.0.0-beta5
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository with submodules
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: true
- name: Update submodules
run: |
cd ocgcore
git checkout master
git pull origin master
cd ..
# cd script
# git checkout master
# git pull origin master
# cd ..
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libevent-dev libfreetype6-dev libgl1-mesa-dev libglu1-mesa-dev libsqlite3-dev libxxf86vm-dev
- name: Download premake
id: premake
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://github.com/premake/premake-core/releases/download/v${{ matrix.premake_version }}/premake-${{ matrix.premake_version }}-linux.tar.gz
filename: premake5.tar.gz
- name: Extract premake
run: |
tar xf ${{ steps.premake.outputs.filepath }}
chmod +x ./premake5
- name: Download lua
id: lua
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://www.lua.org/ftp/lua-5.4.7.tar.gz
- name: Extract lua
run: |
tar xf ${{ steps.lua.outputs.filepath }}
mv lua-5.4.7 lua
- name: Download irrlicht
run: |
git clone --depth=1 https://github.com/mercury233/irrlicht
- name: Copy premake files
run: |
cp -r premake/* .
- name: Use premake to generate make files
run: |
./premake5 gmake \
--no-use-irrklang \
--freetype-include-dir="/usr/include/freetype2"
- name: Make
run: |
cd build
make -j 4 config=release
cd ..
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: YGOPro-${{ matrix.os }}
path: |
bin/release/YGOPro
build-macos:
strategy:
fail-fast: false
matrix:
os:
- macos-13
- macos-15
include:
- os: macos-13
premake_version: 5.0.0-beta5
- os: macos-15
premake_version: 5.0.0-beta5
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository with submodules
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: true
- name: Update submodules
run: |
cd ocgcore
git checkout master
git pull origin master
cd ..
# cd script
# git checkout master
# git pull origin master
# cd ..
# - name: Install dependencies
# run: |
# brew install freetype libevent libx11 sqlite zlib
- name: Download premake
id: premake
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://github.com/premake/premake-core/releases/download/v${{ matrix.premake_version }}/premake-${{ matrix.premake_version }}-macosx.tar.gz
filename: premake5.tar.gz
- name: Extract premake
run: |
tar xf ${{ steps.premake.outputs.filepath }}
chmod +x ./premake5
- name: Download lua
id: lua
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://www.lua.org/ftp/lua-5.4.7.tar.gz
- name: Extract lua
run: |
tar xf ${{ steps.lua.outputs.filepath }}
mv lua-5.4.7 lua
- name: Download irrlicht
run: |
git clone --depth=1 https://github.com/mercury233/irrlicht
- name: Build irrlicht
run: |
cd irrlicht/source/Irrlicht/MacOSX
xcodebuild -project MacOSX.xcodeproj
cd ../../../..
- name: Copy premake files
run: |
cp -r premake/* .
- name: Use premake to generate make files (Intel)
if: runner.arch == 'X64'
run: |
./premake5 gmake \
--cc=clang \
--no-use-irrklang \
--freetype-include-dir="/usr/local/include/freetype2" \
--irrlicht-include-dir="../irrlicht/include" \
--irrlicht-lib-dir="../irrlicht/source/Irrlicht/MacOSX/build/Release"
- name: Use premake to generate make files (ARM64)
if: runner.arch == 'ARM64'
run: |
./premake5 gmake \
--cc=clang \
--no-use-irrklang \
--event-include-dir="/opt/homebrew/include" \
--event-lib-dir="/opt/homebrew/lib" \
--freetype-include-dir="/opt/homebrew/include/freetype2" \
--freetype-lib-dir="/opt/homebrew/lib" \
--sqlite-include-dir="/opt/homebrew/opt/sqlite/include" \
--sqlite-lib-dir="/opt/homebrew/opt/sqlite/lib" \
--irrlicht-include-dir="../irrlicht/include" \
--irrlicht-lib-dir="../irrlicht/source/Irrlicht/MacOSX/build/Release"
- name: Make
run: |
cd build
make -j 3 config=release
cd ..
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: YGOPro-${{ matrix.os }}
path: |
bin/*
......@@ -83,6 +83,11 @@ void ClientField::Clear() {
for(auto cit = extra[i].begin(); cit != extra[i].end(); ++cit)
delete *cit;
extra[i].clear();
deck_act[i] = false;
grave_act[i] = false;
remove_act[i] = false;
extra_act[i] = false;
pzone_act[i] = false;
}
for(auto sit = overlay_cards.begin(); sit != overlay_cards.end(); ++sit)
delete *sit;
......@@ -108,12 +113,6 @@ void ClientField::Clear() {
hovered_controler = 0;
hovered_location = 0;
hovered_sequence = 0;
deck_act = false;
grave_act = false;
remove_act = false;
extra_act = false;
pzone_act[0] = false;
pzone_act[1] = false;
conti_act = false;
deck_reversed = false;
cant_check_grave = false;
......@@ -358,13 +357,14 @@ void ClientField::ClearCommandFlag() {
(*cit)->cmdFlag = 0;
for(auto cit = attackable_cards.begin(); cit != attackable_cards.end(); ++cit)
(*cit)->cmdFlag = 0;
for(int i = 0; i < 2; ++i) {
deck_act[i] = false;
extra_act[i] = false;
grave_act[i] = false;
remove_act[i] = false;
pzone_act[i] = false;
}
conti_cards.clear();
deck_act = false;
extra_act = false;
grave_act = false;
remove_act = false;
pzone_act[0] = false;
pzone_act[1] = false;
conti_act = false;
}
void ClientField::ClearSelect() {
......@@ -392,11 +392,14 @@ void ClientField::ClearChainSelect() {
(*cit)->is_selectable = false;
(*cit)->is_selected = false;
}
for(int i = 0; i < 2; ++i) {
deck_act[i] = false;
extra_act[i] = false;
grave_act[i] = false;
remove_act[i] = false;
pzone_act[i] = false;
}
conti_cards.clear();
deck_act = false;
grave_act = false;
remove_act = false;
extra_act = false;
conti_act = false;
}
// needs to be synchronized with EGET_SCROLL_BAR_CHANGED
......
......@@ -76,11 +76,11 @@ public:
std::vector<ClientCard*> display_cards;
std::vector<int> sort_list;
std::map<int, int> player_desc_hints[2];
bool grave_act{ false };
bool remove_act{ false };
bool deck_act{ false };
bool extra_act{ false };
bool pzone_act[2]{};
bool grave_act[2]{ false };
bool remove_act[2]{ false };
bool deck_act[2]{ false };
bool extra_act[2]{ false };
bool pzone_act[2]{ false };
bool conti_act{ false };
bool chain_forced{ false };
ChainInfo current_chain;
......
......@@ -428,43 +428,38 @@ void Game::DrawMisc() {
im.setRotationRadians(act_rot);
matManager.mTexture.setTexture(0, imageManager.tAct);
driver->setMaterial(matManager.mTexture);
if(dField.deck_act) {
im.setTranslation(irr::core::vector3df((matManager.vFieldDeck[0][0].Pos.X + matManager.vFieldDeck[0][1].Pos.X) / 2,
(matManager.vFieldDeck[0][0].Pos.Y + matManager.vFieldDeck[0][2].Pos.Y) / 2, dField.deck[0].size() * 0.01f + 0.02f));
driver->setTransform(irr::video::ETS_WORLD, im);
driver->drawVertexPrimitiveList(matManager.vActivate, 4, matManager.iRectangle, 2);
}
if(dField.grave_act) {
im.setTranslation(irr::core::vector3df((matManager.vFieldGrave[0][rule][0].Pos.X + matManager.vFieldGrave[0][rule][1].Pos.X) / 2,
(matManager.vFieldGrave[0][rule][0].Pos.Y + matManager.vFieldGrave[0][rule][2].Pos.Y) / 2, dField.grave[0].size() * 0.01f + 0.02f));
driver->setTransform(irr::video::ETS_WORLD, im);
driver->drawVertexPrimitiveList(matManager.vActivate, 4, matManager.iRectangle, 2);
}
if(dField.remove_act) {
im.setTranslation(irr::core::vector3df((matManager.vFieldRemove[0][rule][0].Pos.X + matManager.vFieldRemove[0][rule][1].Pos.X) / 2,
(matManager.vFieldRemove[0][rule][0].Pos.Y + matManager.vFieldRemove[0][rule][2].Pos.Y) / 2, dField.remove[0].size() * 0.01f + 0.02f));
driver->setTransform(irr::video::ETS_WORLD, im);
driver->drawVertexPrimitiveList(matManager.vActivate, 4, matManager.iRectangle, 2);
}
if(dField.extra_act) {
im.setTranslation(irr::core::vector3df((matManager.vFieldExtra[0][0].Pos.X + matManager.vFieldExtra[0][1].Pos.X) / 2,
(matManager.vFieldExtra[0][0].Pos.Y + matManager.vFieldExtra[0][2].Pos.Y) / 2, dField.extra[0].size() * 0.01f + 0.02f));
driver->setTransform(irr::video::ETS_WORLD, im);
driver->drawVertexPrimitiveList(matManager.vActivate, 4, matManager.iRectangle, 2);
}
if(dField.pzone_act[0]) {
int seq = dInfo.duel_rule >= 4 ? 0 : 6;
im.setTranslation(irr::core::vector3df((matManager.vFieldSzone[0][seq][rule][0].Pos.X + matManager.vFieldSzone[0][seq][rule][1].Pos.X) / 2,
(matManager.vFieldSzone[0][seq][rule][0].Pos.Y + matManager.vFieldSzone[0][seq][rule][2].Pos.Y) / 2, 0.03f));
driver->setTransform(irr::video::ETS_WORLD, im);
driver->drawVertexPrimitiveList(matManager.vActivate, 4, matManager.iRectangle, 2);
}
if(dField.pzone_act[1]) {
int seq = dInfo.duel_rule >= 4 ? 0 : 6;
im.setTranslation(irr::core::vector3df((matManager.vFieldSzone[1][seq][rule][0].Pos.X + matManager.vFieldSzone[1][seq][rule][1].Pos.X) / 2,
(matManager.vFieldSzone[1][seq][rule][0].Pos.Y + matManager.vFieldSzone[1][seq][rule][2].Pos.Y) / 2, 0.03f));
driver->setTransform(irr::video::ETS_WORLD, im);
driver->drawVertexPrimitiveList(matManager.vActivate, 4, matManager.iRectangle, 2);
for(int player = 0; player < 2; ++player) {
if(dField.deck_act[player]) {
im.setTranslation(irr::core::vector3df((matManager.vFieldDeck[player][0].Pos.X + matManager.vFieldDeck[player][1].Pos.X) / 2,
(matManager.vFieldDeck[player][0].Pos.Y + matManager.vFieldDeck[player][2].Pos.Y) / 2, dField.deck[player].size() * 0.01f + 0.02f));
driver->setTransform(irr::video::ETS_WORLD, im);
driver->drawVertexPrimitiveList(matManager.vActivate, 4, matManager.iRectangle, 2);
}
if(dField.grave_act[player]) {
im.setTranslation(irr::core::vector3df((matManager.vFieldGrave[player][rule][0].Pos.X + matManager.vFieldGrave[player][rule][1].Pos.X) / 2,
(matManager.vFieldGrave[player][rule][0].Pos.Y + matManager.vFieldGrave[player][rule][2].Pos.Y) / 2, dField.grave[player].size() * 0.01f + 0.02f));
driver->setTransform(irr::video::ETS_WORLD, im);
driver->drawVertexPrimitiveList(matManager.vActivate, 4, matManager.iRectangle, 2);
}
if(dField.remove_act[player]) {
im.setTranslation(irr::core::vector3df((matManager.vFieldRemove[player][rule][0].Pos.X + matManager.vFieldRemove[player][rule][1].Pos.X) / 2,
(matManager.vFieldRemove[player][rule][0].Pos.Y + matManager.vFieldRemove[player][rule][2].Pos.Y) / 2, dField.remove[player].size() * 0.01f + 0.02f));
driver->setTransform(irr::video::ETS_WORLD, im);
driver->drawVertexPrimitiveList(matManager.vActivate, 4, matManager.iRectangle, 2);
}
if(dField.extra_act[player]) {
im.setTranslation(irr::core::vector3df((matManager.vFieldExtra[player][0].Pos.X + matManager.vFieldExtra[player][1].Pos.X) / 2,
(matManager.vFieldExtra[player][0].Pos.Y + matManager.vFieldExtra[player][2].Pos.Y) / 2, dField.extra[player].size() * 0.01f + 0.02f));
driver->setTransform(irr::video::ETS_WORLD, im);
driver->drawVertexPrimitiveList(matManager.vActivate, 4, matManager.iRectangle, 2);
}
if(dField.pzone_act[player]) {
int seq = dInfo.duel_rule >= 4 ? 0 : 6;
im.setTranslation(irr::core::vector3df((matManager.vFieldSzone[player][seq][rule][0].Pos.X + matManager.vFieldSzone[player][seq][rule][1].Pos.X) / 2,
(matManager.vFieldSzone[player][seq][rule][0].Pos.Y + matManager.vFieldSzone[player][seq][rule][2].Pos.Y) / 2, 0.03f));
driver->setTransform(irr::video::ETS_WORLD, im);
driver->drawVertexPrimitiveList(matManager.vActivate, 4, matManager.iRectangle, 2);
}
}
if(dField.conti_act) {
irr::core::vector3df pos = irr::core::vector3df((matManager.vFieldContiAct[0].X + matManager.vFieldContiAct[1].X) / 2,
......
......@@ -1326,14 +1326,12 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
mainGame->dField.conti_act = true;
} else {
pcard->cmdFlag |= COMMAND_ACTIVATE;
if(pcard->controler == 0) {
if(pcard->location == LOCATION_GRAVE)
mainGame->dField.grave_act = true;
else if(pcard->location == LOCATION_REMOVED)
mainGame->dField.remove_act = true;
else if(pcard->location == LOCATION_EXTRA)
mainGame->dField.extra_act = true;
}
if(pcard->location == LOCATION_GRAVE)
mainGame->dField.grave_act[con] = true;
else if(pcard->location == LOCATION_REMOVED)
mainGame->dField.remove_act[con] = true;
else if(pcard->location == LOCATION_EXTRA)
mainGame->dField.extra_act[con] = true;
}
}
mainGame->dField.attackable_cards.clear();
......@@ -1390,17 +1388,17 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
pcard->cmdFlag |= COMMAND_SPSUMMON;
if (pcard->location == LOCATION_DECK) {
pcard->SetCode(code);
mainGame->dField.deck_act = true;
mainGame->dField.deck_act[con] = true;
} else if (pcard->location == LOCATION_GRAVE)
mainGame->dField.grave_act = true;
mainGame->dField.grave_act[con] = true;
else if (pcard->location == LOCATION_REMOVED)
mainGame->dField.remove_act = true;
mainGame->dField.remove_act[con] = true;
else if (pcard->location == LOCATION_EXTRA)
mainGame->dField.extra_act = true;
mainGame->dField.extra_act[con] = true;
else {
int left_seq = mainGame->dInfo.duel_rule >= 4 ? 0 : 6;
if (pcard->location == LOCATION_SZONE && pcard->sequence == left_seq && (pcard->type & TYPE_PENDULUM) && !pcard->equipTarget)
mainGame->dField.pzone_act[pcard->controler] = true;
mainGame->dField.pzone_act[con] = true;
}
}
mainGame->dField.reposable_cards.clear();
......@@ -1460,14 +1458,12 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
mainGame->dField.conti_act = true;
} else {
pcard->cmdFlag |= COMMAND_ACTIVATE;
if(pcard->controler == 0) {
if(pcard->location == LOCATION_GRAVE)
mainGame->dField.grave_act = true;
else if(pcard->location == LOCATION_REMOVED)
mainGame->dField.remove_act = true;
else if(pcard->location == LOCATION_EXTRA)
mainGame->dField.extra_act = true;
}
if(pcard->location == LOCATION_GRAVE)
mainGame->dField.grave_act[con] = true;
else if(pcard->location == LOCATION_REMOVED)
mainGame->dField.remove_act[con] = true;
else if(pcard->location == LOCATION_EXTRA)
mainGame->dField.extra_act[con] = true;
}
}
if(BufferIO::ReadUInt8(pbuf)) {
......@@ -1742,13 +1738,13 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
pcard->cmdFlag |= COMMAND_ACTIVATE;
if(pcard->location == LOCATION_DECK) {
pcard->SetCode(code);
mainGame->dField.deck_act = true;
mainGame->dField.deck_act[c] = true;
} else if(l == LOCATION_GRAVE)
mainGame->dField.grave_act = true;
mainGame->dField.grave_act[c] = true;
else if(l == LOCATION_REMOVED)
mainGame->dField.remove_act = true;
mainGame->dField.remove_act[c] = true;
else if(l == LOCATION_EXTRA)
mainGame->dField.extra_act = true;
mainGame->dField.extra_act[c] = true;
else if(l == LOCATION_OVERLAY)
panelmode = true;
}
......
......@@ -6,7 +6,6 @@ end
project "YGOPro"
kind "WindowedApp"
cdialect "C11"
cppdialect "C++14"
files { "*.cpp", "*.h" }
......
......@@ -6,3 +6,6 @@ project "cspmemvfs"
if BUILD_SQLITE then
includedirs { "../../sqlite3" }
end
filter "not action:vs*"
defines { "_POSIX_C_SOURCE=200809L" }
project "irrlicht"
kind "StaticLib"
cdialect "C11"
cppdialect "C++14"
includedirs { "include", "source/Irrlicht", "source/Irrlicht/jpeglib", "source/Irrlicht/libpng", "source/Irrlicht/zlib" }
......@@ -320,7 +319,7 @@ project "irrlicht"
filter { "system:windows" }
defines { "_IRR_WCHAR_FILESYSTEM" }
includedirs { "$(DXSDK_DIR)include" }
includedirs { "$(DXSDK_DIR)Include" }
libdirs { "$(DXSDK_DIR)Lib/x86" }
links { "imm32" }
......
project "lua"
kind "StaticLib"
cdialect "C11"
cppdialect "C++14"
compileas "C++"
files { "src/*.c", "src/*.h", "src/*.hpp" }
removefiles { "src/lua.c", "src/luac.c" }
filter "action:vs*"
buildoptions { "/TP" }
filter "not action:vs*"
buildoptions { "-x c++" }
files { "src/*.c", "src/*.h" }
removefiles { "src/lua.c", "src/luac.c", "src/linit.c", "src/onelua.c" }
filter "configurations:Debug"
defines { "LUA_USE_APICHECK" }
......
......@@ -42,7 +42,7 @@ newoption { trigger = "irrklang-pro-debug-lib-dir", category = "YGOPro - irrklan
newoption { trigger = 'build-ikpmp3', category = "YGOPro - irrklang - ikpmp3", description = "" }
newoption { trigger = "winxp-support", category = "YGOPro", description = "" }
newoption { trigger = "mac-arm", category = "YGOPro", description = "M1" }
newoption { trigger = "mac-arm", category = "YGOPro", description = "Cross compile for Apple Silicon" }
function GetParam(param)
return _OPTIONS[param] or os.getenv(string.upper(string.gsub(param,"-","_")))
......@@ -56,9 +56,9 @@ end
if not BUILD_LUA then
-- at most times you need to change this if you change BUILD_LUA to false
-- make sure your lua lib is built with C++ and version >= 5.3
LUA_INCLUDE_DIR = GetParam("lua-include-dir") or "/usr/local/include/lua"
LUA_LIB_DIR = GetParam("lua-lib-dir") or "/usr/local/lib"
LUA_LIB_NAME = GetParam("lua-lib-name")
LUA_INCLUDE_DIR = GetParam("lua-include-dir") or os.findheader(LUA_LIB_NAME)
LUA_LIB_DIR = GetParam("lua-lib-dir") or os.findlib(LUA_LIB_NAME)
end
if GetParam("build-event") then
......@@ -67,8 +67,8 @@ elseif GetParam("no-build-event") then
BUILD_EVENT = false
end
if not BUILD_EVENT then
EVENT_INCLUDE_DIR = GetParam("event-include-dir") or "/usr/local/include/event2"
EVENT_LIB_DIR = GetParam("event-lib-dir") or "/usr/local/lib"
EVENT_INCLUDE_DIR = GetParam("event-include-dir") or os.findheader("event")
EVENT_LIB_DIR = GetParam("event-lib-dir") or os.findlib("event")
end
if GetParam("build-freetype") then
......@@ -77,13 +77,8 @@ elseif GetParam("no-build-freetype") then
BUILD_FREETYPE = false
end
if not BUILD_FREETYPE then
if os.istarget("linux") then
FREETYPE_INCLUDE_DIR = "/usr/include/freetype2"
elseif os.istarget("macosx") then
FREETYPE_INCLUDE_DIR = "/usr/local/include/freetype2"
end
FREETYPE_INCLUDE_DIR = GetParam("freetype-include-dir") or FREETYPE_INCLUDE_DIR
FREETYPE_LIB_DIR = GetParam("freetype-lib-dir") or "/usr/local/lib"
FREETYPE_INCLUDE_DIR = GetParam("freetype-include-dir") or os.findheader("freetype")
FREETYPE_LIB_DIR = GetParam("freetype-lib-dir") or os.findlib("freetype")
end
if GetParam("build-sqlite") then
......@@ -92,8 +87,8 @@ elseif GetParam("no-build-sqlite") then
BUILD_SQLITE = false
end
if not BUILD_SQLITE then
SQLITE_INCLUDE_DIR = GetParam("sqlite-include-dir") or "/usr/local/include"
SQLITE_LIB_DIR = GetParam("sqlite-lib-dir") or "/usr/local/lib"
SQLITE_INCLUDE_DIR = GetParam("sqlite-include-dir") or os.findheader("sqlite3")
SQLITE_LIB_DIR = GetParam("sqlite-lib-dir") or os.findlib("sqlite3")
end
if GetParam("build-irrlicht") then
......@@ -102,8 +97,8 @@ elseif GetParam("no-build-irrlicht") then
BUILD_IRRLICHT = false
end
if not BUILD_IRRLICHT then
IRRLICHT_INCLUDE_DIR = GetParam("irrlicht-include-dir") or "/usr/local/include/irrlicht"
IRRLICHT_LIB_DIR = GetParam("irrlicht-lib-dir") or "/usr/local/lib"
IRRLICHT_INCLUDE_DIR = GetParam("irrlicht-include-dir") or os.findheader("irrlicht")
IRRLICHT_LIB_DIR = GetParam("irrlicht-lib-dir") or os.findlib("irrlicht")
end
USE_AUDIO = not GetParam("no-audio")
......@@ -155,7 +150,11 @@ workspace "YGOPro"
targetdir "bin/debug"
filter { "configurations:Release", "action:vs*" }
flags { "LinkTimeOptimization" }
if linktimeoptimization then
linktimeoptimization "On"
else
flags { "LinkTimeOptimization" }
end
staticruntime "On"
disablewarnings { "4244", "4267", "4838", "4577", "4018", "4996", "4477", "4091", "4800", "6011", "6031", "6054", "6262" }
......@@ -173,7 +172,7 @@ workspace "YGOPro"
vectorextensions "SSE2"
buildoptions { "/utf-8" }
defines { "_CRT_SECURE_NO_WARNINGS" }
filter "not action:vs*"
buildoptions { "-fno-strict-aliasing", "-Wno-multichar", "-Wno-format-security" }
......
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