NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
anm_chr_blend.cpp
1#include <game/mLib/m_3d.hpp>
2
3bool m3d::anmChrBlend_c::create(nw4r::g3d::ResMdl mdl, int count, mAllocator_c *allocator, size_t *objSize) {
4 if (allocator == nullptr) {
5 allocator = internal::l_allocator_p;
6 }
7
8 size_t size;
9 if (objSize == nullptr) {
10 objSize = &size;
11 }
12
13 nw4r::g3d::AnmObjChrBlend::Construct(nullptr, objSize, mdl, count);
14 if (!createAllocator(allocator, objSize)) {
15 return false;
16 }
17
18 mpObj = nw4r::g3d::AnmObjChrBlend::Construct(&mAllocator, &size, mdl, count);
19 return true;
20}
21
22void m3d::anmChrBlend_c::attach(int idx, nw4r::g3d::AnmObjChrRes *anmChrRes, float weight) {
23 nw4r::g3d::AnmObjChrBlend *chrBlend = nw4r::g3d::G3dObj::DynamicCast<nw4r::g3d::AnmObjChrBlend>(mpObj);
24 chrBlend->SetWeight(idx, weight);
25 chrBlend->Attach(idx, anmChrRes);
26}
27
28void m3d::anmChrBlend_c::attach(int idx, m3d::anmChr_c *anmChr, float weight) {
29 nw4r::g3d::AnmObjChrRes *res = nw4r::g3d::G3dObj::DynamicCast<nw4r::g3d::AnmObjChrRes>(anmChr->getObj());
30 attach(idx, res, weight);
31}
32
33void m3d::anmChrBlend_c::detach(int idx) {
34 nw4r::g3d::AnmObjChrBlend *chrBlend = nw4r::g3d::G3dObj::DynamicCast<nw4r::g3d::AnmObjChrBlend>(mpObj);
35 chrBlend->Detach(idx);
36}
An allocator class that wraps an EGG:Allocator .