Cursed Earth: HOWTO for programmers
At first I need to say that this HOWTO for people, who didnt works with scons, git and gcc(MinGW) on Windows and want to help with Cursed Earth project.

First step. How to get source code.
Here is 2 ways:
download -src from Cursed Earth Files
Or get newer code from git. We have msysgit for this purpose. Msysgit have an GUI interface. Or you can use command line. You can find thousands of HOWTOs for command line interface, so it`s recommended.
If you will use git in command line mode – use "Run from the Windows command prompt" option. And use option “Checkout Windows-style, commit Unix-style line endings” anyway.
Let`s try – from any folder type in command line:
git --version
as result you`ll see:
git version
If everything works – let`s get source code.
git clone git://
from folder created for project (for example C:dev)
If you will make commits, please don`t forget to set up contact info and exceptions.
Running in – list of exceptions without IDE will contain:
These lines must be added to file cursedearth.gitinfoexclude where .git is a hidden folder. If any IDE used – you must add there any files, that IDE creates, such project file or else.
So, we have source code in project`s folder (for example C:devcursedearth).

Second step. Compiler installation.
Let`s install MinGW gcc 4.4 (not MinGW-5.1.6 with installer, because of gcc 3.6)
You can use my build(freeglut and -dep included) just unpack it to compiler folder (for example C:MinGW) and edit environment variable (thereinafter).
Or you can create your own build. Download last versions of packages from MinGW folder: binutils-*-mingw32-bin
Unpack it in one folder (for example C:MinGW) – merge all duplicated subdirectory.
Download and unpack freeglut to C:MinGW include and lib folders.
Move freeglut.dll to system32 inside WINDOWS folder or to C:MinGWbin folder.
Download and unpack cursedearth-dep to C:MinGW include and lib folders.
Move to system32 inside WINDOWS folder.

After that we need to add
at the end of PATH environment variable.
For do it (for WinXP) you can press Right Mouse Button on My ComputerPropertiesAdvancedEnvironment Variables button.
When new dialog window will be opened find needed variable name in System Variables panel. Select it and press Edit. Do NOT remove or replace selected string – just add new values to the end of it without space.
Ok, everything is done. Let`s test it — type in command line:
gcc -v
and result will be
Thread model: win32
gcc version 4.4.0 (GCC)
If you have some problems with error encoding – delete your locale from C:MinGWsharelocale\.
So compiler works.

Third step. Build system.
We`ll use scons build system.
We need to install Python 2.6.4 (for example to CTongueython26)
After that install scons
to the end of PATH environment variable(thereinbefore).
Let`s try — type in command line:
python -V
and result will be
Python 2.6.4
And response on
scons -v
will be
SCons by Steven Knight et al.:
engine: v1.2.0.r3842,...
So, build system works.

Let`s test union of all this stuff. Command line.
cd C:devcursedearth
Result will be compiled libs and executable files(C:devcursedearthspikes*bin*.exe). Start it from command line.
If you don`t need IDE you can use something like notepad++ and it`s the end of HOWTO for you.

Yo need to complete all steps before start.
Download and install Code::Blocks
If you want start quickly, you can use my project file and Makefile just unpack it into folder with sourcecode and open cursedearth.cbp.
Select any workspace.
Create “Empty Project”, name it cursedearth. Set “Folder to create project in” to C:dev. “Resulting filename” will be C:devcursedearthcursedearth.cbp. Next.
Create targets for release and debug of mapviewer. Name it mapviewer_debug and mapviewer_release. Finish.
We can see cursedearth project inside Management frame.

Select it and add all files Right Mouse Button → “Add files recursively...”. Select C:devcursedearth. OK. Select All. OK. Select all targets - Select All. OK. You need to do it every time you update source code from git or from -src package.
Select cursedearth. In main menu “Project” → “Properties”.
Go to “Project settings”. Set “This is a custom Makefile” flag.
Go to “Build Targets”. For mprviewer_debug set “Output filename” to
. Remove “Auto-generate filename prefix” and “Auto-generate filename extension” flags. Do the same with mprviewer_release but type “release” instead of “debug” in filename.

Create file Makefile(without extension) in folder C:devcursedearth. Paste following code there:

    scons mapviewer
    scons RELEASE=0 mapviewer
    scons mapviewer -c
    scons RELEASE=0 mapviewer -c

Let`s try Build and Run button.
If everything is OK after compilation you`ll see command line window with list of arguments fot this spike. Close it.
Now, arguments using for start spikes. “Project” → “Set programs' arguments...”. For debug and release targets of mprviewer to “Program Arguments” type something like
--ei-path="C:/EI" zone4
Press OK” button after paste arguments line or it won`t be saved.

You need to create targets(in Project settings), section in Makefile and set arguments for all spikes you want to compile and start. Edit them in a similar fasion as for mapviewer.
Get arguments for new spikes from command line window (when spike started without arguments).

Press Run button – spike will start with written argument line.
Save the project.

Command line window must be closed manually.
Don`t forget add exceptions for git (thereinbefore):

That`s all folks.
Thanks for a great guide. Now I will just see if there is anything I can do to help.
All were newbies once, more or less. Repsect that.

Перейти к форуму:

Пользователи, просматривающие эту тему: 1 Гость(ей)