mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-21 10:49:23 +00:00
Fixed grid drawing at incorrect depth, fixed MP2 areas not loading correctly with the AnimSet loader changes
This commit is contained in:
@@ -298,47 +298,50 @@ CAnimSet* CAnimSetLoader::LoadANCS(IInputStream& rANCS)
|
||||
}
|
||||
}
|
||||
|
||||
// Load Animation Set
|
||||
u32 SetStart = rANCS.Tell();
|
||||
SetStart = SetStart;
|
||||
u16 InfoCount = rANCS.ReadShort();
|
||||
u32 NumAnims = rANCS.ReadLong();
|
||||
|
||||
for (u32 iAnim = 0; iAnim < NumAnims; iAnim++)
|
||||
Loader.LoadAnimation(rANCS);
|
||||
|
||||
u32 NumTransitions = rANCS.ReadLong();
|
||||
|
||||
for (u32 iTrans = 0; iTrans < NumTransitions; iTrans++)
|
||||
Loader.LoadTransition(rANCS);
|
||||
Loader.LoadMetaTransition(rANCS);
|
||||
|
||||
u32 NumAdditiveAnims = rANCS.ReadLong();
|
||||
|
||||
for (u32 iAnim = 0; iAnim < NumAdditiveAnims; iAnim++)
|
||||
Loader.LoadAdditiveAnimation(rANCS);
|
||||
|
||||
rANCS.Seek(0x8, SEEK_CUR);
|
||||
|
||||
if (InfoCount > 2)
|
||||
if (Loader.mVersion <= ePrime)
|
||||
{
|
||||
u32 NumHalfTransitions = rANCS.ReadLong();
|
||||
// Load Animation Set
|
||||
u32 SetStart = rANCS.Tell();
|
||||
SetStart = SetStart;
|
||||
u16 InfoCount = rANCS.ReadShort();
|
||||
u32 NumAnims = rANCS.ReadLong();
|
||||
|
||||
for (u32 iHalf = 0; iHalf < NumHalfTransitions; iHalf++)
|
||||
Loader.LoadHalfTransition(rANCS);
|
||||
}
|
||||
for (u32 iAnim = 0; iAnim < NumAnims; iAnim++)
|
||||
Loader.LoadAnimation(rANCS);
|
||||
|
||||
// Add anims to set
|
||||
for (u32 iPrim = 0; iPrim < Loader.mAnimPrimitives.size(); iPrim++)
|
||||
{
|
||||
SPrimitive& rPrim = Loader.mAnimPrimitives[iPrim];
|
||||
u32 NumTransitions = rANCS.ReadLong();
|
||||
|
||||
if (rPrim.Loaded)
|
||||
for (u32 iTrans = 0; iTrans < NumTransitions; iTrans++)
|
||||
Loader.LoadTransition(rANCS);
|
||||
Loader.LoadMetaTransition(rANCS);
|
||||
|
||||
u32 NumAdditiveAnims = rANCS.ReadLong();
|
||||
|
||||
for (u32 iAnim = 0; iAnim < NumAdditiveAnims; iAnim++)
|
||||
Loader.LoadAdditiveAnimation(rANCS);
|
||||
|
||||
rANCS.Seek(0x8, SEEK_CUR);
|
||||
|
||||
if (InfoCount > 2)
|
||||
{
|
||||
CAnimSet::SAnimation Anim;
|
||||
Anim.Name = rPrim.Name;
|
||||
Anim.pAnim = gResCache.GetResource(rPrim.AnimID, "ANIM");
|
||||
Loader.pSet->mAnims.push_back(Anim);
|
||||
u32 NumHalfTransitions = rANCS.ReadLong();
|
||||
|
||||
for (u32 iHalf = 0; iHalf < NumHalfTransitions; iHalf++)
|
||||
Loader.LoadHalfTransition(rANCS);
|
||||
}
|
||||
|
||||
// Add anims to set
|
||||
for (u32 iPrim = 0; iPrim < Loader.mAnimPrimitives.size(); iPrim++)
|
||||
{
|
||||
SPrimitive& rPrim = Loader.mAnimPrimitives[iPrim];
|
||||
|
||||
if (rPrim.Loaded)
|
||||
{
|
||||
CAnimSet::SAnimation Anim;
|
||||
Anim.Name = rPrim.Name;
|
||||
Anim.pAnim = gResCache.GetResource(rPrim.AnimID, "ANIM");
|
||||
Loader.pSet->mAnims.push_back(Anim);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -464,16 +464,6 @@ CModel* CModelLoader::LoadCMDL(IInputStream& rCMDL)
|
||||
{
|
||||
Loader.mMaterials[iSet] = CMaterialLoader::LoadMaterialSet(rCMDL, Loader.mVersion);
|
||||
|
||||
// Toggle skinning on materials
|
||||
if (Loader.mFlags.HasAnyFlags(eSkinnedModel))
|
||||
{
|
||||
for (u32 iMat = 0; iMat < Loader.mMaterials[iSet]->NumMaterials(); iMat++)
|
||||
{
|
||||
CMaterial *pMat = Loader.mMaterials[iSet]->MaterialByIndex(iMat);
|
||||
pMat->SetVertexDescription(pMat->VtxDesc() | FVertexDescription(eBoneIndices | eBoneWeights));
|
||||
}
|
||||
}
|
||||
|
||||
if (Loader.mVersion < eCorruptionProto)
|
||||
Loader.mpSectionMgr->ToNextSection();
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ void CModel::DrawSurface(FRenderOptions Options, u32 Surface, u32 MatSet)
|
||||
SSurface *pSurf = mSurfaces[Surface];
|
||||
CMaterial *pMat = mMaterialSets[MatSet]->MaterialByIndex(pSurf->MaterialID);
|
||||
|
||||
if ((!(Options & eEnableOccluders)) && (pMat->Options() & CMaterial::eOccluder))
|
||||
if (!Options.HasFlag(eEnableOccluders) && pMat->Options().HasFlag(CMaterial::eOccluder))
|
||||
return;
|
||||
|
||||
pMat->SetCurrent(Options);
|
||||
|
||||
Reference in New Issue
Block a user