> News
> About
> Screenshots
> Downloads
> IRC
> Editing
> Sourcecode
> Links
> Credits
 


Sourcecode


The source code for Return to the Shadows is released under an unrestrictive license. The main idea is that you may do with the source whatever you want as long as your work runs under and is supported on an open-source operating system. Since you'll probably use SDL anyway if you're looking at this page, this shouldn't be a problem.
Be aware that this license does not apply to the game data: the data used in Return to the Shadows is licensed under Creative Commons Attribution-ShareAlike 2.5.

Download the source code that corresponds to the online source: rtts-1.1.1-src.tar.bz2 rtts-1.1.1-src.zip

Get uptodate source from the Downloads page.



Source browser and articles

In the long run, I intend to write a series of articles which explain how and why I've done things in the source. At the same time, you can view the actual source files online (see below), and add comments to them in a forum specifically for this purpose. I've never seen something like this on the internet, so all this is pretty much an experiment. I hope it goes well and is actually useful to some people out there :)

Note that I'm not perfect. In fact, there are some parts of the code which I don't really like and plan to restructure or rewrite completely. Some of them are really hacky because I just didn't have the time to implement them properly for the 72 hours code, and didn't bother to fix them.. yet. If you have any suggestions as to how things can be improved, feel free to post on the forums.

Game source:
rtts.h All core definitions
rttspanels.h Useful GUI panels (implemented in main.cpp)
main.cpp Main program with main loop
game.h Definitions used by game logic
game.cpp Game framework (e.g. hangar)
ge_main.cpp Wrapper around the engine for real gameplay
ge_engine.cpp Master class which controls gameplay
ge_level.cpp Handling the tilemap
ge_air.cpp Implemetations for all air units
ff_level.h Some level format constants (actual layout is in ge_level.cpp)
ff_savegame.h Some savegame format constants (actual layout is in game.cpp)
editor.h All definitions concerning the editor
ed_main.cpp Most of the editor's bulkiness
ed_tilesets.cpp EdTilesets, tileset container


GUI source:
gui_panel.h GPanel header
gui_panel.cpp GPanel implementation. Contains most GUI functionality (including the event loop)
gui_label.h A label is a static panel displaying text or images
gui_label.cpp
gui_button.h Basic pushbutton, derived from GLabel
gui_button.cpp
gui_checkbox.h GCheckBox: a button-like panel with an on and off state
gui_checkbox.cpp
gui_radiobutton.h Radiobuttons are organized in a group, of which only one can be on
gui_radiobutton.cpp
gui_listbox.h A selectable list of strings
gui_listbox.cpp
gui_inputbox.h A single-line input panel
gui_inputbox.cpp
gui_grid.h GGrid: simplisticly layout child panels
gui_grid.cpp
gui_menu.h GMenuItem and GMenu: Basic menu structures
gui_menu.cpp
gui_popupmenu.h GPopupMenu: Popup menu
gui_popupmenu.cpp


Hardware access source:
hal.h Definitions for the hardware access code
hal_common.cpp Common control code (e.g. HPicture)
hal_font.cpp HFont: Simplistic bitmap font
hal_sprite.cpp Sprites with multiple animations
hal_sdlgl.h Definitions for the SDL/OpenGL layer
hal_sdlgl.cpp All SDL/OpenGL access code is in this file


Miscellaneous library source:
library.h Common header for all parts of the library
lib_object.cpp Signal/Slot support code
lib_heap.cpp Simple heap tracker
lib_console.cpp A lot less than what it sounds to be
lib_files.cpp LFileRead, LFileWrite
lib_main.cpp Misc. functions
lib_image.cpp Load and save several bitmap formats
lib_parser.cpp LParse: text parser
lib_config.cpp Configuration tree management


Compiling etc...

You will need SDL headers and OpenGL support in order to compile Return to the Shadows.

The makefile and MSVC++ project file are tailored for the following development tree layout:

   rtts/game         game data files
   rtts/game/levels
   ...

   rtts/source/rtts  source files
		

Simply running make should be enough to compile on Linux if SDL and OpenGL libraries are installed properly.

On Windows, you might have to adjust some of the path settings in MSVC++. Note that compiling for Windows with a different compiler is not supported.

If you're somehow feeling like implementing a better (yet compatible!) build system, go ahead.





 


Latest version: 1.3