diff options
author | aap <aap@papnet.eu> | 2021-07-29 19:43:06 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2021-07-29 19:43:06 +0200 |
commit | 30061396e8fb5afb003cb686e3b2d8665145c76f (patch) | |
tree | fa0a77c84311f196518a67f4e695384465abbff0 /src/modelinfo | |
parent | Reverse unused audio functions (diff) | |
download | re3-30061396e8fb5afb003cb686e3b2d8665145c76f.tar re3-30061396e8fb5afb003cb686e3b2d8665145c76f.tar.gz re3-30061396e8fb5afb003cb686e3b2d8665145c76f.tar.bz2 re3-30061396e8fb5afb003cb686e3b2d8665145c76f.tar.lz re3-30061396e8fb5afb003cb686e3b2d8665145c76f.tar.xz re3-30061396e8fb5afb003cb686e3b2d8665145c76f.tar.zst re3-30061396e8fb5afb003cb686e3b2d8665145c76f.zip |
Diffstat (limited to '')
-rw-r--r-- | src/modelinfo/MloModelInfo.cpp | 41 | ||||
-rw-r--r-- | src/modelinfo/MloModelInfo.h | 14 | ||||
-rw-r--r-- | src/modelinfo/ModelInfo.h | 1 |
3 files changed, 56 insertions, 0 deletions
diff --git a/src/modelinfo/MloModelInfo.cpp b/src/modelinfo/MloModelInfo.cpp new file mode 100644 index 00000000..fa12b900 --- /dev/null +++ b/src/modelinfo/MloModelInfo.cpp @@ -0,0 +1,41 @@ +#include "common.h" + +#include "VisibilityPlugins.h" +#include "ModelInfo.h" + +/* +void +CMloModelInfo::ConstructClump() +{ + m_clump = RpClumpCreate(); + RwFrame *mainFrame = RwFrameCreate(); + RwFrameSetIdentity(mainFrame); + RpClumpSetFrame(m_clump, mainFrame); + + for (int i = firstInstance; i < lastInstance; i++) { + int modelId = CModelInfo::GetMloInstanceStore().store[i].m_modelIndex; + RwMatrix *attMat = CModelInfo::GetMloInstanceStore().store[i].GetMatrix().m_attachment; + CSimpleModelInfo *minfo = (CSimpleModelInfo*)CModelInfo::GetModelInfo(modelId); + + if (minfo->m_atomics[0] != nil) { + RpAtomic *newAtomic = RpAtomicClone(minfo->m_atomics[0]); + RwFrame *newFrame = RwFrameCreate(); + if (newAtomic != nil && newFrame != nil) { + *RwFrameGetMatrix(newFrame) = *attMat; + RpAtomicSetFrame(newAtomic, newFrame); + RwFrameAddChild(mainFrame, newFrame); + RpClumpAddAtomic(m_clump, newAtomic); + } else { + debug("Failed to allocate memory while creating template MLO.\n"); + } + } + } + + if (RpClumpGetNumAtomics(m_clump) != 0) { + CVisibilityPlugins::SetClumpModelInfo(m_clump, this); + } else { + RpClumpDestroy(m_clump); + m_clump = nil; + } +} +*/
\ No newline at end of file diff --git a/src/modelinfo/MloModelInfo.h b/src/modelinfo/MloModelInfo.h new file mode 100644 index 00000000..b1ae3298 --- /dev/null +++ b/src/modelinfo/MloModelInfo.h @@ -0,0 +1,14 @@ +#pragma once + +#include "ClumpModelInfo.h" + +class CMloModelInfo : public CClumpModelInfo +{ +public: + float drawDist; + int firstInstance; + int lastInstance; +public: + CMloModelInfo(void) : CClumpModelInfo(MITYPE_MLO) {} + void ConstructClump(); +};
\ No newline at end of file diff --git a/src/modelinfo/ModelInfo.h b/src/modelinfo/ModelInfo.h index f92a73ad..a0ee0015 100644 --- a/src/modelinfo/ModelInfo.h +++ b/src/modelinfo/ModelInfo.h @@ -2,6 +2,7 @@ #include "2dEffect.h" #include "SimpleModelInfo.h" +#include "MloModelInfo.h" #include "TimeModelInfo.h" #include "WeaponModelInfo.h" #include "ClumpModelInfo.h" |