navi homePPSaboutscreenshotsdownloaddevelopmentforum

Version 3 (modified by landauf, 12 years ago) (diff)


This is an archived page!
This page is very old and the content is not up to date.
Not everything (if any) which is written here will be in the final game!

file-link: source:/trunk/src/defs/debug.h#HEAD


The idea behing the debugging system is, that all the output can be redirected, redesigned, and if you want be disabled.


In the code you wold make an output like this:

    PRINT(4)("print cool some text: %s\n", text);

This would tell the debugg-engine that output is to be printed if we are in mode 4 which is debug (see listing below). The output of this would look as follows (given text = "some very cool text"):

print some cool text: some very cool text

As you may have noticed, there are two pairs of brackets ()(). The first one donates the debug-level, the second one the output in printf-style format.

Alternatively you could also output via


The joke with PRINTF (notice the F at the end (it is the only thing that changes)) is, that in addition to just printing the output, it appends the level, code-file and file-line, where the error occured in the following from: (LEVEL)::[filename]:[linenumber]:[output]

try it out for yourself.

what is the meaning of the debug-level

0 just output
5 Very much DEBUG (VD)

select the level of output

the level of output is the maximum debug-mode, that can be outputted

everything is there.

redirected to where??

all the output generated with the Debugging engine is redirected to the Shell's Buffer, where it can be appendet to the Shell itself, and where output will be stored some line-lenght long.