BrawlCrate v0.41
Wii File Editor
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
BrawlLib.Wii.Models.ElementCodec Class Reference

Public Types

enum  CodecType : int
 

Static Public Member Functions

static void Element_Byte_Float2 (ref byte *pIn, ref byte *pOut, float scale)
 
static void Element_SByte_Float2 (ref byte *pIn, ref byte *pOut, float scale)
 
static void Element_wUShort_Float2 (ref byte *pIn, ref byte *pOut, float scale)
 
static void Element_wShort_Float2 (ref byte *pIn, ref byte *pOut, float scale)
 
static void Element_wFloat_Float2 (ref byte *pIn, ref byte *pOut, float scale)
 
static void Element_Byte2_Float2 (ref byte *pIn, ref byte *pOut, float scale)
 
static void Element_SByte2_Float2 (ref byte *pIn, ref byte *pOut, float scale)
 
static void Element_wUShort2_Float2 (ref byte *pIn, ref byte *pOut, float scale)
 
static void Element_wShort2_Float2 (ref byte *pIn, ref byte *pOut, float scale)
 
static void Element_wFloat2_Float2 (ref byte *pIn, ref byte *pOut, float scale)
 
static void Element_wShort2_Float3 (ref byte *pIn, ref byte *pOut, float scale)
 
static void Element_wShort3_Float3 (ref byte *pIn, ref byte *pOut, float scale)
 
static void Element_wUShort2_Float3 (ref byte *pIn, ref byte *pOut, float scale)
 
static void Element_wUShort3_Float3 (ref byte *pIn, ref byte *pOut, float scale)
 
static void Element_Byte2_Float3 (ref byte *pIn, ref byte *pOut, float scale)
 
static void Element_Byte3_Float3 (ref byte *pIn, ref byte *pOut, float scale)
 
static void Element_SByte2_Float3 (ref byte *pIn, ref byte *pOut, float scale)
 
static void Element_SByte3_Float3 (ref byte *pIn, ref byte *pOut, float scale)
 
static void Element_wFloat2_Float3 (ref byte *pIn, ref byte *pOut, float scale)
 
static void Element_wFloat3_Float3 (ref byte *pIn, ref byte *pOut, float scale)
 

Static Public Attributes

static ElementDecoder[] Decoders
 

Member Enumeration Documentation

◆ CodecType

16 {
17 S = 0,
18 ST = 5,
19 XY = 10,
20 XYZ = 15
21 }

Member Function Documentation

◆ Element_Byte2_Float2()

static void BrawlLib.Wii.Models.ElementCodec.Element_Byte2_Float2 ( ref byte *  pIn,
ref byte *  pOut,
float  scale 
)
inlinestatic
93 {
94 ((float*) pOut)[0] = *pIn++ * scale;
95 ((float*) pOut)[1] = *pIn++ * scale;
96 pOut += 8;
97 }

◆ Element_Byte2_Float3()

static void BrawlLib.Wii.Models.ElementCodec.Element_Byte2_Float3 ( ref byte *  pIn,
ref byte *  pOut,
float  scale 
)
inlinestatic
196 {
197 for (int i = 0; i < 3; i++)
198 {
199 *(float*) pOut = i == 2 ? 0.0f : *pIn++ * scale;
200 pOut += 4;
201 }
202 }

◆ Element_Byte3_Float3()

static void BrawlLib.Wii.Models.ElementCodec.Element_Byte3_Float3 ( ref byte *  pIn,
ref byte *  pOut,
float  scale 
)
inlinestatic
205 {
206 for (int i = 0; i < 3; i++)
207 {
208 *(float*) pOut = *pIn++ * scale;
209 pOut += 4;
210 }
211 }

◆ Element_Byte_Float2()

static void BrawlLib.Wii.Models.ElementCodec.Element_Byte_Float2 ( ref byte *  pIn,
ref byte *  pOut,
float  scale 
)
inlinestatic
51 {
52 ((float*) pOut)[0] = *pIn++ * scale;
53 ((float*) pOut)[1] = 0.0f;
54 pOut += 8;
55 }

◆ Element_SByte2_Float2()

static void BrawlLib.Wii.Models.ElementCodec.Element_SByte2_Float2 ( ref byte *  pIn,
ref byte *  pOut,
float  scale 
)
inlinestatic
100 {
101 ((float*) pOut)[0] = *(sbyte*) pIn++ * scale;
102 ((float*) pOut)[1] = *(sbyte*) pIn++ * scale;
103 pOut += 8;
104 }

◆ Element_SByte2_Float3()

static void BrawlLib.Wii.Models.ElementCodec.Element_SByte2_Float3 ( ref byte *  pIn,
ref byte *  pOut,
float  scale 
)
inlinestatic
214 {
215 for (int i = 0; i < 3; i++)
216 {
217 *(float*) pOut = i == 2 ? 0.0f : *(sbyte*) pIn++ * scale;
218 pOut += 4;
219 }
220 }

◆ Element_SByte3_Float3()

