mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-21 18:59:12 +00:00
externals: Update LibCommon
Brings over better header hygiene to reduce build times and also improve math primitive performance.
This commit is contained in:
2
externals/LibCommon
vendored
2
externals/LibCommon
vendored
Submodule externals/LibCommon updated: 85c8fc7223...d6640792ec
@@ -255,8 +255,8 @@ void GenerateAssetNames(CGameProject *pProj)
|
||||
CMaterialPass *pPass = pMat->Pass(iPass);
|
||||
|
||||
bool IsLightmap = ((pArea->Game() <= EGame::Echoes && pMat->Options().HasFlag(EMaterialOption::Lightmap) && iPass == 0) ||
|
||||
(pArea->Game() >= EGame::CorruptionProto && pPass->Type() == "DIFF") );
|
||||
bool IsBloomLightmap = (pArea->Game() >= EGame::CorruptionProto && pPass->Type() == "BLOL");
|
||||
(pArea->Game() >= EGame::CorruptionProto && pPass->Type() == CFourCC("DIFF")));
|
||||
bool IsBloomLightmap = (pArea->Game() >= EGame::CorruptionProto && pPass->Type() == CFourCC("BLOL"));
|
||||
|
||||
TString TexName;
|
||||
|
||||
@@ -430,7 +430,7 @@ void GenerateAssetNames(CGameProject *pProj)
|
||||
CMaterialPass *pPass = pMat->Pass(iPass);
|
||||
|
||||
const bool IsLightmap = (pMat->Version() <= EGame::Echoes && pMat->Options().HasFlag(EMaterialOption::Lightmap) && iPass == 0) ||
|
||||
(pMat->Version() >= EGame::CorruptionProto && pPass->Type() == "DIFF");
|
||||
(pMat->Version() >= EGame::CorruptionProto && pPass->Type() == CFourCC("DIFF"));
|
||||
|
||||
if (IsLightmap)
|
||||
{
|
||||
|
||||
@@ -331,7 +331,7 @@ void CGameExporter::LoadPaks()
|
||||
mResourceMap.insert_or_assign(ResID, SResourceInstance{PakPath, ResID, ResType, ResOffset, ResSize, Compressed, false});
|
||||
|
||||
// Check for duplicate resources
|
||||
if (ResType == "MREA")
|
||||
if (ResType == CFourCC("MREA"))
|
||||
{
|
||||
mAreaDuplicateMap[ResID] = AreaHasDuplicates;
|
||||
AreaHasDuplicates = false;
|
||||
@@ -376,7 +376,7 @@ void CGameExporter::LoadPaks()
|
||||
const uint32 Next = Pak.Tell() + PakSections[iSec].Size;
|
||||
|
||||
// Named Resources
|
||||
if (PakSections[iSec].Type == "STRG")
|
||||
if (PakSections[iSec].Type == CFourCC("STRG"))
|
||||
{
|
||||
const uint32 NumNamedResources = Pak.ReadULong();
|
||||
|
||||
@@ -388,7 +388,7 @@ void CGameExporter::LoadPaks()
|
||||
pPackage->AddResource(Name, ResID, ResType);
|
||||
}
|
||||
}
|
||||
else if (PakSections[iSec].Type == "RSHD")
|
||||
else if (PakSections[iSec].Type == CFourCC("RSHD"))
|
||||
{
|
||||
ASSERT(PakSections[iSec + 1].Type == "DATA");
|
||||
const uint32 DataStart = Next;
|
||||
@@ -412,7 +412,7 @@ void CGameExporter::LoadPaks()
|
||||
// Check for duplicate resources (unnecessary for DKCR)
|
||||
if (mGame != EGame::DKCReturns)
|
||||
{
|
||||
if (Type == "MREA")
|
||||
if (Type == CFourCC("MREA"))
|
||||
{
|
||||
mAreaDuplicateMap.insert_or_assign(ResID, AreaHasDuplicates);
|
||||
AreaHasDuplicates = false;
|
||||
|
||||
@@ -147,7 +147,7 @@ void CGameProject::GetWorldList(std::list<CAssetID>& rOut) const
|
||||
{
|
||||
const SNamedResource& rkRes = pPkg->NamedResourceByIndex(iRes);
|
||||
|
||||
if (rkRes.Type == "MLVL" && !rkRes.Name.EndsWith("NODEPEND"))
|
||||
if (rkRes.Type == CFourCC("MLVL") && !rkRes.Name.EndsWith("NODEPEND"))
|
||||
PackageWorlds.push_back(&rkRes);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
#include "Core/GameProject/COpeningBanner.h"
|
||||
|
||||
#include <Common/FileIO/CFileInStream.h>
|
||||
#include <Common/FileIO/CFileOutStream.h>
|
||||
#include <Common/FileIO/CMemoryInStream.h>
|
||||
#include <Common/FileIO/CMemoryOutStream.h>
|
||||
#include "Core/GameProject/CGameProject.h"
|
||||
|
||||
COpeningBanner::COpeningBanner(CGameProject *pProj)
|
||||
|
||||
@@ -139,7 +139,7 @@ CResourceEntry* CVirtualDirectory::FindChildResource(const TString& rkPath)
|
||||
else if (!Name.IsEmpty())
|
||||
{
|
||||
const TString Ext = Name.GetFileExtension();
|
||||
const EResourceType Type = CResTypeInfo::TypeForCookedExtension(mpStore->Game(), Ext)->Type();
|
||||
const EResourceType Type = CResTypeInfo::TypeForCookedExtension(mpStore->Game(), CFourCC(Ext))->Type();
|
||||
return FindChildResource(Name.GetFileName(false), Type);
|
||||
}
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ void CPackageDependencyListBuilder::BuildDependencyList(bool AllowDuplicates, st
|
||||
if (!pEntry)
|
||||
continue;
|
||||
|
||||
if (rkRes.Name.EndsWith("NODEPEND") || rkRes.Type == "CSNG")
|
||||
if (rkRes.Name.EndsWith("NODEPEND") || rkRes.Type == CFourCC("CSNG"))
|
||||
{
|
||||
rOut.push_back(rkRes.ID);
|
||||
continue;
|
||||
@@ -201,7 +201,7 @@ void CPackageDependencyListBuilder::BuildDependencyList(bool AllowDuplicates, st
|
||||
|
||||
mIsUniversalAreaAsset = mUniversalAreaAssets.contains(rkRes.ID);
|
||||
|
||||
if (rkRes.Type == "MLVL")
|
||||
if (rkRes.Type == CFourCC("MLVL"))
|
||||
{
|
||||
mpWorld = static_cast<CWorld*>(pEntry->Load());
|
||||
ASSERT(mpWorld);
|
||||
@@ -361,7 +361,7 @@ void CPackageDependencyListBuilder::FindUniversalAreaAssets()
|
||||
mUniversalAreaAssets.insert(rkRes.ID);
|
||||
|
||||
// For the universal area world, load it into memory to make sure we can exclude the area/map IDs
|
||||
if (rkRes.Type == "MLVL")
|
||||
if (rkRes.Type == CFourCC("MLVL"))
|
||||
{
|
||||
CWorld *pUniverseWorld = gpResourceStore->LoadResource<CWorld>(rkRes.ID);
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include "Core/GameProject/CResourceIterator.h"
|
||||
#include "Core/Resource/Cooker/CResourceCooker.h"
|
||||
#include <Common/FileUtil.h>
|
||||
#include <Common/FileIO/CFileInStream.h>
|
||||
#include <Common/FileIO/CFileOutStream.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
@@ -451,7 +451,8 @@ bool CShaderGenerator::CreatePixelShader(const CMaterial& rkMat)
|
||||
CFourCC PassType = pPass->Type();
|
||||
|
||||
ShaderCode << " // TEV Stage " << iPass << " - " << PassType.ToString() << "\n";
|
||||
if (pPass->Type() == "DIFF") Lightmap = true;
|
||||
if (pPass->Type() == CFourCC("DIFF"))
|
||||
Lightmap = true;
|
||||
|
||||
if (!pPass->IsEnabled())
|
||||
{
|
||||
@@ -466,8 +467,8 @@ bool CShaderGenerator::CreatePixelShader(const CMaterial& rkMat)
|
||||
ShaderCode << " Tex = texture(Texture" << iPass << ", TevCoord)";
|
||||
|
||||
// Apply lightmap multiplier
|
||||
bool UseLightmapMultiplier = (PassType == "DIFF") ||
|
||||
(PassType == "CUST" && (rkMat.Options() & EMaterialOption::Lightmap) && iPass == 0);
|
||||
bool UseLightmapMultiplier = (PassType == CFourCC("DIFF")) ||
|
||||
(PassType == CFourCC("CUST") && (rkMat.Options() & EMaterialOption::Lightmap) && iPass == 0);
|
||||
if (UseLightmapMultiplier && pPass->Texture())
|
||||
ShaderCode << " * LightmapMultiplier";
|
||||
|
||||
|
||||
@@ -328,20 +328,20 @@ void CMaterialPass::SetEnabled(bool Enabled)
|
||||
// ************ STATIC ************
|
||||
TString CMaterialPass::PassTypeName(CFourCC Type)
|
||||
{
|
||||
if (Type == "CUST") return "Custom";
|
||||
if (Type == "DIFF") return "Light";
|
||||
if (Type == "RIML") return "Rim Light";
|
||||
if (Type == "BLOL") return "Bloom Light";
|
||||
if (Type == CFourCC("CUST")) return "Custom";
|
||||
if (Type == CFourCC("DIFF")) return "Light";
|
||||
if (Type == CFourCC("RIML")) return "Rim Light";
|
||||
if (Type == CFourCC("BLOL")) return "Bloom Light";
|
||||
// BLOD
|
||||
if (Type == "CLR ") return "Diffuse";
|
||||
if (Type == "TRAN") return "Opacity";
|
||||
if (Type == "INCA") return "Emissive";
|
||||
if (Type == "RFLV") return "Specular";
|
||||
if (Type == "RFLD") return "Reflection";
|
||||
if (Type == CFourCC("CLR ")) return "Diffuse";
|
||||
if (Type == CFourCC("TRAN")) return "Opacity";
|
||||
if (Type == CFourCC("INCA")) return "Emissive";
|
||||
if (Type == CFourCC("RFLV")) return "Specular";
|
||||
if (Type == CFourCC("RFLD")) return "Reflection";
|
||||
// LRLD
|
||||
// LURD
|
||||
if (Type == "BLOI") return "Bloom Diffuse";
|
||||
if (Type == "XRAY") return "X-Ray";
|
||||
if (Type == CFourCC("BLOI")) return "Bloom Diffuse";
|
||||
if (Type == CFourCC("XRAY")) return "X-Ray";
|
||||
// TOON
|
||||
return Type.ToString();
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ CFourCC CResTypeInfo::CookedExtension(EGame Game) const
|
||||
[Game](const auto& entry) { return entry.Game == Game; });
|
||||
|
||||
if (iter == mCookedExtensions.cend())
|
||||
return "NONE";
|
||||
return CFourCC("NONE");
|
||||
|
||||
return iter->CookedExt;
|
||||
}
|
||||
@@ -181,238 +181,238 @@ void CResTypeInfo::CResTypeInfoFactory::InitTypes()
|
||||
{
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::Animation, "Animation", "ani");
|
||||
AddExtension(pType, "ANIM", EGame::PrimeDemo, EGame::DKCReturns);
|
||||
AddExtension(pType, CFourCC("ANIM"), EGame::PrimeDemo, EGame::DKCReturns);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::AnimCollisionPrimData, "Animation Collision Primitive Data", "?");
|
||||
AddExtension(pType, "CPRM", EGame::DKCReturns, EGame::DKCReturns);
|
||||
AddExtension(pType, CFourCC("CPRM"), EGame::DKCReturns, EGame::DKCReturns);
|
||||
pType->mCanHaveDependencies = false;
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::AnimEventData, "Animation Event Data", "evnt");
|
||||
AddExtension(pType, "EVNT", EGame::PrimeDemo, EGame::Prime);
|
||||
AddExtension(pType, CFourCC("EVNT"), EGame::PrimeDemo, EGame::Prime);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::AnimSet, "Animation Character Set", "acs");
|
||||
AddExtension(pType, "ANCS", EGame::PrimeDemo, EGame::Echoes);
|
||||
AddExtension(pType, CFourCC("ANCS"), EGame::PrimeDemo, EGame::Echoes);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::Area, "Area", "mrea");
|
||||
AddExtension(pType, "MREA", EGame::PrimeDemo, EGame::DKCReturns);
|
||||
AddExtension(pType, CFourCC("MREA"), EGame::PrimeDemo, EGame::DKCReturns);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::AudioAmplitudeData, "Audio Amplitude Data", "?");
|
||||
AddExtension(pType, "CAAD", EGame::Corruption, EGame::Corruption);
|
||||
AddExtension(pType, CFourCC("CAAD"), EGame::Corruption, EGame::Corruption);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::AudioGroup, "Audio Group", "agsc");
|
||||
AddExtension(pType, "AGSC", EGame::PrimeDemo, EGame::CorruptionProto);
|
||||
AddExtension(pType, CFourCC("AGSC"), EGame::PrimeDemo, EGame::CorruptionProto);
|
||||
pType->mCanHaveDependencies = false;
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::AudioMacro, "Audio Macro", "caud");
|
||||
AddExtension(pType, "CAUD", EGame::CorruptionProto, EGame::DKCReturns);
|
||||
AddExtension(pType, CFourCC("CAUD"), EGame::CorruptionProto, EGame::DKCReturns);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::AudioSample, "Audio Sample", "csmp");
|
||||
AddExtension(pType, "CSMP", EGame::CorruptionProto, EGame::DKCReturns);
|
||||
AddExtension(pType, CFourCC("CSMP"), EGame::CorruptionProto, EGame::DKCReturns);
|
||||
pType->mCanHaveDependencies = false;
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::AudioLookupTable, "Audio Lookup Table", "atbl");
|
||||
AddExtension(pType, "ATBL", EGame::PrimeDemo, EGame::Corruption);
|
||||
AddExtension(pType, CFourCC("ATBL"), EGame::PrimeDemo, EGame::Corruption);
|
||||
pType->mCanHaveDependencies = false;
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::BinaryData, "Generic Data", "dat");
|
||||
AddExtension(pType, "DUMB", EGame::PrimeDemo, EGame::Corruption);
|
||||
AddExtension(pType, CFourCC("DUMB"), EGame::PrimeDemo, EGame::Corruption);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::BurstFireData, "Burst Fire Data", "bfre.bfrc");
|
||||
AddExtension(pType, "BFRC", EGame::CorruptionProto, EGame::Corruption);
|
||||
AddExtension(pType, CFourCC("BFRC"), EGame::CorruptionProto, EGame::Corruption);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::Character, "Character", "char");
|
||||
AddExtension(pType, "CHAR", EGame::CorruptionProto, EGame::DKCReturns);
|
||||
AddExtension(pType, CFourCC("CHAR"), EGame::CorruptionProto, EGame::DKCReturns);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::DependencyGroup, "Dependency Group", "?");
|
||||
AddExtension(pType, "DGRP", EGame::PrimeDemo, EGame::DKCReturns);
|
||||
AddExtension(pType, CFourCC("DGRP"), EGame::PrimeDemo, EGame::DKCReturns);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::DynamicCollision, "Dynamic Collision", "dcln");
|
||||
AddExtension(pType, "DCLN", EGame::PrimeDemo, EGame::DKCReturns);
|
||||
AddExtension(pType, CFourCC("DCLN"), EGame::PrimeDemo, EGame::DKCReturns);
|
||||
pType->mCanHaveDependencies = false;
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::Font, "Font", "rpff");
|
||||
AddExtension(pType, "FONT", EGame::PrimeDemo, EGame::DKCReturns);
|
||||
AddExtension(pType, CFourCC("FONT"), EGame::PrimeDemo, EGame::DKCReturns);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::GuiFrame, "Gui Frame", "frme");
|
||||
AddExtension(pType, "FRME", EGame::PrimeDemo, EGame::DKCReturns);
|
||||
AddExtension(pType, CFourCC("FRME"), EGame::PrimeDemo, EGame::DKCReturns);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::GuiKeyFrame, "Gui Keyframe", "?");
|
||||
AddExtension(pType, "KFAM", EGame::PrimeDemo, EGame::PrimeDemo);
|
||||
AddExtension(pType, CFourCC("KFAM"), EGame::PrimeDemo, EGame::PrimeDemo);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::HintSystem, "Hint System Data", "hint");
|
||||
AddExtension(pType, "HINT", EGame::Prime, EGame::Corruption);
|
||||
AddExtension(pType, CFourCC("HINT"), EGame::Prime, EGame::Corruption);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::MapArea, "Area Map", "mapa");
|
||||
AddExtension(pType, "MAPA", EGame::PrimeDemo, EGame::Corruption);
|
||||
AddExtension(pType, CFourCC("MAPA"), EGame::PrimeDemo, EGame::Corruption);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::MapWorld, "World Map", "mapw");
|
||||
AddExtension(pType, "MAPW", EGame::PrimeDemo, EGame::Corruption);
|
||||
AddExtension(pType, CFourCC("MAPW"), EGame::PrimeDemo, EGame::Corruption);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::MapUniverse, "Universe Map", "mapu");
|
||||
AddExtension(pType, "MAPU", EGame::PrimeDemo, EGame::Echoes);
|
||||
AddExtension(pType, CFourCC("MAPU"), EGame::PrimeDemo, EGame::Echoes);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::Midi, "MIDI", "?");
|
||||
AddExtension(pType, "CSNG", EGame::PrimeDemo, EGame::Echoes);
|
||||
AddExtension(pType, CFourCC("CSNG"), EGame::PrimeDemo, EGame::Echoes);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::Model, "Model", "cmdl");
|
||||
AddExtension(pType, "CMDL", EGame::PrimeDemo, EGame::DKCReturns);
|
||||
AddExtension(pType, CFourCC("CMDL"), EGame::PrimeDemo, EGame::DKCReturns);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::Particle, "Particle System", "gpsm.part");
|
||||
AddExtension(pType, "PART", EGame::PrimeDemo, EGame::DKCReturns);
|
||||
AddExtension(pType, CFourCC("PART"), EGame::PrimeDemo, EGame::DKCReturns);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::ParticleCollisionResponse, "Collision Response Particle System", "crsm.crsc");
|
||||
AddExtension(pType, "CRSC", EGame::PrimeDemo, EGame::Corruption);
|
||||
AddExtension(pType, CFourCC("CRSC"), EGame::PrimeDemo, EGame::Corruption);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::ParticleDecal, "Decal Particle System", "dpsm.dpsc");
|
||||
AddExtension(pType, "DPSC", EGame::PrimeDemo, EGame::Corruption);
|
||||
AddExtension(pType, CFourCC("DPSC"), EGame::PrimeDemo, EGame::Corruption);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::ParticleElectric, "Electric Particle System", "elsm.elsc");
|
||||
AddExtension(pType, "ELSC", EGame::PrimeDemo, EGame::Corruption);
|
||||
AddExtension(pType, CFourCC("ELSC"), EGame::PrimeDemo, EGame::Corruption);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::ParticleSorted, "Sorted Particle System", "srsm.srsc");
|
||||
AddExtension(pType, "SRSC", EGame::EchoesDemo, EGame::Echoes);
|
||||
AddExtension(pType, CFourCC("SRSC"), EGame::EchoesDemo, EGame::Echoes);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::ParticleSpawn, "Spawn Particle System", "spsm.spsc");
|
||||
AddExtension(pType, "SPSC", EGame::EchoesDemo, EGame::DKCReturns);
|
||||
AddExtension(pType, CFourCC("SPSC"), EGame::EchoesDemo, EGame::DKCReturns);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::ParticleSwoosh, "Swoosh Particle System", "swsh.swhc");
|
||||
AddExtension(pType, "SWHC", EGame::PrimeDemo, EGame::DKCReturns);
|
||||
AddExtension(pType, CFourCC("SWHC"), EGame::PrimeDemo, EGame::DKCReturns);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::ParticleTransform, "Transform Particle System", "xfsm.xfsc");
|
||||
AddExtension(pType, "XFSC", EGame::DKCReturns, EGame::DKCReturns);
|
||||
AddExtension(pType, CFourCC("XFSC"), EGame::DKCReturns, EGame::DKCReturns);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::ParticleWeapon, "Weapon Particle System", "wpsm.wpsc");
|
||||
AddExtension(pType, "WPSC", EGame::PrimeDemo, EGame::Corruption);
|
||||
AddExtension(pType, CFourCC("WPSC"), EGame::PrimeDemo, EGame::Corruption);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::Pathfinding, "Pathfinding Mesh", "path");
|
||||
AddExtension(pType, "PATH", EGame::PrimeDemo, EGame::Corruption);
|
||||
AddExtension(pType, CFourCC("PATH"), EGame::PrimeDemo, EGame::Corruption);
|
||||
pType->mCanHaveDependencies = false;
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::PortalArea, "Portal Area", "?");
|
||||
AddExtension(pType, "PTLA", EGame::EchoesDemo, EGame::Corruption);
|
||||
AddExtension(pType, CFourCC("PTLA"), EGame::EchoesDemo, EGame::Corruption);
|
||||
pType->mCanHaveDependencies = false;
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::RuleSet, "Rule Set", "rule");
|
||||
AddExtension(pType, "RULE", EGame::EchoesDemo, EGame::DKCReturns);
|
||||
AddExtension(pType, CFourCC("RULE"), EGame::EchoesDemo, EGame::DKCReturns);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::SaveArea, "Area Save Info", "sava");
|
||||
AddExtension(pType, "SAVA", EGame::CorruptionProto, EGame::Corruption);
|
||||
AddExtension(pType, CFourCC("SAVA"), EGame::CorruptionProto, EGame::Corruption);
|
||||
pType->mCanHaveDependencies = false;
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::SaveWorld, "World Save Info", "savw");
|
||||
AddExtension(pType, "SAVW", EGame::Prime, EGame::DKCReturns);
|
||||
AddExtension(pType, CFourCC("SAVW"), EGame::Prime, EGame::DKCReturns);
|
||||
pType->mCanHaveDependencies = false;
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::Scan, "Scan", "scan");
|
||||
AddExtension(pType, "SCAN", EGame::PrimeDemo, EGame::Corruption);
|
||||
AddExtension(pType, CFourCC("SCAN"), EGame::PrimeDemo, EGame::Corruption);
|
||||
pType->mCanBeCreated = true;
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::Skeleton, "Skeleton", "cin");
|
||||
AddExtension(pType, "CINF", EGame::PrimeDemo, EGame::DKCReturns);
|
||||
AddExtension(pType, CFourCC("CINF"), EGame::PrimeDemo, EGame::DKCReturns);
|
||||
pType->mCanHaveDependencies = false;
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::Skin, "Skin", "cskr");
|
||||
AddExtension(pType, "CSKR", EGame::PrimeDemo, EGame::DKCReturns);
|
||||
AddExtension(pType, CFourCC("CSKR"), EGame::PrimeDemo, EGame::DKCReturns);
|
||||
pType->mCanHaveDependencies = false;
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::SourceAnimData, "Source Animation Data", "sand");
|
||||
AddExtension(pType, "SAND", EGame::CorruptionProto, EGame::Corruption);
|
||||
AddExtension(pType, CFourCC("SAND"), EGame::CorruptionProto, EGame::Corruption);
|
||||
pType->mCanHaveDependencies = false; // all dependencies are added to the CHAR dependency tree
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::SpatialPrimitive, "Spatial Primitive", "?");
|
||||
AddExtension(pType, "CSPP", EGame::EchoesDemo, EGame::Echoes);
|
||||
AddExtension(pType, CFourCC("CSPP"), EGame::EchoesDemo, EGame::Echoes);
|
||||
pType->mCanHaveDependencies = false;
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::StateMachine, "State Machine", "afsm");
|
||||
AddExtension(pType, "AFSM", EGame::PrimeDemo, EGame::Echoes);
|
||||
AddExtension(pType, "FSM2", EGame::CorruptionProto, EGame::Corruption);
|
||||
AddExtension(pType, "FSMC", EGame::DKCReturns, EGame::DKCReturns);
|
||||
AddExtension(pType, CFourCC("AFSM"), EGame::PrimeDemo, EGame::Echoes);
|
||||
AddExtension(pType, CFourCC("FSM2"), EGame::CorruptionProto, EGame::Corruption);
|
||||
AddExtension(pType, CFourCC("FSMC"), EGame::DKCReturns, EGame::DKCReturns);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::StateMachine2, "State Machine 2", "fsm2");
|
||||
AddExtension(pType, "FSM2", EGame::EchoesDemo, EGame::Corruption);
|
||||
AddExtension(pType, CFourCC("FSM2"), EGame::EchoesDemo, EGame::Corruption);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::StaticGeometryMap, "Static Scan Map", "egmc");
|
||||
AddExtension(pType, "EGMC", EGame::EchoesDemo, EGame::Corruption);
|
||||
AddExtension(pType, CFourCC("EGMC"), EGame::EchoesDemo, EGame::Corruption);
|
||||
pType->mCanHaveDependencies = false;
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::StreamedAudio, "Streamed Audio", "?");
|
||||
AddExtension(pType, "STRM", EGame::CorruptionProto, EGame::DKCReturns);
|
||||
AddExtension(pType, CFourCC("STRM"), EGame::CorruptionProto, EGame::DKCReturns);
|
||||
pType->mCanHaveDependencies = false;
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::StringList, "String List", "stlc");
|
||||
AddExtension(pType, "STLC", EGame::EchoesDemo, EGame::CorruptionProto);
|
||||
AddExtension(pType, CFourCC("STLC"), EGame::EchoesDemo, EGame::CorruptionProto);
|
||||
pType->mCanHaveDependencies = false;
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::StringTable, "String Table", "strg");
|
||||
AddExtension(pType, "STRG", EGame::PrimeDemo, EGame::DKCReturns);
|
||||
AddExtension(pType, CFourCC("STRG"), EGame::PrimeDemo, EGame::DKCReturns);
|
||||
pType->mCanBeSerialized = true;
|
||||
pType->mCanBeCreated = true;
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::Texture, "Texture", "txtr");
|
||||
AddExtension(pType, "TXTR", EGame::PrimeDemo, EGame::DKCReturns);
|
||||
AddExtension(pType, CFourCC("TXTR"), EGame::PrimeDemo, EGame::DKCReturns);
|
||||
pType->mCanHaveDependencies = false;
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::Tweaks, "Tweak Data", "ctwk");
|
||||
AddExtension(pType, "CTWK", EGame::PrimeDemo, EGame::Prime);
|
||||
AddExtension(pType, CFourCC("CTWK"), EGame::PrimeDemo, EGame::Prime);
|
||||
pType->mCanHaveDependencies = false;
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::UserEvaluatorData, "User Evaluator Data", "user.usrc");
|
||||
AddExtension(pType, "USRC", EGame::CorruptionProto, EGame::Corruption);
|
||||
AddExtension(pType, CFourCC("USRC"), EGame::CorruptionProto, EGame::Corruption);
|
||||
}
|
||||
{
|
||||
CResTypeInfo *pType = new CResTypeInfo(EResourceType::World, "World", "mwld");
|
||||
AddExtension(pType, "MLVL", EGame::PrimeDemo, EGame::DKCReturns);
|
||||
AddExtension(pType, CFourCC("MLVL"), EGame::PrimeDemo, EGame::DKCReturns);
|
||||
pType->mCanBeSerialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "Core/Resource/CTexture.h"
|
||||
|
||||
#include <Common/FileIO/CMemoryInStream.h>
|
||||
#include <Common/Math/CVector2f.h>
|
||||
|
||||
#include <cmath>
|
||||
|
||||
@@ -74,13 +74,13 @@ void CAreaCooker::DetermineSectionNumbersCorruption()
|
||||
// are present in every file), we don't care about any of these except SCLY and SCGN.
|
||||
for (const auto& num : mpArea->mSectionNumbers)
|
||||
{
|
||||
if (num.SectionID == "SOBJ")
|
||||
if (num.SectionID == CFourCC("SOBJ"))
|
||||
mSCLYSecNum = num.Index;
|
||||
else if (num.SectionID == "SGEN")
|
||||
else if (num.SectionID == CFourCC("SGEN"))
|
||||
mSCGNSecNum = num.Index;
|
||||
else if (num.SectionID == "DEPS")
|
||||
else if (num.SectionID == CFourCC("DEPS"))
|
||||
mDepsSecNum = num.Index;
|
||||
else if (num.SectionID == "RSOS")
|
||||
else if (num.SectionID == CFourCC("RSOS"))
|
||||
mModulesSecNum = num.Index;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <Common/Log.h>
|
||||
#include <Common/Macros.h>
|
||||
#include <Common/FileIO/CBitStreamInWrapper.h>
|
||||
#include <Common/Math/CQuaternion.h>
|
||||
#include <Common/Math/MathUtil.h>
|
||||
#include "Core/Resource/Animation/CAnimation.h"
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "Core/Resource/Script/CScriptTemplate.h"
|
||||
|
||||
#include <Common/CFourCC.h>
|
||||
#include <Common/FileIO/CMemoryInStream.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cfloat>
|
||||
@@ -327,20 +328,20 @@ void CAreaLoader::ReadHeaderCorruption()
|
||||
CFourCC Type(*mpMREA);
|
||||
uint32 Num = mpMREA->ReadLong();
|
||||
|
||||
if (Type == "AABB") mBoundingBoxesBlockNum = Num;
|
||||
else if (Type == "APTL") mPTLABlockNum = Num;
|
||||
else if (Type == "COLI") mCollisionBlockNum = Num;
|
||||
else if (Type == "DEPS") mDependenciesBlockNum = Num;
|
||||
else if (Type == "EGMC") mEGMCBlockNum = Num;
|
||||
else if (Type == "GPUD") mGPUBlockNum = Num;
|
||||
else if (Type == "LITE") mLightsBlockNum = Num;
|
||||
else if (Type == "PFL2") mPathBlockNum = Num;
|
||||
else if (Type == "PVS!") mVisiBlockNum = Num;
|
||||
else if (Type == "ROCT") mOctreeBlockNum = Num;
|
||||
else if (Type == "RSOS") mRSOBlockNum = Num;
|
||||
else if (Type == "SOBJ") mScriptLayerBlockNum = Num;
|
||||
else if (Type == "SGEN") mScriptGeneratorBlockNum = Num;
|
||||
else if (Type == "WOBJ") mGeometryBlockNum = Num; // note WOBJ can show up multiple times, but is always 0
|
||||
if (Type == CFourCC("AABB")) mBoundingBoxesBlockNum = Num;
|
||||
else if (Type == CFourCC("APTL")) mPTLABlockNum = Num;
|
||||
else if (Type == CFourCC("COLI")) mCollisionBlockNum = Num;
|
||||
else if (Type == CFourCC("DEPS")) mDependenciesBlockNum = Num;
|
||||
else if (Type == CFourCC("EGMC")) mEGMCBlockNum = Num;
|
||||
else if (Type == CFourCC("GPUD")) mGPUBlockNum = Num;
|
||||
else if (Type == CFourCC("LITE")) mLightsBlockNum = Num;
|
||||
else if (Type == CFourCC("PFL2")) mPathBlockNum = Num;
|
||||
else if (Type == CFourCC("PVS!")) mVisiBlockNum = Num;
|
||||
else if (Type == CFourCC("ROCT")) mOctreeBlockNum = Num;
|
||||
else if (Type == CFourCC("RSOS")) mRSOBlockNum = Num;
|
||||
else if (Type == CFourCC("SOBJ")) mScriptLayerBlockNum = Num;
|
||||
else if (Type == CFourCC("SGEN")) mScriptGeneratorBlockNum = Num;
|
||||
else if (Type == CFourCC("WOBJ")) mGeometryBlockNum = Num; // note WOBJ can show up multiple times, but is always 0
|
||||
|
||||
const CGameArea::SSectionNumber SecNum{Type, Num};
|
||||
mpArea->mSectionNumbers.push_back(SecNum);
|
||||
|
||||
@@ -272,33 +272,33 @@ void CMaterialLoader::ReadCorruptionMatSet()
|
||||
// Represent passes as contiguous integers for random-access storage in a fixed array.
|
||||
static EPASS PassFourCCToEnum(CFourCC fcc)
|
||||
{
|
||||
if (fcc == "DIFF")
|
||||
if (fcc == CFourCC("DIFF"))
|
||||
return EPASS::DIFF;
|
||||
if (fcc == "RIML")
|
||||
if (fcc == CFourCC("RIML"))
|
||||
return EPASS::RIML;
|
||||
if (fcc == "BLOL")
|
||||
if (fcc == CFourCC("BLOL"))
|
||||
return EPASS::BLOL;
|
||||
if (fcc == "CLR ")
|
||||
if (fcc == CFourCC("CLR "))
|
||||
return EPASS::CLR;
|
||||
if (fcc == "TRAN")
|
||||
if (fcc == CFourCC("TRAN"))
|
||||
return EPASS::TRAN;
|
||||
if (fcc == "INCA")
|
||||
if (fcc == CFourCC("INCA"))
|
||||
return EPASS::INCA;
|
||||
if (fcc == "RFLV")
|
||||
if (fcc == CFourCC("RFLV"))
|
||||
return EPASS::RFLV;
|
||||
if (fcc == "RFLD")
|
||||
if (fcc == CFourCC("RFLD"))
|
||||
return EPASS::RFLD;
|
||||
if (fcc == "LRLD")
|
||||
if (fcc == CFourCC("LRLD"))
|
||||
return EPASS::LRLD;
|
||||
if (fcc == "LURD")
|
||||
if (fcc == CFourCC("LURD"))
|
||||
return EPASS::LURD;
|
||||
if (fcc == "BLOD")
|
||||
if (fcc == CFourCC("BLOD"))
|
||||
return EPASS::BLOD;
|
||||
if (fcc == "BLOI")
|
||||
if (fcc == CFourCC("BLOI"))
|
||||
return EPASS::BLOI;
|
||||
if (fcc == "XRAY")
|
||||
if (fcc == CFourCC("XRAY"))
|
||||
return EPASS::XRAY;
|
||||
if (fcc == "TOON")
|
||||
if (fcc == CFourCC("TOON"))
|
||||
return EPASS::TOON;
|
||||
|
||||
return EPASS::DIFF;
|
||||
@@ -306,15 +306,15 @@ static EPASS PassFourCCToEnum(CFourCC fcc)
|
||||
|
||||
static EINT IntFourCCToEnum(CFourCC fcc)
|
||||
{
|
||||
if (fcc == "OPAC")
|
||||
if (fcc == CFourCC("OPAC"))
|
||||
return EINT::OPAC;
|
||||
if (fcc == "BLOD")
|
||||
if (fcc == CFourCC("BLOD"))
|
||||
return EINT::BLOD;
|
||||
if (fcc == "BLOI")
|
||||
if (fcc == CFourCC("BLOI"))
|
||||
return EINT::BLOI;
|
||||
if (fcc == "BNIF")
|
||||
if (fcc == CFourCC("BNIF"))
|
||||
return EINT::BNIF;
|
||||
if (fcc == "XRBR")
|
||||
if (fcc == CFourCC("XRBR"))
|
||||
return EINT::XRBR;
|
||||
|
||||
return EINT::OPAC;
|
||||
@@ -322,9 +322,9 @@ static EINT IntFourCCToEnum(CFourCC fcc)
|
||||
|
||||
static ECLR ClrFourCCToEnum(CFourCC fcc)
|
||||
{
|
||||
if (fcc == "CLR ")
|
||||
if (fcc == CFourCC("CLR "))
|
||||
return ECLR::CLR;
|
||||
if (fcc == "DIFB")
|
||||
if (fcc == CFourCC("DIFB"))
|
||||
return ECLR::DIFB;
|
||||
|
||||
return ECLR::CLR;
|
||||
@@ -346,11 +346,11 @@ std::unique_ptr<CMaterial> CMaterialLoader::ReadCorruptionMaterial()
|
||||
CFourCC Type = mpFile->ReadULong();
|
||||
|
||||
// END
|
||||
if (Type == "END ")
|
||||
if (Type == CFourCC("END "))
|
||||
break;
|
||||
|
||||
// INT
|
||||
if (Type == "INT ")
|
||||
if (Type == CFourCC("INT "))
|
||||
{
|
||||
const CFourCC IntType = mpFile->ReadULong();
|
||||
const auto IntVal = static_cast<uint8>(mpFile->ReadULong());
|
||||
@@ -358,7 +358,7 @@ std::unique_ptr<CMaterial> CMaterialLoader::ReadCorruptionMaterial()
|
||||
}
|
||||
|
||||
// CLR
|
||||
if (Type == "CLR ")
|
||||
if (Type == CFourCC("CLR "))
|
||||
{
|
||||
const CFourCC ClrType = mpFile->ReadULong();
|
||||
const CColor ClrVal(*mpFile, true);
|
||||
@@ -366,7 +366,7 @@ std::unique_ptr<CMaterial> CMaterialLoader::ReadCorruptionMaterial()
|
||||
}
|
||||
|
||||
// PASS
|
||||
if (Type == "PASS")
|
||||
if (Type == CFourCC("PASS"))
|
||||
{
|
||||
const uint32 Size = mpFile->ReadULong();
|
||||
const uint32 Next = Size + mpFile->Tell();
|
||||
@@ -642,7 +642,7 @@ bool CMaterialLoader::SetupStaticDiffuseLightingStage(STevTracker& Tracker, CMat
|
||||
}
|
||||
else
|
||||
{
|
||||
pPass->mPassType = "DIFF";
|
||||
pPass->mPassType = CFourCC("DIFF");
|
||||
pPass->SetColorOutput(kColor0Reg);
|
||||
pPass->SetAlphaOutput(kPrevReg);
|
||||
pPass->SetColorInputs(kZeroRGB, kColor1RGB, kKonstRGB, kRasRGB);
|
||||
@@ -766,7 +766,7 @@ void CMaterialLoader::SetupColorKColorStage(STevTracker& Tracker, CMaterial* pMa
|
||||
bool useStageAlpha, uint8 Alpha, bool StaticLighting)
|
||||
{
|
||||
auto pPass = std::make_unique<CMaterialPass>(pMat);
|
||||
pPass->mPassType = "CLR ";
|
||||
pPass->mPassType = CFourCC("CLR ");
|
||||
|
||||
bool useDynamicLightingAlpha = false;
|
||||
CColor col = Intermediate.GetCLR(ECLR::CLR);
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <Common/CColor.h>
|
||||
#include <Common/Macros.h>
|
||||
#include <Common/FileIO/IOutputStream.h>
|
||||
#include <Common/FileIO/CMemoryOutStream.h>
|
||||
#include <array>
|
||||
|
||||
// A cleanup is warranted at some point. Trying to support both partial + full decode ended up really messy.
|
||||
@@ -290,11 +291,11 @@ void CTextureDecoder::ReadDDS(IInputStream& rDDS)
|
||||
mDDSInfo.Flags = rDDS.ReadULong();
|
||||
const CFourCC Format(rDDS);
|
||||
|
||||
if (Format == "DXT1") mDDSInfo.Format = SDDSInfo::DXT1;
|
||||
else if (Format == "DXT2") mDDSInfo.Format = SDDSInfo::DXT2;
|
||||
else if (Format == "DXT3") mDDSInfo.Format = SDDSInfo::DXT3;
|
||||
else if (Format == "DXT4") mDDSInfo.Format = SDDSInfo::DXT4;
|
||||
else if (Format == "DXT5") mDDSInfo.Format = SDDSInfo::DXT5;
|
||||
if (Format == CFourCC("DXT1")) mDDSInfo.Format = SDDSInfo::DXT1;
|
||||
else if (Format == CFourCC("DXT2")) mDDSInfo.Format = SDDSInfo::DXT2;
|
||||
else if (Format == CFourCC("DXT3")) mDDSInfo.Format = SDDSInfo::DXT3;
|
||||
else if (Format == CFourCC("DXT4")) mDDSInfo.Format = SDDSInfo::DXT4;
|
||||
else if (Format == CFourCC("DXT5")) mDDSInfo.Format = SDDSInfo::DXT5;
|
||||
else
|
||||
{
|
||||
mDDSInfo.Format = SDDSInfo::RGBA;
|
||||
|
||||
@@ -1734,8 +1734,10 @@ void CUnsupportedParticleLoader::ParseAssetFunction(IInputStream& rFile)
|
||||
void CUnsupportedParticleLoader::ParseSpawnSystemKeyframeData(IInputStream& rFile)
|
||||
{
|
||||
CFourCC Func = rFile.ReadLong();
|
||||
if (Func == "NONE") return;
|
||||
ASSERT(Func == "CNST");
|
||||
if (Func == CFourCC("NONE"))
|
||||
return;
|
||||
|
||||
ASSERT(Func == CFourCC("CNST"));
|
||||
|
||||
rFile.Seek(0x10, SEEK_CUR); // Skip unneeded values
|
||||
uint32 Count = rFile.ReadLong();
|
||||
@@ -1756,15 +1758,15 @@ void CUnsupportedParticleLoader::ParseSpawnSystemKeyframeData(IInputStream& rFil
|
||||
void CUnsupportedParticleLoader::ParseKeyframeEmitterData(IInputStream& rFile, const CFourCC& rkFunc, uint32 ElemSize)
|
||||
{
|
||||
// Skip unneeded values
|
||||
if (rkFunc == "KEYE" || rkFunc == "KEYP")
|
||||
if (rkFunc == CFourCC("KEYE") || rkFunc == CFourCC("KEYP"))
|
||||
rFile.Seek(0x12, SEEK_CUR);
|
||||
else if (rkFunc == "KEYF")
|
||||
else if (rkFunc == CFourCC("KEYF"))
|
||||
rFile.Seek(0x1A, SEEK_CUR);
|
||||
|
||||
uint32 KeyCount = rFile.ReadLong();
|
||||
rFile.Seek(KeyCount * ElemSize, SEEK_CUR);
|
||||
|
||||
if (rkFunc == "KEYF")
|
||||
if (rkFunc == CFourCC("KEYF"))
|
||||
ParseFloatFunction(rFile);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "Core/Resource/Script/CScriptObject.h"
|
||||
|
||||
#include <Common/FileIO/CVectorOutStream.h>
|
||||
#include <Common/Serialization/CBasicBinaryReader.h>
|
||||
#include <Common/Serialization/CBasicBinaryWriter.h>
|
||||
#include "Core/Resource/Animation/CAnimSet.h"
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "Core/Tweaks/CTweakManager.h"
|
||||
|
||||
#include <Common/FileUtil.h>
|
||||
#include <Common/FileIO/CFileInStream.h>
|
||||
#include <Common/FileIO/CFileOutStream.h>
|
||||
#include "Core/GameProject/CGameProject.h"
|
||||
#include "Core/GameProject/CResourceIterator.h"
|
||||
#include "Core/Tweaks/CTweakCooker.h"
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#define CEDITORGLWIDGET_H
|
||||
|
||||
#include <Common/CTimer.h>
|
||||
#include <Common/EKeyInputs.h>
|
||||
#include <Common/EMouseInputs.h>
|
||||
#include <Common/Math/CRay.h>
|
||||
#include <Common/Math/CVector2f.h>
|
||||
#include <Core/OpenGL/GL/glew.h>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <Common/Flags.h>
|
||||
#include <Common/Math/CPlane.h>
|
||||
#include <Common/Math/CQuaternion.h>
|
||||
#include <Common/Math/CTransform4f.h>
|
||||
#include <Common/Math/CVector3f.h>
|
||||
#include <Common/Math/EAxis.h>
|
||||
#include <Common/Math/ETransformSpace.h>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef CGRIDRENDERABLE
|
||||
#define CGRIDRENDERABLE
|
||||
|
||||
#include <Common/CColor.h>
|
||||
#include <Core/Render/CDrawUtil.h>
|
||||
#include <Core/Render/CRenderer.h>
|
||||
#include <Core/Render/IRenderable.h>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef CSELECTIONITERATOR
|
||||
#define CSELECTIONITERATOR
|
||||
|
||||
#include "CNodeSelection.h"
|
||||
#include "Editor/CNodeSelection.h"
|
||||
|
||||
class CSelectionIterator
|
||||
{
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
#define CUIRELAY_H
|
||||
|
||||
#include <Core/IUIRelay.h>
|
||||
#include "CEditorApplication.h"
|
||||
#include "WorldEditor/CWorldEditor.h"
|
||||
#include "UICommon.h"
|
||||
#include "Editor/CEditorApplication.h"
|
||||
#include "Editor/UICommon.h"
|
||||
#include "Editor/WorldEditor/CWorldEditor.h"
|
||||
|
||||
#include <QThread>
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#include "IEditor.h"
|
||||
|
||||
#include "Editor/CEditorApplication.h"
|
||||
#include "Editor/Undo/IUndoCommand.h"
|
||||
|
||||
#include <QCloseEvent>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QToolBar>
|
||||
#include <QCloseEvent>
|
||||
|
||||
IEditor::IEditor(QWidget* pParent)
|
||||
: QMainWindow(pParent)
|
||||
@@ -26,6 +27,8 @@ IEditor::IEditor(QWidget* pParent)
|
||||
connect(&mUndoStack, &QUndoStack::indexChanged, this, &IEditor::OnUndoStackIndexChanged);
|
||||
}
|
||||
|
||||
IEditor::~IEditor() = default;
|
||||
|
||||
QUndoStack& IEditor::UndoStack()
|
||||
{
|
||||
return mUndoStack;
|
||||
@@ -83,6 +86,14 @@ void IEditor::closeEvent(QCloseEvent* pEvent)
|
||||
}
|
||||
}
|
||||
|
||||
bool IEditor::Save()
|
||||
{
|
||||
// Default implementation for editor windows that do not support resaving assets.
|
||||
// This should not be called.
|
||||
errorf("Base IEditor::Save() implementation called. Changes will not be saved.");
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Non-virtual slots */
|
||||
bool IEditor::SaveAndRepack()
|
||||
{
|
||||
@@ -91,7 +102,8 @@ bool IEditor::SaveAndRepack()
|
||||
gpEdApp->CookAllDirtyPackages();
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <QList>
|
||||
#include <QUndoStack>
|
||||
|
||||
#include "CEditorApplication.h"
|
||||
class CBasicViewport;
|
||||
|
||||
/** Base class of all editor windows */
|
||||
class IEditor : public QMainWindow
|
||||
@@ -20,6 +20,7 @@ protected:
|
||||
|
||||
public:
|
||||
explicit IEditor(QWidget* pParent);
|
||||
~IEditor() override;
|
||||
|
||||
QUndoStack& UndoStack();
|
||||
void AddUndoActions(QToolBar* pToolBar, QAction* pBefore = nullptr);
|
||||
@@ -35,13 +36,7 @@ public:
|
||||
|
||||
public slots:
|
||||
/** Virtual slots */
|
||||
virtual bool Save()
|
||||
{
|
||||
// Default implementation for editor windows that do not support resaving assets.
|
||||
// This should not be called.
|
||||
errorf("Base IEditor::Save() implementation called. Changes will not be saved.");
|
||||
return true;
|
||||
}
|
||||
virtual bool Save();
|
||||
|
||||
/** Non-virtual slots */
|
||||
bool SaveAndRepack();
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include "Editor/Widgets/WColorPicker.h"
|
||||
|
||||
#include <Common/TString.h>
|
||||
#include <Common/FileIO/CFileInStream.h>
|
||||
#include <Common/FileIO/CFileOutStream.h>
|
||||
#include <Core/GameProject/CResourceStore.h>
|
||||
#include <Core/Resource/CFont.h>
|
||||
#include <Core/Resource/Cooker/CTextureEncoder.h>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef CPASTENODESCOMMAND
|
||||
#define CPASTENODESCOMMAND
|
||||
|
||||
#include <Common/Math/CVector3f.h>
|
||||
#include "Editor/Undo/IUndoCommand.h"
|
||||
#include "Editor/Undo/ObjReferences.h"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef CSOFTVALIDATORLINEEDIT_H
|
||||
#define CSOFTVALIDATORLINEEDIT_H
|
||||
|
||||
#include "CTimedLineEdit.h"
|
||||
#include "Editor/Widgets/CTimedLineEdit.h"
|
||||
#include <QValidator>
|
||||
|
||||
/**
|
||||
|
||||
@@ -336,7 +336,7 @@ void CPoiMapSidebar::StopPicking()
|
||||
void CPoiMapSidebar::OnInstanceListButtonClicked()
|
||||
{
|
||||
const EGame Game = Editor()->CurrentGame();
|
||||
CScriptTemplate *pPoiTemplate = NGameList::GetGameTemplate(Game)->TemplateByID("POIN");
|
||||
CScriptTemplate *pPoiTemplate = NGameList::GetGameTemplate(Game)->TemplateByID(CFourCC("POIN"));
|
||||
|
||||
CPoiListDialog Dialog(pPoiTemplate, &mSourceModel, Editor()->Scene(), this);
|
||||
Dialog.exec();
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#ifndef CTEMPLATELISTVIEW
|
||||
#define CTEMPLATELISTVIEW
|
||||
|
||||
#include "CTemplateMimeData.h"
|
||||
#include "Editor/UICommon.h"
|
||||
#include "Editor/WorldEditor/CTemplateMimeData.h"
|
||||
|
||||
#include <Core/Resource/Script/CGameTemplate.h>
|
||||
#include <QAbstractListModel>
|
||||
#include <QDrag>
|
||||
|
||||
@@ -349,6 +349,11 @@ bool CWorldEditor::IsQuickplayEnabled() const
|
||||
return mpQuickplayAction->isVisible() && mpQuickplayAction->isEnabled();
|
||||
}
|
||||
|
||||
EGame CWorldEditor::CurrentGame() const
|
||||
{
|
||||
return gpEdApp->CurrentGame();
|
||||
}
|
||||
|
||||
CSceneViewport* CWorldEditor::Viewport() const
|
||||
{
|
||||
return ui->MainViewport;
|
||||
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
|
||||
CWorld* ActiveWorld() const { return mpWorld; }
|
||||
CGameArea* ActiveArea() const { return mpArea; }
|
||||
EGame CurrentGame() const { return gpEdApp->CurrentGame(); }
|
||||
EGame CurrentGame() const;
|
||||
CLinkDialog* LinkDialog() const { return mpLinkDialog; }
|
||||
CGeneratePropertyNamesDialog* NameGeneratorDialog() const { return mpGeneratePropertyNamesDialog; }
|
||||
CTweakEditor* TweakEditor() { return mpTweakEditor; }
|
||||
|
||||
Reference in New Issue
Block a user