Skip to content
mercury233 edited this page Apr 3, 2022 · 1 revision

Preparation

Download

  • YGOPro distribution

    It is used to obtain cards database and pictures, in which database is necessary

  • git

    And have GitHub account and SSH key

  • premake5

    There are two kinds of project description files, premake and cmake, but cmake has not been maintained recently

  • irrKlang

    Download the 64-bit version, can be disabled by changing USE_IRRKLANG in premake5.lua, the result is no sound

Dependency Libraries

Install via apt:

  • libevent-dev
  • libfreetype6-dev
  • libgl1-mesa-dev
  • libglu1-mesa-dev
  • libsqlite3-dev
  • libxxf86vm-dev

The following two dependency libraries need their source codes to be manually downloaded and statically compiled

  • Irrlicht-1.8.5

    Only this version has been tested and needs to be patched with Chinese support

  • Lua-5.4

    Versions 5.2 and earlier are not supported, must be built with C++, not C

Download repo

Just use git clone, and add --recursive to clone sub modules at the same time, or run git submodule update --init after completion

After cloning is finished, enter the ocgcore and script sub-module dirs and checkout to master branch.

Commands:

git clone git@github.com:Fluorohydride/ygopro.git
cd ygopro
git submodule update --init
cd ocgcore/
git checkout master 
cd ..
cd script/
git checkout master 
cd ..

Install Dependency Libraries

  • Unzip the downloaded irrlicht to the project folder and rename it to irrlicht

  • Unzip the downloaded irrKlang to the project folder and rename it to irrklang ("k" is lowercase)

  • Unzip the downloaded lua to the project folder and rename it to lua

  • Copy all folders in the premake folder to the project folder, which contains the premake description files of each dependent library, which can be modified and improved by yourself

Patch Irrlicht

The original version of Irrlicht does not support Chinese copy and paste, does not support input method, and needs to be patched. Enter the Irrlicht folder and run

patch -p1 < irrlicht.patch

You can also use the modified version directly

Generate project files and compile

Extract premake5 executable directly into the project folder and run

./premake5 gmake

Then you can enter the build dir and make

At this time, the directory structure should look like this after omitting redundant files:

├── bin
├── build
├── cmake
├── gframe
├── irrklang
│   ├── bin
│   └── include
├── irrlicht
│   ├── include
│   └── source
│       └── Irrlicht
├── lua
│   └── src
├── obj
├── ocgcore
├── premake
├── script
├── sound
└── textures

Run and Debug

ln cards.cdb and pics dir and deck dir and replay dir to the project folder

And ln the ygopro executable in bin\release or bin\debug to the project folder and run it