static void BrawlLib.Wii.Models.ElementCodec.Element_SByte3_Float3 ( ref byte *  pIn,
ref byte *  pOut,
float  scale 
)
inlinestatic
223 {
224 for (int i = 0; i < 3; i++)
225 {
226 *(float*) pOut = *(sbyte*) pIn++ * scale;
227 pOut += 4;
228 }
229 }

◆ Element_SByte_Float2()

static void BrawlLib.Wii.Models.ElementCodec.Element_SByte_Float2 ( ref byte *  pIn,
ref byte *  pOut,
float  scale 
)
inlinestatic
58 {
59 ((float*) pOut)[0] = *(sbyte*) pIn++ * scale;
60 ((float*) pOut)[1] = 0.0f;
61 pOut += 8;
62 }

◆ Element_wFloat2_Float2()

static void BrawlLib.Wii.Models.ElementCodec.Element_wFloat2_Float2 ( ref byte *  pIn,
ref byte *  pOut,
float  scale 
)
inlinestatic
121 {
122 float val;
123 byte* p = (byte*) &val;
124
125 for (int i = 0; i < 2; i++)
126 {
127 p[3] = *pIn++;
128 p[2] = *pIn++;
129 p[1] = *pIn++;
130 p[0] = *pIn++;
131 ((float*) pOut)[i] = val * scale;
132 }
133
134 pOut += 8;
135 }

◆ Element_wFloat2_Float3()

static void BrawlLib.Wii.Models.ElementCodec.Element_wFloat2_Float3 ( ref byte *  pIn,
ref byte *  pOut,
float  scale 
)
inlinestatic
232 {
233 float temp;
234 byte* p = (byte*) &temp;
235 for (int i = 0; i < 3; i++)
236 {
237 if (i == 2)
238 {
239 *(float*) pOut = 0.0f;
240 }
241 else
242 {
243 p[3] = *pIn++;
244 p[2] = *pIn++;
245 p[1] = *pIn++;
246 p[0] = *pIn++;
247 *(float*) pOut = temp;
248 }
249
250 pOut += 4;
251 }
252 }

◆ Element_wFloat3_Float3()

static void BrawlLib.Wii.Models.ElementCodec.Element_wFloat3_Float3 ( ref byte *  pIn,
ref byte *  pOut,
float  scale 
)
inlinestatic
255 {
256 float val;
257 byte* p = (byte*) &val;
258 for (int i = 0; i < 3; i++)
259 {
260 p[3] = *pIn++;
261 p[2] = *pIn++;
262 p[1] = *pIn++;
263 p[0] = *pIn++;
264 *(float*) pOut = val;
265 pOut += 4;
266 }
267 }

◆ Element_wFloat_Float2()

static void BrawlLib.Wii.Models.ElementCodec.Element_wFloat_Float2 ( ref byte *  pIn,
ref byte *  pOut,
float  scale 
)
inlinestatic
79 {
80 float val;
81 byte* p = (byte*) &val;
82 p[3] = *pIn++;
83 p[2] = *pIn++;
84 p[1] = *pIn++;
85 p[0] = *pIn++;
86
87 ((float*) pOut)[0] = val * scale;
88 ((float*) pOut)[1] = 0.0f;
89 pOut += 8;
90 }

◆ Element_wShort2_Float2()

static void BrawlLib.Wii.Models.ElementCodec.Element_wShort2_Float2 ( ref byte *  pIn,
ref byte *  pOut,
float  scale 
)
inlinestatic
114 {
115 ((float*) pOut)[0] = (short) ((*pIn++ << 8) | *pIn++) * scale;
116 ((float*) pOut)[1] = (short) ((*pIn++ << 8) | *pIn++) * scale;
117 pOut += 8;
118 }

◆ Element_wShort2_Float3()

static void BrawlLib.Wii.Models.ElementCodec.Element_wShort2_Float3 ( ref byte *  pIn,
ref byte *  pOut,
float  scale 
)
inlinestatic
138 {
139 float* f = (float*) pOut;
140
141 *f++ = (short) ((*pIn++ << 8) | *pIn++) * scale;
142 *f++ = (short) ((*pIn++ << 8) | *pIn++) * scale;
143 *f = 0.0f;
144
145 pOut += 12;
146 }

◆ Element_wShort3_Float3()

static void BrawlLib.Wii.Models.ElementCodec.Element_wShort3_Float3 ( ref byte *  pIn,
ref byte *  pOut,
float  scale 
)
inlinestatic
149 {
150 short temp;
151 byte* p = (byte*) &temp;
152 for (int i = 0; i < 3; i++)
153 {
154 p[1] = *pIn++;
155 p[0] = *pIn++;
156 *(float*) pOut = temp * scale;
157 pOut += 4;
158 }
159 }

◆ Element_wShort_Float2()

static void BrawlLib.Wii.Models.ElementCodec.Element_wShort_Float2 ( ref byte *  pIn,
ref byte *  pOut,
float  scale 
)
inlinestatic
72 {
73 ((float*) pOut)[0] = (short) ((*pIn++ << 8) | *pIn++) * scale;
74 ((float*) pOut)[1] = 0.0f;
75 pOut += 8;
76 }

