|
void | Dispose () |
|
| VertexCodec (Vector3[] vertices, bool removeZ, bool forceFloat) |
|
| VertexCodec (Vector3[] vertices, bool removeZ) |
|
| VertexCodec (Vector2[] vertices, bool forceFloat) |
|
| VertexCodec (Vector2[] vertices) |
|
| VertexCodec (Vector3 *sPtr, int count, bool removeZ) |
|
| VertexCodec (Vector2 *sPtr, int count) |
|
void | GetEncoder () |
|
void | Write (byte *pOut) |
|
void | Write (ref byte *pOut, int index) |
|
void | Write (Vector2[] vertices, byte *pOut) |
|
void | Write (Vector3[] vertices, byte *pOut) |
|
void | Write (float *pIn, byte *pOut) |
|
◆ VertexCodec() [1/6]
BrawlLib.Wii.Models.VertexCodec.VertexCodec |
( |
Vector3[] |
vertices, |
|
|
bool |
removeZ, |
|
|
bool |
forceFloat |
|
) |
| |
|
inline |
50 {
51 _forceFloat = forceFloat;
54 _handle = GCHandle.Alloc(vertices, GCHandleType.Pinned);
55 _pData = (float*) _handle.AddrOfPinnedObject();
56 Evaluate(removeZ);
57 }
int _srcElements
Definition: VertexCodec.cs:17
int _srcCount
Definition: VertexCodec.cs:17
◆ VertexCodec() [2/6]
BrawlLib.Wii.Models.VertexCodec.VertexCodec |
( |
Vector3[] |
vertices, |
|
|
bool |
removeZ |
|
) |
| |
|
inline |
60 {
63 _handle = GCHandle.Alloc(vertices, GCHandleType.Pinned);
64 _pData = (float*) _handle.AddrOfPinnedObject();
65 Evaluate(removeZ);
66 }
◆ VertexCodec() [3/6]
BrawlLib.Wii.Models.VertexCodec.VertexCodec |
( |
Vector2[] |
vertices, |
|
|
bool |
forceFloat |
|
) |
| |
|
inline |
69 {
70 _forceFloat = forceFloat;
73 _handle = GCHandle.Alloc(vertices, GCHandleType.Pinned);
74 _pData = (float*) _handle.AddrOfPinnedObject();
75 Evaluate(false);
76 }
◆ VertexCodec() [4/6]
BrawlLib.Wii.Models.VertexCodec.VertexCodec |
( |
Vector2[] |
vertices | ) |
|
|
inline |
79 {
82 _handle = GCHandle.Alloc(vertices, GCHandleType.Pinned);
83 _pData = (float*) _handle.AddrOfPinnedObject();
84 Evaluate(false);
85 }
◆ VertexCodec() [5/6]
BrawlLib.Wii.Models.VertexCodec.VertexCodec |
( |
Vector3 * |
sPtr, |
|
|
int |
count, |
|
|
bool |
removeZ |
|
) |
| |
|
inline |
88 {
91 _pData = (float*) sPtr;
92 Evaluate(removeZ);
93 }
◆ VertexCodec() [6/6]
BrawlLib.Wii.Models.VertexCodec.VertexCodec |
( |
Vector2 * |
sPtr, |
|
|
int |
count |
|
) |
| |
|
inline |
96 {
99 _pData = (float*) sPtr;
100 Evaluate(false);
101 }
◆ Decode() [1/4]
536 {
539 int type = (int) ElementCodec.CodecType.XYZ + header->
_type;
542
544 {
545 count *= 3;
546 }
547
549
550 byte* pIn = (
byte*) header->
Data, pOut = (
byte*) buffer.Address;
551 for (int i = 0; i < count; i++)
552 {
553 decoder(ref pIn, ref pOut, scale);
554 }
555
556 return buffer;
557 }
Definition: UnsafeBuffer.cs:7
static float[] DeQuantTable
Definition: VQuant.cs:5
unsafe delegate void ElementDecoder(ref byte *pIn, ref byte *pOut, float scale)
byte _divisor
Definition: MDL0.cs:773
bint _type
Definition: MDL0.cs:772
bushort _numVertices
Definition: MDL0.cs:775
bint _isNBT
Definition: MDL0.cs:771
VoidPtr Data
Definition: MDL0.cs:788
◆ Decode() [2/4]
474 {
477 int type = (header->
_isST == 0 ? (int) ElementCodec.CodecType.S : (
int) ElementCodec.CodecType.ST) +
481
482 byte* pIn = (
byte*) header->
Entries, pOut = (
byte*) buffer.Address;
483 for (int i = 0; i < count; i++)
484 {
485 decoder(ref pIn, ref pOut, scale);
486 }
487
488 return buffer;
489 }
bint _format
Definition: MDL0.cs:848
byte _divisor
Definition: MDL0.cs:849
bushort _numEntries
Definition: MDL0.cs:851
bint _isST
Definition: MDL0.cs:847
BVec2 * Entries
Definition: MDL0.cs:867
◆ Decode() [3/4]
518 {
521 int type = (header->
_isXYZ == 0 ? (int) ElementCodec.CodecType.XY : (
int) ElementCodec.CodecType.XYZ) +
525
526 byte* pIn = (
byte*) header->
Data, pOut = (
byte*) buffer.Address;
527 for (int i = 0; i < count; i++)
528 {
529 decoder(ref pIn, ref pOut, scale);
530 }
531
532 return buffer;
533 }
byte _divisor
Definition: MDL0.cs:727
VoidPtr Data
Definition: MDL0.cs:746
bint _isXYZ
Definition: MDL0.cs:725
bint _type
Definition: MDL0.cs:726
bushort _numVertices
Definition: MDL0.cs:729
◆ Decode() [4/4]
493 {
495 int type = isSpecial * 5 + (UVs ? 0 : 10) + (int) componentType;
497
499 ? 1
501 ? 2
502 : 4);
503
504 int count = (int) (length / bytesPerVal);
505
507
508 byte* pIn = (
byte*) data, pOut = (
byte*) buffer.
Address;
509 for (int i = 0; i < count; i++)
510 {
511 decoder(ref pIn, ref pOut, scale);
512 }
513
514 return buffer;
515 }
VoidPtr Address
Definition: UnsafeBuffer.cs:9
WiiVertexComponentType
Definition: Enum.cs:4
◆ Dispose()
void BrawlLib.Wii.Models.VertexCodec.Dispose |
( |
| ) |
|
|
inline |
38 {
39 if (_handle.IsAllocated)
40 {
41 _handle.Free();
42 }
43
44 _pData = null;
45 }
◆ ExtractNormals()
586 {
588 }
static Vector3[] ExtractVertices(MDL0VertexData *vertices)
Definition: VertexCodec.cs:563
WiiVertexComponentType Type
Definition: MDL0.cs:790
◆ ExtractUVs()
591 {
593 }
WiiVertexComponentType Type
Definition: MDL0.cs:869
◆ ExtractVertices() [1/2]
575 {
576 if (vertices != null)
577 {
580 }
581
582 return null;
583 }
WiiVertexComponentType Type
Definition: MDL0.cs:946
VoidPtr Data
Definition: MDL0.cs:944
bshort _numVertices
Definition: MDL0.cs:927
byte _divisor
Definition: MDL0.cs:925
bint _isXYZ
Definition: MDL0.cs:923
◆ ExtractVertices() [2/2]
564 {
565 if (vertices != null)
566 {
569 }
570
571 return null;
572 }
WiiVertexComponentType Type
Definition: MDL0.cs:752
◆ GetEncoder()
void BrawlLib.Wii.Models.VertexCodec.GetEncoder |
( |
| ) |
|
|
inline |
352 {
354 {
357 _enc = _byteEncoder;
358 break;
361 _enc = _shortEncoder;
362 break;
363 default:
364 _enc = _floatEncoder;
365 break;
366 }
367 }
WiiVertexComponentType _type
Definition: VertexCodec.cs:15
◆ Write() [1/5]
void BrawlLib.Wii.Models.VertexCodec.Write |
( |
byte * |
pOut | ) |
|
|
inline |
370 {
371 try
372 {
373 int[] imp = _remap._impTable;
374
375
376 float* pTemp = _pData;
378 {
379 if (imp != null)
380 {
382 }
383
385 {
387 {
388 _enc(*pTemp * _quantScale, ref pOut);
389 }
390 }
391 }
392
393
394 for (
int i =
_dataLen; (i & 0x1F) != 0; i++)
395 {
396 *pOut++ = 0;
397 }
398 }
399 finally
400 {
402 }
403 }
void Dispose()
Definition: VertexCodec.cs:37
int _dstElements
Definition: VertexCodec.cs:18
int _dstCount
Definition: VertexCodec.cs:18
int _dataLen
Definition: VertexCodec.cs:21
◆ Write() [2/5]
void BrawlLib.Wii.Models.VertexCodec.Write |
( |
float * |
pIn, |
|
|
byte * |
pOut |
|
) |
| |
|
inline |
442 {
443 int[] imp = _remap._impTable;
444 byte* pCeil = pOut +
_dataLen.Align(0x20);
445
446
447 float* pTemp = pIn;
449 {
450 if (imp != null)
451 {
453 }
454
456 {
458 {
459 _enc(*pTemp * _quantScale, ref pOut);
460 }
461 }
462 }
463
464
465 while (pOut < pCeil)
466 {
467 *pOut++ = 0;
468 }
469 }
◆ Write() [3/5]
void BrawlLib.Wii.Models.VertexCodec.Write |
( |
ref byte * |
pOut, |
|
|
int |
index |
|
) |
| |
|
inline |
406 {
407 int[] imp = _remap._impTable;
408
409
410 float* pTemp = _pData;
411 if (imp != null)
412 {
414 }
415
417 {
419 {
420 _enc(*pTemp * _quantScale, ref pOut);
421 }
422 }
423 }
◆ Write() [4/5]
void BrawlLib.Wii.Models.VertexCodec.Write |
( |
Vector2[] |
vertices, |
|
|
byte * |
pOut |
|
) |
| |
|
inline |
426 {
428 {
429 Write((
float*) p, pOut);
430 }
431 }
void Write(byte *pOut)
Definition: VertexCodec.cs:369
Definition: Vector2.cs:10
◆ Write() [5/5]
void BrawlLib.Wii.Models.VertexCodec.Write |
( |
Vector3[] |
vertices, |
|
|
byte * |
pOut |
|
) |
| |
|
inline |
434 {
436 {
437 Write((
float*) p, pOut);
438 }
439 }
Definition: Vector3.cs:40
◆ _dataLen
int BrawlLib.Wii.Models.VertexCodec._dataLen |
◆ _dstCount
int BrawlLib.Wii.Models.VertexCodec._dstCount |
◆ _dstElements
int BrawlLib.Wii.Models.VertexCodec._dstElements |
◆ _dstStride
int BrawlLib.Wii.Models.VertexCodec._dstStride |
◆ _hasZ
bool BrawlLib.Wii.Models.VertexCodec._hasZ |
◆ _max
Vector3 BrawlLib.Wii.Models.VertexCodec._max |
◆ _min
Vector3 BrawlLib.Wii.Models.VertexCodec._min |
◆ _scale
int BrawlLib.Wii.Models.VertexCodec._scale |
◆ _srcCount
int BrawlLib.Wii.Models.VertexCodec._srcCount |
◆ _srcElements
int BrawlLib.Wii.Models.VertexCodec._srcElements |
◆ _type
◆ Address
Vector2* BrawlLib.Wii.Models.VertexCodec.Address |
The documentation for this class was generated from the following file:
- BrawlLib/Wii/Models/VertexCodec.cs