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 uint32_t unk0; // possible level id
42 uint32_t unk1;
43 uint32_t unk2;
44
45 // Seeds of Evil.lss - most set to 0800 0000, some 0e00 0000 and one 0c00 00002
46 // win32.dat - all set to 0000 0000
47 uint32_t unk3;
48
49 // Seeds of Evil.lss - all set to 94d3 5400
50 // win32.dat - all set to 3890 7000
51 uint32_t unk4;
52
53 // Seeds of Evil.lss - all set to c031 6400
54 // win32.dat - all set to be15 0000
55 uint32_t unk5;
56
57 // This is weird, string can be 27 bytes (inc \0) but when shorter
58 // it seeme random bytes are set after the \0.
59 char name[27];
60
61 uint32_t unk6; // On seeds always set to 0x165e2356
62 uint32_t unk7;
63 uint32_t unk8; // On seeds always set to 0xcdcc0c40
64 uint32_t unk9; // On seeds either 0x00000000 or 0x01000000
65 uint32_t unk10; // On seeds either 0x00000000 or 0x01000000
66
67 // Missing on win32.dat
68 uint32_t unk11;
69
70 char unk12;
72
74
75
76
82typedef struct __attribute__((__packed__)) s_t2fsDataSceneHeader_0x48 {
83 uint32_t unk0;
84 uint32_t unk1;
85 uint32_t unk2;
86 uint32_t unk3;
87 uint32_t unk4;
88 uint32_t unk5;
89 char name[27];
90 uint32_t unk6;
91 uint32_t unk7;
92 uint32_t unk8;
93 uint32_t unk9;
94 uint32_t unk10;
95 //uint32_t unk11;
96 char unk12;
98
100
101
102// ********************************************************************
103// Our structs
104// ********************************************************************
105
106typedef struct s_t2fsScene {
107 t2fsNode *node; // scene node /root/scenes/curSceneIndex/
108 uint8_t isValid;
109
110 // current set entry from /root/scenes/0/0/data
112 uint32_t id;
114
115
116typedef struct s_t2fsScenes {
117 t2fsNode *node; // /root/scenes/
118 t2fsNode *nodeHeader; // info node /root/scenes/0/0/
120 uint8_t isValid;
121
122 // /root/scenes/0/0/data
125
126
127void
129
130void
132
133void
135
136uint32_t
138
139int
141
142void
144
145int
147
148int
149t2fs_scene_load(t2fsScenes *scenes, t2fsScene *dest, uint32_t id);
150
151void
153
154#endif
struct s_t2fsArray t2fsArray
struct s_t2fsDataSceneHeader_0x48 t2fsDataSceneHeader_0x48
struct s_t2fsDataSceneHeader t2fsDataSceneHeader
#define SASSERT_SIZE(what, size)
Definition models/common.h:24
void t2fs_scenes_unload(t2fsScenes *scenes)
struct s_t2fsScenes t2fsScenes
void t2fs_scene_header_clear(t2fsDataSceneHeader *info)
void t2fs_scene_unload(t2fsScene *scene)
int t2fs_scenes_load(t_t2fs *lib, t2fsScenes *scenes)
void t2fs_scene_clear(t2fsScene *scene)
int t2ts_scenes_get_header(t2fsScenes *scenes, t2fsDataSceneHeader *dest, uint32_t id)
struct s_t2fsScene t2fsScene
uint32_t t2fs_scenes_count(t_t2fs *lib)
int t2fs_scene_load(t2fsScenes *scenes, t2fsScene *dest, uint32_t id)
void t2fs_scenes_clear(t2fsScenes *scenes)
Definition scenes.h:82
uint32_t unk3
Definition scenes.h:86
uint32_t unk2
Definition scenes.h:85
char name[27]
Definition scenes.h:89
uint32_t unk1
Definition scenes.h:84
uint32_t unk7
Definition scenes.h:91
uint32_t unk6
Definition scenes.h:90
char unk12
Definition scenes.h:96
uint32_t unk4
Definition scenes.h:87
uint32_t unk10
Definition scenes.h:94
uint32_t unk5
Definition scenes.h:88
uint32_t unk0
Definition scenes.h:83
uint32_t unk8
Definition scenes.h:92
uint32_t unk9
Definition scenes.h:93
Definition scenes.h:40
uint32_t unk6
Definition scenes.h:61
uint32_t unk1
Definition scenes.h:42
uint32_t unk2
Definition scenes.h:43
char name[27]
Definition scenes.h:59
uint32_t unk8
Definition scenes.h:63
uint32_t unk4
Definition scenes.h:51
uint32_t unk0
Definition scenes.h:41
uint32_t unk7
Definition scenes.h:62
uint32_t unk3
Definition scenes.h:47
uint32_t unk9
Definition scenes.h:64
uint32_t unk11
Definition scenes.h:68
char unk12
Definition scenes.h:70
uint32_t unk5
Definition scenes.h:55
uint32_t unk10
Definition scenes.h:65
Definition scenes.h:106
t2fsNode * node
Definition scenes.h:107
uint8_t isValid
Definition scenes.h:108
uint32_t id
Definition scenes.h:112
t2fsDataSceneHeader header
Definition scenes.h:111
Definition scenes.h:116
t2fsArray infoArray
Definition scenes.h:123
t2fsNode * nodeHeader
Definition scenes.h:118
uint8_t isValid
Definition scenes.h:120
t_t2fs * lib
Definition scenes.h:119
t2fsNode * node
Definition scenes.h:117
struct s_t2fsNode t2fsNode
This is the core object to describe a path inside the tree.
Definition t2fs.h:110
struct s_t2fs t_t2fs
This is the core LibT2FS object that you will be passing around.
Definition t2fs.h:53