LibT2FS 0.1
C API for accessing TEngine data in memory.
Loading...
Searching...
No Matches
common.h File Reference
#include <stdint.h>
#include "models/assert.h"

Go to the source code of this file.

Data Structures

struct  s_T2FSDataCoordF32
struct  s_T2FSDataWorldCoordF32
struct  s_T2FSDataCoordS32
 yeah.. not kiddin More...
struct  s_T2FSDataCoordS16
struct  s_T2FSDataWorldCoordS16

Macros

#define SASSERT_SIZE(what, size)
#define T2FS_STRINGIFY(x)
#define T2FS_CONCAT(a, b)
#define T2FS_GET_SWAP_STRUCT(name)
#define T2FS_SWAP_STRUCT_ARGS(...)
#define T2FS_CREATE_SWAP_STRUCT(name, sizes)
#define T2FS_SWAP_STRUCT_COUNT(name)
#define _T2FS_ADD_CONST_ARRAY_NUMBERS_x(n, ...)
#define T2FS_ADD_CONST_ARRAY_NUMBERS(...)
#define T2FS_15BIT_SCALE_FACTOR(v)
#define T2FS_BONE_ROT_SCALE_FACTOR   T2FS_15BIT_SCALE_FACTOR(1.f)
#define T2FS_OBJ_ROT_SCALE_FACTOR   T2FS_15BIT_SCALE_FACTOR(180.f)

Typedefs

typedef struct s_T2FSDataCoordF32 T2FSDataCoordF32
typedef struct s_T2FSDataWorldCoordF32 T2FSDataWorldCoordF32
typedef struct s_T2FSDataCoordS32 T2FSDataCoordS32
 yeah.. not kiddin
typedef struct s_T2FSDataCoordS16 T2FSDataCoordS16
typedef struct s_T2FSDataWorldCoordS16 T2FSDataWorldCoordS16

Functions

void t2fs_endian_swap_struct (void *struc, const uint8_t *const swap, uint32_t swapCount)

Macro Definition Documentation

◆ SASSERT_SIZE

#define SASSERT_SIZE ( what,
size )

◆ T2FS_STRINGIFY

#define T2FS_STRINGIFY ( x)
Value:
#x

◆ T2FS_CONCAT

#define T2FS_CONCAT ( a,
b )
Value:
a##b

◆ T2FS_GET_SWAP_STRUCT

#define T2FS_GET_SWAP_STRUCT ( name)
Value:
T2FS_CONCAT(T2FS_SWAP_, name)
#define T2FS_CONCAT(a, b)
Definition models/common.h:32

◆ T2FS_SWAP_STRUCT_ARGS

#define T2FS_SWAP_STRUCT_ARGS ( ...)
Value:
__VA_ARGS__

◆ T2FS_CREATE_SWAP_STRUCT

#define T2FS_CREATE_SWAP_STRUCT ( name,
sizes )
Value:
const static uint8_t T2FS_GET_SWAP_STRUCT(name)[] = {T2FS_SWAP_STRUCT_ARGS sizes}; \
#define T2FS_SWAP_STRUCT_ARGS(...)
Definition models/common.h:35
#define T2FS_GET_SWAP_STRUCT(name)
Definition models/common.h:33
#define T2FS_ADD_CONST_ARRAY_NUMBERS(...)
Definition models/common.h:46

◆ T2FS_SWAP_STRUCT_COUNT

#define T2FS_SWAP_STRUCT_COUNT ( name)
Value:
sizeof(T2FS_GET_SWAP_STRUCT(name)) / sizeof(T2FS_GET_SWAP_STRUCT(name)[0])

◆ _T2FS_ADD_CONST_ARRAY_NUMBERS_x

#define _T2FS_ADD_CONST_ARRAY_NUMBERS_x ( n,
... )
Value:
T2FS_CONCAT(_T2FS_ADD_CONST_ARRAY_NUMBERS_, n)(__VA_ARGS__)

◆ T2FS_ADD_CONST_ARRAY_NUMBERS

#define T2FS_ADD_CONST_ARRAY_NUMBERS ( ...)
Value:
#define _T2FS_N_VA_ARGS(...)
Definition assert.h:6
#define _T2FS_ADD_CONST_ARRAY_NUMBERS_x(n,...)
Definition models/common.h:45

◆ T2FS_15BIT_SCALE_FACTOR

#define T2FS_15BIT_SCALE_FACTOR ( v)
Value:
(v / 0b0111111111111111)

Used to calculate scaling factor for certain int16_t values, the scaling factor is used for conversion to float.

◆ T2FS_BONE_ROT_SCALE_FACTOR

#define T2FS_BONE_ROT_SCALE_FACTOR   T2FS_15BIT_SCALE_FACTOR(1.f)

◆ T2FS_OBJ_ROT_SCALE_FACTOR

#define T2FS_OBJ_ROT_SCALE_FACTOR   T2FS_15BIT_SCALE_FACTOR(180.f)

Function Documentation

◆ t2fs_endian_swap_struct()

void t2fs_endian_swap_struct ( void * struc,
const uint8_t *const swap,
uint32_t swapCount )