mirror of
https://github.com/PrimeDecomp/prime.git
synced 2025-09-10 14:49:08 +00:00
Start DolphinCSkinnedModel, run ninja apply
This commit is contained in:
parent
d45e3e9cb4
commit
478f2369da
File diff suppressed because it is too large
Load Diff
@ -13171,7 +13171,7 @@ VClone__27CConstantAnimationTimeScaleCFv = .text:0x802FDC9C; // type:function si
|
||||
VFindUpperLimit__27CConstantAnimationTimeScaleCFRCfRCf = .text:0x802FDD24; // type:function size:0x18 scope:global
|
||||
VTimeScaleIntegral__27CConstantAnimationTimeScaleCFRCfRCf = .text:0x802FDD3C; // type:function size:0x18 scope:global
|
||||
GetType__27CConstantAnimationTimeScaleCFv = .text:0x802FDD54; // type:function size:0x8 scope:global
|
||||
IsCAnimTreeNode__11IAnimReaderCFv = .text:0x802FDD5C; // type:function size:0x8 scope:global
|
||||
IsCAnimTreeNode__11IAnimReaderCFv = .text:0x802FDD5C; // type:function size:0x8 scope:weak
|
||||
GetSoundPOIList__11IAnimReaderCFRC13CCharAnimTimeP13CSoundPOINodeUiUii = .text:0x802FDD64; // type:function size:0x7C scope:global
|
||||
GetParticlePOIList__11IAnimReaderCFRC13CCharAnimTimeP16CParticlePOINodeUiUii = .text:0x802FDDE0; // type:function size:0x7C scope:global
|
||||
GetInt32POIList__11IAnimReaderCFRC13CCharAnimTimeP13CInt32POINodeUiUii = .text:0x802FDE5C; // type:function size:0x7C scope:global
|
||||
@ -23235,15 +23235,15 @@ lbl_805AACC4 = .sdata2:0x805AACC4; // type:object size:0x4 align:4 data:float
|
||||
@725 = .sdata2:0x805AACCC; // type:object size:0x4 scope:local align:4 data:float
|
||||
@726 = .sdata2:0x805AACD0; // type:object size:0x4 scope:local align:4 data:float
|
||||
@727 = .sdata2:0x805AACD4; // type:object size:0x4 scope:local align:4 data:float
|
||||
@1108 = .sdata2:0x805AACD8; // type:object size:0x4 scope:local align:4 data:float
|
||||
@1109 = .sdata2:0x805AACDC; // type:object size:0x4 scope:local align:4 data:float
|
||||
@1110 = .sdata2:0x805AACE0; // type:object size:0x4 scope:local align:4 data:float
|
||||
@1111 = .sdata2:0x805AACE4; // type:object size:0x4 scope:local align:4 data:float
|
||||
@1112 = .sdata2:0x805AACE8; // type:object size:0x4 scope:local align:4 data:float
|
||||
@1113 = .sdata2:0x805AACEC; // type:object size:0x4 scope:local align:4 data:float
|
||||
@1116 = .sdata2:0x805AACF0; // type:object size:0x8 scope:local align:8 data:double
|
||||
@1231 = .sdata2:0x805AACF8; // type:object size:0x4 scope:local align:4 data:float
|
||||
@1232 = .sdata2:0x805AACFC; // type:object size:0x4 scope:local align:4 data:float
|
||||
@1105 = .sdata2:0x805AACD8; // type:object size:0x4 scope:local align:4 data:float
|
||||
@1106 = .sdata2:0x805AACDC; // type:object size:0x4 scope:local align:4 data:float
|
||||
@1107 = .sdata2:0x805AACE0; // type:object size:0x4 scope:local align:4 data:float
|
||||
@1108 = .sdata2:0x805AACE4; // type:object size:0x4 scope:local align:4 data:float
|
||||
@1109 = .sdata2:0x805AACE8; // type:object size:0x4 scope:local align:4 data:float
|
||||
@1110 = .sdata2:0x805AACEC; // type:object size:0x4 scope:local align:4 data:float
|
||||
@1113 = .sdata2:0x805AACF0; // type:object size:0x8 scope:local align:8 data:double
|
||||
@1228 = .sdata2:0x805AACF8; // type:object size:0x4 scope:local align:4 data:float
|
||||
@1229 = .sdata2:0x805AACFC; // type:object size:0x4 scope:local align:4 data:float
|
||||
lbl_805AAD00 = .sdata2:0x805AAD00; // type:object size:0x4 align:4 data:float
|
||||
lbl_805AAD04 = .sdata2:0x805AAD04; // type:object size:0x4 align:4 data:float
|
||||
lbl_805AAD08 = .sdata2:0x805AAD08; // type:object size:0x8 align:4 data:float
|
||||
@ -23852,9 +23852,9 @@ lbl_805AB788 = .sdata2:0x805AB788; // type:object size:0x4 align:4 data:float
|
||||
lbl_805AB78C = .sdata2:0x805AB78C; // type:object size:0x4 align:4 data:float
|
||||
lbl_805AB790 = .sdata2:0x805AB790; // type:object size:0x8 align:4 data:float
|
||||
@356 = .sdata2:0x805AB798; // type:object size:0x4 scope:local align:4 data:float
|
||||
@478 = .sdata2:0x805AB79C; // type:object size:0x4 scope:local align:4 data:float
|
||||
@479 = .sdata2:0x805AB7A0; // type:object size:0x4 scope:local align:4 data:float
|
||||
@568 = .sdata2:0x805AB7A4; // type:object size:0x4 scope:local align:4 data:float
|
||||
@472 = .sdata2:0x805AB79C; // type:object size:0x4 scope:local align:4 data:float
|
||||
@473 = .sdata2:0x805AB7A0; // type:object size:0x4 scope:local align:4 data:float
|
||||
@562 = .sdata2:0x805AB7A4; // type:object size:0x4 scope:local align:4 data:float
|
||||
lbl_805AB7A8 = .sdata2:0x805AB7A8; // type:object size:0x4 align:4 data:float
|
||||
lbl_805AB7AC = .sdata2:0x805AB7AC; // type:object size:0x4 align:4 data:float
|
||||
lbl_805AB7B0 = .sdata2:0x805AB7B0; // type:object size:0x4 align:4 data:float
|
||||
@ -24961,14 +24961,14 @@ lbl_805ACB38 = .sdata2:0x805ACB38; // type:object size:0x8 align:8 data:double
|
||||
@490 = .sdata2:0x805ACB40; // type:object size:0x4 scope:local align:4 data:float
|
||||
@491 = .sdata2:0x805ACB44; // type:object size:0x4 scope:local align:4 data:float
|
||||
@492 = .sdata2:0x805ACB48; // type:object size:0x4 scope:local align:4 data:float
|
||||
@739 = .sdata2:0x805ACB50; // type:object size:0x4 scope:local align:4 data:float
|
||||
@740 = .sdata2:0x805ACB54; // type:object size:0x4 scope:local align:4 data:float
|
||||
@741 = .sdata2:0x805ACB58; // type:object size:0x4 scope:local align:4 data:float
|
||||
@742 = .sdata2:0x805ACB5C; // type:object size:0x4 scope:local align:4 data:float
|
||||
@743 = .sdata2:0x805ACB60; // type:object size:0x4 scope:local align:4 data:float
|
||||
@744 = .sdata2:0x805ACB64; // type:object size:0x4 scope:local align:4 data:float
|
||||
@745 = .sdata2:0x805ACB68; // type:object size:0x4 scope:local align:4 data:float
|
||||
@838 = .sdata2:0x805ACB6C; // type:object size:0x4 scope:local align:4 data:float
|
||||
@736 = .sdata2:0x805ACB50; // type:object size:0x4 scope:local align:4 data:float
|
||||
@737 = .sdata2:0x805ACB54; // type:object size:0x4 scope:local align:4 data:float
|
||||
@738 = .sdata2:0x805ACB58; // type:object size:0x4 scope:local align:4 data:float
|
||||
@739 = .sdata2:0x805ACB5C; // type:object size:0x4 scope:local align:4 data:float
|
||||
@740 = .sdata2:0x805ACB60; // type:object size:0x4 scope:local align:4 data:float
|
||||
@741 = .sdata2:0x805ACB64; // type:object size:0x4 scope:local align:4 data:float
|
||||
@742 = .sdata2:0x805ACB68; // type:object size:0x4 scope:local align:4 data:float
|
||||
@835 = .sdata2:0x805ACB6C; // type:object size:0x4 scope:local align:4 data:float
|
||||
lbl_805ACB70 = .sdata2:0x805ACB70; // type:object size:0x4 align:4 data:float
|
||||
lbl_805ACB74 = .sdata2:0x805ACB74; // type:object size:0x4 align:4 data:float
|
||||
lbl_805ACB78 = .sdata2:0x805ACB78; // type:object size:0x4 align:4 data:float
|
||||
@ -26286,8 +26286,8 @@ lbl_805AE268 = .sdata2:0x805AE268; // type:object size:0x8 align:8 data:double
|
||||
lbl_805AE270 = .sdata2:0x805AE270; // type:object size:0x4 align:4 data:float
|
||||
lbl_805AE274 = .sdata2:0x805AE274; // type:object size:0x4 align:4 data:float
|
||||
lbl_805AE278 = .sdata2:0x805AE278; // type:object size:0x8 align:4 data:float
|
||||
@234 = .sdata2:0x805AE280; // type:object size:0x4 scope:local align:4 data:float
|
||||
@235 = .sdata2:0x805AE284; // type:object size:0x4 scope:local align:4 data:float
|
||||
@231 = .sdata2:0x805AE280; // type:object size:0x4 scope:local align:4 data:float
|
||||
@232 = .sdata2:0x805AE284; // type:object size:0x4 scope:local align:4 data:float
|
||||
lbl_805AE288 = .sdata2:0x805AE288; // type:object size:0x4 align:4 data:float
|
||||
lbl_805AE290 = .sdata2:0x805AE290; // type:object size:0x8 align:8 data:double
|
||||
lbl_805AE298 = .sdata2:0x805AE298; // type:object size:0x4 align:4 data:float
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define _CCIRCULARBUFFER
|
||||
|
||||
#include <types.h>
|
||||
#include <rstl/auto_ptr.hpp>
|
||||
|
||||
class CCircularBuffer {
|
||||
public:
|
||||
@ -12,10 +13,12 @@ public:
|
||||
void* Alloc(int len);
|
||||
void Free(void* ptr, int len);
|
||||
int GetAllocatedAmount() const;
|
||||
void* GetOffsettedMemory(int offset) {
|
||||
return x0_ptr.get() + offset;
|
||||
}
|
||||
|
||||
private:
|
||||
uchar x0_owned;
|
||||
void* x4_ptr;
|
||||
rstl::auto_ptr<char> x0_ptr;
|
||||
int x8_bufferLen;
|
||||
int xc_;
|
||||
int x10_nextFreeAddr;
|
||||
|
@ -10,6 +10,7 @@
|
||||
class CModel;
|
||||
class CSkinRules;
|
||||
class CCharLayoutInfo;
|
||||
class CVector3f;
|
||||
|
||||
class CSkinnedModel {
|
||||
public:
|
||||
|
@ -1,18 +1,58 @@
|
||||
#ifndef _IMETAANIM
|
||||
#define _IMETAANIM
|
||||
|
||||
#include "rstl/rc_ptr.hpp"
|
||||
#include "rstl/set.hpp"
|
||||
#include "Kyoto/Animation/CCharAnimTime.hpp"
|
||||
|
||||
enum EMetaAnimType { kMAT_Play, kMAT_Blend, kMAT_PhaseBlend, kMAT_Random, kMAT_Sequence };
|
||||
#include <rstl/optional_object.hpp>
|
||||
#include <rstl/rc_ptr.hpp>
|
||||
#include <rstl/set.hpp>
|
||||
#include <rstl/string.hpp>
|
||||
|
||||
enum EMetaAnimType {
|
||||
kMAT_Play,
|
||||
kMAT_Blend,
|
||||
kMAT_PhaseBlend,
|
||||
kMAT_Random,
|
||||
kMAT_Sequence,
|
||||
};
|
||||
|
||||
class CAnimTreeNode;
|
||||
class CPrimitive;
|
||||
class CCharAnimTime;
|
||||
class IAnimReader;
|
||||
class CAnimSysContext;
|
||||
class CMetaAnimTreeBuildOrders;
|
||||
class CPreAdvanceIndicator;
|
||||
|
||||
class CPreAdvanceIndicator {
|
||||
bool mIsTime;
|
||||
CCharAnimTime mTime;
|
||||
rstl::string mString;
|
||||
uint unk1;
|
||||
uint unk2;
|
||||
uint unk3;
|
||||
uint unk4;
|
||||
uint unk5;
|
||||
uint unk6;
|
||||
uint unk7;
|
||||
uint unk8;
|
||||
uint unk9;
|
||||
|
||||
public:
|
||||
explicit CPreAdvanceIndicator(const CCharAnimTime& time) : mIsTime(true), mTime(time) {}
|
||||
explicit CPreAdvanceIndicator(const rstl::string& string) : mIsTime(false), mString(string) {}
|
||||
bool IsTime() const;
|
||||
const CCharAnimTime& GetTime() const;
|
||||
|
||||
bool IsString() const;
|
||||
const rstl::string& GetString() const;
|
||||
};
|
||||
|
||||
class CMetaAnimTreeBuildOrders {
|
||||
rstl::optional_object< CPreAdvanceIndicator > mRecursiveAdvance;
|
||||
rstl::optional_object< CPreAdvanceIndicator > mSingleAdvance;
|
||||
|
||||
static CMetaAnimTreeBuildOrders NoSpecialOrders();
|
||||
static CMetaAnimTreeBuildOrders PreAdvanceForAll(const CPreAdvanceIndicator& ind);
|
||||
};
|
||||
|
||||
class IMetaAnim {
|
||||
public:
|
||||
|
@ -10,7 +10,12 @@ extern "C" {
|
||||
typedef void (*GXDrawDoneCallback)(void);
|
||||
|
||||
GXFifoObj* GXInit(void* base, u32 size);
|
||||
void GXAbortFrame();
|
||||
|
||||
void GXSetDrawSync(u16 token);
|
||||
u16 GXReadDrawSync(void);
|
||||
GXDrawDoneCallback GXSetDrawDoneCallback(GXDrawDoneCallback cb);
|
||||
|
||||
void GXDrawDone(void);
|
||||
void GXSetDrawDone(void);
|
||||
void GXFlush(void);
|
||||
|
@ -1,9 +1,10 @@
|
||||
#include "Kyoto/Alloc/CCircularBuffer.hpp"
|
||||
|
||||
CCircularBuffer::CCircularBuffer(void* buf, int len, CCircularBuffer::EOwnership ownership)
|
||||
: x0_owned(buf != NULL), x4_ptr(buf), x8_bufferLen(len), xc_(0), x10_nextFreeAddr(0), x14_(-1) {
|
||||
if (ownership == kOS_NotOwned)
|
||||
x0_owned = false;
|
||||
: x0_ptr(static_cast<char*>(buf)), x8_bufferLen(len), xc_(0), x10_nextFreeAddr(0), x14_(-1) {
|
||||
if (ownership == kOS_NotOwned) {
|
||||
x0_ptr.release();
|
||||
}
|
||||
}
|
||||
|
||||
bool CCircularBuffer::IsWrappedMemory(int offset, int len) {
|
||||
@ -18,7 +19,7 @@ void* CCircularBuffer::Alloc(int len) {
|
||||
uchar* ret;
|
||||
if ((x8_bufferLen - x10_nextFreeAddr) >= len && !IsWrappedMemory(x10_nextFreeAddr, len)) {
|
||||
int offset = x10_nextFreeAddr;
|
||||
uchar* ptr = (uchar*)x4_ptr;
|
||||
uchar* ptr = (uchar*)x0_ptr.get();
|
||||
x10_nextFreeAddr = offset + len;
|
||||
return ptr + offset;
|
||||
} else if (xc_ >= len && !IsWrappedMemory(0, len)) {
|
||||
@ -26,7 +27,7 @@ void* CCircularBuffer::Alloc(int len) {
|
||||
xc_ = 0;
|
||||
x10_nextFreeAddr = len;
|
||||
x14_ = r3;
|
||||
return x4_ptr;
|
||||
return x0_ptr.get();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
@ -34,7 +35,7 @@ void* CCircularBuffer::Alloc(int len) {
|
||||
|
||||
void CCircularBuffer::Free(void* ptr, int len) {
|
||||
if (x14_ > -1) {
|
||||
if (ptr == x4_ptr) {
|
||||
if (ptr == x0_ptr.get()) {
|
||||
x14_ = -1;
|
||||
xc_ = len;
|
||||
} else {
|
||||
|
49
src/Kyoto/Animation/DolphinCSkinnedModel.cpp
Normal file
49
src/Kyoto/Animation/DolphinCSkinnedModel.cpp
Normal file
@ -0,0 +1,49 @@
|
||||
#include "Kyoto/Animation/CSkinnedModel.hpp"
|
||||
|
||||
#include "Kyoto/Alloc/CCircularBuffer.hpp"
|
||||
|
||||
#include <dolphin/gx.h>
|
||||
#include <rstl/optional_object.hpp>
|
||||
|
||||
struct SSkinnedAllocation {
|
||||
SSkinnedAllocation(void* ptr, int w1, ushort w2) : x0_ptr(ptr), x4_unk1(w1), x8_unk2(w2) {}
|
||||
|
||||
void* x0_ptr;
|
||||
int x4_unk1;
|
||||
ushort x8_unk2;
|
||||
};
|
||||
|
||||
namespace Skinning {
|
||||
static ushort skCurrentToken = 0;
|
||||
static int sNumSkinnedObjects = 0;
|
||||
static bool sSkinningInitialized = false;
|
||||
static char sStaticSkinningData[0x80000] ATTRIBUTE_ALIGN(32);
|
||||
static rstl::optional_object< CCircularBuffer > sSkinningBuffer;
|
||||
static rstl::list< SSkinnedAllocation > sAllocations;
|
||||
|
||||
void AddSkinnedRef();
|
||||
void DelSkinnedRef();
|
||||
} // namespace Skinning
|
||||
|
||||
void Skinning::AddSkinnedRef() {
|
||||
if (!sSkinningInitialized) {
|
||||
GXSetDrawSync(0xFFFF);
|
||||
while (GXReadDrawSync() != 0xFFFF) {
|
||||
}
|
||||
skCurrentToken = 1;
|
||||
sSkinningInitialized = true;
|
||||
}
|
||||
|
||||
if (sNumSkinnedObjects == 0) {
|
||||
sSkinningBuffer = CCircularBuffer(sStaticSkinningData, sizeof(sStaticSkinningData));
|
||||
}
|
||||
++sNumSkinnedObjects;
|
||||
}
|
||||
|
||||
void Skinning::DelSkinnedRef() {
|
||||
--sNumSkinnedObjects;
|
||||
if (sNumSkinnedObjects == 0) {
|
||||
sSkinningBuffer.clear();
|
||||
sAllocations.clear();
|
||||
}
|
||||
}
|
26
src/Kyoto/Animation/IMetaAnim.cpp
Normal file
26
src/Kyoto/Animation/IMetaAnim.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
#include "Kyoto/Animation/IMetaAnim.hpp"
|
||||
|
||||
bool CPreAdvanceIndicator::IsTime() const {
|
||||
return mIsTime;
|
||||
}
|
||||
|
||||
const CCharAnimTime& CPreAdvanceIndicator::GetTime() const {
|
||||
return mTime;
|
||||
}
|
||||
|
||||
bool CPreAdvanceIndicator::IsString() const {
|
||||
return !IsTime();
|
||||
}
|
||||
|
||||
const rstl::string& CPreAdvanceIndicator::GetString() const {
|
||||
return mString;
|
||||
}
|
||||
|
||||
CMetaAnimTreeBuildOrders CMetaAnimTreeBuildOrders::NoSpecialOrders() {
|
||||
return CMetaAnimTreeBuildOrders();
|
||||
}
|
||||
CMetaAnimTreeBuildOrders CMetaAnimTreeBuildOrders::PreAdvanceForAll(const CPreAdvanceIndicator& ind) {
|
||||
CMetaAnimTreeBuildOrders ret;
|
||||
ret.mSingleAdvance = ind;
|
||||
return ret;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user