Compiling the source code
This page discusses on how to modify and compile the source code.
Contents
Windows:
Main Method
Click here to download the version of Codeblocks with the mingw compiler: [1]
Then go into your \src\windows folder. Click on sandbox.cbp and codeblocks should load up. Go to build and then build and it should create the Windows binary :)
If you get "Invalid Compiler" when building, you need to set up the Mingw Compiler location. When you are in Codeblocks go to "Settings" > "Compiler and Debugger". Then click the ">" button until you get to "Toolchain Executables". Click the "Auto-Detect" button. It should find the Mingw folder, if it is pointing to the wrong location click the "..." button and find the folder yourself.
If you are getting errors while compiling such as having to do with "_UnwindResume" you might have to link the libraries. You could do so like this: Go to "Settings" > "Compiler and Debugger", then click Linker Settings. Under link libraries click "Add" and go to the \src\lib folder then highlight all the ".lib" files and click "Ok". Now try compiling! :D
Other Methods: There is a visual C++ project file included that you can use. Load up the proper file and compile :) I'm not sure if you'd need any libraries but you probably shouldn't need any.
POSIX systems
You may need to convert some of the text file from dos format. There's a handy program to do it with so you may need to install and use tofrodos
Linux
NOTE The Binaries are compiled for 32 bit systems, so if you're on a 64 bit system, you'll have to 1) compile your own, by using modified versions of the below instructions, or 2) install and use 32 bit libraries.
Makefile
First of all, make sure you have the the SDL and SDL_Image and SDL_Mixer development libraries installed on your system. Next up, go into src folder. and type 'make', you can add one of the following at the end of the line
- all - compiles the client
- libenet - compiles enet library
- clean - cleans up temporary files
- client - builds enet and integrates it into a client
- install - compiles enet and the client, and compies the client in /bin_unix/
- distinstall - creates a directory names /usr/local/sandbox/, and copies everything in there. it then sets permissions and some symlinks, so you can play the game by typing 'sandbox' into a console.
- distclean - deletes /usr/local/sandbox/
The compile automatically defaults to 'all'
Chances are, you won't have everything you needed installed, so if you receive any errors from missing devel libraries and frameworks, just installed them too. if you receive errors similar "bash: ./configure: /bin/sh^M: bad interpreter" you'll need to use a dos to unix converted (such as tofrodos) to convert them to a unix friendly format.
Debug
A debug file is already set up. Debug versions can be compiled by invoking...
make -C src -f Makefile.debug install
After this, you'd start up gdb with the game mode of your choice, for example....
# this will load up gdb using the 32 bit FPS client gdb bin/debug_client_32_fps # this will execute sandbox, provide any additional arguments which were used run -q${HOME}/.platinumarts -r # when sandbox crashes, this will produce a back which will be very useful to us bt full
There are plenty of additional features available through gdb, but they are beyond the scope of this synopsis.
MAC OSX
To start, you should have Xcode installed on your computer. Either install the Developer tools from the OS X install disks that came with your computer, or download Xcode from the apple website: http://developer.apple.com/technology/xcode.html
ABOUT SDL! You should only download the following release if you have a PPC Mac! Otherwise download the source for best results!
Download SDL: http://www.libsdl.org/release/SDL-1.2.9.dmg Copy the SDL.framework folder to /Library/Frameworks
Download SDL_Image: http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.9.dmg Copy the SDL_image.framework folder to /Library/Frameworks
Download SDL_Mixer: http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.8.dmg Copy the SDL_mixer.framework folder to /Library/Frameworks
Download the latest Multiplatform.zip of Sandbox. Unzip and double click on PASX.X.Xmultiplatform/src/xcode/sandbox.xcodeproj
Xcode will open the project. Change the Active Build Configuration from Debug to Release. Click on build - the Binary should compile with errors. These errors may include missing functions! Any help would be appreciated.
By default the executables, launcher and sandbox, are created in the folder PASX.X.Xmultiplatform/src/xcode/build/Release/
Rename the PASX.X.Xmultiplatform folder to sandbox and move the compiled sandbox.app into the top level of that folder. The launcher.app should be on the same level, but outside, the renamed sandbox folder.
FreeBSD
Unwritten