Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaoye
ygopro
Commits
a0201290
Commit
a0201290
authored
May 31, 2025
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fh' into patch-event-2.1.12-win
parents
47859b49
750f2ede
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
515 additions
and
130 deletions
+515
-130
.github/workflows/build.yml
.github/workflows/build.yml
+338
-60
gframe/game.cpp
gframe/game.cpp
+6
-20
gframe/game.h
gframe/game.h
+17
-2
gframe/image_manager.cpp
gframe/image_manager.cpp
+4
-4
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+10
-3
gframe/premake5.lua
gframe/premake5.lua
+6
-2
gframe/replay.cpp
gframe/replay.cpp
+10
-12
gframe/replay.h
gframe/replay.h
+0
-1
premake/event/premake5.lua
premake/event/premake5.lua
+7
-0
premake/irrlicht/premake5.lua
premake/irrlicht/premake5.lua
+5
-1
premake/miniaudio/premake5.lua
premake/miniaudio/premake5.lua
+21
-9
premake/sqlite3/premake5.lua
premake/sqlite3/premake5.lua
+9
-0
premake5.lua
premake5.lua
+82
-16
No files found.
.github/workflows/build.yml
View file @
a0201290
...
@@ -11,8 +11,41 @@ jobs:
...
@@ -11,8 +11,41 @@ jobs:
strategy
:
strategy
:
fail-fast
:
false
fail-fast
:
false
matrix
:
matrix
:
os
:
[
windows-2019
,
windows-2022
]
name
:
audiolib
:
[
miniaudio
,
irrklang
]
-
windows
-
windows-xp
-
windows-irrklang
-
windows-no-dxsdk
-
windows-x64
# - windows-2025
include
:
-
name
:
windows
os
:
windows-2022
vs
:
vs2022
audiolib
:
miniaudio
-
name
:
windows-xp
os
:
windows-2019
vs
:
vs2019
audiolib
:
miniaudio
xp
:
true
-
name
:
windows-irrklang
os
:
windows-2022
vs
:
vs2022
audiolib
:
irrklang
-
name
:
windows-no-dxsdk
os
:
windows-2022
vs
:
vs2022
audiolib
:
miniaudio
nodxsdk
:
true
-
name
:
windows-x64
os
:
windows-2022
vs
:
vs2022
audiolib
:
miniaudio
x64
:
true
# - name: windows-2025
# os: windows-2025
# vs: vs2022
# audiolib: miniaudio
runs-on
:
${{ matrix.os }}
runs-on
:
${{ matrix.os }}
...
@@ -38,7 +71,7 @@ jobs:
...
@@ -38,7 +71,7 @@ jobs:
id
:
premake
id
:
premake
uses
:
mercury233/action-cache-download-file@v1.0.0
uses
:
mercury233/action-cache-download-file@v1.0.0
with
:
with
:
url
:
https://github.com/premake/premake-core/releases/download/v5.0.0-beta
5/premake-5.0.0-beta5
-windows.zip
url
:
https://github.com/premake/premake-core/releases/download/v5.0.0-beta
6/premake-5.0.0-beta6
-windows.zip
filename
:
premake5.zip
filename
:
premake5.zip
-
name
:
Extract premake
-
name
:
Extract premake
...
@@ -61,7 +94,7 @@ jobs:
...
@@ -61,7 +94,7 @@ jobs:
id
:
freetype
id
:
freetype
uses
:
mercury233/action-cache-download-file@v1.0.0
uses
:
mercury233/action-cache-download-file@v1.0.0
with
:
with
:
url
:
http://downloads.sourceforge.net/freetype/freetype-2.13.3.tar.gz
url
:
http
s
://downloads.sourceforge.net/freetype/freetype-2.13.3.tar.gz
-
name
:
Extract freetype
-
name
:
Extract freetype
run
:
|
run
:
|
...
@@ -168,6 +201,7 @@ jobs:
...
@@ -168,6 +201,7 @@ jobs:
git clone --depth=1 https://github.com/mercury233/irrlicht
git clone --depth=1 https://github.com/mercury233/irrlicht
-
name
:
Check DirectX SDK
-
name
:
Check DirectX SDK
if
:
matrix.nodxsdk !=
true
id
:
dxsdk
id
:
dxsdk
uses
:
actions/cache@v4
uses
:
actions/cache@v4
with
:
with
:
...
@@ -175,18 +209,19 @@ jobs:
...
@@ -175,18 +209,19 @@ jobs:
path
:
DXSDK
path
:
DXSDK
-
name
:
Download DirectX SDK
-
name
:
Download DirectX SDK
if
:
steps.dxsdk.outputs.cache-hit != 'true'
if
:
matrix.nodxsdk !=
true
&&
steps.dxsdk.outputs.cache-hit != 'true'
id
:
dxsdk-download
id
:
dxsdk-download
uses
:
mercury233/action-cache-download-file@v1.0.0
uses
:
mercury233/action-cache-download-file@v1.0.0
with
:
with
:
url
:
https://download.microsoft.com/download/a/e/7/ae743f1f-632b-4809-87a9-aa1bb3458e31/DXSDK_Jun10.exe
url
:
https://download.microsoft.com/download/a/e/7/ae743f1f-632b-4809-87a9-aa1bb3458e31/DXSDK_Jun10.exe
-
name
:
Install DirectX SDK
-
name
:
Install DirectX SDK
if
:
steps.dxsdk.outputs.cache-hit != 'true'
if
:
matrix.nodxsdk !=
true
&&
steps.dxsdk.outputs.cache-hit != 'true'
run
:
|
run
:
|
7z x ${{ steps.dxsdk-download.outputs.filepath }} -aoa
7z x ${{ steps.dxsdk-download.outputs.filepath }} -aoa
-
name
:
Set DirectX SDK environment variable
-
name
:
Set DirectX SDK environment variable
if
:
matrix.nodxsdk !=
true
run
:
|
run
:
|
$dxsdkPath = Resolve-Path 'DXSDK'
$dxsdkPath = Resolve-Path 'DXSDK'
"DXSDK_DIR=$($dxsdkPath.ProviderPath)\" | Out-File -FilePath $env:GITHUB_ENV -Append
"DXSDK_DIR=$($dxsdkPath.ProviderPath)\" | Out-File -FilePath $env:GITHUB_ENV -Append
...
@@ -196,55 +231,44 @@ jobs:
...
@@ -196,55 +231,44 @@ jobs:
xcopy /E premake\* .
xcopy /E premake\* .
xcopy /E resource\* .
xcopy /E resource\* .
-
name
:
Use premake to generate Visual Studio solution (2019, miniaudio)
-
name
:
Use premake to generate Visual Studio solution
if
:
matrix.os == 'windows-2019' && matrix.audiolib == 'miniaudio'
run
:
|
.\premake5.exe vs2019 --winxp-support
-
name
:
Use premake to generate Visual Studio solution (2022, miniaudio)
if
:
matrix.os == 'windows-2022' && matrix.audiolib == 'miniaudio'
run
:
|
run
:
|
.\premake5.exe vs2022
.\premake5.exe ${{ matrix.vs }} --audio-lib=${{ matrix.audiolib }} ${{ matrix.xp && '--winxp-support' || '' }}
-
name
:
Use premake to generate Visual Studio solution (2019, irrKlang)
if
:
matrix.os == 'windows-2019' && matrix.audiolib == 'irrklang'
run
:
|
.\premake5.exe vs2019 --winxp-support --audio-lib=irrklang
-
name
:
Use premake to generate Visual Studio solution (2022, irrKlang)
if
:
matrix.os == 'windows-2022' && matrix.audiolib == 'irrklang'
run
:
|
.\premake5.exe vs2022 --audio-lib=irrklang
-
name
:
Add msbuild to PATH
-
name
:
Add msbuild to PATH
uses
:
microsoft/setup-msbuild@v2
uses
:
microsoft/setup-msbuild@v2
-
name
:
Build solution
-
name
:
Build solution
run
:
|
run
:
|
MSBuild.exe build\YGOPro.sln /m /p:Configuration=Release
MSBuild.exe build\YGOPro.sln /m /p:Configuration=Release
/p:Platform=${{ matrix.x64 && 'x64' || 'Win32' }}
-
name
:
Upload build artifacts
-
name
:
Upload build artifacts
uses
:
actions/upload-artifact@v4
uses
:
actions/upload-artifact@v4
with
:
with
:
name
:
YGOPro-${{ matrix.
os }}-${{ matrix.audiolib
}}
name
:
YGOPro-${{ matrix.
name
}}
path
:
|
path
:
|
bin/release/YGOPro.exe
bin/release/x86/YGOPro.exe
bin/release/x64/YGOPro.exe
build-linux
:
build-linux
:
strategy
:
strategy
:
fail-fast
:
false
fail-fast
:
false
matrix
:
matrix
:
os
:
name
:
# - ubuntu-20.04
-
ubuntu-22
-
ubuntu-2
2.0
4
-
ubuntu-24
-
ubuntu-
24.04
-
ubuntu-
static-link
include
:
include
:
# - os: ubuntu-20.04
-
name
:
ubuntu-22
# premake_version: 5.0.0-beta2
os
:
ubuntu-22.04
-
os
:
ubuntu-22.04
premake-version
:
5.0.0-beta4
premake_version
:
5.0.0-beta4
-
name
:
ubuntu-24
-
os
:
ubuntu-24.04
os
:
ubuntu-24.04
premake_version
:
5.0.0-beta5
premake-version
:
5.0.0-beta6
-
name
:
ubuntu-static-link
os
:
ubuntu-22.04
premake-version
:
5.0.0-beta4
static-link
:
true
runs-on
:
${{ matrix.os }}
runs-on
:
${{ matrix.os }}
...
@@ -269,13 +293,18 @@ jobs:
...
@@ -269,13 +293,18 @@ jobs:
-
name
:
Install dependencies
-
name
:
Install dependencies
run
:
|
run
:
|
sudo apt-get update
sudo apt-get update
sudo apt-get install -y libevent-dev libfreetype6-dev libgl1-mesa-dev libglu1-mesa-dev libsqlite3-dev libxxf86vm-dev libopusfile-dev libvorbis-dev
sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev libxxf86vm-dev
-
name
:
Install dependencies (dynamic link)
if
:
matrix.static-link !=
true
run
:
|
sudo apt-get install -y libevent-dev libfreetype6-dev libsqlite3-dev libopusfile-dev libvorbis-dev
-
name
:
Download premake
-
name
:
Download premake
id
:
premake
id
:
premake
uses
:
mercury233/action-cache-download-file@v1.0.0
uses
:
mercury233/action-cache-download-file@v1.0.0
with
:
with
:
url
:
https://github.com/premake/premake-core/releases/download/v${{ matrix.premake
_version }}/premake-${{ matrix.premake_
version }}-linux.tar.gz
url
:
https://github.com/premake/premake-core/releases/download/v${{ matrix.premake
-version }}/premake-${{ matrix.premake-
version }}-linux.tar.gz
filename
:
premake5.tar.gz
filename
:
premake5.tar.gz
-
name
:
Extract premake
-
name
:
Extract premake
...
@@ -283,6 +312,41 @@ jobs:
...
@@ -283,6 +312,41 @@ jobs:
tar xf ${{ steps.premake.outputs.filepath }}
tar xf ${{ steps.premake.outputs.filepath }}
chmod +x ./premake5
chmod +x ./premake5
-
name
:
Download libevent
if
:
matrix.static-link ==
true
id
:
libevent
uses
:
mercury233/action-cache-download-file@v1.0.0
with
:
url
:
https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz
filename
:
libevent.tar.gz
-
name
:
Extract libevent
if
:
matrix.static-link ==
true
run
:
|
tar xf ${{ steps.libevent.outputs.filepath }}
mv libevent-2.1.12-stable event
-
name
:
Configure libevent
if
:
matrix.static-link ==
true
run
:
|
cd event
./configure --disable-openssl --enable-static=yes --enable-shared=no
sed -f make-event-config.sed < config.h > ./include/event2/event-config.h
cd ..
-
name
:
Download freetype
if
:
matrix.static-link ==
true
id
:
freetype
uses
:
mercury233/action-cache-download-file@v1.0.0
with
:
url
:
https://downloads.sourceforge.net/freetype/freetype-2.13.3.tar.gz
-
name
:
Extract freetype
if
:
matrix.static-link ==
true
run
:
|
tar xf ${{ steps.freetype.outputs.filepath }}
mv freetype-2.13.3 freetype
-
name
:
Download lua
-
name
:
Download lua
id
:
lua
id
:
lua
uses
:
mercury233/action-cache-download-file@v1.0.0
uses
:
mercury233/action-cache-download-file@v1.0.0
...
@@ -294,6 +358,19 @@ jobs:
...
@@ -294,6 +358,19 @@ jobs:
tar xf ${{ steps.lua.outputs.filepath }}
tar xf ${{ steps.lua.outputs.filepath }}
mv lua-5.4.7 lua
mv lua-5.4.7 lua
-
name
:
Download sqlite
if
:
matrix.static-link ==
true
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
if
:
matrix.static-link ==
true
run
:
|
7z x ${{ steps.sqlite.outputs.filepath }}
mv sqlite-amalgamation-3490100 sqlite3
-
name
:
Download miniaudio
-
name
:
Download miniaudio
run
:
|
run
:
|
git clone --depth=1 --branch 0.11.22 https://github.com/mackron/miniaudio
git clone --depth=1 --branch 0.11.22 https://github.com/mackron/miniaudio
...
@@ -301,6 +378,65 @@ jobs:
...
@@ -301,6 +378,65 @@ jobs:
cp extras/miniaudio_split/miniaudio.* .
cp extras/miniaudio_split/miniaudio.* .
cd ..
cd ..
-
name
:
Download ogg
if
:
matrix.static-link ==
true
id
:
ogg
uses
:
mercury233/action-cache-download-file@v1.0.0
with
:
url
:
https://github.com/xiph/ogg/releases/download/v1.3.5/libogg-1.3.5.tar.gz
-
name
:
Extract ogg
if
:
matrix.static-link ==
true
run
:
|
tar xf ${{ steps.ogg.outputs.filepath }}
mv libogg-1.3.5 miniaudio/external/ogg
-
name
:
Configure ogg
if
:
matrix.static-link ==
true
run
:
|
cd miniaudio/external/ogg
./configure
cd ../../..
-
name
:
Download opus
if
:
matrix.static-link ==
true
id
:
opus
uses
:
mercury233/action-cache-download-file@v1.0.0
with
:
url
:
https://github.com/xiph/opus/releases/download/v1.5.2/opus-1.5.2.tar.gz
-
name
:
Extract opus
if
:
matrix.static-link ==
true
run
:
|
tar xf ${{ steps.opus.outputs.filepath }}
mv opus-1.5.2 miniaudio/external/opus
-
name
:
Download opusfile
if
:
matrix.static-link ==
true
id
:
opusfile
uses
:
mercury233/action-cache-download-file@v1.0.0
with
:
url
:
https://github.com/xiph/opusfile/releases/download/v0.12/opusfile-0.12.tar.gz
-
name
:
Extract opusfile
if
:
matrix.static-link ==
true
run
:
|
tar xf ${{ steps.opusfile.outputs.filepath }}
mv opusfile-0.12 miniaudio/external/opusfile
-
name
:
Download vorbis
if
:
matrix.static-link ==
true
id
:
vorbis
uses
:
mercury233/action-cache-download-file@v1.0.0
with
:
url
:
https://github.com/xiph/vorbis/releases/download/v1.3.7/libvorbis-1.3.7.tar.gz
-
name
:
Extract vorbis
if
:
matrix.static-link ==
true
run
:
|
tar xf ${{ steps.vorbis.outputs.filepath }}
mv libvorbis-1.3.7 miniaudio/external/vorbis
-
name
:
Download irrlicht
-
name
:
Download irrlicht
run
:
|
run
:
|
git clone --depth=1 https://github.com/mercury233/irrlicht
git clone --depth=1 https://github.com/mercury233/irrlicht
...
@@ -310,20 +446,36 @@ jobs:
...
@@ -310,20 +446,36 @@ jobs:
cp -r premake/* .
cp -r premake/* .
cp -r resource/* .
cp -r resource/* .
-
name
:
Use premake to generate make files
-
name
:
Use premake to generate make files (apt packages)
if
:
matrix.static-link !=
true
run
:
|
run
:
|
./premake5 gmake
./premake5 gmake
-
name
:
Use premake to generate make files (static link)
if
:
matrix.static-link ==
true
run
:
|
./premake5 gmake \
--build-event \
--build-freetype \
--build-sqlite \
--build-opus-vorbis
-
name
:
Make
-
name
:
Make
run
:
|
run
:
|
cd build
cd build
make -j 4 config=release
make -j 4 config=release
cd ..
cd ..
-
name
:
Strip symbols
run
:
|
cd bin/release
strip YGOPro
cd ../..
-
name
:
Upload build artifacts
-
name
:
Upload build artifacts
uses
:
actions/upload-artifact@v4
uses
:
actions/upload-artifact@v4
with
:
with
:
name
:
YGOPro-${{ matrix.
os
}}
name
:
YGOPro-${{ matrix.
name
}}
path
:
|
path
:
|
bin/release/YGOPro
bin/release/YGOPro
...
@@ -331,14 +483,36 @@ jobs:
...
@@ -331,14 +483,36 @@ jobs:
strategy
:
strategy
:
fail-fast
:
false
fail-fast
:
false
matrix
:
matrix
:
os
:
name
:
-
macos-13
-
macos-13-intel
-
macos-15
-
macos-13-arm-cross-compile-static-link
-
macos-13-universal-static-link
-
macos-15-arm
-
macos-15-intel-cross-compile-static-link
-
macos-15-universal-static-link
include
:
include
:
-
os
:
macos-13
-
name
:
macos-13-intel
premake_version
:
5.0.0-beta5
os
:
macos-13
-
os
:
macos-15
-
name
:
macos-13-arm-cross-compile-static-link
premake_version
:
5.0.0-beta5
os
:
macos-13
cross-build-arm
:
true
static-link
:
true
-
name
:
macos-13-universal-static-link
os
:
macos-13
cross-build-intel
:
true
cross-build-arm
:
true
static-link
:
true
-
name
:
macos-15-arm
os
:
macos-15
-
name
:
macos-15-intel-cross-compile-static-link
os
:
macos-15
cross-build-intel
:
true
static-link
:
true
-
name
:
macos-15-universal-static-link
os
:
macos-15
cross-build-intel
:
true
cross-build-arm
:
true
static-link
:
true
runs-on
:
${{ matrix.os }}
runs-on
:
${{ matrix.os }}
...
@@ -361,20 +535,49 @@ jobs:
...
@@ -361,20 +535,49 @@ jobs:
# cd ..
# cd ..
-
name
:
Install dependencies
-
name
:
Install dependencies
if
:
matrix.static-link !=
true
run
:
|
run
:
|
brew install freetype libevent libx11 sqlite opus opusfile libvorbis
brew install opus opusfile libvorbis
# brew install sqlite libx11 freetype libevent
-
name
:
Download premake
-
name
:
Install premake
id
:
premake
run
:
|
brew install premake
-
name
:
Download libevent
if
:
matrix.static-link ==
true
id
:
libevent
uses
:
mercury233/action-cache-download-file@v1.0.0
uses
:
mercury233/action-cache-download-file@v1.0.0
with
:
with
:
url
:
https://github.com/
premake/premake-core/releases/download/v${{ matrix.premake_version }}/premake-${{ matrix.premake_version }}-macosx
.tar.gz
url
:
https://github.com/
libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable
.tar.gz
filename
:
premake5
.tar.gz
filename
:
libevent
.tar.gz
-
name
:
Extract premake
-
name
:
Extract libevent
if
:
matrix.static-link ==
true
run
:
|
run
:
|
tar xf ${{ steps.premake.outputs.filepath }}
tar xf ${{ steps.libevent.outputs.filepath }}
chmod +x ./premake5
mv libevent-2.1.12-stable event
-
name
:
Configure libevent
if
:
matrix.static-link ==
true
run
:
|
cd event
./configure --disable-openssl --enable-static=yes --enable-shared=no
sed -f make-event-config.sed < config.h > ./include/event2/event-config.h
cd ..
-
name
:
Download freetype
if
:
matrix.static-link ==
true
id
:
freetype
uses
:
mercury233/action-cache-download-file@v1.0.0
with
:
url
:
https://downloads.sourceforge.net/freetype/freetype-2.13.3.tar.gz
-
name
:
Extract freetype
if
:
matrix.static-link ==
true
run
:
|
tar xf ${{ steps.freetype.outputs.filepath }}
mv freetype-2.13.3 freetype
-
name
:
Download lua
-
name
:
Download lua
id
:
lua
id
:
lua
...
@@ -387,6 +590,19 @@ jobs:
...
@@ -387,6 +590,19 @@ jobs:
tar xf ${{ steps.lua.outputs.filepath }}
tar xf ${{ steps.lua.outputs.filepath }}
mv lua-5.4.7 lua
mv lua-5.4.7 lua
-
name
:
Download sqlite
if
:
matrix.static-link ==
true
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
if
:
matrix.static-link ==
true
run
:
|
7z x ${{ steps.sqlite.outputs.filepath }}
mv sqlite-amalgamation-3490100 sqlite3
-
name
:
Download miniaudio
-
name
:
Download miniaudio
run
:
|
run
:
|
git clone --depth=1 --branch 0.11.22 https://github.com/mackron/miniaudio
git clone --depth=1 --branch 0.11.22 https://github.com/mackron/miniaudio
...
@@ -394,6 +610,58 @@ jobs:
...
@@ -394,6 +610,58 @@ jobs:
cp extras/miniaudio_split/miniaudio.* .
cp extras/miniaudio_split/miniaudio.* .
cd ..
cd ..
-
name
:
Download ogg
if
:
matrix.static-link ==
true
id
:
ogg
uses
:
mercury233/action-cache-download-file@v1.0.0
with
:
url
:
https://github.com/xiph/ogg/releases/download/v1.3.5/libogg-1.3.5.tar.gz
-
name
:
Extract ogg
if
:
matrix.static-link ==
true
run
:
|
tar xf ${{ steps.ogg.outputs.filepath }}
mv libogg-1.3.5 miniaudio/external/ogg
-
name
:
Download opus
if
:
matrix.static-link ==
true
id
:
opus
uses
:
mercury233/action-cache-download-file@v1.0.0
with
:
url
:
https://github.com/xiph/opus/releases/download/v1.5.2/opus-1.5.2.tar.gz
-
name
:
Extract opus
if
:
matrix.static-link ==
true
run
:
|
tar xf ${{ steps.opus.outputs.filepath }}
mv opus-1.5.2 miniaudio/external/opus
-
name
:
Download opusfile
if
:
matrix.static-link ==
true
id
:
opusfile
uses
:
mercury233/action-cache-download-file@v1.0.0
with
:
url
:
https://github.com/xiph/opusfile/releases/download/v0.12/opusfile-0.12.tar.gz
-
name
:
Extract opusfile
if
:
matrix.static-link ==
true
run
:
|
tar xf ${{ steps.opusfile.outputs.filepath }}
mv opusfile-0.12 miniaudio/external/opusfile
-
name
:
Download vorbis
if
:
matrix.static-link ==
true
id
:
vorbis
uses
:
mercury233/action-cache-download-file@v1.0.0
with
:
url
:
https://github.com/xiph/vorbis/releases/download/v1.3.7/libvorbis-1.3.7.tar.gz
-
name
:
Extract vorbis
if
:
matrix.static-link ==
true
run
:
|
tar xf ${{ steps.vorbis.outputs.filepath }}
mv libvorbis-1.3.7 miniaudio/external/vorbis
-
name
:
Download irrlicht
-
name
:
Download irrlicht
run
:
|
run
:
|
git clone --depth=1 https://github.com/mercury233/irrlicht
git clone --depth=1 https://github.com/mercury233/irrlicht
...
@@ -403,9 +671,19 @@ jobs:
...
@@ -403,9 +671,19 @@ jobs:
cp -r premake/* .
cp -r premake/* .
cp -r resource/* .
cp -r resource/* .
-
name
:
Use premake to generate make files
-
name
:
Use premake to generate make files (Homebrew packages)
if
:
matrix.static-link !=
true
run
:
|
DYLD_LIBRARY_PATH=$(brew --prefix)/lib premake5 gmake
-
name
:
Use premake to generate make files (static link)
if
:
matrix.static-link ==
true
run
:
|
run
:
|
DYLD_LIBRARY_PATH=$(brew --prefix)/lib ./premake5 gmake --cc=clang
premake5 gmake ${{ matrix.cross-build-intel == true && '--mac-intel' || '' }} ${{ matrix.cross-build-arm == true && '--mac-arm' || '' }} \
--build-event \
--build-freetype \
--build-sqlite \
--build-opus-vorbis
-
name
:
Make
-
name
:
Make
run
:
|
run
:
|
...
@@ -416,6 +694,6 @@ jobs:
...
@@ -416,6 +694,6 @@ jobs:
-
name
:
Upload build artifacts
-
name
:
Upload build artifacts
uses
:
actions/upload-artifact@v4
uses
:
actions/upload-artifact@v4
with
:
with
:
name
:
YGOPro-${{ matrix.
os
}}
name
:
YGOPro-${{ matrix.
name
}}
path
:
|
path
:
|
bin/
*
bin/
release/YGOPro.app
gframe/game.cpp
View file @
a0201290
...
@@ -50,22 +50,6 @@ void DuelInfo::Clear() {
...
@@ -50,22 +50,6 @@ void DuelInfo::Clear() {
time_left
[
1
]
=
0
;
time_left
[
1
]
=
0
;
}
}
bool
IsExtension
(
const
wchar_t
*
filename
,
const
wchar_t
*
extension
)
{
auto
flen
=
std
::
wcslen
(
filename
);
auto
elen
=
std
::
wcslen
(
extension
);
if
(
!
elen
||
flen
<
elen
)
return
false
;
return
!
mywcsncasecmp
(
filename
+
(
flen
-
elen
),
extension
,
elen
);
}
bool
IsExtension
(
const
char
*
filename
,
const
char
*
extension
)
{
auto
flen
=
std
::
strlen
(
filename
);
auto
elen
=
std
::
strlen
(
extension
);
if
(
!
elen
||
flen
<
elen
)
return
false
;
return
!
mystrncasecmp
(
filename
+
(
flen
-
elen
),
extension
,
elen
);
}
bool
Game
::
Initialize
()
{
bool
Game
::
Initialize
()
{
LoadConfig
();
LoadConfig
();
irr
::
SIrrlichtCreationParameters
params
{};
irr
::
SIrrlichtCreationParameters
params
{};
...
@@ -1141,19 +1125,21 @@ std::wstring Game::SetStaticText(irr::gui::IGUIStaticText* pControl, irr::u32 cW
...
@@ -1141,19 +1125,21 @@ std::wstring Game::SetStaticText(irr::gui::IGUIStaticText* pControl, irr::u32 cW
}
}
void
Game
::
LoadExpansions
()
{
void
Game
::
LoadExpansions
()
{
FileSystem
::
TraversalDir
(
L"./expansions"
,
[](
const
wchar_t
*
name
,
bool
isdir
)
{
FileSystem
::
TraversalDir
(
L"./expansions"
,
[](
const
wchar_t
*
name
,
bool
isdir
)
{
if
(
isdir
)
return
;
wchar_t
fpath
[
1024
];
wchar_t
fpath
[
1024
];
myswprintf
(
fpath
,
L"./expansions/%ls"
,
name
);
myswprintf
(
fpath
,
L"./expansions/%ls"
,
name
);
if
(
!
isdir
&&
IsExtension
(
name
,
L".cdb"
))
{
if
(
IsExtension
(
name
,
L".cdb"
))
{
dataManager
.
LoadDB
(
fpath
);
dataManager
.
LoadDB
(
fpath
);
return
;
return
;
}
}
if
(
!
isdir
&&
IsExtension
(
name
,
L".conf"
))
{
if
(
IsExtension
(
name
,
L".conf"
))
{
char
upath
[
1024
];
char
upath
[
1024
];
BufferIO
::
EncodeUTF8
(
fpath
,
upath
);
BufferIO
::
EncodeUTF8
(
fpath
,
upath
);
dataManager
.
LoadStrings
(
upath
);
dataManager
.
LoadStrings
(
upath
);
return
;
return
;
}
}
if
(
!
isdir
&&
(
IsExtension
(
name
,
L".zip"
)
||
IsExtension
(
name
,
L".ypk"
)
))
{
if
(
IsExtension
(
name
,
L".zip"
)
||
IsExtension
(
name
,
L".ypk"
))
{
#ifdef _WIN32
#ifdef _WIN32
DataManager
::
FileSystem
->
addFileArchive
(
fpath
,
true
,
false
,
irr
::
io
::
EFAT_ZIP
);
DataManager
::
FileSystem
->
addFileArchive
(
fpath
,
true
,
false
,
irr
::
io
::
EFAT_ZIP
);
#else
#else
...
@@ -1256,7 +1242,7 @@ void Game::RefreshDeck(const wchar_t* deckpath, const std::function<void(const w
...
@@ -1256,7 +1242,7 @@ void Game::RefreshDeck(const wchar_t* deckpath, const std::function<void(const w
void
Game
::
RefreshReplay
()
{
void
Game
::
RefreshReplay
()
{
lstReplayList
->
clear
();
lstReplayList
->
clear
();
FileSystem
::
TraversalDir
(
L"./replay"
,
[
this
](
const
wchar_t
*
name
,
bool
isdir
)
{
FileSystem
::
TraversalDir
(
L"./replay"
,
[
this
](
const
wchar_t
*
name
,
bool
isdir
)
{
if
(
!
isdir
&&
IsExtension
(
name
,
L".yrp"
)
&&
Replay
::
CheckReplay
(
name
)
)
if
(
!
isdir
&&
IsExtension
(
name
,
L".yrp"
))
lstReplayList
->
addItem
(
name
);
lstReplayList
->
addItem
(
name
);
});
});
}
}
...
...
gframe/game.h
View file @
a0201290
...
@@ -28,8 +28,23 @@ constexpr int TEXT_LINE_SIZE = 256;
...
@@ -28,8 +28,23 @@ constexpr int TEXT_LINE_SIZE = 256;
namespace
ygo
{
namespace
ygo
{
bool
IsExtension
(
const
wchar_t
*
filename
,
const
wchar_t
*
extension
);
template
<
size_t
N
>
bool
IsExtension
(
const
char
*
filename
,
const
char
*
extension
);
bool
IsExtension
(
const
wchar_t
*
filename
,
const
wchar_t
(
&
extension
)[
N
])
{
auto
flen
=
std
::
wcslen
(
filename
);
constexpr
size_t
elen
=
N
-
1
;
if
(
!
elen
||
flen
<
elen
)
return
false
;
return
!
mywcsncasecmp
(
filename
+
(
flen
-
elen
),
extension
,
elen
);
}
template
<
size_t
N
>
bool
IsExtension
(
const
char
*
filename
,
const
char
(
&
extension
)[
N
])
{
auto
flen
=
std
::
strlen
(
filename
);
constexpr
size_t
elen
=
N
-
1
;
if
(
!
elen
||
flen
<
elen
)
return
false
;
return
!
mystrncasecmp
(
filename
+
(
flen
-
elen
),
extension
,
elen
);
}
struct
Config
{
struct
Config
{
bool
use_d3d
{
false
};
bool
use_d3d
{
false
};
...
...
gframe/image_manager.cpp
View file @
a0201290
...
@@ -143,8 +143,8 @@ void ImageManager::ResizeTexture() {
...
@@ -143,8 +143,8 @@ void ImageManager::ResizeTexture() {
}
}
// function by Warr1024, from https://github.com/minetest/minetest/issues/2419 , modified
// function by Warr1024, from https://github.com/minetest/minetest/issues/2419 , modified
void
imageScaleNNAA
(
irr
::
video
::
IImage
*
src
,
irr
::
video
::
IImage
*
dest
)
{
void
imageScaleNNAA
(
irr
::
video
::
IImage
*
src
,
irr
::
video
::
IImage
*
dest
)
{
const
irr
::
core
::
dimension2d
<
irr
::
u32
>
srcDim
=
src
->
getDimension
();
const
auto
&
srcDim
=
src
->
getDimension
();
const
irr
::
core
::
dimension2d
<
irr
::
u32
>
destDim
=
dest
->
getDimension
();
const
auto
&
destDim
=
dest
->
getDimension
();
// Cache scale ratios.
// Cache scale ratios.
const
double
rx
=
(
double
)
srcDim
.
Width
/
destDim
.
Width
;
const
double
rx
=
(
double
)
srcDim
.
Width
/
destDim
.
Width
;
...
@@ -157,8 +157,8 @@ void imageScaleNNAA(irr::video::IImage *src, irr::video::IImage *dest) {
...
@@ -157,8 +157,8 @@ void imageScaleNNAA(irr::video::IImage *src, irr::video::IImage *dest) {
// Walk each destination image pixel.
// Walk each destination image pixel.
#pragma omp for schedule(dynamic)
#pragma omp for schedule(dynamic)
for
(
irr
::
s32
dy
=
0
;
dy
<
destDim
.
Height
;
dy
++
)
{
for
(
irr
::
s32
dy
=
0
;
dy
<
(
irr
::
s32
)
destDim
.
Height
;
dy
++
)
{
for
(
irr
::
s32
dx
=
0
;
dx
<
destDim
.
Width
;
dx
++
)
{
for
(
irr
::
s32
dx
=
0
;
dx
<
(
irr
::
s32
)
destDim
.
Width
;
dx
++
)
{
// Calculate floating-point source rectangle bounds.
// Calculate floating-point source rectangle bounds.
minsx
=
dx
*
rx
;
minsx
=
dx
*
rx
;
maxsx
=
minsx
+
rx
;
maxsx
=
minsx
+
rx
;
...
...
gframe/menu_handler.cpp
View file @
a0201290
...
@@ -523,10 +523,13 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -523,10 +523,13 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
}
}
case
LISTBOX_REPLAY_LIST
:
{
case
LISTBOX_REPLAY_LIST
:
{
int
sel
=
mainGame
->
lstReplayList
->
getSelected
();
int
sel
=
mainGame
->
lstReplayList
->
getSelected
();
if
(
sel
==
-
1
)
if
(
sel
<
0
)
break
;
auto
filename
=
mainGame
->
lstReplayList
->
getListItem
(
sel
);
if
(
!
filename
)
break
;
break
;
wchar_t
replay_path
[
256
]{};
wchar_t
replay_path
[
256
]{};
myswprintf
(
replay_path
,
L"./replay/%ls"
,
mainGame
->
lstReplayList
->
getListItem
(
sel
)
);
myswprintf
(
replay_path
,
L"./replay/%ls"
,
filename
);
if
(
!
temp_replay
.
OpenReplay
(
replay_path
))
{
if
(
!
temp_replay
.
OpenReplay
(
replay_path
))
{
mainGame
->
stReplayInfo
->
setText
(
L"Error"
);
mainGame
->
stReplayInfo
->
setText
(
L"Error"
);
break
;
break
;
...
@@ -536,8 +539,12 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -536,8 +539,12 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
time_t
curtime
;
time_t
curtime
;
if
(
temp_replay
.
pheader
.
flag
&
REPLAY_UNIFORM
)
if
(
temp_replay
.
pheader
.
flag
&
REPLAY_UNIFORM
)
curtime
=
temp_replay
.
pheader
.
start_time
;
curtime
=
temp_replay
.
pheader
.
start_time
;
else
else
{
curtime
=
temp_replay
.
pheader
.
seed
;
curtime
=
temp_replay
.
pheader
.
seed
;
wchar_t
version_info
[
256
]{};
myswprintf
(
version_info
,
L"version 0x%X
\n
"
,
temp_replay
.
pheader
.
version
);
repinfo
.
append
(
version_info
);
}
std
::
wcsftime
(
infobuf
,
sizeof
infobuf
/
sizeof
infobuf
[
0
],
L"%Y/%m/%d %H:%M:%S
\n
"
,
std
::
localtime
(
&
curtime
));
std
::
wcsftime
(
infobuf
,
sizeof
infobuf
/
sizeof
infobuf
[
0
],
L"%Y/%m/%d %H:%M:%S
\n
"
,
std
::
localtime
(
&
curtime
));
repinfo
.
append
(
infobuf
);
repinfo
.
append
(
infobuf
);
if
(
temp_replay
.
pheader
.
flag
&
REPLAY_SINGLE_MODE
)
{
if
(
temp_replay
.
pheader
.
flag
&
REPLAY_SINGLE_MODE
)
{
...
...
gframe/premake5.lua
View file @
a0201290
...
@@ -16,6 +16,7 @@ project "YGOPro"
...
@@ -16,6 +16,7 @@ project "YGOPro"
else
else
includedirs
{
EVENT_INCLUDE_DIR
}
includedirs
{
EVENT_INCLUDE_DIR
}
libdirs
{
EVENT_LIB_DIR
}
libdirs
{
EVENT_LIB_DIR
}
links
{
"event_pthreads"
}
end
end
if
BUILD_IRRLICHT
then
if
BUILD_IRRLICHT
then
...
@@ -67,6 +68,7 @@ project "YGOPro"
...
@@ -67,6 +68,7 @@ project "YGOPro"
end
end
filter
"system:windows"
filter
"system:windows"
entrypoint
"mainCRTStartup"
defines
{
"_IRR_WCHAR_FILESYSTEM"
}
defines
{
"_IRR_WCHAR_FILESYSTEM"
}
files
"ygopro.rc"
files
"ygopro.rc"
links
{
"opengl32"
,
"ws2_32"
,
"winmm"
,
"gdi32"
,
"kernel32"
,
"user32"
,
"imm32"
,
"iphlpapi"
}
links
{
"opengl32"
,
"ws2_32"
,
"winmm"
,
"gdi32"
,
"kernel32"
,
"user32"
,
"imm32"
,
"iphlpapi"
}
...
@@ -82,15 +84,17 @@ project "YGOPro"
...
@@ -82,15 +84,17 @@ project "YGOPro"
end
end
end
end
filter
"not system:windows"
filter
"not system:windows"
links
{
"
event_pthreads"
,
"
dl"
,
"pthread"
}
links
{
"dl"
,
"pthread"
}
filter
"system:macosx"
filter
"system:macosx"
openmp
"Off"
openmp
"Off"
links
{
"z"
}
links
{
"z"
}
defines
{
"GL_SILENCE_DEPRECATION"
}
defines
{
"GL_SILENCE_DEPRECATION"
}
if
MAC_ARM
then
if
MAC_ARM
then
buildoptions
{
"--target=arm64-apple-macos12"
}
linkoptions
{
"-arch arm64"
}
linkoptions
{
"-arch arm64"
}
end
end
if
MAC_INTEL
then
linkoptions
{
"-arch x86_64"
}
end
if
USE_AUDIO
and
AUDIO_LIB
==
"irrklang"
then
if
USE_AUDIO
and
AUDIO_LIB
==
"irrklang"
then
links
{
"irrklang"
}
links
{
"irrklang"
}
end
end
...
...
gframe/replay.cpp
View file @
a0201290
...
@@ -111,7 +111,16 @@ bool Replay::OpenReplay(const wchar_t* name) {
...
@@ -111,7 +111,16 @@ bool Replay::OpenReplay(const wchar_t* name) {
return
false
;
return
false
;
Reset
();
Reset
();
if
(
std
::
fread
(
&
pheader
,
sizeof
pheader
,
1
,
rfp
)
<
1
)
{
bool
correct_header
=
true
;
if
(
std
::
fread
(
&
pheader
,
sizeof
pheader
,
1
,
rfp
)
<
1
)
correct_header
=
false
;
else
if
(
pheader
.
id
!=
0x31707279
)
correct_header
=
false
;
else
if
(
pheader
.
version
<
0x12d0u
)
correct_header
=
false
;
else
if
(
pheader
.
version
>=
0x1353u
&&
!
(
pheader
.
flag
&
REPLAY_UNIFORM
))
correct_header
=
false
;
if
(
!
correct_header
)
{
std
::
fclose
(
rfp
);
std
::
fclose
(
rfp
);
return
false
;
return
false
;
}
}
...
@@ -142,17 +151,6 @@ bool Replay::OpenReplay(const wchar_t* name) {
...
@@ -142,17 +151,6 @@ bool Replay::OpenReplay(const wchar_t* name) {
data_position
=
0
;
data_position
=
0
;
return
true
;
return
true
;
}
}
bool
Replay
::
CheckReplay
(
const
wchar_t
*
name
)
{
wchar_t
fname
[
256
];
myswprintf
(
fname
,
L"./replay/%ls"
,
name
);
FILE
*
rfp
=
mywfopen
(
fname
,
"rb"
);
if
(
!
rfp
)
return
false
;
ReplayHeader
rheader
;
size_t
count
=
std
::
fread
(
&
rheader
,
sizeof
rheader
,
1
,
rfp
);
std
::
fclose
(
rfp
);
return
count
==
1
&&
rheader
.
id
==
0x31707279
&&
rheader
.
version
>=
0x12d0u
&&
(
rheader
.
version
<
0x1353u
||
(
rheader
.
flag
&
REPLAY_UNIFORM
));
}
bool
Replay
::
DeleteReplay
(
const
wchar_t
*
name
)
{
bool
Replay
::
DeleteReplay
(
const
wchar_t
*
name
)
{
wchar_t
fname
[
256
];
wchar_t
fname
[
256
];
myswprintf
(
fname
,
L"./replay/%ls"
,
name
);
myswprintf
(
fname
,
L"./replay/%ls"
,
name
);
...
...
gframe/replay.h
View file @
a0201290
...
@@ -53,7 +53,6 @@ public:
...
@@ -53,7 +53,6 @@ public:
void
SaveReplay
(
const
wchar_t
*
name
);
void
SaveReplay
(
const
wchar_t
*
name
);
// play
// play
static
bool
CheckReplay
(
const
wchar_t
*
name
);
static
bool
DeleteReplay
(
const
wchar_t
*
name
);
static
bool
DeleteReplay
(
const
wchar_t
*
name
);
static
bool
RenameReplay
(
const
wchar_t
*
oldname
,
const
wchar_t
*
newname
);
static
bool
RenameReplay
(
const
wchar_t
*
oldname
,
const
wchar_t
*
newname
);
static
size_t
GetDeckPlayer
(
size_t
deck_index
)
{
static
size_t
GetDeckPlayer
(
size_t
deck_index
)
{
...
...
premake/event/premake5.lua
View file @
a0201290
...
@@ -17,3 +17,10 @@ project "event"
...
@@ -17,3 +17,10 @@ project "event"
"xcopy /E /Y $(ProjectDir)..\\event\\WIN32-Code\\nmake $(ProjectDir)..\\event\\include"
}
"xcopy /E /Y $(ProjectDir)..\\event\\WIN32-Code\\nmake $(ProjectDir)..\\event\\include"
}
files
{
"win32select.c"
,
"evthread_win32.c"
,
"buffer_iocp.c"
,
"event_iocp.c"
,
"bufferevent_async.c"
}
files
{
"win32select.c"
,
"evthread_win32.c"
,
"buffer_iocp.c"
,
"event_iocp.c"
,
"bufferevent_async.c"
}
defines
{
"UINT32_MAX=0xffffffffui32"
}
-- quirk of libevent 2.1.2
defines
{
"UINT32_MAX=0xffffffffui32"
}
-- quirk of libevent 2.1.2
--defines { "WIN32" } -- quirk of old libevent
filter
"system:linux"
files
{
"evthread_pthread.c"
,
"epoll.c"
,
"epoll_sub.c"
,
"poll.c"
,
"select.c"
}
filter
"system:macosx"
files
{
"evthread_pthread.c"
,
"kqueue.c"
,
"poll.c"
,
"select.c"
}
premake/irrlicht/premake5.lua
View file @
a0201290
...
@@ -155,7 +155,11 @@ project "irrlicht"
...
@@ -155,7 +155,11 @@ project "irrlicht"
filter
{
"system:windows"
}
filter
{
"system:windows"
}
defines
{
"_IRR_WCHAR_FILESYSTEM"
}
defines
{
"_IRR_WCHAR_FILESYSTEM"
}
includedirs
{
"$(DXSDK_DIR)Include"
}
if
USE_DXSDK
then
includedirs
{
"$(DXSDK_DIR)Include"
}
else
defines
{
"NO_IRR_COMPILE_WITH_DIRECT3D_9_"
}
end
filter
{
"system:linux"
}
filter
{
"system:linux"
}
links
{
"X11"
,
"Xxf86vm"
}
links
{
"X11"
,
"Xxf86vm"
}
...
...
premake/miniaudio/premake5.lua
View file @
a0201290
...
@@ -33,12 +33,6 @@ project "miniaudio"
...
@@ -33,12 +33,6 @@ project "miniaudio"
"external/opus/celt/rate.c"
,
"external/opus/celt/rate.c"
,
"external/opus/celt/vq.c"
,
"external/opus/celt/vq.c"
,
"external/opus/celt/x86/pitch_avx.c"
,
"external/opus/celt/x86/pitch_sse.c"
,
"external/opus/celt/x86/vq_sse2.c"
,
"external/opus/celt/x86/x86_celt_map.c"
,
"external/opus/celt/x86/x86cpu.c"
,
"external/opus/silk/bwexpander.c"
,
"external/opus/silk/bwexpander.c"
,
"external/opus/silk/bwexpander_32.c"
,
"external/opus/silk/bwexpander_32.c"
,
"external/opus/silk/CNG.c"
,
"external/opus/silk/CNG.c"
,
...
@@ -118,10 +112,28 @@ project "miniaudio"
...
@@ -118,10 +112,28 @@ project "miniaudio"
"external/vorbis/include"
,
"external/vorbis/include"
,
}
}
defines
{
defines
{
"OPUS_BUILD"
,
"USE_ALLOCA"
,
"HAVE_LRINTF"
,
"OP_HAVE_LRINTF"
,
"OPUS_BUILD"
,
"OPUS_X86_PRESUME_SSE"
,
"OPUS_X86_PRESUME_SSE2"
,
"USE_ALLOCA"
,
"OPUS_HAVE_RTCD"
,
"OPUS_X86_MAY_HAVE_SSE"
,
"OPUS_X86_MAY_HAVE_SSE4_1"
,
"OPUS_X86_MAY_HAVE_AVX2"
,
"HAVE_LRINTF"
,
"OP_HAVE_LRINTF"
,
}
}
if
not
TARGET_MAC_ARM
then
files
{
"external/opus/celt/x86/pitch_avx.c"
,
"external/opus/celt/x86/pitch_sse.c"
,
"external/opus/celt/x86/vq_sse2.c"
,
"external/opus/celt/x86/x86_celt_map.c"
,
"external/opus/celt/x86/x86cpu.c"
,
}
defines
{
"OPUS_HAVE_RTCD"
,
"CPU_INFO_BY_ASM"
,
"OPUS_X86_PRESUME_SSE"
,
"OPUS_X86_PRESUME_SSE2"
,
"OPUS_X86_MAY_HAVE_SSE"
,
"OPUS_X86_MAY_HAVE_SSE4_1"
,
"OPUS_X86_MAY_HAVE_AVX2"
,
}
filter
"system:linux"
buildoptions
{
"-mavx"
,
"-mfma"
}
filter
{}
end
else
else
includedirs
{
OPUS_INCLUDE_DIR
,
OPUSFILE_INCLUDE_DIR
,
VORBIS_INCLUDE_DIR
,
OGG_INCLUDE_DIR
}
includedirs
{
OPUS_INCLUDE_DIR
,
OPUSFILE_INCLUDE_DIR
,
VORBIS_INCLUDE_DIR
,
OGG_INCLUDE_DIR
}
end
end
...
...
premake/sqlite3/premake5.lua
View file @
a0201290
...
@@ -2,3 +2,12 @@ project "sqlite3"
...
@@ -2,3 +2,12 @@ project "sqlite3"
kind
"StaticLib"
kind
"StaticLib"
files
{
"sqlite3.c"
,
"sqlite3.h"
}
files
{
"sqlite3.c"
,
"sqlite3.h"
}
defines
{
"SQLITE_DQS=0"
,
"SQLITE_DEFAULT_MEMSTATUS=0"
,
"SQLITE_MAX_EXPR_DEPTH=0"
,
"SQLITE_OMIT_DECLTYPE"
,
"SQLITE_OMIT_DEPRECATED"
,
"SQLITE_OMIT_PROGRESS_CALLBACK"
,
"SQLITE_OMIT_SHARED_CACHE"
,
}
premake5.lua
View file @
a0201290
-- default global settings
-- Supported systems: Windows, Linux, MacOS
-- Global settings
-- Default: Build Lua, Irrlicht from source on all systems.
-- Don't build event, freetype, sqlite, opus, vorbis on Linux or MacOS, use apt or homebrew,
-- but build them on Windows, due to the lack of package manager on Windows.
BUILD_LUA
=
true
BUILD_LUA
=
true
LUA_LIB_NAME
=
"lua"
LUA_LIB_NAME
=
"lua"
-- change this if you don't build Lua
BUILD_EVENT
=
os
.
istarget
(
"windows"
)
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
=
true
BUILD_IRRLICHT
=
true
-- modified Irrlicht is required, can't use the official one
USE_DXSDK
=
true
USE_AUDIO
=
true
USE_AUDIO
=
true
AUDIO_LIB
=
"miniaudio"
AUDIO_LIB
=
"miniaudio"
-- can be "miniaudio" or "irrklang"
-- BUILD_MINIAUDIO is always true
MINIAUDIO_SUPPORT_OPUS_VORBIS
=
true
MINIAUDIO_SUPPORT_OPUS_VORBIS
=
true
MINIAUDIO_BUILD_OPUS_VORBIS
=
os
.
istarget
(
"windows"
)
MINIAUDIO_BUILD_OPUS_VORBIS
=
os
.
istarget
(
"windows"
)
-- BUILD_IRRKLANG is impossible because irrKlang is not open source
IRRKLANG_PRO
=
false
IRRKLANG_PRO
=
false
IRRKLANG_PRO_BUILD_IKPMP3
=
false
IRRKLANG_PRO_BUILD_IKPMP3
=
false
--
r
ead settings from command line or environment variables
--
R
ead settings from command line or environment variables
newoption
{
trigger
=
"build-lua"
,
category
=
"YGOPro - lua"
,
description
=
""
}
newoption
{
trigger
=
"build-lua"
,
category
=
"YGOPro - lua"
,
description
=
""
}
newoption
{
trigger
=
"no-build-lua"
,
category
=
"YGOPro - lua"
,
description
=
""
}
newoption
{
trigger
=
"no-build-lua"
,
category
=
"YGOPro - lua"
,
description
=
""
}
...
@@ -42,6 +54,7 @@ newoption { trigger = "build-irrlicht", category = "YGOPro - irrlicht", descript
...
@@ -42,6 +54,7 @@ newoption { trigger = "build-irrlicht", category = "YGOPro - irrlicht", descript
newoption
{
trigger
=
"no-build-irrlicht"
,
category
=
"YGOPro - irrlicht"
,
description
=
""
}
newoption
{
trigger
=
"no-build-irrlicht"
,
category
=
"YGOPro - irrlicht"
,
description
=
""
}
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
=
"no-dxsdk"
,
category
=
"YGOPro - irrlicht"
,
description
=
""
}
newoption
{
trigger
=
"no-audio"
,
category
=
"YGOPro"
,
description
=
""
}
newoption
{
trigger
=
"no-audio"
,
category
=
"YGOPro"
,
description
=
""
}
newoption
{
trigger
=
"audio-lib"
,
category
=
"YGOPro"
,
description
=
""
,
value
=
"miniaudio, irrklang"
,
default
=
AUDIO_LIB
}
newoption
{
trigger
=
"audio-lib"
,
category
=
"YGOPro"
,
description
=
""
,
value
=
"miniaudio, irrklang"
,
default
=
AUDIO_LIB
}
...
@@ -71,7 +84,8 @@ newoption { trigger = "irrklang-pro-debug-lib-dir", category = "YGOPro - irrklan
...
@@ -71,7 +84,8 @@ newoption { trigger = "irrklang-pro-debug-lib-dir", category = "YGOPro - irrklan
newoption
{
trigger
=
'build-ikpmp3'
,
category
=
"YGOPro - irrklang - ikpmp3"
,
description
=
""
}
newoption
{
trigger
=
'build-ikpmp3'
,
category
=
"YGOPro - irrklang - ikpmp3"
,
description
=
""
}
newoption
{
trigger
=
"winxp-support"
,
category
=
"YGOPro"
,
description
=
""
}
newoption
{
trigger
=
"winxp-support"
,
category
=
"YGOPro"
,
description
=
""
}
newoption
{
trigger
=
"mac-arm"
,
category
=
"YGOPro"
,
description
=
"Cross compile for Apple Silicon"
}
newoption
{
trigger
=
"mac-arm"
,
category
=
"YGOPro"
,
description
=
"Compile for Apple Silicon Mac"
}
newoption
{
trigger
=
"mac-intel"
,
category
=
"YGOPro"
,
description
=
"Compile for Intel Mac"
}
function
GetParam
(
param
)
function
GetParam
(
param
)
return
_OPTIONS
[
param
]
or
os.getenv
(
string.upper
(
string.gsub
(
param
,
"-"
,
"_"
)))
return
_OPTIONS
[
param
]
or
os.getenv
(
string.upper
(
string.gsub
(
param
,
"-"
,
"_"
)))
...
@@ -91,15 +105,15 @@ elseif GetParam("no-build-lua") then
...
@@ -91,15 +105,15 @@ elseif GetParam("no-build-lua") then
BUILD_LUA
=
false
BUILD_LUA
=
false
end
end
if
not
BUILD_LUA
then
if
not
BUILD_LUA
then
-- at most times you need to change th
is
if you change BUILD_LUA to false
-- at most times you need to change th
ose
if you change BUILD_LUA to false
-- make sure your lua lib is built with C++ and version >= 5.3
-- make sure your lua lib is built with C++ and version >= 5.3
LUA_LIB_NAME
=
GetParam
(
"lua-lib-name"
)
LUA_LIB_NAME
=
GetParam
(
"lua-lib-name"
)
or
LUA_LIB_NAME
LUA_INCLUDE_DIR
=
GetParam
(
"lua-include-dir"
)
or
os
.
findheader
(
"lua.h"
)
LUA_INCLUDE_DIR
=
GetParam
(
"lua-include-dir"
)
or
os
.
findheader
(
"lua.h"
)
LUA_LIB_DIR
=
GetParam
(
"lua-lib-dir"
)
or
os
.
findlib
(
LUA_LIB_NAME
)
LUA_LIB_DIR
=
GetParam
(
"lua-lib-dir"
)
or
os
.
findlib
(
LUA_LIB_NAME
)
end
end
if
GetParam
(
"build-event"
)
then
if
GetParam
(
"build-event"
)
then
BUILD_EVENT
=
os
.
istarget
(
"windows"
)
-- only on windows for now
BUILD_EVENT
=
true
elseif
GetParam
(
"no-build-event"
)
then
elseif
GetParam
(
"no-build-event"
)
then
BUILD_EVENT
=
false
BUILD_EVENT
=
false
end
end
...
@@ -138,6 +152,16 @@ if not BUILD_IRRLICHT then
...
@@ -138,6 +152,16 @@ if not BUILD_IRRLICHT then
IRRLICHT_LIB_DIR
=
GetParam
(
"irrlicht-lib-dir"
)
or
os
.
findlib
(
"irrlicht"
)
IRRLICHT_LIB_DIR
=
GetParam
(
"irrlicht-lib-dir"
)
or
os
.
findlib
(
"irrlicht"
)
end
end
if
GetParam
(
"no-dxsdk"
)
then
USE_DXSDK
=
false
end
if
USE_DXSDK
and
os
.
istarget
(
"windows"
)
then
if
not
os.getenv
(
"DXSDK_DIR"
)
then
print
(
"DXSDK_DIR environment variable not set, it seems you don't have the DirectX SDK installed. DirectX mode will be disabled."
)
USE_DXSDK
=
false
end
end
if
GetParam
(
"no-audio"
)
then
if
GetParam
(
"no-audio"
)
then
USE_AUDIO
=
false
USE_AUDIO
=
false
elseif
GetParam
(
"no-use-miniaudio"
)
then
elseif
GetParam
(
"no-use-miniaudio"
)
then
...
@@ -212,8 +236,26 @@ end
...
@@ -212,8 +236,26 @@ end
if
GetParam
(
"winxp-support"
)
and
os
.
istarget
(
"windows"
)
then
if
GetParam
(
"winxp-support"
)
and
os
.
istarget
(
"windows"
)
then
WINXP_SUPPORT
=
true
WINXP_SUPPORT
=
true
end
end
if
GetParam
(
"mac-arm"
)
and
os
.
istarget
(
"macosx"
)
then
MAC_ARM
=
true
if
os
.
istarget
(
"macosx"
)
then
if
GetParam
(
"mac-arm"
)
then
MAC_ARM
=
true
end
if
GetParam
(
"mac-intel"
)
then
MAC_INTEL
=
true
end
if
MAC_ARM
then
TARGET_MAC_ARM
=
true
elseif
not
MAC_INTEL
then
-- automatic target arm64, need extra detect
local
uname
=
os
.
outputof
(
"uname -m"
)
local
proctranslated
=
os
.
outputof
(
"sysctl sysctl.proc_translated"
)
if
uname
:
find
(
"arm"
)
or
proctranslated
then
print
(
"Detected Apple Silicon Mac"
)
TARGET_MAC_ARM
=
true
end
end
end
end
workspace
"YGOPro"
workspace
"YGOPro"
...
@@ -224,7 +266,6 @@ workspace "YGOPro"
...
@@ -224,7 +266,6 @@ workspace "YGOPro"
configurations
{
"Release"
,
"Debug"
}
configurations
{
"Release"
,
"Debug"
}
filter
"system:windows"
filter
"system:windows"
entrypoint
"mainCRTStartup"
systemversion
"latest"
systemversion
"latest"
startproject
"YGOPro"
startproject
"YGOPro"
if
WINXP_SUPPORT
then
if
WINXP_SUPPORT
then
...
@@ -233,11 +274,24 @@ workspace "YGOPro"
...
@@ -233,11 +274,24 @@ workspace "YGOPro"
else
else
defines
{
"WINVER=0x0601"
}
-- WIN7
defines
{
"WINVER=0x0601"
}
-- WIN7
end
end
platforms
{
"Win32"
,
"x64"
}
filter
{
"system:windows"
,
"platforms:Win32"
}
architecture
"x86"
filter
{
"system:windows"
,
"platforms:x64"
}
architecture
"x86_64"
filter
"system:macosx"
filter
"system:macosx"
libdirs
{
"/usr/local/lib"
}
libdirs
{
"/usr/local/lib"
}
if
MAC_ARM
then
if
MAC_ARM
then
buildoptions
{
"--target=arm64-apple-macos12"
}
buildoptions
{
"-arch arm64"
}
end
if
MAC_INTEL
then
buildoptions
{
"-arch x86_64"
,
"-mavx"
,
"-mfma"
}
end
if
MAC_ARM
and
MAC_INTEL
then
architecture
"universal"
end
end
links
{
"OpenGL.framework"
,
"Cocoa.framework"
,
"IOKit.framework"
}
links
{
"OpenGL.framework"
,
"Cocoa.framework"
,
"IOKit.framework"
}
...
@@ -253,6 +307,18 @@ workspace "YGOPro"
...
@@ -253,6 +307,18 @@ workspace "YGOPro"
defines
"_DEBUG"
defines
"_DEBUG"
targetdir
"bin/debug"
targetdir
"bin/debug"
filter
{
"system:windows"
,
"platforms:Win32"
,
"configurations:Release"
}
targetdir
"bin/release/x86"
filter
{
"system:windows"
,
"platforms:Win32"
,
"configurations:Debug"
}
targetdir
"bin/debug/x86"
filter
{
"system:windows"
,
"platforms:x64"
,
"configurations:Release"
}
targetdir
"bin/release/x64"
filter
{
"system:windows"
,
"platforms:x64"
,
"configurations:Debug"
}
targetdir
"bin/debug/x64"
filter
{
"configurations:Release"
,
"action:vs*"
}
filter
{
"configurations:Release"
,
"action:vs*"
}
if
linktimeoptimization
then
if
linktimeoptimization
then
linktimeoptimization
"On"
linktimeoptimization
"On"
...
@@ -265,9 +331,6 @@ workspace "YGOPro"
...
@@ -265,9 +331,6 @@ workspace "YGOPro"
filter
{
"configurations:Release"
,
"not action:vs*"
}
filter
{
"configurations:Release"
,
"not action:vs*"
}
symbols
"On"
symbols
"On"
defines
"NDEBUG"
defines
"NDEBUG"
if
not
MAC_ARM
then
buildoptions
"-march=native"
end
filter
{
"configurations:Debug"
,
"action:vs*"
}
filter
{
"configurations:Debug"
,
"action:vs*"
}
disablewarnings
{
"6011"
,
"6031"
,
"6054"
,
"6262"
}
disablewarnings
{
"6011"
,
"6031"
,
"6054"
,
"6262"
}
...
@@ -283,6 +346,9 @@ workspace "YGOPro"
...
@@ -283,6 +346,9 @@ workspace "YGOPro"
filter
"not action:vs*"
filter
"not action:vs*"
buildoptions
{
"-fno-strict-aliasing"
,
"-Wno-multichar"
,
"-Wno-format-security"
}
buildoptions
{
"-fno-strict-aliasing"
,
"-Wno-multichar"
,
"-Wno-format-security"
}
if
not
MAC_ARM
and
not
MAC_INTEL
then
buildoptions
"-march=native"
end
filter
{}
filter
{}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment