Epok Engine

EPOK RUNTIME

epok::sprite_detail::project_ratio

Function · 1 overload

Function

Sprite projection historically truncates toward zero (not mesh floor-rounding).

Belongs to
epok::sprite_detail
Header
sprite_math.hpp
Overloads
1

Declaration

Declaration
inline int32_t project_ratio(int32_t coordinate,int scale,int32_t depth)

Sprite projection historically truncates toward zero (not mesh floor-rounding).

ParameterTypeMeaning
coordinateint32_tValue supplied for coordinate. Keep referenced or pointed-to data valid for the complete call.
scaleintValue supplied for scale. Keep referenced or pointed-to data valid for the complete call.
depthint32_tValue supplied for depth. Keep referenced or pointed-to data valid for the complete call.

Returns: int32_t. Check the value before continuing when it represents success, availability or a resource handle.

Example

C++ example
#include "sprite_math.hpp"

// Assume these named values have been initialized with valid data:
// int32_t coordinate
// int scale
// int32_t depth

auto result = epok::sprite_detail::project_ratio(coordinate, scale, depth);

Why use it

It provides direct, allocation-conscious access to sprites, flipbooks and screen-facing rendering. No exception-based error path is implied by the signature.

Trade-offs and warnings

Call it only in the lifecycle phase described by the module. Validate indices, capacities and object state before use.

Declared in runtime/sprite_math.hpp:10

Related members