MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / assemble

Method assemble

Engine/source/ts/tsDecal.cpp:36–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34#define tsalloc TSShape::smTSAlloc
35
36void TSDecalMesh::assemble(bool)
37{
38 if (TSShape::smReadVersion<20)
39 {
40 // read empty mesh...decals used to be derived from meshes
41 tsalloc.checkGuard();
42 tsalloc.getPointer32(15);
43 }
44
45 S32 sz = tsalloc.get32();
46 S32 * ptr32 = tsalloc.copyToShape32(0); // get current shape address w/o doing anything
47 for (S32 i=0; i<sz; i++)
48 {
49 tsalloc.getPointer16(2);
50 tsalloc.getPointer32(1);
51 }
52 tsalloc.align32();
53 primitives.set(ptr32,sz);
54
55 sz = tsalloc.get32();
56 S16 * ptr16 = tsalloc.getPointer16(sz);
57 tsalloc.align32();
58 indices.set(ptr16,sz);
59
60 if (TSShape::smReadVersion<20)
61 {
62 // read more empty mesh stuff...decals used to be derived from meshes
63 tsalloc.getPointer32(3);
64 tsalloc.checkGuard();
65 }
66
67 sz = tsalloc.get32();
68 ptr32 = tsalloc.getPointer32(sz);
69 startPrimitive.set(ptr32,sz);
70
71 if (TSShape::smReadVersion>=19)
72 {
73 ptr32 = tsalloc.getPointer32(sz*4);
74 texgenS.set(ptr32,startPrimitive.size());
75 ptr32 = tsalloc.getPointer32(sz*4);
76 texgenT.set(ptr32,startPrimitive.size());
77 }
78 else
79 {
80 texgenS.set(NULL,0);
81 texgenT.set(NULL,0);
82 }
83
84 materialIndex = tsalloc.get32();
85
86 tsalloc.checkGuard();
87}
88
89void TSDecalMesh::disassemble()
90{

Callers

nothing calls this directly

Calls 4

checkGuardMethod · 0.80
align32Method · 0.80
setMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected