This is the documentation for Enlighten.

module Infrastructure (GeoBase)

Functions

Name Description
GeoAlign(T *, s32)

Align the supplied pointer to the supplied boundary.

GeoAlign(T, s32)

Align the supplied value to the supplied boundary.

GeoIsAligned(T, s32)

Check if the supplied value is aligned to the given alignment.

GeoIsAligned(T *, s32)

Check if the supplied address is aligned to the given alignment.

numeric_cast(Y)

Safer static cast that 'protects' against underflow/overflow.

Defines

Name Description
GEO_ALIGN GEO_PRE_ALIGN(alignment) toAlign GEO_POST_ALIGN(alignment)

A helper macro for the two above.

GEO_ALIGN_OF 4

Reports the alignment of the object.

GEO_CONTROLLED_INLINE inline

To be put in front of functions that should optionally be inlined, depending on the definition of GEO_FAST_INPUT_LIGHTING.

GEO_FAST_INPUT_LIGHTING 0

Indicates whether additional functions should be force inlined.

GEO_FORCE_INLINE __forceinline

To be put in front of functions that should always be inlined.

GEO_PLATFORM_VARIABLE_PACK

Defined if the platform/compiler allows the programmer to change the default packing of structures.

GEO_POST_ALIGN

To be put after types/variables to be aligned.

GEO_PRE_ALIGN

To be put infront of types/variables to be aligned.


T* Geo::GeoAlign


public: T * GeoAlign
(
    T * ptr,
    s32 align
)


Align the supplied pointer to the supplied boundary.


T Geo::GeoAlign


public: T GeoAlign
(
    T value,
    s32 align
)


Align the supplied value to the supplied boundary.


bool Geo::GeoIsAligned


public: bool GeoIsAligned
(
    T value,
    s32 align
)


Check if the supplied value is aligned to the given alignment.

Parameters
[in] value

Value to check alignment of.

[in] align

Must be a power of two.


bool Geo::GeoIsAligned


public: bool GeoIsAligned
(
    T * ptr,
    s32 align
)


Check if the supplied address is aligned to the given alignment.

Parameters
[in] ptr

Address to check. A NULL address will be classified as aligned regardless of alignment.

[in] align

Must be a power of two.


T Geo::numeric_cast


public: T numeric_cast
(
    Y numval
)


Safer static cast that 'protects' against underflow/overflow.

Template Parameters
T

Type being cast to

Y

Type being cast from

Parameters
numval

Numeric value being cast

Returns

numval as type Y, asserts if the range of Y is exceeded