This is the first part of a few small tutorials on how to get the source code (and possibly compile it).
Getting the source code
There are two avenues you can take when downloading the source code. The first would be to use GitHub's "Download as Zip" button on the project's homepage. This is probably the easiest way to get the source code. The second option is to install git and download the source by cloning the repository. A nice choice for windows is
TortoiseGit which provides a graphical interface as well as the option to add the git command to the command prompt. The benefit of this method is that getting the newest code is just a simple command which can even be integrated into a batch file.
Downloading the source using the command prompt and git
Create a new folder where you want to download the source code to, either using the mkdir command or by creating one in Explorer. Open a command prompt and navigate to your newly created folder using the cd command. Once in the folder, enter 'git clone
https://github.com/someone972/driver-level-editor.git'. If all goes well it should create a folder called driver-level-editor. you can then enter this folder and use the 'git pull' command to get updates. To make this process easy, you may wish to create a batch file in the driver-level-editor folder called update.bat or similar. Enter the following:
You can now just run the batch file instead of having to open a command prompt every time.
Downloading the source using TortoiseGit's GUI
This assumes that you allowed shell extensions when installing TortoiseGit. Create a new folder where you want to download the files to. Then right-click the folder and select "Git Clone...". A dialog box should pop up; enter '
https://github.com/someone972/driver-level-editor.git' into the URL field. If 'Load putty key' is checked, uncheck it. Once you click OK the download should begin, and hopefully will not have any errors. To get updates, right click on the driver-level-editor folder and navigate to the TortoiseGit sub-menu and select pull. Click OK on the dialog box that appears and it should get the newest versions of the files, or inform you that they are up to date.
Compiling the source
There are a few things you will need in order to compile the source.
FINISH ME
Setting up Code::Blocks
Start by downloading Code::Blocks 12.11 bundled with MinGW (codeblocks-12.11mingw-setup.exe) from
here. If you already have a compiler installed you can download the version without MinGW instead, so long as your compiler is up to date.
Getting Qt5
Compiling Qt5
Getting FreeImage
Download the precompiled FreeImage DLL from the following link:
http://freeimage.sourceforge.net/download.html After extracting the file you should have a folder 'FreeImage' with a 'dist' folder inside. Copy the 'FreeImage' folder to the location of your choice (I generally like to put it in the Code::Blocks directory).
Setting up Environment Variables in Code::Blocks
Before you can compile the DLE, you need to set up some environment variables in Code::Blocks telling it where to look for Qt and FreeImage. Select Settings->Environment and scroll down to the environment variables section. There are three variables you must add in order for DLE to compile:
- QTDIR - Set this to the folder where Qt is installed. The folder you select should have a folder called 'bin' inside of it, with qmake.exe inside of that.
- FREEIMAGE_INCLUDE_DIR - Set this to the folder that contains FreeImage.h. This will probably be the 'dist' folder if you downloaded the binary release.
- FREEIMAGE_LIB_DIR - Set this to the folder that contains FreeImage.lib. This may be the same as FREEIMAGE_INCLUDE_DIR.
Compiling the Driver Level Editor
If everything is set up properly then you should be able to compile the DLE by selecting either 'debug' or 'release' and selecting Build from the Build menu. By default the project is set up to output the executable and object files in a directory called 'DCI_nosync' which should be in the same folder as the main source folder. It is formatted this way so that if you are syncing the source folders between multiple computers using SugarSync or the like, it will not waste time uploading the exe.