LibT2FS 0.1
C API for accessing TEngine data in memory.
Loading...
Searching...
No Matches
scenes.h
Go to the documentation of this file.
1/* This file is part of LibT2FS.
2 *
3 * LibT2FS is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
7 *
8 * LibT2FS is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <https://www.gnu.org/licenses/>.
15 */
16#ifndef H_T2FS_SCENES
17#define H_T2FS_SCENES
18
19#include <stdint.h>
20
21#include "t2fs.h"
22#include "array.h"
23#include "models/common.h"
24
25
26// ********************************************************************
27// Structs as in file (possible after decompression and/or deinterleaving)
28// ********************************************************************
29
40typedef struct __attribute__((__packed__)) s_T2FSDataSceneHeader {
41 int32_t levelId;
42 int32_t regionId;
43
44 uint32_t unk2;
45
48 uint32_t unk3;
49
53 uint32_t unk4;
54
57 uint32_t unk5;
58
59 // This is weird, string can be 27 bytes (inc \0) but when shorter
60 // it seeme random bytes are set after the \0.
61 char name[28];
62
63
64 uint32_t unk6;
65 uint32_t unk7;
66
67 uint32_t unk8;
68 uint32_t unk9;
69 uint32_t unk10;
70
71 uint32_t unk11;
73
75
76
77
83typedef struct __attribute__((__packed__)) s_T2FSDataSceneHeader_0x48 {
84 int32_t levelId;
85 int32_t regionId;
86
87 uint32_t unk2;
88
91 uint32_t unk3;
92
96 uint32_t unk4;
97
100 uint32_t unk5;
101
102 char name[28];
103
104 uint32_t unk6;
105 uint32_t unk7;
106
107 uint32_t unk8;
108 uint32_t unk9;
109 uint32_t unk10;
111
113
114
115// ********************************************************************
116// Our structs
117// ********************************************************************
118
119typedef struct s_T2FSScene {
120 T2FSNode *node; // scene node /root/scenes/curSceneIndex/
121 uint8_t isValid;
122
123 // current set entry from /root/scenes/0/0/data
125 uint32_t id;
127
128
129typedef struct s_T2FSScenes {
130 T2FSNode *node; // /root/scenes/
131 T2FSNode *nodeHeader; // info node /root/scenes/0/0/
133 uint8_t isValid;
134
135 // /root/scenes/0/0/data
138
139
140void
142
143void
145
146void
148
149uint32_t
151
152int
154
155void
157
158int
160
161int
162t2fs_scene_load(T2FSScenes *scenes, T2FSScene *dest, uint32_t id);
163
164void
166
167#endif
struct s_T2FSArray T2FSArray
struct s_T2FSDataSceneHeader T2FSDataSceneHeader
struct s_T2FSDataSceneHeader_0x48 T2FSDataSceneHeader_0x48
#define SASSERT_SIZE(what, size)
Definition models/common.h:26
void t2fs_scene_unload(T2FSScene *scene)
struct s_T2FSScenes T2FSScenes
void t2fs_scene_header_clear(T2FSDataSceneHeader *info)
void t2fs_scenes_unload(T2FSScenes *scenes)
int t2fs_scene_load(T2FSScenes *scenes, T2FSScene *dest, uint32_t id)
int t2ts_scenes_get_header(T2FSScenes *scenes, T2FSDataSceneHeader *dest, uint32_t id)
int t2fs_scenes_load(T2FSContext *ctx, T2FSScenes *scenes)
struct s_T2FSScene T2FSScene
void t2fs_scene_clear(T2FSScene *scene)
void t2fs_scenes_clear(T2FSScenes *scenes)
uint32_t t2fs_scenes_count(T2FSContext *ctx)
Definition scenes.h:83
uint32_t unk7
Definition scenes.h:105
uint32_t unk5
Definition scenes.h:100
int32_t levelId
might be unused (-1)
Definition scenes.h:84
uint32_t unk9
Either 0x00000000 or 0x01000000.
Definition scenes.h:108
uint32_t unk10
Either 0x00000000 or 0x01000000.
Definition scenes.h:109
uint32_t unk3
Definition scenes.h:91
int32_t regionId
might be unused (-1)
Definition scenes.h:85
char name[28]
Definition scenes.h:102
uint32_t unk8
Almost always set to 0xcdcc0c40, two entries set to 0x0000803f.
Definition scenes.h:107
uint32_t unk4
Definition scenes.h:96
uint32_t unk6
Definition scenes.h:104
uint32_t unk2
Definition scenes.h:87
Definition scenes.h:40
int32_t regionId
might be unused (-1)
Definition scenes.h:42
uint32_t unk9
Either 0x00000000 or 0x01000000.
Definition scenes.h:68
uint32_t unk11
Missing on South Park.
Definition scenes.h:71
uint32_t unk3
Definition scenes.h:48
uint32_t unk2
Definition scenes.h:44
uint32_t unk8
On seeds always set to 0xcdcc0c40.
Definition scenes.h:67
uint32_t unk5
Definition scenes.h:57
uint32_t unk6
Definition scenes.h:64
uint32_t unk7
Definition scenes.h:65
uint32_t unk4
Definition scenes.h:53
int32_t levelId
might be unused (-1)
Definition scenes.h:41
uint32_t unk10
Either 0x00000000 or 0x01000000.
Definition scenes.h:69
char name[28]
Definition scenes.h:61
Definition scenes.h:119
T2FSDataSceneHeader header
Definition scenes.h:124
uint32_t id
Definition scenes.h:125
T2FSNode * node
Definition scenes.h:120
uint8_t isValid
Definition scenes.h:121
Definition scenes.h:129
T2FSNode * nodeHeader
Definition scenes.h:131
uint8_t isValid
Definition scenes.h:133
T2FSContext * ctx
Definition scenes.h:132
T2FSNode * node
Definition scenes.h:130
T2FSArray infoArray
Definition scenes.h:136
struct s_T2FSNode T2FSNode
This is the core object to describe a path inside the tree.
Definition t2fs.h:110
struct s_T2FSContext T2FSContext
This is the core LibT2FS object that you will be passing around.
Definition t2fs.h:53