Blade Defines
Not logged in

Here is a list of the "defines" that can be set to customize Blade: The Game Engine:


BLADE_BACKEND_*

BLADE_BACKEND_LINUX

Build the Linux backend

BLADE_BACKEND_Qt5

Build the Qt5 backend

BLADE_BACKEND_WINDOWS

Build the Windows backend



BLADE_DEBUG_ENABLED=value

If BLADE_DEBUG_ENABLED is equal to a non-zero value, then debugging checks and logging will be enabled. Setting BLADE_DEBUG_ENABLED to 0 or undefined will disable the debugging features.

The debugging code will check method parameters and perform extra checks during run-time. If anything is found, it will be logged. As you would expect, these checks can be costly and will impact performance.

This is enabled by default in all debug builds.



BLADE_MATH_SIN_STEP=value

Blade's Math module provides a SIN look-up table to avoid costly sine calculations. This look-up table represents 90 degrees to take advantage of sine's symmetry and repeating nature. The value is used to determine how many "steps" are in each degree. A step value of 10 will give the SIN table an accuracy to the tenth of a degree.

To determine the amount of memory needed for the look-up table, use this formula:

sizeof(float) * ((90 * BLADE_MATH_SIN_STEP) + 1)

111 is the default value



BLADE_MATH_ACOS_TABLE_SIZE=value

Blade's Math module provides an ACOS look-up table to avoid costly ACOS calculations. This value is the total number of elements in the look-up table. The ACOS step value uses the formula:

2 / BLADE_MATH_ACOS_TABLE_SIZE

The amount of error in each step can vary wildly based on the provided value. However, the greatest amount of error in the ACOS value is usually at the start and end of the table. Also, using a larger value will reduce the amount of error in each step.

4500 is the default value



BLADE_MESSAGE_BUFFER_SIZE=value

Blade's messaging system sends and receives messages. The value determines the initial size of the message buffer. This is useful to help minimize the amount of memory allocations. If the initial size is large enough, then it will never need to grow.

32 is the default value

Note: This is only used for the Messenger object in the Application class.



BLADE_MESSAGE_BUFFER_GROW=value

Blade's messaging system sends and receives messages. When the messaging system receives messages faster than it can send them, those messages need to be buffered. This value is used to determine the linear expansion of the buffer. The formula is:

Current Buffer Size += BLADE_MESSAGE_BUFFER_GROW

If the value is 0 then the message buffer will not grow. Any messages that are received when the buffer is full means that those messages will be dropped.

4 is the default value

Note: This is only used for the Messenger object in the Application class.



BLADE_ROADENGINE_ENABLED

If BLADE_ROADENGINE_ENABLED is equal to a non-zero value, then the Road Engine will be built and included in the Blade library. A value of 0 will prevent the Road Engine from being built.

0 is the default value



BLADE_STATS_ENABLED

When set to a non-zero value, this define will enable the performance statistics code. To activate this feature, use the command-line arg: --BladeStats. This is enabled by default for the debug builds.



BLADE_TILEENGINE_ENABLED

If BLADE_TILEENGINE_ENABLED is equal to a non-zero value, then the Tile Engine will be built and included in the Blade library. A value of 0 will prevent the Tile Engine from being built.

1 is the default value



BLADE_UIENGINE_ENABLED

If BLADE_UIENGINE_ENABLED is equal to a non-zero value, then the UI Engine will be built and included in the Blade library. A value of 0 will prevent the Tile Engine from being built.

0 is the default value



BLADE_VERSION_*

BLADE_VERSION_MAJOR

Set the major version number (major.minor.patch)

BLADE_VERSION_MINOR

Set the minor version number (major.minor.patch)

BLADE_VERSION_PATCH

Set the patch version number (major.minor.patch)