diff --git a/src/Common/AssertMacro.h b/src/Common/AssertMacro.h index 3af8b669..fa6d9872 100644 --- a/src/Common/AssertMacro.h +++ b/src/Common/AssertMacro.h @@ -14,16 +14,17 @@ * Note that in public release builds, asserts are compiled out entirely, so neither log messages nor debug breaks * will occur. * - * There are two other macros defined which can be useful for debugging, but shouldn't be used as permanent error - * checks: BREAK_ONLY_ASSERT, which doesn't write the error to the log, and LOG_ONLY_ASSERT, which doesn't trigger - * a debug break. + * LOG_ONLY_ASSERT is similar to a regular assert, but doesn't trigger a debug break. It can be useful for debugging, + * but shouldn't be used as a permanent error check. */ #define __FILE_SHORT__ strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__ #if _DEBUG #define DEBUG_BREAK __debugbreak(); + #define CONDITIONAL_BREAK(Condition) if (##Condition) DEBUG_BREAK #else #define DEBUG_BREAK {} + #define CONDITIONAL_BREAK(Condition) {} #endif #if !PUBLIC_RELEASE @@ -41,11 +42,6 @@ #define WRITE_FAILURE_TO_LOG(Expression) \ Log::Write(TString(__FILE_SHORT__) + "(" + TString::FromInt32(__LINE__, 0, 10) + "): ASSERT FAILED: " + #Expression); - #define BREAK_ONLY_ASSERT(Expression) \ - ASSERT_CHECK_BEGIN(Expression) \ - DEBUG_BREAK \ - ASSERT_CHECK_END - #define LOG_ONLY_ASSERT(Expression) \ ASSERT_CHECK_BEGIN(Expression) \ WRITE_FAILURE_TO_LOG(Expression) \ diff --git a/src/Common/CompressionUtil.cpp b/src/Common/CompressionUtil.cpp index f61ae536..f1724e2d 100644 --- a/src/Common/CompressionUtil.cpp +++ b/src/Common/CompressionUtil.cpp @@ -199,7 +199,7 @@ namespace CompressionUtil return true; } - bool CompressSegmentedData(u8 *pSrc, u32 SrcLen, u8 *pDst, u32& rTotalOut, bool IsZlib) + bool CompressSegmentedData(u8 *pSrc, u32 SrcLen, u8 *pDst, u32& rTotalOut, bool IsZlib, bool AllowUncompressedSegments) { u8 *pSrcEnd = pSrc + SrcLen; u8 *pDstStart = pDst; @@ -222,7 +222,7 @@ namespace CompressionUtil CompressLZO(pSrc, Size, Compressed.data(), TotalOut); // Verify that the compressed data is actually smaller. - if (TotalOut >= Size) + if (AllowUncompressedSegments && TotalOut >= Size) { // Write negative size value to destination (which signifies uncompressed) *pDst++ = -Size >> 8; @@ -250,13 +250,13 @@ namespace CompressionUtil return true; } - bool CompressZlibSegmented(u8 *pSrc, u32 SrcLen, u8 *pDst, u32& rTotalOut) + bool CompressZlibSegmented(u8 *pSrc, u32 SrcLen, u8 *pDst, u32& rTotalOut, bool AllowUncompressedSegments) { - return CompressSegmentedData(pSrc, SrcLen, pDst, rTotalOut, true); + return CompressSegmentedData(pSrc, SrcLen, pDst, rTotalOut, true, AllowUncompressedSegments); } - bool CompressLZOSegmented(u8 *pSrc, u32 SrcLen, u8 *pDst, u32& rTotalOut) + bool CompressLZOSegmented(u8 *pSrc, u32 SrcLen, u8 *pDst, u32& rTotalOut, bool AllowUncompressedSegments) { - return CompressSegmentedData(pSrc, SrcLen, pDst, rTotalOut, false); + return CompressSegmentedData(pSrc, SrcLen, pDst, rTotalOut, false, AllowUncompressedSegments); } } diff --git a/src/Common/CompressionUtil.h b/src/Common/CompressionUtil.h index ea5ccaf9..9cffb160 100644 --- a/src/Common/CompressionUtil.h +++ b/src/Common/CompressionUtil.h @@ -18,9 +18,9 @@ namespace CompressionUtil // Compression bool CompressZlib(u8 *pSrc, u32 SrcLen, u8 *pDst, u32 DstLen, u32& rTotalOut); bool CompressLZO(u8 *pSrc, u32 SrcLen, u8 *pDst, u32& rTotalOut); - bool CompressSegmentedData(u8 *pSrc, u32 SrcLen, u8 *pDst, u32& rTotalOut, bool IsZlib); - bool CompressZlibSegmented(u8 *pSrc, u32 SrcLen, u8 *pDst, u32& rTotalOut); - bool CompressLZOSegmented(u8 *pSrc, u32 SrcLen, u8 *pDst, u32& rTotalOut); + bool CompressSegmentedData(u8 *pSrc, u32 SrcLen, u8 *pDst, u32& rTotalOut, bool IsZlib, bool AllowUncompressedSegments); + bool CompressZlibSegmented(u8 *pSrc, u32 SrcLen, u8 *pDst, u32& rTotalOut, bool AllowUncompressedSegments); + bool CompressLZOSegmented(u8 *pSrc, u32 SrcLen, u8 *pDst, u32& rTotalOut, bool AllowUncompressedSegments); } #endif // COMPRESSIONUTIL_H diff --git a/src/Core/GameProject/CDependencyTree.cpp b/src/Core/GameProject/CDependencyTree.cpp index 1a0c71d1..895bb747 100644 --- a/src/Core/GameProject/CDependencyTree.cpp +++ b/src/Core/GameProject/CDependencyTree.cpp @@ -55,6 +55,15 @@ void CDependencyTree::AddDependency(CResource *pRes, bool AvoidDuplicates /*= tr AddDependency(pRes->ID(), AvoidDuplicates); } +void CDependencyTree::AddCharacterDependency(const CAnimationParameters& rkAnimParams) +{ + // This is for formats other than MREA that use AnimationParameters (such as SCAN). + CAnimSet *pSet = rkAnimParams.AnimSet(); + if (!pSet || rkAnimParams.CharacterIndex() == -1) return; + CCharPropertyDependency *pChar = new CCharPropertyDependency("NULL", pSet->ID(), rkAnimParams.CharacterIndex()); + mChildren.push_back(pChar); +} + // ************ CResourceDependency ************ EDependencyNodeType CResourceDependency::Type() const { @@ -215,6 +224,7 @@ CSetCharacterDependency* CSetCharacterDependency::BuildTree(const CAnimSet *pkOw pTree->AddDependency(pkChar->IceModel); pTree->AddDependency(pkChar->IceSkin); + pTree->AddDependency(pkChar->SpatialPrimitives); } return pTree; @@ -300,7 +310,8 @@ void CAreaDependencyTree::AddScriptLayer(CScriptLayer *pLayer) CScriptInstanceDependency *pTree = CScriptInstanceDependency::BuildTree( pLayer->InstanceByIndex(iInst) ); ASSERT(pTree != nullptr); - if (pTree->NumChildren() > 0) + // Note: MP2+ need to track all instances (not just instances with dependencies) to be able to build the layer module list + if (pTree->NumChildren() > 0 || pLayer->Area()->Game() >= eEchoesDemo) mChildren.push_back(pTree); else delete pTree; diff --git a/src/Core/GameProject/CDependencyTree.h b/src/Core/GameProject/CDependencyTree.h index 41e55a70..12dee499 100644 --- a/src/Core/GameProject/CDependencyTree.h +++ b/src/Core/GameProject/CDependencyTree.h @@ -10,6 +10,7 @@ class CScriptLayer; class CScriptObject; class CPropertyStruct; class CAnimSet; +class CAnimationParameters; struct SSetCharacter; // Group of node classes forming a tree of cached resource dependencies. @@ -39,8 +40,8 @@ public: virtual bool HasDependency(const CAssetID& rkID) const; // Accessors - u32 NumChildren() const { return mChildren.size(); } - IDependencyNode* ChildByIndex(u32 Index) const { return mChildren[Index]; } + inline u32 NumChildren() const { return mChildren.size(); } + inline IDependencyNode* ChildByIndex(u32 Index) const { return mChildren[Index]; } }; // Basic dependency tree; this class is sufficient for most resource types. @@ -59,6 +60,7 @@ public: void AddChild(IDependencyNode *pNode); void AddDependency(const CAssetID& rkID, bool AvoidDuplicates = true); void AddDependency(CResource *pRes, bool AvoidDuplicates = true); + void AddCharacterDependency(const CAnimationParameters& rkAnimParams); // Accessors inline void SetID(const CAssetID& rkID) { mRootID = rkID; } @@ -183,6 +185,7 @@ public: // Accessors inline bool IsUsedByCharacter(u32 CharIdx) const { return mCharacterIndices.find(CharIdx) != mCharacterIndices.end(); } + inline bool IsUsedByAnyCharacter() const { return !mCharacterIndices.empty(); } // Static static CSetAnimationDependency* BuildTree(const CAnimSet *pkOwnerSet, u32 AnimIndex); diff --git a/src/Core/GameProject/CGameProject.cpp b/src/Core/GameProject/CGameProject.cpp index bee0d30c..c78a5fc6 100644 --- a/src/Core/GameProject/CGameProject.cpp +++ b/src/Core/GameProject/CGameProject.cpp @@ -1,4 +1,5 @@ #include "CGameProject.h" +#include "Core/Resource/Factory/CTemplateLoader.h" #include "Core/Resource/Script/CMasterTemplate.h" #include @@ -21,6 +22,7 @@ bool CGameProject::Load(const TWideString& rkPath) TString ProjPath = rkPath.ToUTF8(); CXMLReader Reader(ProjPath); Serialize(Reader); + CTemplateLoader::LoadGameTemplates(mGame); mpResourceStore->LoadResourceDatabase(); mpAudioManager->LoadAssets(); diff --git a/src/Core/GameProject/CPackage.cpp b/src/Core/GameProject/CPackage.cpp index c222114c..3e1f5315 100644 --- a/src/Core/GameProject/CPackage.cpp +++ b/src/Core/GameProject/CPackage.cpp @@ -159,7 +159,7 @@ void CPackage::Cook() if (mpProject->Game() <= eEchoesDemo) Success = CompressionUtil::CompressZlib(ResourceData.data(), ResourceData.size(), CompressedData.data(), CompressedData.size(), CompressedSize); else - Success = CompressionUtil::CompressLZOSegmented(ResourceData.data(), ResourceData.size(), CompressedData.data(), CompressedSize); + Success = CompressionUtil::CompressLZOSegmented(ResourceData.data(), ResourceData.size(), CompressedData.data(), CompressedSize, false); // Make sure that the compressed data is actually smaller, accounting for padding + uncompressed size value if (Success) @@ -217,7 +217,7 @@ void CPackage::CompareOriginalAssetList(const std::list& rkNewList) TWideString CookedPath = CookedPackagePath(false); CFileInStream Pak(CookedPath.ToUTF8().ToStdString(), IOUtil::eBigEndian); - if (!Pak.IsValid()) + if (!Pak.IsValid() || Pak.Size() == 0) { Log::Error("Failed to compare to original asset list; couldn't open the original pak"); return; diff --git a/src/Core/GameProject/DependencyListBuilders.cpp b/src/Core/GameProject/DependencyListBuilders.cpp index 18991ba9..53b5b059 100644 --- a/src/Core/GameProject/DependencyListBuilders.cpp +++ b/src/Core/GameProject/DependencyListBuilders.cpp @@ -139,6 +139,21 @@ void CCharacterUsageMap::ParseDependencyNode(IDependencyNode *pNode) rUsageList[UsedChar] = true; } + // Parse dependencies of the referenced resource if it's a type that can reference animsets + else if (Type == eDNT_ResourceDependency || Type == eDNT_ScriptProperty) + { + CResourceDependency *pDep = static_cast(pNode); + CResourceEntry *pEntry = gpResourceStore->FindEntry(pDep->ID()); + + if (pEntry) + { + EResType ResType = pEntry->ResourceType(); + + if (ResType == eScan) + ParseDependencyNode(pEntry->Dependencies()); + } + } + // Look for sub-dependencies of the current node else { @@ -275,7 +290,7 @@ void CPackageDependencyListBuilder::EvaluateDependencyNode(CResourceEntry *pCurE else if (Type == eDNT_SetAnimation) { CSetAnimationDependency *pAnim = static_cast(pNode); - ParseChildren = mCharacterUsageMap.IsAnimationUsed(mCurrentAnimSetID, pAnim) || mIsPlayerActor; // todo - should maybe omit completely unused animations on PlayerActors? + ParseChildren = mCharacterUsageMap.IsAnimationUsed(mCurrentAnimSetID, pAnim) || (mIsPlayerActor && pAnim->IsUsedByAnyCharacter()); } else @@ -409,7 +424,10 @@ void CAreaDependencyListBuilder::AddDependency(const CAssetID& rkID, std::list& rOut, std::set *pAudioGroupsOut) @@ -445,7 +463,7 @@ void CAreaDependencyListBuilder::EvaluateDependencyNode(CResourceEntry *pCurEntr else if (Type == eDNT_SetAnimation) { CSetAnimationDependency *pAnim = static_cast(pNode); - ParseChildren = mCharacterUsageMap.IsAnimationUsed(mCurrentAnimSetID, pAnim); + ParseChildren = mCharacterUsageMap.IsAnimationUsed(mCurrentAnimSetID, pAnim) || (mIsPlayerActor && pAnim->IsUsedByAnyCharacter()); } else diff --git a/src/Core/Resource/Animation/CAnimSet.h b/src/Core/Resource/Animation/CAnimSet.h index 92166931..31ea44ff 100644 --- a/src/Core/Resource/Animation/CAnimSet.h +++ b/src/Core/Resource/Animation/CAnimSet.h @@ -57,6 +57,7 @@ struct SSetCharacter std::vector EffectParticles; CAssetID IceModel; CAssetID IceSkin; + CAssetID SpatialPrimitives; std::set UsedAnimationIndices; }; diff --git a/src/Core/Resource/Area/CGameArea.cpp b/src/Core/Resource/Area/CGameArea.cpp index e4fa04e6..c5c24437 100644 --- a/src/Core/Resource/Area/CGameArea.cpp +++ b/src/Core/Resource/Area/CGameArea.cpp @@ -11,7 +11,6 @@ CGameArea::CGameArea(CResourceEntry *pEntry /*= 0*/) , mOriginalWorldMeshCount(0) , mUsesCompression(false) , mpMaterialSet(nullptr) - , mpGeneratorLayer(nullptr) , mpCollision(nullptr) { } @@ -21,7 +20,6 @@ CGameArea::~CGameArea() ClearTerrain(); delete mpCollision; - delete mpGeneratorLayer; for (u32 iSCLY = 0; iSCLY < mScriptLayers.size(); iSCLY++) delete mScriptLayers[iSCLY]; @@ -54,8 +52,6 @@ CDependencyTree* CGameArea::BuildDependencyTree() const for (u32 iLayer = 0; iLayer < mScriptLayers.size(); iLayer++) pTree->AddScriptLayer(mScriptLayers[iLayer]); - pTree->AddScriptLayer(mpGeneratorLayer); - return pTree; } @@ -134,8 +130,6 @@ void CGameArea::ClearScriptLayers() for (auto it = mScriptLayers.begin(); it != mScriptLayers.end(); it++) delete *it; mScriptLayers.clear(); - delete mpGeneratorLayer; - mpGeneratorLayer = nullptr; } u32 CGameArea::TotalInstanceCount() const diff --git a/src/Core/Resource/Area/CGameArea.h b/src/Core/Resource/Area/CGameArea.h index b01156b0..fbac0102 100644 --- a/src/Core/Resource/Area/CGameArea.h +++ b/src/Core/Resource/Area/CGameArea.h @@ -49,7 +49,6 @@ class CGameArea : public CResource std::vector mStaticWorldModels; // StaticTerrainModels is the merged terrain for faster rendering in the world editor // Script std::vector mScriptLayers; - CScriptLayer *mpGeneratorLayer; std::unordered_map mObjectMap; // Collision CCollisionMeshGroup *mpCollision; @@ -92,7 +91,6 @@ public: inline CCollisionMeshGroup* Collision() const { return mpCollision; } inline u32 NumScriptLayers() const { return mScriptLayers.size(); } inline CScriptLayer* ScriptLayer(u32 Index) const { return mScriptLayers[Index]; } - inline CScriptLayer* GeneratedObjectsLayer() const { return mpGeneratorLayer; } inline u32 NumLightLayers() const { return mLightLayers.size(); } inline u32 NumLights(u32 LayerIndex) const { return (LayerIndex < mLightLayers.size() ? mLightLayers[LayerIndex].size() : 0); } inline CLight* Light(u32 LayerIndex, u32 LightIndex) const { return mLightLayers[LayerIndex][LightIndex]; } diff --git a/src/Core/Resource/CScan.h b/src/Core/Resource/CScan.h index 8d73306c..06a3a8e7 100644 --- a/src/Core/Resource/CScan.h +++ b/src/Core/Resource/CScan.h @@ -4,6 +4,7 @@ #include "CResource.h" #include "CStringTable.h" #include "TResPtr.h" +#include "Core/Resource/Animation/CAnimationParameters.h" #include class CScan : public CResource @@ -22,15 +23,34 @@ public: eResearch }; + struct SScanInfoSecondaryModel + { + CAssetID ModelID; + CAnimationParameters AnimParams; + TString AttachBoneName; + }; + private: - EGame mVersion; - CAssetID mFrameID; + // Common TResPtr mpStringTable; bool mIsSlow; bool mIsImportant; ELogbookCategory mCategory; + + // MP1 + CAssetID mFrameID; CAssetID mScanImageTextures[4]; - std::vector mLogbookAssets; + + // MP2/3 + bool mUseLogbookModelPostScan; + CAssetID mPostOverrideTexture; + float mLogbookDefaultRotX; + float mLogbookDefaultRotZ; + float mLogbookScale; + CAssetID mLogbookModel; + CAnimationParameters mLogbookAnimParams; + CAnimationParameters mUnknownAnimParams; + std::vector mSecondaryModels; public: CScan(CResourceEntry *pEntry = 0) @@ -43,23 +63,41 @@ public: CDependencyTree* BuildDependencyTree() const { + // note: not handling Corruption yet if (Game() >= eCorruptionProto) Log::Warning("CScan::BuildDependencyTree not handling Corruption dependencies"); CDependencyTree *pTree = new CDependencyTree(ID()); - pTree->AddDependency(mFrameID); + + if (Game() <= ePrime) + pTree->AddDependency(mFrameID); + pTree->AddDependency(mpStringTable); - for (u32 iImg = 0; iImg < 4; iImg++) - pTree->AddDependency(mScanImageTextures[iImg]); + if (Game() <= ePrime) + { + for (u32 iImg = 0; iImg < 4; iImg++) + pTree->AddDependency(mScanImageTextures[iImg]); + } - for (u32 iLog = 0; iLog < mLogbookAssets.size(); iLog++) - pTree->AddDependency(mLogbookAssets[iLog]); + else if (Game() <= eEchoes) + { + pTree->AddDependency(mPostOverrideTexture); + pTree->AddDependency(mLogbookModel); + pTree->AddCharacterDependency(mLogbookAnimParams); + pTree->AddCharacterDependency(mUnknownAnimParams); + + for (u32 iSec = 0; iSec < mSecondaryModels.size(); iSec++) + { + const SScanInfoSecondaryModel& rkSecModel = mSecondaryModels[iSec]; + pTree->AddDependency(rkSecModel.ModelID); + pTree->AddCharacterDependency(rkSecModel.AnimParams); + } + } return pTree; } - EGame Version() const { return mVersion; } CStringTable* ScanText() const { return mpStringTable; } bool IsImportant() const { return mIsImportant; } bool IsSlow() const { return mIsSlow; } diff --git a/src/Core/Resource/Cooker/CAreaCooker.cpp b/src/Core/Resource/Cooker/CAreaCooker.cpp index e48b7642..e36dbf4d 100644 --- a/src/Core/Resource/Cooker/CAreaCooker.cpp +++ b/src/Core/Resource/Cooker/CAreaCooker.cpp @@ -200,10 +200,11 @@ void CAreaCooker::WritePrimeSCLY(IOutputStream& rOut) // SCGN if (mVersion == eEchoesDemo) { - rOut.WriteString("SCGN", 4); + // IMPORTANT TODO - REGENERATE SCGN LAYER + /*rOut.WriteString("SCGN", 4); rOut.WriteByte(1); CScriptCooker::WriteLayer(mVersion, mpArea->mpGeneratorLayer, rOut); - FinishSection(false); + FinishSection(false);*/ } } @@ -220,9 +221,10 @@ void CAreaCooker::WriteEchoesSCLY(IOutputStream& rOut) } // SCGN + // IMPORTANT TODO - REGENERATE SCGN rOut.WriteString("SCGN", 4); rOut.WriteByte(0x1); - CScriptCooker::WriteLayer(mVersion, mpArea->mpGeneratorLayer, rOut); + //CScriptCooker::WriteLayer(mVersion, mpArea->mpGeneratorLayer, rOut); FinishSection(true); } @@ -276,7 +278,7 @@ void CAreaCooker::FinishBlock() if (EnableCompression) { - bool Success = CompressionUtil::CompressSegmentedData((u8*) mCompressedData.Data(), mCompressedData.Size(), CompressedBuf.data(), CompressedSize, UseZlib); + bool Success = CompressionUtil::CompressSegmentedData((u8*) mCompressedData.Data(), mCompressedData.Size(), CompressedBuf.data(), CompressedSize, UseZlib, true); u32 PadBytes = (32 - (CompressedSize % 32)) & 0x1F; WriteCompressedData = Success && (CompressedSize + PadBytes < (u32) mCompressedData.Size()); } diff --git a/src/Core/Resource/Cooker/CWorldCooker.cpp b/src/Core/Resource/Cooker/CWorldCooker.cpp index dc5e1989..0e93d70b 100644 --- a/src/Core/Resource/Cooker/CWorldCooker.cpp +++ b/src/Core/Resource/Cooker/CWorldCooker.cpp @@ -141,6 +141,10 @@ bool CWorldCooker::CookMLVL(CWorld *pWorld, IOutputStream& rMLVL) for (u32 iOff = 0; iOff < ModuleLayerOffsets.size(); iOff++) rMLVL.WriteLong(ModuleLayerOffsets[iOff]); } + + // Internal Name + if (Game >= eEchoesDemo) + rMLVL.WriteString(rArea.InternalName.ToStdString()); } if (Game <= eCorruption) diff --git a/src/Core/Resource/Factory/CAnimSetLoader.cpp b/src/Core/Resource/Factory/CAnimSetLoader.cpp index 29c024e2..5d24e15b 100644 --- a/src/Core/Resource/Factory/CAnimSetLoader.cpp +++ b/src/Core/Resource/Factory/CAnimSetLoader.cpp @@ -33,7 +33,7 @@ CAnimSet* CAnimSetLoader::LoadReturnsCHAR(IInputStream& rCHAR) return pSet; } -void CAnimSetLoader::LoadPASDatabase(IInputStream& rPAS4, SSetCharacter *pChar) +void CAnimSetLoader::LoadPASDatabase(IInputStream& rPAS4) { // For now, just parse the data; don't store it rPAS4.Seek(0x4, SEEK_CUR); // Skipping PAS4 FourCC @@ -68,11 +68,7 @@ void CAnimSetLoader::LoadPASDatabase(IInputStream& rPAS4, SSetCharacter *pChar) } for (u32 iInfo = 0; iInfo < AnimInfoCount; iInfo++) - { - u32 MetaAnimID = rPAS4.ReadLong(); - rPAS4.Seek(Skip, SEEK_CUR); - pChar->UsedAnimationIndices.insert(MetaAnimID); - } + rPAS4.Seek(0x4 + Skip, SEEK_CUR); } } @@ -321,7 +317,7 @@ CAnimSet* CAnimSetLoader::LoadANCS(IInputStream& rANCS, CResourceEntry *pEntry) } // PAS Database - Loader.LoadPASDatabase(rANCS, pChar); + Loader.LoadPASDatabase(rANCS); // Particles u32 ParticleCount = rANCS.ReadLong(); @@ -394,7 +390,8 @@ CAnimSet* CAnimSetLoader::LoadANCS(IInputStream& rANCS, CResourceEntry *pEntry) if (Loader.mVersion == eEchoes) { - rANCS.Seek(0x5, SEEK_CUR); + pChar->SpatialPrimitives = rANCS.ReadLong(); + rANCS.Seek(0x1, SEEK_CUR); u32 UnknownCount2 = rANCS.ReadLong(); rANCS.Seek(UnknownCount2 * 0x1C, SEEK_CUR); } diff --git a/src/Core/Resource/Factory/CAnimSetLoader.h b/src/Core/Resource/Factory/CAnimSetLoader.h index 5275ea08..7ee1d9f1 100644 --- a/src/Core/Resource/Factory/CAnimSetLoader.h +++ b/src/Core/Resource/Factory/CAnimSetLoader.h @@ -12,7 +12,7 @@ class CAnimSetLoader CAnimSetLoader(); CAnimSet* LoadCorruptionCHAR(IInputStream& rCHAR); CAnimSet* LoadReturnsCHAR(IInputStream& rCHAR); - void LoadPASDatabase(IInputStream& rPAS4, SSetCharacter *pChar); + void LoadPASDatabase(IInputStream& rPAS4); void LoadAnimationSet(IInputStream& rANCS); void ProcessPrimitives(); diff --git a/src/Core/Resource/Factory/CAreaLoader.cpp b/src/Core/Resource/Factory/CAreaLoader.cpp index 625719f8..9f2b66fb 100644 --- a/src/Core/Resource/Factory/CAreaLoader.cpp +++ b/src/Core/Resource/Factory/CAreaLoader.cpp @@ -158,9 +158,8 @@ void CAreaLoader::ReadSCLYPrime() if (pLayer) { - mpArea->mpGeneratorLayer = pLayer; - pLayer->SetName("Generated Objects"); - pLayer->SetActive(true); + MergeGeneratedLayer(pLayer); + delete pLayer; } } } @@ -311,6 +310,7 @@ void CAreaLoader::ReadSCLYEchoes() } // SCGN + // we want to regenerate the SCGN layer on cook - for now just move everything back to its original layer CFourCC SCGN(*mpMREA); if (SCGN != "SCGN") { @@ -319,12 +319,12 @@ void CAreaLoader::ReadSCLYEchoes() } mpMREA->Seek(0x1, SEEK_CUR); // Skipping unknown - mpArea->mpGeneratorLayer = CScriptLoader::LoadLayer(*mpMREA, mpArea, mVersion); + CScriptLayer *pGeneratedLayer = CScriptLoader::LoadLayer(*mpMREA, mpArea, mVersion); - if (mpArea->mpGeneratorLayer) + if (pGeneratedLayer) { - mpArea->mpGeneratorLayer->SetName("Generated Objects"); - mpArea->mpGeneratorLayer->SetActive(true); + MergeGeneratedLayer(pGeneratedLayer); + delete pGeneratedLayer; } SetUpObjects(); @@ -606,19 +606,37 @@ void CAreaLoader::ReadEGMC() mpArea->mpPoiToWorldMap = gpResourceStore->LoadResource(EGMC, "EGMC"); } -void CAreaLoader::SetUpObjects() +void CAreaLoader::MergeGeneratedLayer(CScriptLayer *pLayer) { - // Iterate over all objects - for (u32 iLyr = 0; iLyr < mpArea->NumScriptLayers() + 1; iLyr++) + while (pLayer->NumInstances() != 0) { - CScriptLayer *pLayer; - if (iLyr < mpArea->NumScriptLayers()) pLayer = mpArea->mScriptLayers[iLyr]; + CScriptObject *pObj = pLayer->InstanceByIndex(0); + u32 InstanceID = pObj->InstanceID(); + + // Check if this is a duplicate of an existing instance (this only happens with DKCR GenericCreature as far as I'm aware) + CScriptObject *pDupe = mpArea->InstanceByID(InstanceID); + + if (pDupe) + { + Log::Write("Duplicate SCGN object: [" + pObj->Template()->Name() + "] " + pObj->InstanceName() + " (" + TString::HexString(pObj->InstanceID(), 8, false) + ")"); + pLayer->RemoveInstance(pObj); + delete pObj; + } else { - pLayer = mpArea->GeneratedObjectsLayer(); - if (!pLayer) break; + u32 LayerIdx = (InstanceID >> 26) & 0x3F; + pObj->SetLayer( mpArea->ScriptLayer(LayerIdx) ); } + } +} + +void CAreaLoader::SetUpObjects() +{ + // Iterate over all objects + for (u32 iLyr = 0; iLyr < mpArea->NumScriptLayers(); iLyr++) + { + CScriptLayer *pLayer = mpArea->mScriptLayers[iLyr]; for (u32 iObj = 0; iObj < pLayer->NumInstances(); iObj++) { diff --git a/src/Core/Resource/Factory/CAreaLoader.h b/src/Core/Resource/Factory/CAreaLoader.h index 860cfff6..37d7890e 100644 --- a/src/Core/Resource/Factory/CAreaLoader.h +++ b/src/Core/Resource/Factory/CAreaLoader.h @@ -78,6 +78,7 @@ class CAreaLoader void ReadPATH(); void ReadPTLA(); void ReadEGMC(); + void MergeGeneratedLayer(CScriptLayer *pLayer); void SetUpObjects(); public: diff --git a/src/Core/Resource/Factory/CAudioGroupLoader.cpp b/src/Core/Resource/Factory/CAudioGroupLoader.cpp index b8464b06..50888df7 100644 --- a/src/Core/Resource/Factory/CAudioGroupLoader.cpp +++ b/src/Core/Resource/Factory/CAudioGroupLoader.cpp @@ -27,28 +27,33 @@ CAudioGroup* CAudioGroupLoader::LoadAGSC(IInputStream& rAGSC, CResourceEntry *pE } // Read needed data from the Proj chunk - u32 ProjStart = rAGSC.Tell(); - rAGSC.Seek(0x4, SEEK_CUR); - u16 GroupID = rAGSC.ReadShort(); - u16 GroupType = rAGSC.ReadShort(); - rAGSC.Seek(0x14, SEEK_CUR); - u32 SfxTableStart = rAGSC.ReadLong(); + u16 Peek = rAGSC.PeekShort(); - if (Game == ePrime) - pOut->mGroupID = GroupID; - else - ASSERT(pOut->mGroupID == GroupID); - - if (GroupType == 1) + if (Peek != 0xFFFF) { - rAGSC.Seek(ProjStart + SfxTableStart, SEEK_SET); - u16 NumSounds = rAGSC.ReadShort(); - rAGSC.Seek(0x2, SEEK_CUR); + u32 ProjStart = rAGSC.Tell(); + rAGSC.Seek(0x4, SEEK_CUR); + u16 GroupID = rAGSC.ReadShort(); + u16 GroupType = rAGSC.ReadShort(); + rAGSC.Seek(0x14, SEEK_CUR); + u32 SfxTableStart = rAGSC.ReadLong(); - for (u32 iSfx = 0; iSfx < NumSounds; iSfx++) + if (Game == ePrime) + pOut->mGroupID = GroupID; + else + ASSERT(pOut->mGroupID == GroupID); + + if (GroupType == 1) { - pOut->mDefineIDs.push_back( rAGSC.ReadShort() ); - rAGSC.Seek(0x8, SEEK_CUR); + rAGSC.Seek(ProjStart + SfxTableStart, SEEK_SET); + u16 NumSounds = rAGSC.ReadShort(); + rAGSC.Seek(0x2, SEEK_CUR); + + for (u32 iSfx = 0; iSfx < NumSounds; iSfx++) + { + pOut->mDefineIDs.push_back( rAGSC.ReadShort() ); + rAGSC.Seek(0x8, SEEK_CUR); + } } } @@ -70,9 +75,10 @@ CStringList* CAudioGroupLoader::LoadSTLC(IInputStream& rSTLC, CResourceEntry *pE { CStringList *pOut = new CStringList(pEntry); u32 NumStrings = rSTLC.ReadLong(); + pOut->mStringList.reserve(NumStrings); for (u32 iStr = 0; iStr < NumStrings; iStr++) - pOut->mStringList[iStr] = rSTLC.ReadString(); + pOut->mStringList.push_back( rSTLC.ReadString() ); return pOut; } diff --git a/src/Core/Resource/Factory/CScanLoader.cpp b/src/Core/Resource/Factory/CScanLoader.cpp index 98962dcf..fa4478fd 100644 --- a/src/Core/Resource/Factory/CScanLoader.cpp +++ b/src/Core/Resource/Factory/CScanLoader.cpp @@ -21,7 +21,7 @@ CScan* CScanLoader::LoadScanMP1(IInputStream& rSCAN) rSCAN.Seek(0x18, SEEK_CUR); } - mpScan->mVersion = ePrime; + mpScan->SetGame(ePrime); return mpScan; } @@ -67,26 +67,29 @@ CScan* CScanLoader::LoadScanMP2(IInputStream& rSCAN) case 0xB: mpScan = new CScan(mpEntry); mpScan->SetGame(eEchoes); - LoadParamsMP2(rSCAN); + LoadParamsMP2(rSCAN, NumProperties); break; case 0x12: case 0x16: mpScan = new CScan(mpEntry); mpScan->SetGame(eCorruption); - LoadParamsMP3(rSCAN); + LoadParamsMP3(rSCAN, NumProperties); break; default: Log::FileError(rSCAN.GetSourceString(), rSCAN.Tell() - 2, "Invalid SNFO property count: " + TString::HexString(NumProperties)); return nullptr; } + mpScan->SetGame(eEchoes); return mpScan; } -void CScanLoader::LoadParamsMP2(IInputStream& rSCAN) +void CScanLoader::LoadParamsMP2(IInputStream& rSCAN, u16 NumProperties) { // Function begins after the SNFO property count - for (u32 iProp = 0; iProp < 20; iProp++) + mpScan->mSecondaryModels.resize(9); + + for (u32 iProp = 0; iProp < NumProperties; iProp++) { u32 PropertyID = rSCAN.ReadLong(); u16 PropertySize = rSCAN.ReadShort(); @@ -103,39 +106,75 @@ void CScanLoader::LoadParamsMP2(IInputStream& rSCAN) break; case 0x7B714814: - mpScan->mIsImportant = (rSCAN.ReadByte() != 0); + mpScan->mIsImportant = rSCAN.ReadBool(); + break; + + case 0x1733B1EC: + mpScan->mUseLogbookModelPostScan = rSCAN.ReadBool(); break; - // Override texture and logbook model/animsets case 0x53336141: - case 0xB7ADC418: - case 0x15694EE1: - case 0x58F9FE99: - mpScan->mLogbookAssets.push_back( CAssetID(rSCAN, eEchoes) ); + mpScan->mPostOverrideTexture = CAssetID(rSCAN, mVersion); + break; + + case 0x3DE0BA64: + mpScan->mLogbookDefaultRotX = rSCAN.ReadFloat(); + break; + + case 0x2ADD6628: + mpScan->mLogbookDefaultRotZ = rSCAN.ReadFloat(); + break; + + case 0xD0C15066: + mpScan->mLogbookScale = rSCAN.ReadFloat(); + break; + + case 0xB7ADC418: + mpScan->mLogbookModel = CAssetID(rSCAN, mVersion); + break; + + case 0x15694EE1: + mpScan->mLogbookAnimParams = CAnimationParameters(rSCAN, mVersion); + break; + + case 0x58F9FE99: + mpScan->mUnknownAnimParams = CAnimationParameters(rSCAN, mVersion); break; - // ScanInfoSecondaryModels case 0x1C5B4A3A: + LoadScanInfoSecondaryModel( rSCAN, mpScan->mSecondaryModels[0] ); + break; + case 0x8728A0EE: + LoadScanInfoSecondaryModel( rSCAN, mpScan->mSecondaryModels[1] ); + break; + case 0xF1CD99D3: + LoadScanInfoSecondaryModel( rSCAN, mpScan->mSecondaryModels[2] ); + break; + case 0x6ABE7307: + LoadScanInfoSecondaryModel( rSCAN, mpScan->mSecondaryModels[3] ); + break; + case 0x1C07EBA9: + LoadScanInfoSecondaryModel( rSCAN, mpScan->mSecondaryModels[4] ); + break; + case 0x8774017D: + LoadScanInfoSecondaryModel( rSCAN, mpScan->mSecondaryModels[5] ); + break; + case 0xF1913840: + LoadScanInfoSecondaryModel( rSCAN, mpScan->mSecondaryModels[6] ); + break; + case 0x6AE2D294: + LoadScanInfoSecondaryModel( rSCAN, mpScan->mSecondaryModels[7] ); + break; + case 0x1CE2091C: - u16 NumSubProps = rSCAN.ReadShort(); - - for (u32 iSub = 0; iSub < NumSubProps; iSub++) - { - u32 SubPropertyID = rSCAN.ReadLong(); - u32 Next = rSCAN.Tell() + rSCAN.ReadShort(); - - if (SubPropertyID == 0x1F7921BC || SubPropertyID == 0xCDD202D1) - mpScan->mLogbookAssets.push_back( CAssetID(rSCAN, eEchoes) ); - - rSCAN.Seek(Next, SEEK_SET); - } + LoadScanInfoSecondaryModel( rSCAN, mpScan->mSecondaryModels[8] ); break; } @@ -143,15 +182,12 @@ void CScanLoader::LoadParamsMP2(IInputStream& rSCAN) } mpScan->mCategory = CScan::eNone; - mpScan->mVersion = eEchoes; } -void CScanLoader::LoadParamsMP3(IInputStream& rSCAN) +void CScanLoader::LoadParamsMP3(IInputStream& rSCAN, u16 NumProperties) { // Function begins after the SNFO property count - // Function is near-identical to the MP2 one, but when I add support - // for the other params, there will be more differences - for (u32 iProp = 0; iProp < 20; iProp++) + for (u32 iProp = 0; iProp < NumProperties; iProp++) { u32 PropertyID = rSCAN.ReadLong(); u16 PropertySize = rSCAN.ReadShort(); @@ -176,7 +212,35 @@ void CScanLoader::LoadParamsMP3(IInputStream& rSCAN) } mpScan->mCategory = CScan::eNone; - mpScan->mVersion = eCorruption; +} + +void CScanLoader::LoadScanInfoSecondaryModel(IInputStream& rSCAN, CScan::SScanInfoSecondaryModel& rSecondaryModel) +{ + u16 NumProperties = rSCAN.ReadShort(); + + for (u32 iProp = 0; iProp < NumProperties; iProp++) + { + u32 PropertyID = rSCAN.ReadLong(); + u16 PropertySize = rSCAN.ReadShort(); + u32 Next = rSCAN.Tell() + PropertySize; + + switch (PropertyID) + { + case 0x1F7921BC: + rSecondaryModel.ModelID = CAssetID(rSCAN, mVersion); + break; + + case 0xCDD202D1: + rSecondaryModel.AnimParams = CAnimationParameters(rSCAN, mVersion); + break; + + case 0x3EA2BED8: + rSecondaryModel.AttachBoneName = rSCAN.ReadString(); + break; + } + + rSCAN.Seek(Next, SEEK_SET); + } } // ************ STATIC/PUBLIC ************ diff --git a/src/Core/Resource/Factory/CScanLoader.h b/src/Core/Resource/Factory/CScanLoader.h index 2f3cb42f..26b82eb7 100644 --- a/src/Core/Resource/Factory/CScanLoader.h +++ b/src/Core/Resource/Factory/CScanLoader.h @@ -13,8 +13,9 @@ class CScanLoader CScanLoader(); CScan* LoadScanMP1(IInputStream& rSCAN); CScan* LoadScanMP2(IInputStream& rSCAN); - void LoadParamsMP2(IInputStream& rSCAN); - void LoadParamsMP3(IInputStream& rSCAN); + void LoadParamsMP2(IInputStream& rSCAN, u16 NumProperties); + void LoadParamsMP3(IInputStream& rSCAN, u16 NumProperties); + void LoadScanInfoSecondaryModel(IInputStream& rSCAN, CScan::SScanInfoSecondaryModel& rSecondaryModel); public: static CScan* LoadSCAN(IInputStream& rSCAN, CResourceEntry *pEntry); diff --git a/src/Core/Resource/Factory/CScriptLoader.cpp b/src/Core/Resource/Factory/CScriptLoader.cpp index a43f17c1..37e2cd34 100644 --- a/src/Core/Resource/Factory/CScriptLoader.cpp +++ b/src/Core/Resource/Factory/CScriptLoader.cpp @@ -59,7 +59,7 @@ void CScriptLoader::ReadProperty(IProperty *pProp, u32 Size, IInputStream& rSCLY u32 Check = pBitfieldCast->Get() & ~Mask; if (Check != 0) - Log::FileWarning(rSCLY.GetSourceString(), rSCLY.Tell() - 4, "Bitfield property \"" + pBitfieldTemp->Name() + "\" in struct \"" + pTemp->Name() + "\" has flags set that aren't in the template: " + TString::HexString(Check)); + Log::FileWarning(rSCLY.GetSourceString(), rSCLY.Tell() - 4, "Bitfield property \"" + pBitfieldTemp->FullName() + "\" + (" + pBitfieldTemp->IDString(true) + ") has flags set that aren't in the template: " + TString::HexString(Check)); break; } @@ -72,7 +72,7 @@ void CScriptLoader::ReadProperty(IProperty *pProp, u32 Size, IInputStream& rSCLY // Validate u32 Index = pEnumTemp->EnumeratorIndex(ID); - if (Index == -1) Log::FileError(rSCLY.GetSourceString(), rSCLY.Tell() - 4, "Enum property \"" + pEnumTemp->Name() + "\" in struct \"" + pTemp->Name() + "\" has invalid enumerator value: " + TString::HexString(ID)); + if (Index == -1) Log::FileError(rSCLY.GetSourceString(), rSCLY.Tell() - 4, "Enum property \"" + pEnumTemp->FullName() + "\" (" + pEnumTemp->IDString(true) + ") has invalid enumerator value: " + TString::HexString(ID)); pEnumCast->Set(ID); break; @@ -140,7 +140,7 @@ void CScriptLoader::ReadProperty(IProperty *pProp, u32 Size, IInputStream& rSCLY } if (!Valid) - Log::FileWarning(rSCLY.GetSourceString(), rSCLY.Tell() - ID.Length(), "Asset property " + pTemp->IDString(true) + " in object " + pTemp->ScriptTemplate()->Name() + " has a reference to an illegal asset type: " + CookedExt); + Log::FileWarning(rSCLY.GetSourceString(), rSCLY.Tell() - ID.Length(), "Asset property \"" + pTemp->FullName() + "\" (" + pTemp->IDString(true) + ") has a reference to an illegal asset type: " + CookedExt); } } @@ -220,7 +220,7 @@ void CScriptLoader::LoadStructMP1(IInputStream& rSCLY, CPropertyStruct *pStruct, TIDString IDString = pTemp->IDString(true); if (!IDString.IsEmpty()) IDString = " (" + IDString + ")"; - Log::FileWarning(rSCLY.GetSourceString(), StructStart, "Struct \"" + pTemp->Name() + "\"" + IDString + " template prop count doesn't match file; template is " + TString::HexString(PropCount, 2) + ", file is " + TString::HexString(FilePropCount, 2)); + Log::FileWarning(rSCLY.GetSourceString(), StructStart, "Struct \"" + pTemp->FullName() + "\" (" + IDString + ") template prop count doesn't match file; template is " + TString::HexString(PropCount, 2) + ", file is " + TString::HexString(FilePropCount, 2)); Version = 0; } } diff --git a/src/Core/Resource/Factory/CTemplateLoader.cpp b/src/Core/Resource/Factory/CTemplateLoader.cpp index 3c042be3..2ceb1907 100644 --- a/src/Core/Resource/Factory/CTemplateLoader.cpp +++ b/src/Core/Resource/Factory/CTemplateLoader.cpp @@ -105,7 +105,7 @@ IPropertyTemplate* CTemplateLoader::LoadProperty(XMLElement *pElem, CScriptTempl pParams = pParams->NextSiblingElement(); } - // File-specific parameters + // Asset-specific parameters if (Type == eAssetProperty) { TString ExtensionsAttr = pElem->Attribute("extensions"); diff --git a/src/Core/Resource/Script/CScriptLayer.h b/src/Core/Resource/Script/CScriptLayer.h index 7f015aff..6769c9b3 100644 --- a/src/Core/Resource/Script/CScriptLayer.h +++ b/src/Core/Resource/Script/CScriptLayer.h @@ -2,6 +2,7 @@ #define CSCRIPTLAYER_H #include "CScriptObject.h" +#include "Core/Resource/CDependencyGroup.h" #include #include #include @@ -107,9 +108,6 @@ public: return iLyr; } - if (mpArea->GeneratedObjectsLayer() == this) - return mpArea->NumScriptLayers(); - return -1; } diff --git a/src/Core/Resource/Script/CScriptObject.cpp b/src/Core/Resource/Script/CScriptObject.cpp index b55fdf6c..8c2df6eb 100644 --- a/src/Core/Resource/Script/CScriptObject.cpp +++ b/src/Core/Resource/Script/CScriptObject.cpp @@ -70,11 +70,13 @@ bool CScriptObject::IsEditorProperty(IProperty *pProp) void CScriptObject::SetLayer(CScriptLayer *pLayer, u32 NewLayerIndex) { + ASSERT(pLayer != nullptr); + if (pLayer != mpLayer) { if (mpLayer) mpLayer->RemoveInstance(this); mpLayer = pLayer; - if (mpLayer) mpLayer->AddInstance(this, NewLayerIndex); + mpLayer->AddInstance(this, NewLayerIndex); } } diff --git a/src/Core/Resource/Script/IPropertyTemplate.cpp b/src/Core/Resource/Script/IPropertyTemplate.cpp index aa9f53a4..b90cb189 100644 --- a/src/Core/Resource/Script/IPropertyTemplate.cpp +++ b/src/Core/Resource/Script/IPropertyTemplate.cpp @@ -20,20 +20,25 @@ bool IPropertyTemplate::IsInVersion(u32 Version) const return false; } +TString IPropertyTemplate::FullName() const +{ + return mpParent ? mpParent->FullName() + "::" + Name() : Name(); +} + TIDString IPropertyTemplate::IDString(bool FullPath) const { if (mID != 0xFFFFFFFF) { - TIDString out; + TIDString Out; if (mpParent && FullPath) { - out = mpParent->IDString(true); - if (!out.IsEmpty()) out += ":"; + Out = mpParent->IDString(true); + if (!Out.IsEmpty()) Out += ":"; } - out += TIDString::HexString(mID); - return out; + Out += TIDString::HexString(mID); + return Out; } else return ""; } diff --git a/src/Core/Resource/Script/IPropertyTemplate.h b/src/Core/Resource/Script/IPropertyTemplate.h index 99d4f9c6..eb9b9340 100644 --- a/src/Core/Resource/Script/IPropertyTemplate.h +++ b/src/Core/Resource/Script/IPropertyTemplate.h @@ -113,6 +113,7 @@ public: EGame Game() const; bool IsInVersion(u32 Version) const; + TString FullName() const; TIDString IDString(bool FullPath) const; bool IsDescendantOf(const CStructTemplate *pStruct) const; bool IsFromStructTemplate() const; diff --git a/src/Core/Scene/CScene.cpp b/src/Core/Scene/CScene.cpp index c7a6fc90..7ebc6d16 100644 --- a/src/Core/Scene/CScene.cpp +++ b/src/Core/Scene/CScene.cpp @@ -217,16 +217,6 @@ void CScene::SetActiveArea(CGameArea *pArea) } } - CScriptLayer *pGenLayer = mpArea->GeneratedObjectsLayer(); - if (pGenLayer) - { - for (u32 iObj = 0; iObj < pGenLayer->NumInstances(); iObj++) - { - CScriptObject *pObj = pGenLayer->InstanceByIndex(iObj); - CreateScriptNode(pObj); - } - } - // Ensure script nodes have valid positions + build light lists for (CSceneIterator It(this, eScriptNode, true); It; ++It) { diff --git a/src/Editor/Undo/CCreateInstanceCommand.cpp b/src/Editor/Undo/CCreateInstanceCommand.cpp index 5bdd4224..bc4e1d88 100644 --- a/src/Editor/Undo/CCreateInstanceCommand.cpp +++ b/src/Editor/Undo/CCreateInstanceCommand.cpp @@ -12,6 +12,7 @@ CCreateInstanceCommand::CCreateInstanceCommand(CWorldEditor *pEditor, CScriptTem , mpNewInstance(nullptr) , mpNewNode(nullptr) { + ASSERT(mLayerIndex != -1); } void CCreateInstanceCommand::undo() @@ -30,7 +31,7 @@ void CCreateInstanceCommand::redo() { mpEditor->NotifyNodeAboutToBeSpawned(); - CScriptLayer *pLayer = (mLayerIndex == -1 ? mpArea->GeneratedObjectsLayer() : mpArea->ScriptLayer(mLayerIndex)); + CScriptLayer *pLayer = mpArea->ScriptLayer(mLayerIndex); CScriptObject *pNewInst = mpArea->SpawnInstance(mpTemplate, pLayer, mSpawnPosition); CScriptNode *pNewNode = mpScene->CreateScriptNode(pNewInst); pNewNode->SetPosition(mSpawnPosition); diff --git a/src/Editor/Widgets/WScanPreviewPanel.cpp b/src/Editor/Widgets/WScanPreviewPanel.cpp index 00af1314..a9f0fbe0 100644 --- a/src/Editor/Widgets/WScanPreviewPanel.cpp +++ b/src/Editor/Widgets/WScanPreviewPanel.cpp @@ -45,7 +45,7 @@ void WScanPreviewPanel::SetResource(CResource *pRes) ui->ScanTypeLabel->setText("Important"); else { - if (pScan->Version() <= ePrime) + if (pScan->Game() <= ePrime) ui->ScanTypeLabel->setText("Normal"); else ui->ScanTypeLabel->setText("Normal"); @@ -81,7 +81,7 @@ void WScanPreviewPanel::SetResource(CResource *pRes) ui->ScanTextWidget->SetResource(pScan->ScanText()); // Show logbook category? (Yes on MP1, no on MP2+) - if (pScan->Version() <= ePrime) + if (pScan->Game() <= ePrime) { ui->CategoryInfoLabel->show(); ui->ScanCategoryLabel->show(); diff --git a/src/Editor/WorldEditor/CLayerModel.cpp b/src/Editor/WorldEditor/CLayerModel.cpp index 6e1c04ee..8bac661c 100644 --- a/src/Editor/WorldEditor/CLayerModel.cpp +++ b/src/Editor/WorldEditor/CLayerModel.cpp @@ -2,10 +2,10 @@ #include "Editor/UICommon.h" #include -CLayerModel::CLayerModel(QObject *pParent) : QAbstractListModel(pParent) +CLayerModel::CLayerModel(QObject *pParent) + : QAbstractListModel(pParent) + , mpArea(nullptr) { - mpArea = nullptr; - mHasGenerateLayer = false; } CLayerModel::~CLayerModel() @@ -14,9 +14,7 @@ CLayerModel::~CLayerModel() int CLayerModel::rowCount(const QModelIndex& /*parent*/) const { - if (!mpArea) return 0; - if (mHasGenerateLayer) return mpArea->NumScriptLayers() + 1; - else return mpArea->NumScriptLayers(); + return mpArea ? mpArea->NumScriptLayers() : 0; } QVariant CLayerModel::data(const QModelIndex &index, int role) const @@ -30,7 +28,6 @@ QVariant CLayerModel::data(const QModelIndex &index, int role) const void CLayerModel::SetArea(CGameArea *pArea) { mpArea = pArea; - mHasGenerateLayer = (pArea->GeneratedObjectsLayer() != nullptr); emit layoutChanged(); } @@ -41,8 +38,6 @@ CScriptLayer* CLayerModel::Layer(const QModelIndex& index) const if (index.row() < (int) NumLayers) return mpArea->ScriptLayer(index.row()); - if (mHasGenerateLayer && (index.row() == NumLayers)) - return mpArea->GeneratedObjectsLayer(); return nullptr; } diff --git a/src/Editor/WorldEditor/CLayerModel.h b/src/Editor/WorldEditor/CLayerModel.h index 2c19ce5a..209dc3d7 100644 --- a/src/Editor/WorldEditor/CLayerModel.h +++ b/src/Editor/WorldEditor/CLayerModel.h @@ -7,7 +7,6 @@ class CLayerModel : public QAbstractListModel { TResPtr mpArea; - bool mHasGenerateLayer; public: explicit CLayerModel(QObject *pParent = 0); diff --git a/templates/mp2/Script/AIMannedTurret.xml b/templates/mp2/Script/AIMannedTurret.xml index 615fa4e1..994f998e 100644 --- a/templates/mp2/Script/AIMannedTurret.xml +++ b/templates/mp2/Script/AIMannedTurret.xml @@ -57,7 +57,7 @@ - + diff --git a/templates/mp2/Script/AreaAttributes.xml b/templates/mp2/Script/AreaAttributes.xml index 9bf99fe2..815fd06d 100644 --- a/templates/mp2/Script/AreaAttributes.xml +++ b/templates/mp2/Script/AreaAttributes.xml @@ -23,15 +23,13 @@ - + - - -1 - + 1.0 diff --git a/templates/mp2/Script/AtomicBeta.xml b/templates/mp2/Script/AtomicBeta.xml index ccecfe42..080ed6f8 100644 --- a/templates/mp2/Script/AtomicBeta.xml +++ b/templates/mp2/Script/AtomicBeta.xml @@ -57,7 +57,7 @@ - + @@ -80,13 +80,13 @@ 1.0 - + -1 - + -1 - + -1 diff --git a/templates/mp2/Script/BacteriaSwarm.xml b/templates/mp2/Script/BacteriaSwarm.xml index bc5e35d7..e0b50cc4 100644 --- a/templates/mp2/Script/BacteriaSwarm.xml +++ b/templates/mp2/Script/BacteriaSwarm.xml @@ -49,12 +49,8 @@ 0.5 - - -1 - - - -1 - + + 0.5 diff --git a/templates/mp2/Script/Brizgee.xml b/templates/mp2/Script/Brizgee.xml index eb472e87..eccd5c49 100644 --- a/templates/mp2/Script/Brizgee.xml +++ b/templates/mp2/Script/Brizgee.xml @@ -41,15 +41,9 @@ 2.0 - - -1 - - - -1 - - - -1 - + + + diff --git a/templates/mp2/Script/ChozoGhost.xml b/templates/mp2/Script/ChozoGhost.xml index b472e5f4..62a9df11 100644 --- a/templates/mp2/Script/ChozoGhost.xml +++ b/templates/mp2/Script/ChozoGhost.xml @@ -67,9 +67,7 @@ 2.0 - - -1 - + @@ -77,9 +75,7 @@ - - -1 - + @@ -147,18 +143,12 @@ - - -1 - + 1.5 - - -1 - - - -1 - + + 0 @@ -171,12 +161,8 @@ 1.5 - - -1 - - - -1 - + + 20.0 diff --git a/templates/mp2/Script/CommandoPirate.xml b/templates/mp2/Script/CommandoPirate.xml index 5aa42436..96075d7d 100644 --- a/templates/mp2/Script/CommandoPirate.xml +++ b/templates/mp2/Script/CommandoPirate.xml @@ -78,15 +78,9 @@ 80.0 - - -1 - - - -1 - - - -1 - + + + -1 @@ -117,9 +111,7 @@ - - -1 - + 20.0 @@ -177,12 +169,8 @@ 8.0 - - -1 - - - -1 - + + @@ -211,9 +199,7 @@ 40.0 - - -1 - + 50.0 @@ -232,12 +218,8 @@ - - -1 - - - -1 - + + diff --git a/templates/mp2/Script/DarkCommando.xml b/templates/mp2/Script/DarkCommando.xml index 30c141ec..f1bb5d24 100644 --- a/templates/mp2/Script/DarkCommando.xml +++ b/templates/mp2/Script/DarkCommando.xml @@ -102,12 +102,8 @@ 8.0 - - -1 - - - -1 - + + diff --git a/templates/mp2/Script/DarkSamus.xml b/templates/mp2/Script/DarkSamus.xml index 71c8e7c0..12bba473 100644 --- a/templates/mp2/Script/DarkSamus.xml +++ b/templates/mp2/Script/DarkSamus.xml @@ -29,12 +29,8 @@ -1.0 - - -1 - - - -1 - + + false @@ -97,23 +93,15 @@ - - -1 - - - -1 - + + - - -1 - + - - -1 - + diff --git a/templates/mp2/Script/DarkTrooper.xml b/templates/mp2/Script/DarkTrooper.xml index e73a9c65..f93f2ad7 100644 --- a/templates/mp2/Script/DarkTrooper.xml +++ b/templates/mp2/Script/DarkTrooper.xml @@ -52,9 +52,7 @@ - - -1 - + false diff --git a/templates/mp2/Script/DebrisExtended.xml b/templates/mp2/Script/DebrisExtended.xml index f09ce8c4..68d3e61a 100644 --- a/templates/mp2/Script/DebrisExtended.xml +++ b/templates/mp2/Script/DebrisExtended.xml @@ -66,9 +66,7 @@ - - -1 - + 1 diff --git a/templates/mp2/Script/Effect.xml b/templates/mp2/Script/Effect.xml index 03f4e74e..6ccb68cb 100644 --- a/templates/mp2/Script/Effect.xml +++ b/templates/mp2/Script/Effect.xml @@ -3,7 +3,7 @@ Effect - + false diff --git a/templates/mp2/Script/ElitePirate.xml b/templates/mp2/Script/ElitePirate.xml index 087b49b4..93ac41bd 100644 --- a/templates/mp2/Script/ElitePirate.xml +++ b/templates/mp2/Script/ElitePirate.xml @@ -51,14 +51,10 @@ - - -1 - + - - -1 - + 8.0 @@ -122,9 +118,7 @@ - - -1 - + diff --git a/templates/mp2/Script/EmperorIngStage1.xml b/templates/mp2/Script/EmperorIngStage1.xml index da51b45f..f0da7f30 100644 --- a/templates/mp2/Script/EmperorIngStage1.xml +++ b/templates/mp2/Script/EmperorIngStage1.xml @@ -26,9 +26,7 @@ 0.0 - - -1 - + @@ -54,12 +52,8 @@ -1 - - -1 - - - -1 - + + @@ -71,9 +65,7 @@ 0 - - -1 - + @@ -107,9 +99,7 @@ - - -1 - + diff --git a/templates/mp2/Script/EmperorIngStage3.xml b/templates/mp2/Script/EmperorIngStage3.xml index c6013abc..09cf5c2f 100644 --- a/templates/mp2/Script/EmperorIngStage3.xml +++ b/templates/mp2/Script/EmperorIngStage3.xml @@ -43,9 +43,7 @@ - - -1 - + @@ -90,9 +88,7 @@ - - -1 - + diff --git a/templates/mp2/Script/EyeBall.xml b/templates/mp2/Script/EyeBall.xml index d667e1c0..a47b7157 100644 --- a/templates/mp2/Script/EyeBall.xml +++ b/templates/mp2/Script/EyeBall.xml @@ -38,9 +38,7 @@ -1 - - -1 - + false diff --git a/templates/mp2/Script/FishCloud.xml b/templates/mp2/Script/FishCloud.xml index 1081dda9..d45ba70f 100644 --- a/templates/mp2/Script/FishCloud.xml +++ b/templates/mp2/Script/FishCloud.xml @@ -87,9 +87,7 @@ 0 - - -1 - + true diff --git a/templates/mp2/Script/FlyingPirate.xml b/templates/mp2/Script/FlyingPirate.xml index f8cf640c..5ea9a4a2 100644 --- a/templates/mp2/Script/FlyingPirate.xml +++ b/templates/mp2/Script/FlyingPirate.xml @@ -81,9 +81,7 @@ - - -1 - + @@ -134,12 +132,8 @@ 1000.0 - - -1 - - - -1 - + + 25.0 @@ -152,12 +146,8 @@ - - -1 - - - -1 - + + 25.0 diff --git a/templates/mp2/Script/FrontEndDataNetwork.xml b/templates/mp2/Script/FrontEndDataNetwork.xml index 56d6f029..7f5a11ee 100644 --- a/templates/mp2/Script/FrontEndDataNetwork.xml +++ b/templates/mp2/Script/FrontEndDataNetwork.xml @@ -48,9 +48,7 @@ 0.247059, 0.247059, 0.247059, 1.0 - - -1 - + 0.75 diff --git a/templates/mp2/Script/Glowbug.xml b/templates/mp2/Script/Glowbug.xml index f595c670..0f5946a0 100644 --- a/templates/mp2/Script/Glowbug.xml +++ b/templates/mp2/Script/Glowbug.xml @@ -10,7 +10,7 @@ - + @@ -22,12 +22,8 @@ 0.0, 0.0, 0.0 - - -1 - - - -1 - + + false diff --git a/templates/mp2/Script/Grenchler.xml b/templates/mp2/Script/Grenchler.xml index c7a4ac63..f6e591b8 100644 --- a/templates/mp2/Script/Grenchler.xml +++ b/templates/mp2/Script/Grenchler.xml @@ -69,12 +69,8 @@ - - -1 - - - -1 - + + 4.5 diff --git a/templates/mp2/Script/GuiSlider.xml b/templates/mp2/Script/GuiSlider.xml index dbe797bd..69ea0947 100644 --- a/templates/mp2/Script/GuiSlider.xml +++ b/templates/mp2/Script/GuiSlider.xml @@ -25,9 +25,7 @@ 1.0 - - -1 - + 127 diff --git a/templates/mp2/Script/GunTurretBase.xml b/templates/mp2/Script/GunTurretBase.xml index 7b47c989..ddfc56bd 100644 --- a/templates/mp2/Script/GunTurretBase.xml +++ b/templates/mp2/Script/GunTurretBase.xml @@ -99,45 +99,19 @@ -1 - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - + + + + + + + + + + + + + 100.0 diff --git a/templates/mp2/Script/GunTurretTop.xml b/templates/mp2/Script/GunTurretTop.xml index b4120168..feed412e 100644 --- a/templates/mp2/Script/GunTurretTop.xml +++ b/templates/mp2/Script/GunTurretTop.xml @@ -23,12 +23,8 @@ 1.0, 1.0, 1.0, 0.0 - - -1 - - - -1 - + + diff --git a/templates/mp2/Script/Ing.xml b/templates/mp2/Script/Ing.xml index eda426c3..e446bbcf 100644 --- a/templates/mp2/Script/Ing.xml +++ b/templates/mp2/Script/Ing.xml @@ -54,21 +54,11 @@ - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - + + + + + @@ -85,21 +75,11 @@ 1.5 - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - + + + + + 15.0 @@ -160,12 +140,8 @@ 40.0 - - -1 - - - -1 - + + 70.0 @@ -176,9 +152,7 @@ 100.0 - - -1 - + @@ -239,12 +213,8 @@ 30.0 - - -1 - - - -1 - + + 10.0 diff --git a/templates/mp2/Script/IngBlobSwarm.xml b/templates/mp2/Script/IngBlobSwarm.xml index cba78a71..593910f5 100644 --- a/templates/mp2/Script/IngBlobSwarm.xml +++ b/templates/mp2/Script/IngBlobSwarm.xml @@ -13,9 +13,7 @@ true - - -1 - + -1 diff --git a/templates/mp2/Script/IngBoostBallGuardian.xml b/templates/mp2/Script/IngBoostBallGuardian.xml index ed746988..c3123ddb 100644 --- a/templates/mp2/Script/IngBoostBallGuardian.xml +++ b/templates/mp2/Script/IngBoostBallGuardian.xml @@ -56,21 +56,11 @@ - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - + + + + + @@ -87,21 +77,11 @@ 1.5 - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - + + + + + 15.0 @@ -162,12 +142,8 @@ 40.0 - - -1 - - - -1 - + + 70.0 @@ -178,9 +154,7 @@ 100.0 - - -1 - + @@ -285,24 +259,12 @@ - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - + + + + + + 2 diff --git a/templates/mp2/Script/IngPuddle.xml b/templates/mp2/Script/IngPuddle.xml index e8f67d81..bd306e86 100644 --- a/templates/mp2/Script/IngPuddle.xml +++ b/templates/mp2/Script/IngPuddle.xml @@ -11,7 +11,7 @@ - + @@ -26,21 +26,11 @@ - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - + + + + + diff --git a/templates/mp2/Script/IngSnatchingSwarm.xml b/templates/mp2/Script/IngSnatchingSwarm.xml index 700a99ed..77428ac2 100644 --- a/templates/mp2/Script/IngSnatchingSwarm.xml +++ b/templates/mp2/Script/IngSnatchingSwarm.xml @@ -6,8 +6,8 @@ - - + + 0.5 @@ -65,15 +65,9 @@ - - -1 - - - -1 - - - -1 - + + + 50.0 diff --git a/templates/mp2/Script/IngSpaceJumpGuardian.xml b/templates/mp2/Script/IngSpaceJumpGuardian.xml index 1da4da49..20bdc8ae 100644 --- a/templates/mp2/Script/IngSpaceJumpGuardian.xml +++ b/templates/mp2/Script/IngSpaceJumpGuardian.xml @@ -32,9 +32,7 @@ - - -1 - + @@ -46,9 +44,7 @@ 5.0 - - -1 - + diff --git a/templates/mp2/Script/Kralee.xml b/templates/mp2/Script/Kralee.xml index 054dcbd0..1d336c27 100644 --- a/templates/mp2/Script/Kralee.xml +++ b/templates/mp2/Script/Kralee.xml @@ -123,9 +123,7 @@ - - -1 - + -1 diff --git a/templates/mp2/Script/Krocuss.xml b/templates/mp2/Script/Krocuss.xml index 12fd1743..1c6137bd 100644 --- a/templates/mp2/Script/Krocuss.xml +++ b/templates/mp2/Script/Krocuss.xml @@ -114,12 +114,8 @@ 1.0, 0.0, 0.0, 1.0 - - -1 - - - -1 - + + 50.0 diff --git a/templates/mp2/Script/Lumite.xml b/templates/mp2/Script/Lumite.xml index d18d1670..bbe60918 100644 --- a/templates/mp2/Script/Lumite.xml +++ b/templates/mp2/Script/Lumite.xml @@ -68,12 +68,8 @@ 45.0 - - -1 - - - -1 - + + diff --git a/templates/mp2/Script/MediumIng.xml b/templates/mp2/Script/MediumIng.xml index b9820faa..d4b68d25 100644 --- a/templates/mp2/Script/MediumIng.xml +++ b/templates/mp2/Script/MediumIng.xml @@ -90,9 +90,7 @@ - - -1 - + 50.0 diff --git a/templates/mp2/Script/MinorIng.xml b/templates/mp2/Script/MinorIng.xml index 433f14d4..dff36e92 100644 --- a/templates/mp2/Script/MinorIng.xml +++ b/templates/mp2/Script/MinorIng.xml @@ -120,21 +120,11 @@ - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - + + + + + 100.0 @@ -178,12 +168,8 @@ 5 - - -1 - - - -1 - + + 30.0 diff --git a/templates/mp2/Script/OctapedeSegment.xml b/templates/mp2/Script/OctapedeSegment.xml index 63c34dbd..875eee04 100644 --- a/templates/mp2/Script/OctapedeSegment.xml +++ b/templates/mp2/Script/OctapedeSegment.xml @@ -153,21 +153,11 @@ - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - + + + + + 0.0 diff --git a/templates/mp2/Script/PlantScarabSwarm.xml b/templates/mp2/Script/PlantScarabSwarm.xml index 14efd024..86ff0c04 100644 --- a/templates/mp2/Script/PlantScarabSwarm.xml +++ b/templates/mp2/Script/PlantScarabSwarm.xml @@ -48,18 +48,14 @@ - - -1 - + 0.0 100.0 - - -1 - + 0.0 diff --git a/templates/mp2/Script/PlayerTurret.xml b/templates/mp2/Script/PlayerTurret.xml index f67b5147..9dbd1fea 100644 --- a/templates/mp2/Script/PlayerTurret.xml +++ b/templates/mp2/Script/PlayerTurret.xml @@ -36,21 +36,11 @@ - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - + + + + + diff --git a/templates/mp2/Script/PortalTransition.xml b/templates/mp2/Script/PortalTransition.xml index debe7f0f..67121f01 100644 --- a/templates/mp2/Script/PortalTransition.xml +++ b/templates/mp2/Script/PortalTransition.xml @@ -15,15 +15,9 @@ - - -1 - - - -1 - - - -1 - + + + 0 diff --git a/templates/mp2/Script/PuddleSpore.xml b/templates/mp2/Script/PuddleSpore.xml index b1523979..ff42f4f2 100644 --- a/templates/mp2/Script/PuddleSpore.xml +++ b/templates/mp2/Script/PuddleSpore.xml @@ -66,9 +66,7 @@ 0.0 - - -1 - + diff --git a/templates/mp2/Script/Puffer.xml b/templates/mp2/Script/Puffer.xml index eb6d13e0..d1d055e7 100644 --- a/templates/mp2/Script/Puffer.xml +++ b/templates/mp2/Script/Puffer.xml @@ -76,9 +76,7 @@ false - - -1 - + diff --git a/templates/mp2/Script/Rezbit.xml b/templates/mp2/Script/Rezbit.xml index 35dce30b..770bd604 100644 --- a/templates/mp2/Script/Rezbit.xml +++ b/templates/mp2/Script/Rezbit.xml @@ -140,12 +140,8 @@ -1 - - -1 - - - -1 - + + 20.0 diff --git a/templates/mp2/Script/RubiksPuzzle.xml b/templates/mp2/Script/RubiksPuzzle.xml index 98b6b625..142268f3 100644 --- a/templates/mp2/Script/RubiksPuzzle.xml +++ b/templates/mp2/Script/RubiksPuzzle.xml @@ -11,7 +11,7 @@ 90.0 - + diff --git a/templates/mp2/Script/SafeZone.xml b/templates/mp2/Script/SafeZone.xml index 526ecdfb..9e03672a 100644 --- a/templates/mp2/Script/SafeZone.xml +++ b/templates/mp2/Script/SafeZone.xml @@ -115,9 +115,7 @@ 0.5 - - -1 - + 0 diff --git a/templates/mp2/Script/SandBoss.xml b/templates/mp2/Script/SandBoss.xml index 901d8c83..e630e228 100644 --- a/templates/mp2/Script/SandBoss.xml +++ b/templates/mp2/Script/SandBoss.xml @@ -119,12 +119,8 @@ 150.0 - - -1 - - - -1 - + + diff --git a/templates/mp2/Script/Sandworm.xml b/templates/mp2/Script/Sandworm.xml index 1eecfeff..a0ba437e 100644 --- a/templates/mp2/Script/Sandworm.xml +++ b/templates/mp2/Script/Sandworm.xml @@ -41,18 +41,10 @@ 1.0 - - -1 - - - -1 - - - -1 - - - -1 - + + + + @@ -156,12 +148,8 @@ 0.0 - - -1 - - - -1 - + + 50.0 diff --git a/templates/mp2/Script/Shrieker.xml b/templates/mp2/Script/Shrieker.xml index e2615756..b160c183 100644 --- a/templates/mp2/Script/Shrieker.xml +++ b/templates/mp2/Script/Shrieker.xml @@ -105,9 +105,7 @@ 1.0 - - -1 - + 3.0 diff --git a/templates/mp2/Script/SnakeWeedSwarm.xml b/templates/mp2/Script/SnakeWeedSwarm.xml index a9085371..cb2f9743 100644 --- a/templates/mp2/Script/SnakeWeedSwarm.xml +++ b/templates/mp2/Script/SnakeWeedSwarm.xml @@ -60,15 +60,9 @@ 0.0 - - -1 - - - -1 - - - -1 - + + + diff --git a/templates/mp2/Script/Sound.xml b/templates/mp2/Script/Sound.xml index 7b6b1e10..318ffc25 100644 --- a/templates/mp2/Script/Sound.xml +++ b/templates/mp2/Script/Sound.xml @@ -3,9 +3,7 @@ Sound - - -1 - + 50.0 diff --git a/templates/mp2/Script/SpacePirate.xml b/templates/mp2/Script/SpacePirate.xml index 84f4ecb8..7080abc1 100644 --- a/templates/mp2/Script/SpacePirate.xml +++ b/templates/mp2/Script/SpacePirate.xml @@ -101,9 +101,7 @@ - - -1 - + @@ -134,9 +132,7 @@ 80.0 - - -1 - + 0.1 @@ -170,12 +166,8 @@ 10.0 - - -1 - - - -1 - + + 0.2 @@ -231,12 +223,8 @@ 2 - - -1 - - - -1 - + + diff --git a/templates/mp2/Script/SpecialFunction.xml b/templates/mp2/Script/SpecialFunction.xml index 000b1294..6023764c 100644 --- a/templates/mp2/Script/SpecialFunction.xml +++ b/templates/mp2/Script/SpecialFunction.xml @@ -106,15 +106,9 @@ 0x00000000 - - -1 - - - -1 - - - -1 - + + + diff --git a/templates/mp2/Script/Spinner.xml b/templates/mp2/Script/Spinner.xml index fccc2e6d..3abec7e4 100644 --- a/templates/mp2/Script/Spinner.xml +++ b/templates/mp2/Script/Spinner.xml @@ -27,15 +27,9 @@ true - - -1 - - - -1 - - - -1 - + + + diff --git a/templates/mp2/Script/SplitterCommandModule.xml b/templates/mp2/Script/SplitterCommandModule.xml index fef11a3e..4dc421e3 100644 --- a/templates/mp2/Script/SplitterCommandModule.xml +++ b/templates/mp2/Script/SplitterCommandModule.xml @@ -151,27 +151,17 @@ - - -1 - - - -1 - - - -1 - - - -1 - + + + + -1 -1 - - -1 - + diff --git a/templates/mp2/Script/SplitterMainChassis.xml b/templates/mp2/Script/SplitterMainChassis.xml index bcb6d945..b0744617 100644 --- a/templates/mp2/Script/SplitterMainChassis.xml +++ b/templates/mp2/Script/SplitterMainChassis.xml @@ -124,9 +124,7 @@ - - -1 - + diff --git a/templates/mp2/Script/SporbBase.xml b/templates/mp2/Script/SporbBase.xml index ad958820..3683d867 100644 --- a/templates/mp2/Script/SporbBase.xml +++ b/templates/mp2/Script/SporbBase.xml @@ -125,39 +125,19 @@ 5.0 - - -1 - + -1 - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - + + + + + + + + + diff --git a/templates/mp2/Script/SporbNeedle.xml b/templates/mp2/Script/SporbNeedle.xml index 801b60aa..6d56b834 100644 --- a/templates/mp2/Script/SporbNeedle.xml +++ b/templates/mp2/Script/SporbNeedle.xml @@ -32,21 +32,11 @@ - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - + + + + + diff --git a/templates/mp2/Script/SwampBossStage2.xml b/templates/mp2/Script/SwampBossStage2.xml index 7115df46..51594530 100644 --- a/templates/mp2/Script/SwampBossStage2.xml +++ b/templates/mp2/Script/SwampBossStage2.xml @@ -95,9 +95,7 @@ - - -1 - + 2.0 @@ -164,9 +162,7 @@ 180.0 - - -1 - + 5.0 diff --git a/templates/mp2/Script/WallWalker.xml b/templates/mp2/Script/WallWalker.xml index 8452199b..49522078 100644 --- a/templates/mp2/Script/WallWalker.xml +++ b/templates/mp2/Script/WallWalker.xml @@ -41,12 +41,8 @@ 5 - - -1 - - - -1 - + + 2.0 diff --git a/templates/mp2/Script/Water.xml b/templates/mp2/Script/Water.xml index 381f213a..ca1c7392 100644 --- a/templates/mp2/Script/Water.xml +++ b/templates/mp2/Script/Water.xml @@ -149,21 +149,13 @@ - - -1 - + -1 - - -1 - - - -1 - - - -1 - + + + 1.0, 1.0, 1.0, 1.0 diff --git a/templates/mp2/Script/WorldTeleporter.xml b/templates/mp2/Script/WorldTeleporter.xml index 49fca6dd..8a6a7b88 100644 --- a/templates/mp2/Script/WorldTeleporter.xml +++ b/templates/mp2/Script/WorldTeleporter.xml @@ -21,9 +21,7 @@ true - - -1 - + 127 diff --git a/templates/mp2/Structs/AudioPlaybackParms.xml b/templates/mp2/Structs/AudioPlaybackParms.xml index af7efc01..4a12879a 100644 --- a/templates/mp2/Structs/AudioPlaybackParms.xml +++ b/templates/mp2/Structs/AudioPlaybackParms.xml @@ -7,9 +7,7 @@ 0.1 - - -1 - + 127 diff --git a/templates/mp2/Structs/BasicSwarmProperties.xml b/templates/mp2/Structs/BasicSwarmProperties.xml index a72a7d12..a17149e7 100644 --- a/templates/mp2/Structs/BasicSwarmProperties.xml +++ b/templates/mp2/Structs/BasicSwarmProperties.xml @@ -101,9 +101,7 @@ false - - -1 - + -1 diff --git a/templates/mp2/Structs/CameraShakerData.xml b/templates/mp2/Structs/CameraShakerData.xml index d8a321aa..4a3d1bd5 100644 --- a/templates/mp2/Structs/CameraShakerData.xml +++ b/templates/mp2/Structs/CameraShakerData.xml @@ -13,8 +13,6 @@ 1.0 - - -1 - + diff --git a/templates/mp2/Structs/ConditionalTest.xml b/templates/mp2/Structs/ConditionalTest.xml index 593588cf..120b4ab8 100644 --- a/templates/mp2/Structs/ConditionalTest.xml +++ b/templates/mp2/Structs/ConditionalTest.xml @@ -22,12 +22,13 @@ 0x00000000 - - - - - - + + + + + + + diff --git a/templates/mp2/Structs/EmperorIngStage3StructA.xml b/templates/mp2/Structs/EmperorIngStage3StructA.xml index 10609b35..18330342 100644 --- a/templates/mp2/Structs/EmperorIngStage3StructA.xml +++ b/templates/mp2/Structs/EmperorIngStage3StructA.xml @@ -30,8 +30,6 @@ - - -1 - + diff --git a/templates/mp2/Structs/PatternedInfo.xml b/templates/mp2/Structs/PatternedInfo.xml index fb771d65..44bd7ffd 100644 --- a/templates/mp2/Structs/PatternedInfo.xml +++ b/templates/mp2/Structs/PatternedInfo.xml @@ -73,9 +73,7 @@ 0.0 - - -1 - + @@ -100,15 +98,9 @@ 0.0, 0.0, 0.0 - - -1 - - - -1 - - - -1 - + + + 0 diff --git a/templates/mp2/Structs/SafeZoneStructB.xml b/templates/mp2/Structs/SafeZoneStructB.xml index 9b122b30..af44eb27 100644 --- a/templates/mp2/Structs/SafeZoneStructB.xml +++ b/templates/mp2/Structs/SafeZoneStructB.xml @@ -1,24 +1,14 @@ - - -1 - + 0.0 - - -1 - - - -1 - - - -1 - - - -1 - + + + + 50.0 diff --git a/templates/mp2/Structs/SandBossStructB.xml b/templates/mp2/Structs/SandBossStructB.xml index 223811d4..b906b01b 100644 --- a/templates/mp2/Structs/SandBossStructB.xml +++ b/templates/mp2/Structs/SandBossStructB.xml @@ -44,9 +44,7 @@ 0.0 - - -1 - + 1 diff --git a/templates/mp2/Structs/ShockWaveInfo.xml b/templates/mp2/Structs/ShockWaveInfo.xml index d6d0d157..f2d73cd9 100644 --- a/templates/mp2/Structs/ShockWaveInfo.xml +++ b/templates/mp2/Structs/ShockWaveInfo.xml @@ -19,8 +19,6 @@ 0.0 - - -1 - + diff --git a/templates/mp2demo/Script/Brizgee.xml b/templates/mp2demo/Script/Brizgee.xml index eb472e87..1d64466c 100644 --- a/templates/mp2demo/Script/Brizgee.xml +++ b/templates/mp2demo/Script/Brizgee.xml @@ -41,13 +41,13 @@ 2.0 - + -1 - + -1 - + -1 diff --git a/templates/mp2demo/Script/ChozoGhost.xml b/templates/mp2demo/Script/ChozoGhost.xml index 2fe08f2c..2448a757 100644 --- a/templates/mp2demo/Script/ChozoGhost.xml +++ b/templates/mp2demo/Script/ChozoGhost.xml @@ -67,9 +67,7 @@ 2.0 - - -1 - + @@ -77,9 +75,7 @@ - - -1 - + @@ -147,18 +143,12 @@ - - -1 - + 1.5 - - -1 - - - -1 - + + 0 @@ -171,12 +161,8 @@ 1.5 - - -1 - - - -1 - + + 20.0 diff --git a/templates/mp2demo/Script/CommandoPirate.xml b/templates/mp2demo/Script/CommandoPirate.xml index c889b3f0..55ac04cc 100644 --- a/templates/mp2demo/Script/CommandoPirate.xml +++ b/templates/mp2demo/Script/CommandoPirate.xml @@ -84,15 +84,9 @@ 4.0 - - -1 - - - -1 - - - -1 - + + + -1 @@ -129,9 +123,7 @@ - - -1 - + 20.0 @@ -189,12 +181,8 @@ 8.0 - - -1 - - - -1 - + + @@ -227,9 +215,7 @@ 40.0 - - -1 - + 50.0 @@ -248,12 +234,8 @@ - - -1 - - - -1 - + + diff --git a/templates/mp2demo/Script/DarkSamus.xml b/templates/mp2demo/Script/DarkSamus.xml index 1f6c0135..0e16dbfb 100644 --- a/templates/mp2demo/Script/DarkSamus.xml +++ b/templates/mp2demo/Script/DarkSamus.xml @@ -23,9 +23,7 @@ - - -1 - + false diff --git a/templates/mp2demo/Script/DarkTrooper.xml b/templates/mp2demo/Script/DarkTrooper.xml index 3103610c..55dfb632 100644 --- a/templates/mp2demo/Script/DarkTrooper.xml +++ b/templates/mp2demo/Script/DarkTrooper.xml @@ -44,12 +44,8 @@ 18.0 - - -1 - - - -1 - + + diff --git a/templates/mp2demo/Script/DebrisExtended.xml b/templates/mp2demo/Script/DebrisExtended.xml index a6903520..d23d2184 100644 --- a/templates/mp2demo/Script/DebrisExtended.xml +++ b/templates/mp2demo/Script/DebrisExtended.xml @@ -63,9 +63,7 @@ - - -1 - + 1 diff --git a/templates/mp2demo/Script/ElitePirate.xml b/templates/mp2demo/Script/ElitePirate.xml index 518100d6..5aff4d65 100644 --- a/templates/mp2demo/Script/ElitePirate.xml +++ b/templates/mp2demo/Script/ElitePirate.xml @@ -122,9 +122,7 @@ - - -1 - + diff --git a/templates/mp2demo/Script/FishCloud.xml b/templates/mp2demo/Script/FishCloud.xml index 05195df5..d2de176d 100644 --- a/templates/mp2demo/Script/FishCloud.xml +++ b/templates/mp2demo/Script/FishCloud.xml @@ -91,9 +91,7 @@ 0 - - -1 - + true diff --git a/templates/mp2demo/Script/FlyingPirate.xml b/templates/mp2demo/Script/FlyingPirate.xml index 09c1d402..53b624f6 100644 --- a/templates/mp2demo/Script/FlyingPirate.xml +++ b/templates/mp2demo/Script/FlyingPirate.xml @@ -81,9 +81,7 @@ - - -1 - + @@ -134,12 +132,8 @@ 1000.0 - - -1 - - - -1 - + + 25.0 @@ -152,12 +146,8 @@ - - -1 - - - -1 - + + 25.0 diff --git a/templates/mp2demo/Script/FrontEndDataNetwork.xml b/templates/mp2demo/Script/FrontEndDataNetwork.xml index 16dca5b8..8ca3b1a5 100644 --- a/templates/mp2demo/Script/FrontEndDataNetwork.xml +++ b/templates/mp2demo/Script/FrontEndDataNetwork.xml @@ -39,9 +39,7 @@ 0.247059, 0.247059, 0.247059, 1.0 - - -1 - + diff --git a/templates/mp2demo/Script/Glowbug.xml b/templates/mp2demo/Script/Glowbug.xml index 7c900aa8..e6888c13 100644 --- a/templates/mp2demo/Script/Glowbug.xml +++ b/templates/mp2demo/Script/Glowbug.xml @@ -21,12 +21,8 @@ 0.0, 0.0, 0.0 - - -1 - - - -1 - + + false diff --git a/templates/mp2demo/Script/GunTurretBase.xml b/templates/mp2demo/Script/GunTurretBase.xml index e8be0389..e8c8e352 100644 --- a/templates/mp2demo/Script/GunTurretBase.xml +++ b/templates/mp2demo/Script/GunTurretBase.xml @@ -99,45 +99,19 @@ -1 - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - + + + + + + + + + + + + + diff --git a/templates/mp2demo/Script/GunTurretTop.xml b/templates/mp2demo/Script/GunTurretTop.xml index b4120168..feed412e 100644 --- a/templates/mp2demo/Script/GunTurretTop.xml +++ b/templates/mp2demo/Script/GunTurretTop.xml @@ -23,12 +23,8 @@ 1.0, 1.0, 1.0, 0.0 - - -1 - - - -1 - + + diff --git a/templates/mp2demo/Script/Ing.xml b/templates/mp2demo/Script/Ing.xml index e4d3588f..3be7d98c 100644 --- a/templates/mp2demo/Script/Ing.xml +++ b/templates/mp2demo/Script/Ing.xml @@ -54,21 +54,11 @@ - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - + + + + + @@ -78,18 +68,10 @@ 15.0 - - -1 - - - -1 - - - -1 - - - -1 - + + + + 15.0 @@ -150,12 +132,8 @@ 40.0 - - -1 - - - -1 - + + 40.0 @@ -163,9 +141,7 @@ 100.0 - - -1 - + @@ -226,12 +202,8 @@ 30.0 - - -1 - - - -1 - + + 10.0 diff --git a/templates/mp2demo/Script/IngSnatchingSwarm.xml b/templates/mp2demo/Script/IngSnatchingSwarm.xml index e7978644..e83b5384 100644 --- a/templates/mp2demo/Script/IngSnatchingSwarm.xml +++ b/templates/mp2demo/Script/IngSnatchingSwarm.xml @@ -59,15 +59,9 @@ - - -1 - - - -1 - - - -1 - + + + 50.0 diff --git a/templates/mp2demo/Script/IngSpaceJumpGuardian.xml b/templates/mp2demo/Script/IngSpaceJumpGuardian.xml index 3a73340f..6cb4bcf6 100644 --- a/templates/mp2demo/Script/IngSpaceJumpGuardian.xml +++ b/templates/mp2demo/Script/IngSpaceJumpGuardian.xml @@ -43,12 +43,8 @@ 5.0 - - -1 - - - -1 - + + diff --git a/templates/mp2demo/Script/Kralee.xml b/templates/mp2demo/Script/Kralee.xml index 48f6b0bf..ba645146 100644 --- a/templates/mp2demo/Script/Kralee.xml +++ b/templates/mp2demo/Script/Kralee.xml @@ -123,9 +123,7 @@ - - -1 - + -1 diff --git a/templates/mp2demo/Script/MediumIng.xml b/templates/mp2demo/Script/MediumIng.xml index d79b9a88..e1034ea4 100644 --- a/templates/mp2demo/Script/MediumIng.xml +++ b/templates/mp2demo/Script/MediumIng.xml @@ -90,9 +90,7 @@ - - -1 - + diff --git a/templates/mp2demo/Script/MinorIng.xml b/templates/mp2demo/Script/MinorIng.xml index 67231993..1f04292e 100644 --- a/templates/mp2demo/Script/MinorIng.xml +++ b/templates/mp2demo/Script/MinorIng.xml @@ -96,21 +96,11 @@ - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - + + + + + @@ -150,12 +140,8 @@ 5 - - -1 - - - -1 - + + 30.0 diff --git a/templates/mp2demo/Script/Puffer.xml b/templates/mp2demo/Script/Puffer.xml index 5909c887..72f92091 100644 --- a/templates/mp2demo/Script/Puffer.xml +++ b/templates/mp2demo/Script/Puffer.xml @@ -76,9 +76,7 @@ false - - -1 - + diff --git a/templates/mp2demo/Script/SandBoss.xml b/templates/mp2demo/Script/SandBoss.xml index ac8e9f76..60166e1a 100644 --- a/templates/mp2demo/Script/SandBoss.xml +++ b/templates/mp2demo/Script/SandBoss.xml @@ -30,21 +30,13 @@ - - -1 - + 0 - - -1 - - - -1 - - - -1 - + + + 0.498039, 0.498039, 0.0, 1.0 @@ -238,36 +230,16 @@ 5.0 - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - + + + + + + + + + + -1 diff --git a/templates/mp2demo/Script/Sandworm.xml b/templates/mp2demo/Script/Sandworm.xml index cc73e696..19e700aa 100644 --- a/templates/mp2demo/Script/Sandworm.xml +++ b/templates/mp2demo/Script/Sandworm.xml @@ -26,27 +26,17 @@ - - -1 - - - -1 - - - -1 - - - -1 - + + + + 9.0 25.0 - - -1 - + 60.0 diff --git a/templates/mp2demo/Script/SnakeWeedSwarm.xml b/templates/mp2demo/Script/SnakeWeedSwarm.xml index 9f49e808..a0c182d1 100644 --- a/templates/mp2demo/Script/SnakeWeedSwarm.xml +++ b/templates/mp2demo/Script/SnakeWeedSwarm.xml @@ -60,15 +60,9 @@ 0.0 - - -1 - - - -1 - - - -1 - + + + diff --git a/templates/mp2demo/Script/Sound.xml b/templates/mp2demo/Script/Sound.xml index bf200ab0..619746ca 100644 --- a/templates/mp2demo/Script/Sound.xml +++ b/templates/mp2demo/Script/Sound.xml @@ -3,9 +3,7 @@ Sound - - -1 - + 50.0 diff --git a/templates/mp2demo/Script/SpacePirate.xml b/templates/mp2demo/Script/SpacePirate.xml index 1a45ce7a..9624a7aa 100644 --- a/templates/mp2demo/Script/SpacePirate.xml +++ b/templates/mp2demo/Script/SpacePirate.xml @@ -101,9 +101,7 @@ - - -1 - + @@ -134,9 +132,7 @@ 80.0 - - -1 - + 0.1 @@ -164,12 +160,8 @@ 10.0 - - -1 - - - -1 - + + 0.2 @@ -225,12 +217,8 @@ 2 - - -1 - - - -1 - + + diff --git a/templates/mp2demo/Script/SpecialFunction.xml b/templates/mp2demo/Script/SpecialFunction.xml index 9c14e82e..1603d7c8 100644 --- a/templates/mp2demo/Script/SpecialFunction.xml +++ b/templates/mp2demo/Script/SpecialFunction.xml @@ -35,15 +35,9 @@ 0 - - -1 - - - -1 - - - -1 - + + + diff --git a/templates/mp2demo/Script/SplitterCommandModule.xml b/templates/mp2demo/Script/SplitterCommandModule.xml index d89cf9c3..45256998 100644 --- a/templates/mp2demo/Script/SplitterCommandModule.xml +++ b/templates/mp2demo/Script/SplitterCommandModule.xml @@ -123,27 +123,17 @@ - - -1 - - - -1 - - - -1 - - - -1 - + + + + -1 -1 - - -1 - + diff --git a/templates/mp2demo/Script/SplitterMainChassis.xml b/templates/mp2demo/Script/SplitterMainChassis.xml index a3b4dca5..c2922c51 100644 --- a/templates/mp2demo/Script/SplitterMainChassis.xml +++ b/templates/mp2demo/Script/SplitterMainChassis.xml @@ -124,9 +124,7 @@ - - -1 - + diff --git a/templates/mp2demo/Script/SporbBase.xml b/templates/mp2demo/Script/SporbBase.xml index e2d875a9..0e39b556 100644 --- a/templates/mp2demo/Script/SporbBase.xml +++ b/templates/mp2demo/Script/SporbBase.xml @@ -92,39 +92,19 @@ 1.0 - - -1 - + -1 - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - + + + + + + + + + diff --git a/templates/mp2demo/Script/SporbNeedle.xml b/templates/mp2demo/Script/SporbNeedle.xml index 1825ff69..517a21f4 100644 --- a/templates/mp2demo/Script/SporbNeedle.xml +++ b/templates/mp2demo/Script/SporbNeedle.xml @@ -32,21 +32,11 @@ - - -1 - - - -1 - - - -1 - - - -1 - - - -1 - + + + + + diff --git a/templates/mp2demo/Script/Water.xml b/templates/mp2demo/Script/Water.xml index 5810cfcb..2ae9c838 100644 --- a/templates/mp2demo/Script/Water.xml +++ b/templates/mp2demo/Script/Water.xml @@ -74,21 +74,13 @@ - - -1 - + -1 - - -1 - - - -1 - - - -1 - + + + 1.0, 1.0, 1.0, 1.0 diff --git a/templates/mp2demo/Script/WorldTeleporter.xml b/templates/mp2demo/Script/WorldTeleporter.xml index 1e0ee33b..f1dc6fb5 100644 --- a/templates/mp2demo/Script/WorldTeleporter.xml +++ b/templates/mp2demo/Script/WorldTeleporter.xml @@ -20,9 +20,7 @@ true - - -1 - + 127 diff --git a/templates/mp2demo/Structs/CameraShakerData.xml b/templates/mp2demo/Structs/CameraShakerData.xml index d8a321aa..4a3d1bd5 100644 --- a/templates/mp2demo/Structs/CameraShakerData.xml +++ b/templates/mp2demo/Structs/CameraShakerData.xml @@ -13,8 +13,6 @@ 1.0 - - -1 - + diff --git a/templates/mp2demo/Structs/SafeZoneStruct.xml b/templates/mp2demo/Structs/SafeZoneStruct.xml index f4793f44..92196198 100644 --- a/templates/mp2demo/Structs/SafeZoneStruct.xml +++ b/templates/mp2demo/Structs/SafeZoneStruct.xml @@ -1,18 +1,12 @@ - - -1 - + 0.0 - - -1 - - - -1 - + + 50.0