#include <stdint.h>
#include "t2fs.h"
#include "array.h"
#include "models/common.h"
Go to the source code of this file.
◆ T2FS_VERTEX_CACHE_SIZE
| #define T2FS_VERTEX_CACHE_SIZE 32 |
◆ T2FS_VERTEX_GLOBAL_UNSET
| #define T2FS_VERTEX_GLOBAL_UNSET (uint32_t)-1 |
◆ T2FS_MODEL_BONE_SYMBOL_LEG
| #define T2FS_MODEL_BONE_SYMBOL_LEG 0b001 |
◆ T2FS_MODEL_BONE_SYMBOL_NOT_HEAD
| #define T2FS_MODEL_BONE_SYMBOL_NOT_HEAD 0b010 |
◆ T2FS_MODEL_BONE_SYMBOL_RIGHT
| #define T2FS_MODEL_BONE_SYMBOL_RIGHT 0b100 |
◆ T2FS_MATERIAL_FLAG_UNK_0
| #define T2FS_MATERIAL_FLAG_UNK_0 0b0000000000000001 |
◆ T2FS_MATERIAL_FLAG_UNK_1
| #define T2FS_MATERIAL_FLAG_UNK_1 0b0000000000000010 |
◆ T2FS_MATERIAL_FLAG_CULBF
| #define T2FS_MATERIAL_FLAG_CULBF 0b0000000000000100 |
◆ T2FS_MATERIAL_FLAG_UNK_3
| #define T2FS_MATERIAL_FLAG_UNK_3 0b0000000000001000 |
◆ T2FS_MATERIAL_FLAG_UNK_4
| #define T2FS_MATERIAL_FLAG_UNK_4 0b0000000000010000 |
◆ T2FS_MATERIAL_FLAG_UNK_5
| #define T2FS_MATERIAL_FLAG_UNK_5 0b0000000000100000 |
◆ T2FS_MATERIAL_FLAG_UNK_6
| #define T2FS_MATERIAL_FLAG_UNK_6 0b0000000001000000 |
◆ T2FS_MATERIAL_FLAG_UNK_7
| #define T2FS_MATERIAL_FLAG_UNK_7 0b0000000010000000 |
◆ T2FS_MATERIAL_FLAG_TRANSPARENCY
| #define T2FS_MATERIAL_FLAG_TRANSPARENCY 0b0000000100000000 |
◆ T2FS_MATERIAL_FLAG_UNK_9
| #define T2FS_MATERIAL_FLAG_UNK_9 0b0000001000000000 |
◆ T2FS_MATERIAL_FLAG_UNK_10
| #define T2FS_MATERIAL_FLAG_UNK_10 0b0000010000000000 |
◆ T2FS_MATERIAL_FLAG_UNK_11
| #define T2FS_MATERIAL_FLAG_UNK_11 0b0000100000000000 |
◆ T2FS_MATERIAL_FLAG_UNK_12
| #define T2FS_MATERIAL_FLAG_UNK_12 0b0001000000000000 |
◆ T2FS_MATERIAL_FLAG_UNK_13
| #define T2FS_MATERIAL_FLAG_UNK_13 0b0010000000000000 |
◆ T2FS_MATERIAL_FLAG_UNK_14
| #define T2FS_MATERIAL_FLAG_UNK_14 0b0100000000000000 |
◆ T2FS_MATERIAL_FLAG_UNK_15
| #define T2FS_MATERIAL_FLAG_UNK_15 0b1000000000000000 |
◆ T2FSDataUnk2_x_4
This is a guess, to try out stuff.
◆ T2FSDataVertexNormal
◆ T2FSDataVertexColor
◆ T2FSDataVertexAttr
◆ T2FSDataVertexN64
◆ T2FSAnimationFrame
◆ T2FSAnimation
◆ T2FSPolygon
◆ T2FSVertexBonePair
◆ T2FSSurface
◆ T2FSModelType
◆ T2FSModel
◆ T2FSVtxCache
◆ T2FSSurfaceVertices
Contains indices to vertices in global vertex buffer.
◆ T2FSPolygonBuffer
◆ T2FSModelContext
helper to unify different games/versions
◆ e_T2FSModelType
| Enumerator |
|---|
| T2FS_MDL_TYPE_STATIC | |
| T2FS_MDL_TYPE_ANIMATED | |
◆ t2fs_model_count()
Get the amount of models present.
- Returns
- The model count.
◆ t2fs_model_context_init()
Initialize T2FSModelContext.
T2FSModelContext is a struct with function pointers, this will set those pointers to functions that match current file (game platform and version specific stuff).
- Parameters
-
| ctx | Open and valid T2FSContext object. |
| mdlCtx | The model context object to initialize. |
◆ t2fs_model_load_data_node()
Loads the model data into memory.
It will decompress and de-interleave when needed.
- Parameters
-
| mdlCtx | Initialized model context. |
| mdlId | Model ID |
| dest | This will be set on success, it is the model data node. |
- Returns
- 0 on success, anything else is an error.
◆ t2fs_model_unload_data_node()
| void t2fs_model_unload_data_node |
( |
T2FSNode * | modelNode | ) |
|
Unloads the model data node.
This will free all allocated memory used by this model data node.
◆ t2fs_model_get_variation_count()
Get the model variation count.
- Parameters
-
- Returns
- 0 on error, the model variation count on success.
◆ t2fs_model_init()
◆ t2fs_model_make()
Convert the model data to our unified struct s_T2FSModel.
You are responsible to call t2fs_model_free() when this returned success and you are done with the T2FSModel.
On error all potential memory this allocated will be freed, so no need to call t2fs_model_free() when this returns an error.
- Parameters
-
- Returns
- 0 on success, anything else is an error.
◆ t2fs_model_free()
Free all allocated memory for given T2FSModel.