-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae9477d
commit 8b3cc63
Showing
5 changed files
with
76 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef M_M3D_PROC_H | ||
#define M_M3D_PROC_H | ||
|
||
#include <common.h> | ||
#include <m/m3d/m_scnleaf.h> | ||
|
||
namespace m3d { | ||
|
||
class proc_c : public scnLeaf_c { | ||
public: | ||
virtual ~proc_c(); | ||
virtual int getType() const override; | ||
bool create(mAllocator_c *, u32 *); | ||
|
||
virtual void drawOpa(); | ||
virtual void drawXlu(); | ||
}; | ||
|
||
} // namespace m3d | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include <m/m3d/m3d.h> | ||
#include <m/m3d/m_proc.h> | ||
#include <nw4r/g3d/g3d_scnproc.h> | ||
|
||
namespace m3d { | ||
|
||
void proc_c_drawProc(nw4r::g3d::ScnProc *proc, bool b) { | ||
proc_c *p = static_cast<proc_c *>(proc->GetUserData()); | ||
if (b) { | ||
p->drawOpa(); | ||
} else { | ||
p->drawXlu(); | ||
} | ||
} | ||
|
||
proc_c::~proc_c() {} | ||
|
||
int proc_c::getType() const { | ||
return 0x2; | ||
} | ||
|
||
void proc_c::drawOpa() {} | ||
void proc_c::drawXlu() {} | ||
|
||
bool proc_c::create(mAllocator_c *alloc, u32 *pSize) { | ||
if (alloc == nullptr) { | ||
alloc = internal::l_allocator_p; | ||
} | ||
|
||
u32 size; | ||
if (pSize == nullptr) { | ||
pSize = &size; | ||
} | ||
|
||
mpScnLeaf = nw4r::g3d::ScnProc::Construct(alloc, pSize, proc_c_drawProc, true, true, 0); | ||
if (!mpScnLeaf) { | ||
return false; | ||
} | ||
|
||
mpScnLeaf->SetPriorityDrawOpa(0x7f); | ||
mpScnLeaf->SetPriorityDrawXlu(0x7f); | ||
nw4r::g3d::G3dObj::DynamicCast<nw4r::g3d::ScnProc>(mpScnLeaf)->SetUserData(this); | ||
return true; | ||
} | ||
|
||
} // namespace m3d |