Code

Code


Summary

Cendric is an open-source game, written in C++ using the multimedia library SFML. Its code is available on Github
and you're free to compile it yourself. Be aware that the master branch is the development branch, which means that it's the most recent code, but far from stable. Compile it at your own risk.

Used Libraries

  • SFML SFML is used for window handling, rendering and sound.
  • SQLite A SQLite database is used to store items and translations.
  • LUA Scripts for quests, NPC-routines and dialogues are written in LUA.
  • LUA Bridge A helper library that acts as a bridge between C++ (Engine) and C (LUA).
  • TinyXML 2 A small XML parser, used to parse level and map files.

How to compile

Windows

For Windows based systems, you are going to need Visual Studio, CMake and Git. You'll get them here:


Now you're ready to download and compile the code.
  • Use git clone https://github.com/tizian/Cendric2.git --recursive to download the code in a folder of your choice.
  • Prepare the source code for the use in Visual Studio with CMake.

    No caption
  • Open "build/Cendric2.sln" with Visual Studio.
  • In VS, set the project "Cendric2", as start-up project".
  • In "Configuration -> Properties -> Debugging", set the path to the working directory to "..".
  • Set the build type from "Release" to "Debug" and compile Cendric.
  • After compiling, you'll get an error because the .dlls have not been found. To solve this, copy the following files from the "Cendric2/build/ext/sfml/lib/Debug" folder into the "Cendric2/build/Debug" folder: sfml-audio-d-2.dll, sfml-graphics-d-2.dll, sfml-window-d-2.dll, sfml-system-d-2.dll and from the "Cendric2/ext/sfml/extlibs/bin/x86" folder the file openal32.dll also into the "Cendric/build/Debug" folder.
  • Start the program.

Linux

The following steps have been tested on Ubuntu 14.04 and 16.04 LTS. Be aware that if you're building for 16.04, there's still a GCC bug when it comes to linking shared libraries. To be sure to get rid of it, use at least GCC version 6.

  • Execute the following commands in the terminal:

    # install the libraries
    sudo apt-get install build-essential
    sudo apt-get install mesa-common-dev
    sudo apt-get install libxrandr-dev
    sudo apt-get install libx11-dev
    sudo apt-get install libsndfile1-dev
    sudo apt-get install libgl1-mesa-dev
    sudo apt-get install libglu1-mesa-dev
    sudo apt-get install libfreetype6-dev
    sudo apt-get install libopenal-dev
    sudo apt-get install libfreetype
    sudo apt-get install git
    sudo apt-get install cmake

    # get the code and create the makefile
    git clone https://github.com/tizian/Cendric2.git --recursive
    cd Cendric2
    mkdir build
    cd build
    cmake ..

    # compile
    make

    # run
    cd ..
    ./build/Cendric2

Mac

[TBD]