-
Notifications
You must be signed in to change notification settings - Fork 617
Building on Windows
-
YGOPro distribution
- Used to obtain card database and card images, the database is essential
-
- Supports Visual Studio 2015 and higher versions
- When installing, please check the Desktop development with C++ component
-
- The project supports both Premake and CMake build systems, but CMake has not been maintained recently, so Premake is recommended
Currently, there is no well-established automated solution for installing dependencies on Windows platform. It is recommended to manually download the source code of each library and compile them statically.
-
- Only version 2.0.22 has been thoroughly tested, newer versions may be compatible but have not been verified
-
- This is a modified version of Irrlicht with added Chinese support and other features
- The original Irrlicht is not supported
-
- Only versions 5.3.x and 5.4.x are supported
-
- Only version 0.11.22 is supported, and you need to use the
miniaudio_split
version from it
- Only version 0.11.22 is supported, and you need to use the
-
- Only the amalgamation version is supported
Use Git to clone the repository, making sure to include all submodules:
# Complete clone of code and submodules (recommended)
git clone --recursive https://github.com/Fluorohydride/ygopro.git
cd ygopro
# Or step by step
git clone https://github.com/Fluorohydride/ygopro.git
cd ygopro
git submodule update --init
# Switch submodules to the correct branch
cd ocgcore
git checkout master
cd ..
cd script
git checkout master
cd ..
Extract all downloaded dependency libraries to the project root directory and rename them according to the following rules:
-
libevent → Rename to
event
-
Freetype → Rename to
freetype
-
Irrlicht → Rename to
irrlicht
-
Lua → Rename to
lua
-
miniaudio → Rename to
miniaudio
- Copy the c and h files from
miniaudio/extras/miniaudio_split
to theminiaudio
folder to replace the original files
- Copy the c and h files from
-
SQLite → Rename to
sqlite3
(note that there is a 3 at the end of the name)
- Copy all subfolders in the premake folder to the project root directory
- These folders contain the premake description files needed to compile each dependency library
- Copy all subfolders in the resource folder to the project root directory
Install premake5.exe and add it to the PATH environment variable, or place it directly in the project root directory, then run:
premake5 vs2022 --no-miniaudio-support-opus-vorbis
This will generate a Visual Studio solution file (YGOPro.sln) in the build folder.
After successful configuration, the project directory structure should look like this (some files omitted):
├─build
├─event
│ └─include
├─freetype
│ ├─include
│ └─src
├─gframe
├─irrlicht
│ ├─include
│ └─source
│ └─Irrlicht
├─lua
│ └─src
├─miniaudio
├─ocgcore
├─script
├─sound
├─sqlite3
└─textures
Open YGOPro.sln
in Visual Studio, select Release
or Debug
mode, then build the solution.
After compilation, the generated executable will be located in the bin/release
or bin/debug
directory.
-
Copy the following files from the YGOPro distribution to the project root directory:
cards.cdb
-
pics
folder -
deck
folder
-
Copy the compiled
YGOPro.exe
to the project root directory -
Run
YGOPro.exe
In Visual Studio, you can set the working directory to your YGOPro directory for direct debugging.
Install the following 4 additional libraries:
Place these libraries in the miniaudio/external
folder and rename them to ogg
, opus
, opusfile
, vorbis
respectively.
Then run premake5
without the --no-miniaudio-support-opus-vorbis
parameter.
When generating project files with premake5, add the --winxp-support
parameter.
Note: You need to use Visual Studio 2019 or earlier versions, and install the XP support component for v141. Although Visual Studio 2022 can install the XP support for v141 and compile, it will report errors when running and cannot be used.
See FAQ for Building