forked from kapuragu/FoxEngineTemplates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstp.bt
143 lines (122 loc) · 3.83 KB
/
stp.bt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
// STP - Streamed Package
// By RLC - inspired by other FOX templates by the researchers of Modders' Heaven!
enum LipAnimIndex
{
A = 0,
AH = 1,
AY = 2,
B = 3,
C = 4,
CH = 5,
D = 6,
E = 7,
EE = 8,
ER = 9,
F = 10,
G = 11,
H = 12,
I = 13,
J = 14,
L = 15,
M = 16,
N = 17,
NG = 18,
OH = 19,
OO = 20,
OU = 21,
OW = 22,
OY = 23,
P = 24,
R = 25,
S = 26,
SH = 27,
T = 28,
TH = 29,
TT = 30,
U = 31,
V = 32,
W = 33,
Y = 34,
Z = 35,
_i = 36,
_tH = 37,
};
struct Laddie
{
struct Header
{
int64 fileName <comment="StrCode64 hash of the file name, string embedded in .wem file, *not* tolowered">;
int keyCount <comment="Key count including key zero">;
short offsetToKey[keyCount] <comment="Offset from keyCount", bgcolor=0x94A6AA>;
} header <bgcolor=0x776C7C>;
// align the stream
if (FTell() % 4 != 0)
FSkip(4 - FTell() % 4);
struct Keys
{
// this is "key zero" - this counts as a key for everything before it
ushort defaultPosition <comment="Position of a keyframe in the timeline.", fgcolor=0xFF0000, bgcolor=0x87E7FF>;
ushort defaultIntensity <comment="Always empty?", fgcolor=0x0000FF, bgcolor=0x87E7FF>;
byte paramsCount <bgcolor=0xB9C199>; Assert(paramsCount==3,"Laddie keyZero lipAnimCount isn't right!!!");
FSkip(3);
int keyZeroParam0 <bgcolor=0xB9C199>;
int keyCount2 <comment="Amount of keys aside from key zero... most of the time", bgcolor=0xB9C199>; //inaccurate in vox_ene_common_ru?
int keyZeroParam2 <comment="Always 1?", bgcolor=0xB9C199>; Assert(keyZeroParam2==1||keyZeroParam2==2,".ls KeyZero Param2 Isn't 1 or 2!!!!");
if (keyZeroParam2==2)
Printf("\n keyZeroParam2==2");
local int realKeyCount = header.keyCount-1;
if (keyCount2!=realKeyCount)
Printf("\n Wierd Keycount!!!!"); //2FFA97C8.wem/804952008.wem in vox_ene_common_ru, keycount is 12 when keyCount is 3
struct Key
{
//these are keyframes
ushort position <comment="Position of a keyframe in the timeline.", fgcolor=0xFF0000, bgcolor=0x87E7FF>;
ushort intensity <comment="Duration or intensity?", fgcolor=0x0000FF, bgcolor=0x87E7FF>;
byte lipAnimCount <bgcolor=0xB8F8EB>;
byte strengthCount <comment="GZ doesn't have this, but TPP absolutely requires it!", bgcolor=0xA3D0D1>;
FSkip(2);
LipAnimIndex lipAnimIndex[lipAnimCount] <comment="Index of the mouth animation to play", bgcolor=0xB8F8EB>;
float strength[strengthCount] <comment="GZ doesn't have this, but TPP absolutely requires it!", bgcolor=0xA3D0D1>;
} key[realKeyCount] <optimize=false>;
} keys <optimize=false>;
// align the stream to cap off the file
if (FTell() % 16 != 0)
FSkip(16 - (FTell() % 16));
};
struct StreamedPackage
{
char sign[4];
short wemCount;
byte hasLipSync;
FSkip(1);
struct StreamedWemDefiniton
{
uint streamedPackageId <comment=".wem name", bgcolor=0x58D7E9>;
int offsetToWem <bgcolor=0x58D7E9>;
if (hasLipSync==1)
int offsetToLip <bgcolor=0x5285FF>;
} streamedWemDefinition[wemCount];
if (FTell() % 16 != 0)
FSkip(16 - (FTell() % 16));
local int index = 0;
struct RiffStreamed
{
local int preLipIndexCheck = FTell();
if (hasLipSync==1)
{
if ((streamedWemDefinition[index].offsetToWem-streamedWemDefinition[index].offsetToLip)>0)
Laddie lipFile <bgcolor=0x5285FF>;
Assert(FTell()-(streamedWemDefinition[index].offsetToWem-streamedWemDefinition[index].offsetToLip)==preLipIndexCheck,"Laddie didn't parse all!!!");
}
local int size = 0;
if (index+1<wemCount)
if (hasLipSync==1)
size = (streamedWemDefinition[index+1].offsetToLip-streamedWemDefinition[index].offsetToWem);
else
size = (streamedWemDefinition[index+1].offsetToWem-streamedWemDefinition[index].offsetToWem);
else
size = (FileSize()-streamedWemDefinition[index].offsetToWem);
char riffData[size] <bgcolor=0x58D7E9>;
index+=1;
} riffStreamed[wemCount] <optimize=false>;
} streamedPackage;