241 {
245 int len;
246
247
248 foreach (MR resType in OrderBank)
249 {
250 if ((@group =
Groups[(
int) resType]) ==
null || SpecialRebuildData((
int) resType))
251 {
252 continue;
253 }
254
255 if (resType == MR.Bones)
256 {
257 form?.
Say(
"Writing Bones");
258
261 {
264 pData += len;
265 }
266
267
268
270 {
272 }
273 }
274 else if (resType == MR.Shaders)
275 {
278
279 form?.Say("Writing Shaders");
280
281
283 {
285 {
288 pData += len;
289 }
290 }
291
292
293 if (mats != null)
294 {
296 {
297 mHeader = mat.Header;
298 if (mat._shader != null)
299 {
300 len = (int) mat._shader.Header;
301 mHeader->_shaderOffset = len - (int) mHeader;
302 }
303 else
304 {
305 mHeader->_shaderOffset = 0;
306 }
307 }
308 }
309 }
310 else if (resType == MR.Objects || resType == MR.Materials)
311 {
313 {
314 form?.
Say(
"Writing " + resType +
" - " + r.
Name);
315
318 pData += len;
319 }
320 }
321 else
322 {
323 bool rebuild = true;
324
326 {
327 if (group.
_name ==
"Vertices" ||
328 group.
_name ==
"Normals" ||
329 group.
_name ==
"UVs" ||
330 group.
_name ==
"Colors")
331 {
332 rebuild = false;
333 }
334 }
335
336 if (rebuild)
337 {
339 {
340
341
342 form?.
Say(
"Writing the " + resType +
" - " + e.
Name);
343
346 pData += len;
347 }
348 }
349 }
350 }
351
352
354 {
356 {
357 if ((@group =
Groups[(
int) resType]) ==
null || SpecialRebuildData((
int) resType))
358 {
359 continue;
360 }
361
363 pEntry = &pGrp->
_first + 1;
364 if (resType == MR.Bones)
365 {
368 {
370 }
371 }
372 else if (resType == MR.Shaders)
373 {
375
376 if (mats != null)
377 {
378
380
382 {
383 (pEntry++)->_dataOffset = (int) mat._shader.Header - (int) pGrp;
384 }
385 }
386 }
387 else
388 {
391 {
393 }
394 }
395
397 }
398 }
399 }
void Say(string text)
Definition: ColladaImportDialog.cs:30
void CalculateOffsets()
Definition: MDL0BoneNode.cs:697
Definition: MDL0MaterialNode.cs:22
bool _isImport
Definition: MDL0Node.cs:47
Definition: MDL0ShaderNode.cs:11
Definition: ResourceNode.cs:129
virtual void Rebuild()
Definition: ResourceNode.cs:987
int _calcSize
Definition: ResourceNode.cs:145
string _name
Definition: ResourceNode.cs:139
DataSource WorkingUncompressed
Definition: ResourceNode.cs:183
MDL0GroupNode[] Groups
Definition: ModelLinker.cs:135
VoidPtr Address
Definition: ResourceNode.cs:31
Definition: Common.cs:472
bint _totalSize
Definition: Common.cs:383
ResourceEntry _first
Definition: Common.cs:385