◆ Element_wUShort2_Float2()

static void BrawlLib.Wii.Models.ElementCodec.Element_wUShort2_Float2 ( ref byte *  pIn,
ref byte *  pOut,
float  scale 
)
inlinestatic
107 {
108 ((float*) pOut)[0] = (ushort) ((*pIn++ << 8) | *pIn++) * scale;
109 ((float*) pOut)[1] = (ushort) ((*pIn++ << 8) | *pIn++) * scale;
110 pOut += 8;
111 }

◆ Element_wUShort2_Float3()

static void BrawlLib.Wii.Models.ElementCodec.Element_wUShort2_Float3 ( ref byte *  pIn,
ref byte *  pOut,
float  scale 
)
inlinestatic
162 {
163 ushort temp;
164 byte* p = (byte*) &temp;
165 for (int i = 0; i < 3; i++)
166 {
167 if (i == 2)
168 {
169 *(float*) pOut = 0.0f;
170 }
171 else
172 {
173 p[1] = *pIn++;
174 p[0] = *pIn++;
175 *(float*) pOut = temp * scale;
176 }
177
178 pOut += 4;
179 }
180 }

◆ Element_wUShort3_Float3()

static void BrawlLib.Wii.Models.ElementCodec.Element_wUShort3_Float3 ( ref byte *  pIn,
ref byte *  pOut,
float  scale 
)
inlinestatic
183 {
184 ushort temp;
185 byte* p = (byte*) &temp;
186 for (int i = 0; i < 3; i++)
187 {
188 p[1] = *pIn++;
189 p[0] = *pIn++;
190 *(float*) pOut = temp * scale;
191 pOut += 4;
192 }
193 }

◆ Element_wUShort_Float2()

static void BrawlLib.Wii.Models.ElementCodec.Element_wUShort_Float2 ( ref byte *  pIn,
ref byte *  pOut,
float  scale 
)
inlinestatic
65 {
66 ((float*) pOut)[0] = (ushort) ((*pIn++ << 8) | *pIn++) * scale;
67 ((float*) pOut)[1] = 0.0f;
68 pOut += 8;
69 }

Member Data Documentation

◆ Decoders

ElementDecoder [] BrawlLib.Wii.Models.ElementCodec.Decoders
static
Initial value:
{
}
static void Element_wShort_Float2(ref byte *pIn, ref byte *pOut, float scale)
Definition: ElementCodec.cs:71
static void Element_wShort2_Float3(ref byte *pIn, ref byte *pOut, float scale)
Definition: ElementCodec.cs:137
static void Element_Byte2_Float3(ref byte *pIn, ref byte *pOut, float scale)
Definition: ElementCodec.cs:195
static void Element_Byte3_Float3(ref byte *pIn, ref byte *pOut, float scale)
Definition: ElementCodec.cs:204
static void Element_wUShort2_Float3(ref byte *pIn, ref byte *pOut, float scale)
Definition: ElementCodec.cs:161
static void Element_Byte_Float2(ref byte *pIn, ref byte *pOut, float scale)
Definition: ElementCodec.cs:50
static void Element_wFloat2_Float3(ref byte *pIn, ref byte *pOut, float scale)
Definition: ElementCodec.cs:231
static void Element_SByte3_Float3(ref byte *pIn, ref byte *pOut, float scale)
Definition: ElementCodec.cs:222
static void Element_wShort2_Float2(ref byte *pIn, ref byte *pOut, float scale)
Definition: ElementCodec.cs:113
static void Element_wShort3_Float3(ref byte *pIn, ref byte *pOut, float scale)
Definition: ElementCodec.cs:148
static void Element_wFloat3_Float3(ref byte *pIn, ref byte *pOut, float scale)
Definition: ElementCodec.cs:254
static void Element_SByte2_Float3(ref byte *pIn, ref byte *pOut, float scale)
Definition: ElementCodec.cs:213
static void Element_wUShort_Float2(ref byte *pIn, ref byte *pOut, float scale)
Definition: ElementCodec.cs:64
static void Element_SByte2_Float2(ref byte *pIn, ref byte *pOut, float scale)
Definition: ElementCodec.cs:99
static void Element_wFloat2_Float2(ref byte *pIn, ref byte *pOut, float scale)
Definition: ElementCodec.cs:120
static void Element_SByte_Float2(ref byte *pIn, ref byte *pOut, float scale)
Definition: ElementCodec.cs:57
static void Element_wUShort3_Float3(ref byte *pIn, ref byte *pOut, float scale)
Definition: ElementCodec.cs:182
static void Element_wFloat_Float2(ref byte *pIn, ref byte *pOut, float scale)
Definition: ElementCodec.cs:78
static void Element_wUShort2_Float2(ref byte *pIn, ref byte *pOut, float scale)
Definition: ElementCodec.cs:106
static void Element_Byte2_Float2(ref byte *pIn, ref byte *pOut, float scale)
Definition: ElementCodec.cs:92
unsafe delegate void ElementDecoder(ref byte *pIn, ref byte *pOut, float scale)

The documentation for this class was generated from the following file: