Rename everything
|
@ -5,7 +5,7 @@ version.h
|
||||||
*.autosave
|
*.autosave
|
||||||
docs/*
|
docs/*
|
||||||
.idea/
|
.idea/
|
||||||
Editor/platforms/win/urde.rc
|
Editor/platforms/win/metaforce.rc
|
||||||
.vs/
|
.vs/
|
||||||
out/
|
out/
|
||||||
cmake-build-*/
|
cmake-build-*/
|
|
@ -9,7 +9,7 @@ make_dnalist(CMDL
|
||||||
EGMC
|
EGMC
|
||||||
SAVWCommon
|
SAVWCommon
|
||||||
ParticleCommon
|
ParticleCommon
|
||||||
URDEVersionInfo
|
MetaforceVersionInfo
|
||||||
Tweaks/ITweakPlayerGun)
|
Tweaks/ITweakPlayerGun)
|
||||||
|
|
||||||
set(DNACOMMON_SOURCES
|
set(DNACOMMON_SOURCES
|
||||||
|
@ -41,7 +41,7 @@ set(DNACOMMON_SOURCES
|
||||||
RigInverter.hpp RigInverter.cpp
|
RigInverter.hpp RigInverter.cpp
|
||||||
AROTBuilder.hpp AROTBuilder.cpp
|
AROTBuilder.hpp AROTBuilder.cpp
|
||||||
OBBTreeBuilder.hpp OBBTreeBuilder.cpp
|
OBBTreeBuilder.hpp OBBTreeBuilder.cpp
|
||||||
URDEVersionInfo.hpp
|
MetaforceVersionInfo.hpp
|
||||||
Tweaks/ITweak.hpp
|
Tweaks/ITweak.hpp
|
||||||
Tweaks/TweakWriter.hpp
|
Tweaks/TweakWriter.hpp
|
||||||
Tweaks/ITweakGame.hpp
|
Tweaks/ITweakGame.hpp
|
||||||
|
|
|
@ -11,12 +11,12 @@ AT_SUBSPECIALIZE_DNA_YAML(PPImpl<_CRSM<UniqueID64>>)
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
std::string_view PPImpl<_CRSM<UniqueID32>>::DNAType() {
|
std::string_view PPImpl<_CRSM<UniqueID32>>::DNAType() {
|
||||||
return "urde::CRSM<UniqueID32>"sv;
|
return "CRSM<UniqueID32>"sv;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
std::string_view PPImpl<_CRSM<UniqueID64>>::DNAType() {
|
std::string_view PPImpl<_CRSM<UniqueID64>>::DNAType() {
|
||||||
return "urde::CRSM<UniqueID64>"sv;
|
return "CRSM<UniqueID64>"sv;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class IDType>
|
template <class IDType>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
namespace DataSpec {
|
namespace DataSpec {
|
||||||
|
|
||||||
logvisor::Module LogDNACommon("urde::DNACommon");
|
logvisor::Module LogDNACommon("DataSpec::DNACommon");
|
||||||
ThreadLocalPtr<SpecBase> g_curSpec;
|
ThreadLocalPtr<SpecBase> g_curSpec;
|
||||||
ThreadLocalPtr<PAKRouterBase> g_PakRouter;
|
ThreadLocalPtr<PAKRouterBase> g_PakRouter;
|
||||||
ThreadLocalPtr<hecl::blender::Token> g_ThreadBlenderToken;
|
ThreadLocalPtr<hecl::blender::Token> g_ThreadBlenderToken;
|
||||||
|
|
|
@ -11,12 +11,12 @@ AT_SUBSPECIALIZE_DNA_YAML(PPImpl<_ELSM<UniqueID64>>)
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
std::string_view ELSM<UniqueID32>::DNAType() {
|
std::string_view ELSM<UniqueID32>::DNAType() {
|
||||||
return "urde::ELSM<UniqueID32>"sv;
|
return "ELSM<UniqueID32>"sv;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
std::string_view ELSM<UniqueID64>::DNAType() {
|
std::string_view ELSM<UniqueID64>::DNAType() {
|
||||||
return "urde::ELSM<UniqueID64>"sv;
|
return "ELSM<UniqueID64>"sv;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class IDType>
|
template <class IDType>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <logvisor/logvisor.hpp>
|
#include <logvisor/logvisor.hpp>
|
||||||
|
|
||||||
namespace DataSpec::DNAFont {
|
namespace DataSpec::DNAFont {
|
||||||
logvisor::Module LogModule("urde::DNAFont");
|
logvisor::Module LogModule("DataSpec::DNAFont");
|
||||||
|
|
||||||
template <class IDType>
|
template <class IDType>
|
||||||
void FONT<IDType>::_read(athena::io::IStreamReader& __dna_reader) {
|
void FONT<IDType>::_read(athena::io::IStreamReader& __dna_reader) {
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <logvisor/logvisor.hpp>
|
#include <logvisor/logvisor.hpp>
|
||||||
|
|
||||||
namespace DataSpec::DNAFSM2 {
|
namespace DataSpec::DNAFSM2 {
|
||||||
logvisor::Module LogDNAFSM2("urde::DNAFSM2");
|
logvisor::Module LogDNAFSM2("DataSpec::DNAFSM2");
|
||||||
|
|
||||||
template <class IDType>
|
template <class IDType>
|
||||||
template <class Op>
|
template <class Op>
|
||||||
|
@ -39,12 +39,12 @@ AT_SPECIALIZE_DNA(FSM2<UniqueID64>)
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
std::string_view FSM2<UniqueID32>::DNAType() {
|
std::string_view FSM2<UniqueID32>::DNAType() {
|
||||||
return "urde::FSM2<UniqueID32>"sv;
|
return "FSM2<UniqueID32>"sv;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
std::string_view FSM2<UniqueID64>::DNAType() {
|
std::string_view FSM2<UniqueID64>::DNAType() {
|
||||||
return "urde::FSM2<UniqueID64>"sv;
|
return "FSM2<UniqueID64>"sv;
|
||||||
}
|
}
|
||||||
|
|
||||||
template struct FSM2<UniqueID32>;
|
template struct FSM2<UniqueID32>;
|
||||||
|
|
|
@ -13,7 +13,7 @@ enum class EGame {
|
||||||
MetroidPrime3,
|
MetroidPrime3,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct URDEVersionInfo : BigDNA {
|
struct MetaforceVersionInfo : BigDNA {
|
||||||
AT_DECL_DNA_YAML
|
AT_DECL_DNA_YAML
|
||||||
|
|
||||||
String<-1> version;
|
String<-1> version;
|
|
@ -1,7 +1,7 @@
|
||||||
#include "ParticleCommon.hpp"
|
#include "ParticleCommon.hpp"
|
||||||
|
|
||||||
namespace DataSpec::DNAParticle {
|
namespace DataSpec::DNAParticle {
|
||||||
logvisor::Module LogModule("urde::DNAParticle");
|
logvisor::Module LogModule("DataSpec::DNAParticle");
|
||||||
|
|
||||||
template struct PEImpl<_RealElementFactory>;
|
template struct PEImpl<_RealElementFactory>;
|
||||||
template struct PEImpl<_IntElementFactory>;
|
template struct PEImpl<_IntElementFactory>;
|
||||||
|
|
|
@ -846,7 +846,7 @@ bool TXTR::Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath) {
|
||||||
png_infop info = png_create_info_struct(png);
|
png_infop info = png_create_info_struct(png);
|
||||||
|
|
||||||
png_text textStruct = {};
|
png_text textStruct = {};
|
||||||
textStruct.key = png_charp("urde_nomip");
|
textStruct.key = png_charp("metaforce_nomip");
|
||||||
if (numMips == 1)
|
if (numMips == 1)
|
||||||
png_set_text(png, info, &textStruct, 1);
|
png_set_text(png, info, &textStruct, 1);
|
||||||
|
|
||||||
|
@ -1088,13 +1088,13 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Disable mipmapping if urde_nomip embedded */
|
/* Disable mipmapping if metaforce_nomip embedded */
|
||||||
bool mipmap = true;
|
bool mipmap = true;
|
||||||
png_text* textStruct;
|
png_text* textStruct;
|
||||||
int numText;
|
int numText;
|
||||||
png_get_text(pngRead, info, &textStruct, &numText);
|
png_get_text(pngRead, info, &textStruct, &numText);
|
||||||
for (int i = 0; i < numText; ++i) {
|
for (int i = 0; i < numText; ++i) {
|
||||||
if (std::strcmp(textStruct[i].key, "urde_nomip") == 0) {
|
if (std::strcmp(textStruct[i].key, "metaforce_nomip") == 0) {
|
||||||
mipmap = false;
|
mipmap = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1401,13 +1401,13 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
|
||||||
const png_byte colorType = png_get_color_type(pngRead, info);
|
const png_byte colorType = png_get_color_type(pngRead, info);
|
||||||
const png_byte bitDepth = png_get_bit_depth(pngRead, info);
|
const png_byte bitDepth = png_get_bit_depth(pngRead, info);
|
||||||
|
|
||||||
/* Disable mipmapping if urde_nomip embedded */
|
/* Disable mipmapping if metaforce_nomip embedded */
|
||||||
bool mipmap = true;
|
bool mipmap = true;
|
||||||
png_text* textStruct;
|
png_text* textStruct;
|
||||||
int numText;
|
int numText;
|
||||||
png_get_text(pngRead, info, &textStruct, &numText);
|
png_get_text(pngRead, info, &textStruct, &numText);
|
||||||
for (int i = 0; i < numText; ++i) {
|
for (int i = 0; i < numText; ++i) {
|
||||||
if (std::strcmp(textStruct[i].key, "urde_nomip") == 0) {
|
if (std::strcmp(textStruct[i].key, "metaforce_nomip") == 0) {
|
||||||
mipmap = false;
|
mipmap = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
namespace DataSpec {
|
namespace DataSpec {
|
||||||
|
|
||||||
struct ITweakGunRes : ITweak {
|
struct ITweakGunRes : ITweak {
|
||||||
using ResId = urde::CAssetId;
|
using ResId = metaforce::CAssetId;
|
||||||
using EBeamId = urde::CPlayerState::EBeamId;
|
using EBeamId = metaforce::CPlayerState::EBeamId;
|
||||||
|
|
||||||
ResId x4_gunMotion;
|
ResId x4_gunMotion;
|
||||||
ResId x8_grappleArm;
|
ResId x8_grappleArm;
|
||||||
|
@ -68,7 +68,7 @@ struct ITweakGunRes : ITweak {
|
||||||
return x34_weapons[b];
|
return x34_weapons[b];
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResolveResources(const urde::IFactory& factory) {
|
void ResolveResources(const metaforce::IFactory& factory) {
|
||||||
x4_gunMotion = factory.GetResourceIdByName(GetGunMotion())->id;
|
x4_gunMotion = factory.GetResourceIdByName(GetGunMotion())->id;
|
||||||
x8_grappleArm = factory.GetResourceIdByName(GetGrappleArm())->id;
|
x8_grappleArm = factory.GetResourceIdByName(GetGrappleArm())->id;
|
||||||
xc_rightHand = factory.GetResourceIdByName(GetRightHand())->id;
|
xc_rightHand = factory.GetResourceIdByName(GetRightHand())->id;
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
namespace DataSpec {
|
namespace DataSpec {
|
||||||
|
|
||||||
struct ITweakPlayerRes : ITweak {
|
struct ITweakPlayerRes : ITweak {
|
||||||
using ResId = urde::CAssetId;
|
using ResId = metaforce::CAssetId;
|
||||||
using EBeamId = urde::CPlayerState::EBeamId;
|
using EBeamId = metaforce::CPlayerState::EBeamId;
|
||||||
|
|
||||||
ResId x4_saveStationIcon;
|
ResId x4_saveStationIcon;
|
||||||
ResId x8_missileStationIcon;
|
ResId x8_missileStationIcon;
|
||||||
|
@ -85,7 +85,7 @@ struct ITweakPlayerRes : ITweak {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResolveResources(const urde::IFactory& factory) {
|
void ResolveResources(const metaforce::IFactory& factory) {
|
||||||
x4_saveStationIcon = factory.GetResourceIdByName(_GetSaveStationIcon())->id;
|
x4_saveStationIcon = factory.GetResourceIdByName(_GetSaveStationIcon())->id;
|
||||||
x8_missileStationIcon = factory.GetResourceIdByName(_GetMissileStationIcon())->id;
|
x8_missileStationIcon = factory.GetResourceIdByName(_GetMissileStationIcon())->id;
|
||||||
xc_elevatorIcon = factory.GetResourceIdByName(_GetElevatorIcon())->id;
|
xc_elevatorIcon = factory.GetResourceIdByName(_GetElevatorIcon())->id;
|
||||||
|
|
|
@ -43,7 +43,7 @@ void AFSM::State::Transition::Enumerate<BigDNA::BinarySize>(typename BinarySize:
|
||||||
trig.binarySize(s);
|
trig.binarySize(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view AFSM::State::Transition::DNAType() { return "urde::DNAMP1::AFSM::Transition"sv; }
|
std::string_view AFSM::State::Transition::DNAType() { return "DNAMP1::AFSM::Transition"sv; }
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void AFSM::State::Transition::Trigger::Enumerate<BigDNA::Read>(athena::io::IStreamReader& __dna_reader) {
|
void AFSM::State::Transition::Trigger::Enumerate<BigDNA::Read>(athena::io::IStreamReader& __dna_reader) {
|
||||||
|
@ -100,7 +100,7 @@ void AFSM::State::Transition::Trigger::Enumerate<BigDNA::BinarySize>(size_t& __i
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view AFSM::State::Transition::Trigger::DNAType() {
|
std::string_view AFSM::State::Transition::Trigger::DNAType() {
|
||||||
return "urde::DNAMP1::AFSM::State::Transition::Trigger"sv;
|
return "DNAMP1::AFSM::State::Transition::Trigger"sv;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace DataSpec::DNAMP1
|
} // namespace DataSpec::DNAMP1
|
||||||
|
|
|
@ -139,7 +139,7 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::Enumer
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::DNAType() {
|
std::string_view ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::DNAType() {
|
||||||
return "urde::DNAMP1::ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo"sv;
|
return "DNAMP1::ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo"sv;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
@ -315,7 +315,7 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::Enumerate<BigDNA
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::DNAType() {
|
std::string_view ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::DNAType() {
|
||||||
return "urde::DNAMP1::ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState"sv;
|
return "DNAMP1::ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState"sv;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
@ -606,7 +606,7 @@ void ANCS::CharacterSet::CharacterInfo::Enumerate<BigDNA::WriteYaml>(athena::io:
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view ANCS::CharacterSet::CharacterInfo::DNAType() {
|
std::string_view ANCS::CharacterSet::CharacterInfo::DNAType() {
|
||||||
return "urde::DNAMP1::ANCS::CharacterSet::CharacterInfo"sv;
|
return "DNAMP1::ANCS::CharacterSet::CharacterInfo"sv;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
@ -688,7 +688,7 @@ void ANCS::AnimationSet::MetaAnimFactory::Enumerate<BigDNA::WriteYaml>(athena::i
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view ANCS::AnimationSet::MetaAnimFactory::DNAType() {
|
std::string_view ANCS::AnimationSet::MetaAnimFactory::DNAType() {
|
||||||
return "urde::DNAMP1::ANCS::AnimationSet::MetaAnimFactory"sv;
|
return "DNAMP1::ANCS::AnimationSet::MetaAnimFactory"sv;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
@ -761,7 +761,7 @@ void ANCS::AnimationSet::MetaTransFactory::Enumerate<BigDNA::WriteYaml>(athena::
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view ANCS::AnimationSet::MetaTransFactory::DNAType() {
|
std::string_view ANCS::AnimationSet::MetaTransFactory::DNAType() {
|
||||||
return "urde::DNAMP1::ANCS::AnimationSet::MetaTransFactory"sv;
|
return "DNAMP1::ANCS::AnimationSet::MetaTransFactory"sv;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
@ -955,7 +955,7 @@ void ANCS::AnimationSet::MetaAnimPrimitive::gatherPrimitives(
|
||||||
out[animIdx] = {animName, animId, ANIM::GetEVNTId(rs), false};
|
out[animIdx] = {animName, animId, ANIM::GetEVNTId(rs), false};
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view ANCS::AnimationSet::DNAType() { return "urde::DNAMP1::ANCS::AnimationSet"sv; }
|
std::string_view ANCS::AnimationSet::DNAType() { return "DNAMP1::ANCS::AnimationSet"sv; }
|
||||||
|
|
||||||
bool ANCS::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl::ProjectPath& outPath,
|
bool ANCS::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl::ProjectPath& outPath,
|
||||||
PAKRouter<PAKBridge>& pakRouter, const PAK::Entry& entry, bool force, hecl::blender::Token& btok,
|
PAKRouter<PAKBridge>& pakRouter, const PAK::Entry& entry, bool force, hecl::blender::Token& btok,
|
||||||
|
@ -994,7 +994,7 @@ bool ANCS::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
|
||||||
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("can't open '{}' for reading")), yamlPath.getRelativePath());
|
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("can't open '{}' for reading")), yamlPath.getRelativePath());
|
||||||
|
|
||||||
if (!athena::io::ValidateFromYAMLStream<ANCS>(reader)) {
|
if (!athena::io::ValidateFromYAMLStream<ANCS>(reader)) {
|
||||||
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("'{}' is not urde::DNAMP1::ANCS type")), yamlPath.getRelativePath());
|
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("'{}' is not DNAMP1::ANCS type")), yamlPath.getRelativePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
athena::io::YAMLDocReader yamlReader;
|
athena::io::YAMLDocReader yamlReader;
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#include "PATH.hpp"
|
#include "PATH.hpp"
|
||||||
|
|
||||||
#include "DataSpec/DNACommon/Tweaks/TweakWriter.hpp"
|
#include "DataSpec/DNACommon/Tweaks/TweakWriter.hpp"
|
||||||
#include "DataSpec/DNACommon/URDEVersionInfo.hpp"
|
#include "DataSpec/DNACommon/MetaforceVersionInfo.hpp"
|
||||||
#include "Tweaks/CTweakPlayerRes.hpp"
|
#include "Tweaks/CTweakPlayerRes.hpp"
|
||||||
#include "Tweaks/CTweakGunRes.hpp"
|
#include "Tweaks/CTweakGunRes.hpp"
|
||||||
#include "Tweaks/CTweakPlayer.hpp"
|
#include "Tweaks/CTweakPlayer.hpp"
|
||||||
|
@ -49,7 +49,7 @@
|
||||||
#include "SnowForces.hpp"
|
#include "SnowForces.hpp"
|
||||||
|
|
||||||
namespace DataSpec::DNAMP1 {
|
namespace DataSpec::DNAMP1 {
|
||||||
logvisor::Module Log("urde::DNAMP1");
|
logvisor::Module Log("DataSpec::DNAMP1");
|
||||||
|
|
||||||
static bool GetNoShare(std::string_view name) {
|
static bool GetNoShare(std::string_view name) {
|
||||||
std::string lowerName(name);
|
std::string lowerName(name);
|
||||||
|
|
|
@ -23,6 +23,6 @@ void EVNT::Enumerate(typename Op::StreamT& s) {
|
||||||
|
|
||||||
AT_SPECIALIZE_DNA_YAML(EVNT)
|
AT_SPECIALIZE_DNA_YAML(EVNT)
|
||||||
|
|
||||||
std::string_view EVNT::DNAType() { return "urde::DNAMP1::EVNT"sv; }
|
std::string_view EVNT::DNAType() { return "DNAMP1::EVNT"sv; }
|
||||||
|
|
||||||
} // namespace DataSpec::DNAMP1
|
} // namespace DataSpec::DNAMP1
|
||||||
|
|
|
@ -269,7 +269,7 @@ bool MLVL::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
|
||||||
std::vector<hecl::ProjectPath> depPaths;
|
std::vector<hecl::ProjectPath> depPaths;
|
||||||
std::vector<hecl::ProjectPath> lazyPaths;
|
std::vector<hecl::ProjectPath> lazyPaths;
|
||||||
for (std::unique_ptr<IScriptObject>& obj : layer.objects) {
|
for (std::unique_ptr<IScriptObject>& obj : layer.objects) {
|
||||||
if (obj->type == int(urde::EScriptObjectType::MemoryRelay)) {
|
if (obj->type == int(metaforce::EScriptObjectType::MemoryRelay)) {
|
||||||
MemoryRelay& memRelay = static_cast<MemoryRelay&>(*obj);
|
MemoryRelay& memRelay = static_cast<MemoryRelay&>(*obj);
|
||||||
for (IScriptObject::Connection& conn : memRelay.connections) {
|
for (IScriptObject::Connection& conn : memRelay.connections) {
|
||||||
MemRelayLink linkOut;
|
MemRelayLink linkOut;
|
||||||
|
@ -319,7 +319,7 @@ bool MLVL::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
|
||||||
areaOut.depLayers.push_back(areaOut.deps.size());
|
areaOut.depLayers.push_back(areaOut.deps.size());
|
||||||
for (const std::pair<hecl::ProjectPath, bool>& path : layer) {
|
for (const std::pair<hecl::ProjectPath, bool>& path : layer) {
|
||||||
if (path.first) {
|
if (path.first) {
|
||||||
urde::SObjectTag tag = g_curSpec->buildTagFromPath(path.first);
|
metaforce::SObjectTag tag = g_curSpec->buildTagFromPath(path.first);
|
||||||
if (tag.id.IsValid()) {
|
if (tag.id.IsValid()) {
|
||||||
if (path.second)
|
if (path.second)
|
||||||
areaOut.lazyDeps.emplace_back(tag.id.Value(), tag.type);
|
areaOut.lazyDeps.emplace_back(tag.id.Value(), tag.type);
|
||||||
|
@ -348,7 +348,7 @@ bool MLVL::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
|
||||||
layerResources.addSharedPath(path, false);
|
layerResources.addSharedPath(path, false);
|
||||||
|
|
||||||
for (const std::pair<hecl::ProjectPath, bool>& path : layerResources.sharedPaths) {
|
for (const std::pair<hecl::ProjectPath, bool>& path : layerResources.sharedPaths) {
|
||||||
urde::SObjectTag tag = g_curSpec->buildTagFromPath(path.first);
|
metaforce::SObjectTag tag = g_curSpec->buildTagFromPath(path.first);
|
||||||
if (tag.id.IsValid()) {
|
if (tag.id.IsValid()) {
|
||||||
if (path.second)
|
if (path.second)
|
||||||
areaOut.lazyDeps.emplace_back(tag.id.Value(), tag.type);
|
areaOut.lazyDeps.emplace_back(tag.id.Value(), tag.type);
|
||||||
|
@ -359,7 +359,7 @@ bool MLVL::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
|
||||||
}
|
}
|
||||||
|
|
||||||
hecl::ProjectPath pathPath = GetPathBeginsWith(areaDEnum, area.path, _SYS_STR("!path_"));
|
hecl::ProjectPath pathPath = GetPathBeginsWith(areaDEnum, area.path, _SYS_STR("!path_"));
|
||||||
urde::SObjectTag pathTag = g_curSpec->buildTagFromPath(pathPath);
|
metaforce::SObjectTag pathTag = g_curSpec->buildTagFromPath(pathPath);
|
||||||
if (pathTag.id.IsValid()) {
|
if (pathTag.id.IsValid()) {
|
||||||
areaOut.deps.emplace_back(pathTag.id.Value(), pathTag.type);
|
areaOut.deps.emplace_back(pathTag.id.Value(), pathTag.type);
|
||||||
areaOut.lazyDeps.emplace_back(0, FOURCC('NONE'));
|
areaOut.lazyDeps.emplace_back(0, FOURCC('NONE'));
|
||||||
|
@ -392,7 +392,7 @@ bool MLVL::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MLVL::CookMAPW(const hecl::ProjectPath& outPath, const World& wld) {
|
bool MLVL::CookMAPW(const hecl::ProjectPath& outPath, const World& wld) {
|
||||||
std::vector<urde::SObjectTag> mapaTags;
|
std::vector<metaforce::SObjectTag> mapaTags;
|
||||||
mapaTags.reserve(wld.areas.size());
|
mapaTags.reserve(wld.areas.size());
|
||||||
|
|
||||||
for (const World::Area& area : wld.areas) {
|
for (const World::Area& area : wld.areas) {
|
||||||
|
@ -411,7 +411,7 @@ bool MLVL::CookMAPW(const hecl::ProjectPath& outPath, const World& wld) {
|
||||||
fo.writeUint32Big(0xDEADF00D);
|
fo.writeUint32Big(0xDEADF00D);
|
||||||
fo.writeUint32Big(1);
|
fo.writeUint32Big(1);
|
||||||
fo.writeUint32Big(mapaTags.size());
|
fo.writeUint32Big(mapaTags.size());
|
||||||
for (const urde::SObjectTag& mapa : mapaTags)
|
for (const metaforce::SObjectTag& mapa : mapaTags)
|
||||||
fo.writeUint32Big(u32(mapa.id.Value()));
|
fo.writeUint32Big(u32(mapa.id.Value()));
|
||||||
int64_t rem = fo.position() % 32;
|
int64_t rem = fo.position() % 32;
|
||||||
if (rem)
|
if (rem)
|
||||||
|
@ -479,7 +479,7 @@ bool MLVL::CookSAVW(const hecl::ProjectPath& outPath, const World& wld) {
|
||||||
{
|
{
|
||||||
std::vector<Scan> scans;
|
std::vector<Scan> scans;
|
||||||
for (std::unique_ptr<IScriptObject>& obj : layer.objects) {
|
for (std::unique_ptr<IScriptObject>& obj : layer.objects) {
|
||||||
if (obj->type == int(urde::EScriptObjectType::MemoryRelay)) {
|
if (obj->type == int(metaforce::EScriptObjectType::MemoryRelay)) {
|
||||||
MemoryRelay& memRelay = static_cast<MemoryRelay&>(*obj);
|
MemoryRelay& memRelay = static_cast<MemoryRelay&>(*obj);
|
||||||
auto iter = std::find(memRelays.begin(), memRelays.end(), memRelay.id);
|
auto iter = std::find(memRelays.begin(), memRelays.end(), memRelay.id);
|
||||||
if (iter == memRelays.end()) {
|
if (iter == memRelays.end()) {
|
||||||
|
@ -487,7 +487,7 @@ bool MLVL::CookSAVW(const hecl::ProjectPath& outPath, const World& wld) {
|
||||||
savw.relays.push_back(memRelay.id);
|
savw.relays.push_back(memRelay.id);
|
||||||
memRelays.push_back(memRelay.id);
|
memRelays.push_back(memRelay.id);
|
||||||
}
|
}
|
||||||
} else if (obj->type == int(urde::EScriptObjectType::SpecialFunction)) {
|
} else if (obj->type == int(metaforce::EScriptObjectType::SpecialFunction)) {
|
||||||
SpecialFunction& specialFunc = static_cast<SpecialFunction&>(*obj);
|
SpecialFunction& specialFunc = static_cast<SpecialFunction&>(*obj);
|
||||||
if (specialFunc.function == ESpecialFunctionType::CinematicSkip)
|
if (specialFunc.function == ESpecialFunctionType::CinematicSkip)
|
||||||
savw.skippableCutscenes.push_back(specialFunc.id);
|
savw.skippableCutscenes.push_back(specialFunc.id);
|
||||||
|
@ -497,7 +497,7 @@ bool MLVL::CookSAVW(const hecl::ProjectPath& outPath, const World& wld) {
|
||||||
layer.areaId = specialFunc.layerSwitch.area;
|
layer.areaId = specialFunc.layerSwitch.area;
|
||||||
layer.layer = specialFunc.layerSwitch.layerIdx;
|
layer.layer = specialFunc.layerSwitch.layerIdx;
|
||||||
}
|
}
|
||||||
} else if (obj->type == int(urde::EScriptObjectType::Door)) {
|
} else if (obj->type == int(metaforce::EScriptObjectType::Door)) {
|
||||||
DoorArea& doorArea = static_cast<DoorArea&>(*obj);
|
DoorArea& doorArea = static_cast<DoorArea&>(*obj);
|
||||||
savw.doors.push_back(doorArea.id);
|
savw.doors.push_back(doorArea.id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ void SCAN::Texture::Enumerate<BigDNA::WriteYaml>(typename WriteYaml::StreamT& w)
|
||||||
w.writeFloat("fadeDuration", fadeDuration);
|
w.writeFloat("fadeDuration", fadeDuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view SCAN::Texture::DNAType() { return "urde::DNAMP1::SCAN::Texture"sv; }
|
std::string_view SCAN::Texture::DNAType() { return "DNAMP1::SCAN::Texture"sv; }
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void SCAN::Texture::Enumerate<BigDNA::BinarySize>(typename BinarySize::StreamT& s) {
|
void SCAN::Texture::Enumerate<BigDNA::BinarySize>(typename BinarySize::StreamT& s) {
|
||||||
|
|
|
@ -91,7 +91,7 @@ void SCLY::Enumerate<BigDNA::WriteYaml>(athena::io::YAMLDocWriter& docout) {
|
||||||
docout.enumerate("layers", layers);
|
docout.enumerate("layers", layers);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view SCLY::DNAType() { return "urde::DNAMP1::SCLY"sv; }
|
std::string_view SCLY::DNAType() { return "DNAMP1::SCLY"sv; }
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void SCLY::ScriptLayer::Enumerate<BigDNA::Read>(athena::io::IStreamReader& rs) {
|
void SCLY::ScriptLayer::Enumerate<BigDNA::Read>(athena::io::IStreamReader& rs) {
|
||||||
|
@ -191,6 +191,6 @@ void SCLY::ScriptLayer::Enumerate<BigDNA::WriteYaml>(athena::io::YAMLDocWriter&
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view SCLY::ScriptLayer::DNAType() { return "urde::DNAMP1::SCLY::ScriptLayer"sv; }
|
std::string_view SCLY::ScriptLayer::DNAType() { return "DNAMP1::SCLY::ScriptLayer"sv; }
|
||||||
|
|
||||||
} // namespace DataSpec::DNAMP1
|
} // namespace DataSpec::DNAMP1
|
||||||
|
|
|
@ -458,5 +458,5 @@ void STRG::Enumerate<BigDNA::WriteYaml>(typename WriteYaml::StreamT& writer) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view STRG::DNAType() { return "urde::DNAMP1::STRG"sv; }
|
std::string_view STRG::DNAType() { return "DNAMP1::STRG"sv; }
|
||||||
} // namespace DataSpec::DNAMP1
|
} // namespace DataSpec::DNAMP1
|
||||||
|
|
|
@ -26,7 +26,7 @@ void Oculus::Enumerate(typename Op::StreamT& s) {
|
||||||
unknown8 = 0.f;
|
unknown8 = 0.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view Oculus::DNAType() { return "urde::DNAMP1::Oculus"sv; }
|
std::string_view Oculus::DNAType() { return "DNAMP1::Oculus"sv; }
|
||||||
|
|
||||||
AT_SPECIALIZE_DNA_YAML(Oculus)
|
AT_SPECIALIZE_DNA_YAML(Oculus)
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ void Ridley::Enumerate(typename Op::StreamT& s) {
|
||||||
Do<Op>(athena::io::PropId{"damageInfo9"}, damageInfo9, s);
|
Do<Op>(athena::io::PropId{"damageInfo9"}, damageInfo9, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view Ridley::DNAType() { return "urde::DNAMP1::Ridley"sv; }
|
std::string_view Ridley::DNAType() { return "DNAMP1::Ridley"sv; }
|
||||||
|
|
||||||
AT_SPECIALIZE_DNA_YAML(Ridley)
|
AT_SPECIALIZE_DNA_YAML(Ridley)
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ void WorldTeleporter::Enumerate(typename Op::StreamT& s) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view WorldTeleporter::DNAType() { return "urde::DNAMP1::WorldTeleporter"sv; }
|
std::string_view WorldTeleporter::DNAType() { return "DNAMP1::WorldTeleporter"sv; }
|
||||||
|
|
||||||
AT_SPECIALIZE_DNA_YAML(WorldTeleporter)
|
AT_SPECIALIZE_DNA_YAML(WorldTeleporter)
|
||||||
|
|
||||||
|
|
|
@ -347,7 +347,7 @@ void ANCS::CharacterSet::CharacterInfo::Enumerate<BigDNA::WriteYaml>(typename Wr
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view ANCS::CharacterSet::CharacterInfo::DNAType() {
|
std::string_view ANCS::CharacterSet::CharacterInfo::DNAType() {
|
||||||
return "urde::DNAMP2::ANCS::CharacterSet::CharacterInfo"sv;
|
return "DNAMP2::ANCS::CharacterSet::CharacterInfo"sv;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
@ -523,7 +523,7 @@ void ANCS::AnimationSet::Enumerate<BigDNA::WriteYaml>(typename WriteYaml::Stream
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view ANCS::AnimationSet::DNAType() { return "urde::DNAMP2::ANCS::AnimationSet"sv; }
|
std::string_view ANCS::AnimationSet::DNAType() { return "DNAMP2::ANCS::AnimationSet"sv; }
|
||||||
|
|
||||||
template <class Op>
|
template <class Op>
|
||||||
void ANCS::AnimationSet::EVNT::Enumerate(typename Op::StreamT& s) {
|
void ANCS::AnimationSet::EVNT::Enumerate(typename Op::StreamT& s) {
|
||||||
|
@ -542,6 +542,6 @@ void ANCS::AnimationSet::EVNT::Enumerate(typename Op::StreamT& s) {
|
||||||
|
|
||||||
AT_SPECIALIZE_DNA(ANCS::AnimationSet::EVNT)
|
AT_SPECIALIZE_DNA(ANCS::AnimationSet::EVNT)
|
||||||
|
|
||||||
std::string_view ANCS::AnimationSet::EVNT::DNAType() { return "urde::DNAMP2::ANCS::AnimationSet::EVNT"sv; }
|
std::string_view ANCS::AnimationSet::EVNT::DNAType() { return "DNAMP2::ANCS::AnimationSet::EVNT"sv; }
|
||||||
|
|
||||||
} // namespace DataSpec::DNAMP2
|
} // namespace DataSpec::DNAMP2
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include "Runtime/GCNTypes.hpp"
|
#include "Runtime/GCNTypes.hpp"
|
||||||
|
|
||||||
namespace DataSpec::DNAMP2 {
|
namespace DataSpec::DNAMP2 {
|
||||||
logvisor::Module Log("urde::DNAMP2");
|
logvisor::Module Log("DataSpec::DNAMP2");
|
||||||
|
|
||||||
static bool GetNoShare(std::string_view name) {
|
static bool GetNoShare(std::string_view name) {
|
||||||
std::string lowerName(name);
|
std::string lowerName(name);
|
||||||
|
|
|
@ -213,6 +213,6 @@ void STRG::Enumerate<BigDNA::WriteYaml>(athena::io::YAMLDocWriter& writer) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view STRG::DNAType() { return "urde::DNAMP2::STRG"sv; }
|
std::string_view STRG::DNAType() { return "DNAMP2::STRG"sv; }
|
||||||
|
|
||||||
} // namespace DataSpec::DNAMP2
|
} // namespace DataSpec::DNAMP2
|
||||||
|
|
|
@ -69,7 +69,7 @@ void CHAR::AnimationInfo::EVNT::SFXEvent::Enumerate<BigDNA::WriteYaml>(athena::i
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view CHAR::AnimationInfo::EVNT::SFXEvent::DNAType() {
|
std::string_view CHAR::AnimationInfo::EVNT::SFXEvent::DNAType() {
|
||||||
return "urde::DNAMP3::CHAR::AnimationInfo::EVNT::SFXEvent"sv;
|
return "DNAMP3::CHAR::AnimationInfo::EVNT::SFXEvent"sv;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
@ -151,7 +151,7 @@ void CHAR::AnimationInfo::MetaAnimFactory::Enumerate<BigDNA::WriteYaml>(athena::
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view CHAR::AnimationInfo::MetaAnimFactory::DNAType() {
|
std::string_view CHAR::AnimationInfo::MetaAnimFactory::DNAType() {
|
||||||
return "urde::DNAMP3::CHAR::AnimationInfo::MetaAnimFactory"sv;
|
return "DNAMP3::CHAR::AnimationInfo::MetaAnimFactory"sv;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace DataSpec::DNAMP3
|
} // namespace DataSpec::DNAMP3
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include "Runtime/GCNTypes.hpp"
|
#include "Runtime/GCNTypes.hpp"
|
||||||
|
|
||||||
namespace DataSpec::DNAMP3 {
|
namespace DataSpec::DNAMP3 {
|
||||||
logvisor::Module Log("urde::DNAMP3");
|
logvisor::Module Log("DataSpec::DNAMP3");
|
||||||
|
|
||||||
static bool GetNoShare(std::string_view name) {
|
static bool GetNoShare(std::string_view name) {
|
||||||
std::string lowerName(name);
|
std::string lowerName(name);
|
||||||
|
|
|
@ -220,6 +220,6 @@ void STRG::Enumerate<BigDNA::WriteYaml>(athena::io::YAMLDocWriter& writer) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view STRG::DNAType() { return "urde::DNAMP3::STRG"sv; }
|
std::string_view STRG::DNAType() { return "DNAMP3::STRG"sv; }
|
||||||
|
|
||||||
} // namespace DataSpec::DNAMP3
|
} // namespace DataSpec::DNAMP3
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include "DataSpec/DNACommon/DNACommon.hpp"
|
#include "DataSpec/DNACommon/DNACommon.hpp"
|
||||||
#include "DataSpec/DNACommon/TXTR.hpp"
|
#include "DataSpec/DNACommon/TXTR.hpp"
|
||||||
#include "DataSpec/AssetNameMap.hpp"
|
#include "DataSpec/AssetNameMap.hpp"
|
||||||
#include "DataSpec/DNACommon/URDEVersionInfo.hpp"
|
#include "DataSpec/DNACommon/MetaforceVersionInfo.hpp"
|
||||||
#include "hecl/ClientProcess.hpp"
|
#include "hecl/ClientProcess.hpp"
|
||||||
#include "nod/DiscBase.hpp"
|
#include "nod/DiscBase.hpp"
|
||||||
#include "nod/nod.hpp"
|
#include "nod/nod.hpp"
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
namespace DataSpec {
|
namespace DataSpec {
|
||||||
|
|
||||||
static logvisor::Module Log("urde::SpecBase");
|
static logvisor::Module Log("DataSpec::SpecBase");
|
||||||
|
|
||||||
static const hecl::SystemChar* MomErr[] = {_SYS_STR("Your metroid is in another castle"),
|
static const hecl::SystemChar* MomErr[] = {_SYS_STR("Your metroid is in another castle"),
|
||||||
_SYS_STR("HECL is experiencing a PTSD attack"),
|
_SYS_STR("HECL is experiencing a PTSD attack"),
|
||||||
|
@ -441,8 +441,8 @@ bool SpecBase::canPackage(const hecl::ProjectPath& path) {
|
||||||
return path.isFile() || path.isDirectory();
|
return path.isFile() || path.isDirectory();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpecBase::recursiveBuildResourceList(std::vector<urde::SObjectTag>& listOut,
|
void SpecBase::recursiveBuildResourceList(std::vector<metaforce::SObjectTag>& listOut,
|
||||||
std::unordered_set<urde::SObjectTag>& addedTags,
|
std::unordered_set<metaforce::SObjectTag>& addedTags,
|
||||||
const hecl::ProjectPath& path, hecl::blender::Token& btok) {
|
const hecl::ProjectPath& path, hecl::blender::Token& btok) {
|
||||||
hecl::DirectoryEnumerator dEnum(path.getAbsolutePath(), hecl::DirectoryEnumerator::Mode::DirsThenFilesSorted, false,
|
hecl::DirectoryEnumerator dEnum(path.getAbsolutePath(), hecl::DirectoryEnumerator::Mode::DirsThenFilesSorted, false,
|
||||||
false, true);
|
false, true);
|
||||||
|
@ -452,7 +452,7 @@ void SpecBase::recursiveBuildResourceList(std::vector<urde::SObjectTag>& listOut
|
||||||
if (hecl::ProjectPath(childPath, _SYS_STR("!project.yaml")).isFile() &&
|
if (hecl::ProjectPath(childPath, _SYS_STR("!project.yaml")).isFile() &&
|
||||||
hecl::ProjectPath(childPath, _SYS_STR("!pool.yaml")).isFile()) {
|
hecl::ProjectPath(childPath, _SYS_STR("!pool.yaml")).isFile()) {
|
||||||
/* Handle AudioGroup case */
|
/* Handle AudioGroup case */
|
||||||
if (urde::SObjectTag tag = tagFromPath(childPath)) {
|
if (metaforce::SObjectTag tag = tagFromPath(childPath)) {
|
||||||
if (addedTags.find(tag) != addedTags.end())
|
if (addedTags.find(tag) != addedTags.end())
|
||||||
continue;
|
continue;
|
||||||
addedTags.insert(tag);
|
addedTags.insert(tag);
|
||||||
|
@ -466,7 +466,7 @@ void SpecBase::recursiveBuildResourceList(std::vector<urde::SObjectTag>& listOut
|
||||||
std::vector<hecl::ProjectPath> subPaths;
|
std::vector<hecl::ProjectPath> subPaths;
|
||||||
flattenDependencies(childPath, subPaths, btok);
|
flattenDependencies(childPath, subPaths, btok);
|
||||||
for (const auto& subPath : subPaths) {
|
for (const auto& subPath : subPaths) {
|
||||||
if (urde::SObjectTag tag = tagFromPath(subPath)) {
|
if (metaforce::SObjectTag tag = tagFromPath(subPath)) {
|
||||||
if (addedTags.find(tag) != addedTags.end())
|
if (addedTags.find(tag) != addedTags.end())
|
||||||
continue;
|
continue;
|
||||||
addedTags.insert(tag);
|
addedTags.insert(tag);
|
||||||
|
@ -478,10 +478,10 @@ void SpecBase::recursiveBuildResourceList(std::vector<urde::SObjectTag>& listOut
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpecBase::copyBuildListData(std::vector<std::tuple<size_t, size_t, bool>>& fileIndex,
|
void SpecBase::copyBuildListData(std::vector<std::tuple<size_t, size_t, bool>>& fileIndex,
|
||||||
const std::vector<urde::SObjectTag>& buildList,
|
const std::vector<metaforce::SObjectTag>& buildList,
|
||||||
const hecl::Database::DataSpecEntry* entry, bool fast,
|
const hecl::Database::DataSpecEntry* entry, bool fast,
|
||||||
const hecl::MultiProgressPrinter& progress, athena::io::FileWriter& pakOut,
|
const hecl::MultiProgressPrinter& progress, athena::io::FileWriter& pakOut,
|
||||||
const std::unordered_map<urde::CAssetId, std::vector<uint8_t>>& mlvlData) {
|
const std::unordered_map<metaforce::CAssetId, std::vector<uint8_t>>& mlvlData) {
|
||||||
fileIndex.reserve(buildList.size());
|
fileIndex.reserve(buildList.size());
|
||||||
int loadIdx = 0;
|
int loadIdx = 0;
|
||||||
for (const auto& tag : buildList) {
|
for (const auto& tag : buildList) {
|
||||||
|
@ -564,9 +564,9 @@ void SpecBase::doPackage(const hecl::ProjectPath& path, const hecl::Database::Da
|
||||||
|
|
||||||
/* Output file */
|
/* Output file */
|
||||||
athena::io::FileWriter pakOut(outPath.getAbsolutePath());
|
athena::io::FileWriter pakOut(outPath.getAbsolutePath());
|
||||||
std::vector<urde::SObjectTag> buildList;
|
std::vector<metaforce::SObjectTag> buildList;
|
||||||
atUint64 resTableOffset = 0;
|
atUint64 resTableOffset = 0;
|
||||||
std::unordered_map<urde::CAssetId, std::vector<uint8_t>> mlvlData;
|
std::unordered_map<metaforce::CAssetId, std::vector<uint8_t>> mlvlData;
|
||||||
|
|
||||||
if (IsWorldBlend(path)) /* World PAK */
|
if (IsWorldBlend(path)) /* World PAK */
|
||||||
{
|
{
|
||||||
|
@ -583,9 +583,9 @@ void SpecBase::doPackage(const hecl::ProjectPath& path, const hecl::Database::Da
|
||||||
} else if (path.getPathType() == hecl::ProjectPath::Type::Directory) /* General PAK */
|
} else if (path.getPathType() == hecl::ProjectPath::Type::Directory) /* General PAK */
|
||||||
{
|
{
|
||||||
/* Build resource list */
|
/* Build resource list */
|
||||||
std::unordered_set<urde::SObjectTag> addedTags;
|
std::unordered_set<metaforce::SObjectTag> addedTags;
|
||||||
recursiveBuildResourceList(buildList, addedTags, path, btok);
|
recursiveBuildResourceList(buildList, addedTags, path, btok);
|
||||||
std::vector<std::pair<urde::SObjectTag, std::string>> nameList;
|
std::vector<std::pair<metaforce::SObjectTag, std::string>> nameList;
|
||||||
|
|
||||||
/* Build name list */
|
/* Build name list */
|
||||||
for (const auto& item : buildList) {
|
for (const auto& item : buildList) {
|
||||||
|
@ -605,10 +605,10 @@ void SpecBase::doPackage(const hecl::ProjectPath& path, const hecl::Database::Da
|
||||||
/* Build resource list */
|
/* Build resource list */
|
||||||
std::vector<hecl::ProjectPath> subPaths;
|
std::vector<hecl::ProjectPath> subPaths;
|
||||||
flattenDependencies(path, subPaths, btok);
|
flattenDependencies(path, subPaths, btok);
|
||||||
std::unordered_set<urde::SObjectTag> addedTags;
|
std::unordered_set<metaforce::SObjectTag> addedTags;
|
||||||
std::vector<std::pair<urde::SObjectTag, std::string>> nameList;
|
std::vector<std::pair<metaforce::SObjectTag, std::string>> nameList;
|
||||||
for (const auto& subPath : subPaths) {
|
for (const auto& subPath : subPaths) {
|
||||||
if (urde::SObjectTag tag = tagFromPath(subPath)) {
|
if (metaforce::SObjectTag tag = tagFromPath(subPath)) {
|
||||||
if (addedTags.find(tag) != addedTags.end())
|
if (addedTags.find(tag) != addedTags.end())
|
||||||
continue;
|
continue;
|
||||||
addedTags.insert(tag);
|
addedTags.insert(tag);
|
||||||
|
@ -635,12 +635,12 @@ void SpecBase::doPackage(const hecl::ProjectPath& path, const hecl::Database::Da
|
||||||
if (cp) {
|
if (cp) {
|
||||||
Log.report(logvisor::Info, FMT_STRING(_SYS_STR("Validating resources")));
|
Log.report(logvisor::Info, FMT_STRING(_SYS_STR("Validating resources")));
|
||||||
progress.setMainIndeterminate(true);
|
progress.setMainIndeterminate(true);
|
||||||
std::vector<urde::SObjectTag> cookTags;
|
std::vector<metaforce::SObjectTag> cookTags;
|
||||||
cookTags.reserve(buildList.size());
|
cookTags.reserve(buildList.size());
|
||||||
|
|
||||||
/* Ensure CMDLs are enqueued first to minimize synchronous dependency cooking */
|
/* Ensure CMDLs are enqueued first to minimize synchronous dependency cooking */
|
||||||
for (int i = 0; i < 2; ++i) {
|
for (int i = 0; i < 2; ++i) {
|
||||||
std::unordered_set<urde::SObjectTag> addedTags;
|
std::unordered_set<metaforce::SObjectTag> addedTags;
|
||||||
addedTags.reserve(buildList.size());
|
addedTags.reserve(buildList.size());
|
||||||
for (auto& tag : buildList) {
|
for (auto& tag : buildList) {
|
||||||
if ((i == 0 && tag.type == FOURCC('CMDL')) || (i == 1 && tag.type != FOURCC('CMDL'))) {
|
if ((i == 0 && tag.type == FOURCC('CMDL')) || (i == 1 && tag.type != FOURCC('CMDL'))) {
|
||||||
|
@ -732,7 +732,7 @@ void SpecBase::extractRandomStaticEntropy(const uint8_t* buf, const hecl::Projec
|
||||||
png_infop info = png_create_info_struct(png);
|
png_infop info = png_create_info_struct(png);
|
||||||
|
|
||||||
png_text textStruct = {};
|
png_text textStruct = {};
|
||||||
textStruct.key = png_charp("urde_nomip");
|
textStruct.key = png_charp("meta_nomip");
|
||||||
png_set_text(png, info, &textStruct, 1);
|
png_set_text(png, info, &textStruct, 1);
|
||||||
|
|
||||||
png_set_IHDR(png, info, 1024, 512, 8, PNG_COLOR_TYPE_GRAY_ALPHA, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT,
|
png_set_IHDR(png, info, 1024, 512, 8, PNG_COLOR_TYPE_GRAY_ALPHA, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT,
|
||||||
|
@ -761,7 +761,7 @@ void SpecBase::clearTagCache() {
|
||||||
m_catalogTagToNames.clear();
|
m_catalogTagToNames.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
hecl::ProjectPath SpecBase::pathFromTag(const urde::SObjectTag& tag) const {
|
hecl::ProjectPath SpecBase::pathFromTag(const metaforce::SObjectTag& tag) const {
|
||||||
std::unique_lock lk(m_backgroundIndexMutex);
|
std::unique_lock lk(m_backgroundIndexMutex);
|
||||||
auto search = m_tagToPath.find(tag);
|
auto search = m_tagToPath.find(tag);
|
||||||
if (search != m_tagToPath.cend())
|
if (search != m_tagToPath.cend())
|
||||||
|
@ -769,14 +769,14 @@ hecl::ProjectPath SpecBase::pathFromTag(const urde::SObjectTag& tag) const {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
urde::SObjectTag SpecBase::tagFromPath(const hecl::ProjectPath& path) const {
|
metaforce::SObjectTag SpecBase::tagFromPath(const hecl::ProjectPath& path) const {
|
||||||
auto search = m_pathToTag.find(path.hash());
|
auto search = m_pathToTag.find(path.hash());
|
||||||
if (search != m_pathToTag.cend())
|
if (search != m_pathToTag.cend())
|
||||||
return search->second;
|
return search->second;
|
||||||
return buildTagFromPath(path);
|
return buildTagFromPath(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SpecBase::waitForTagReady(const urde::SObjectTag& tag, const hecl::ProjectPath*& pathOut) {
|
bool SpecBase::waitForTagReady(const metaforce::SObjectTag& tag, const hecl::ProjectPath*& pathOut) {
|
||||||
std::unique_lock lk(m_backgroundIndexMutex);
|
std::unique_lock lk(m_backgroundIndexMutex);
|
||||||
auto search = m_tagToPath.find(tag);
|
auto search = m_tagToPath.find(tag);
|
||||||
if (search == m_tagToPath.end()) {
|
if (search == m_tagToPath.end()) {
|
||||||
|
@ -799,7 +799,7 @@ bool SpecBase::waitForTagReady(const urde::SObjectTag& tag, const hecl::ProjectP
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const urde::SObjectTag* SpecBase::getResourceIdByName(std::string_view name) const {
|
const metaforce::SObjectTag* SpecBase::getResourceIdByName(std::string_view name) const {
|
||||||
std::string lower(name);
|
std::string lower(name);
|
||||||
std::transform(lower.cbegin(), lower.cend(), lower.begin(), tolower);
|
std::transform(lower.cbegin(), lower.cend(), lower.begin(), tolower);
|
||||||
|
|
||||||
|
@ -823,12 +823,12 @@ const urde::SObjectTag* SpecBase::getResourceIdByName(std::string_view name) con
|
||||||
return &search->second;
|
return &search->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
FourCC SpecBase::getResourceTypeById(urde::CAssetId id) const {
|
FourCC SpecBase::getResourceTypeById(metaforce::CAssetId id) const {
|
||||||
if (!id.IsValid())
|
if (!id.IsValid())
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
std::unique_lock lk(m_backgroundIndexMutex);
|
std::unique_lock lk(m_backgroundIndexMutex);
|
||||||
urde::SObjectTag searchTag = {FourCC(), id};
|
metaforce::SObjectTag searchTag = {FourCC(), id};
|
||||||
auto search = m_tagToPath.find(searchTag);
|
auto search = m_tagToPath.find(searchTag);
|
||||||
if (search == m_tagToPath.end()) {
|
if (search == m_tagToPath.end()) {
|
||||||
if (m_backgroundRunning) {
|
if (m_backgroundRunning) {
|
||||||
|
@ -849,7 +849,7 @@ FourCC SpecBase::getResourceTypeById(urde::CAssetId id) const {
|
||||||
return search->first.type;
|
return search->first.type;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpecBase::enumerateResources(const std::function<bool(const urde::SObjectTag&)>& lambda) const {
|
void SpecBase::enumerateResources(const std::function<bool(const metaforce::SObjectTag&)>& lambda) const {
|
||||||
waitForIndexComplete();
|
waitForIndexComplete();
|
||||||
for (const auto& pair : m_tagToPath) {
|
for (const auto& pair : m_tagToPath) {
|
||||||
if (!lambda(pair.first))
|
if (!lambda(pair.first))
|
||||||
|
@ -858,7 +858,7 @@ void SpecBase::enumerateResources(const std::function<bool(const urde::SObjectTa
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpecBase::enumerateNamedResources(
|
void SpecBase::enumerateNamedResources(
|
||||||
const std::function<bool(std::string_view, const urde::SObjectTag&)>& lambda) const {
|
const std::function<bool(std::string_view, const metaforce::SObjectTag&)>& lambda) const {
|
||||||
waitForIndexComplete();
|
waitForIndexComplete();
|
||||||
for (const auto& pair : m_catalogNameToTag) {
|
for (const auto& pair : m_catalogNameToTag) {
|
||||||
if (!lambda(pair.first, pair.second))
|
if (!lambda(pair.first, pair.second))
|
||||||
|
@ -866,7 +866,7 @@ void SpecBase::enumerateNamedResources(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WriteTag(athena::io::YAMLDocWriter& cacheWriter, const urde::SObjectTag& pathTag,
|
static void WriteTag(athena::io::YAMLDocWriter& cacheWriter, const metaforce::SObjectTag& pathTag,
|
||||||
const hecl::ProjectPath& path) {
|
const hecl::ProjectPath& path) {
|
||||||
auto key = fmt::format(FMT_STRING("{}"), pathTag.id);
|
auto key = fmt::format(FMT_STRING("{}"), pathTag.id);
|
||||||
if (auto* existing = cacheWriter.getCurNode()->findMapChild(key)) {
|
if (auto* existing = cacheWriter.getCurNode()->findMapChild(key)) {
|
||||||
|
@ -877,7 +877,7 @@ static void WriteTag(athena::io::YAMLDocWriter& cacheWriter, const urde::SObject
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WriteNameTag(athena::io::YAMLDocWriter& nameWriter, const urde::SObjectTag& pathTag,
|
static void WriteNameTag(athena::io::YAMLDocWriter& nameWriter, const metaforce::SObjectTag& pathTag,
|
||||||
std::string_view name) {
|
std::string_view name) {
|
||||||
nameWriter.writeString(name.data(), fmt::format(FMT_STRING("{}"), pathTag.id));
|
nameWriter.writeString(name.data(), fmt::format(FMT_STRING("{}"), pathTag.id));
|
||||||
}
|
}
|
||||||
|
@ -915,7 +915,7 @@ void SpecBase::readCatalog(const hecl::ProjectPath& catalogPath, athena::io::YAM
|
||||||
}
|
}
|
||||||
if (path.isNone())
|
if (path.isNone())
|
||||||
continue;
|
continue;
|
||||||
urde::SObjectTag pathTag = tagFromPath(path);
|
metaforce::SObjectTag pathTag = tagFromPath(path);
|
||||||
if (pathTag) {
|
if (pathTag) {
|
||||||
std::unique_lock lk(m_backgroundIndexMutex);
|
std::unique_lock lk(m_backgroundIndexMutex);
|
||||||
m_catalogNameToTag[pLower] = pathTag;
|
m_catalogNameToTag[pLower] = pathTag;
|
||||||
|
@ -956,7 +956,7 @@ void SpecBase::backgroundIndexRecursiveCatalogs(const hecl::ProjectPath& dir, at
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpecBase::insertPathTag(athena::io::YAMLDocWriter& cacheWriter, const urde::SObjectTag& tag,
|
void SpecBase::insertPathTag(athena::io::YAMLDocWriter& cacheWriter, const metaforce::SObjectTag& tag,
|
||||||
const hecl::ProjectPath& path, bool dump) {
|
const hecl::ProjectPath& path, bool dump) {
|
||||||
#if 0
|
#if 0
|
||||||
auto search = m_tagToPath.find(tag);
|
auto search = m_tagToPath.find(tag);
|
||||||
|
@ -989,7 +989,7 @@ bool SpecBase::addFileToIndex(const hecl::ProjectPath& path, athena::io::YAMLDoc
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
/* Classify intermediate into tag */
|
/* Classify intermediate into tag */
|
||||||
urde::SObjectTag pathTag = buildTagFromPath(path);
|
metaforce::SObjectTag pathTag = buildTagFromPath(path);
|
||||||
if (pathTag) {
|
if (pathTag) {
|
||||||
std::unique_lock lk{m_backgroundIndexMutex};
|
std::unique_lock lk{m_backgroundIndexMutex};
|
||||||
bool useGlob = false;
|
bool useGlob = false;
|
||||||
|
@ -1085,7 +1085,7 @@ void SpecBase::backgroundIndexRecursiveProc(const hecl::ProjectPath& dir, athena
|
||||||
if (hecl::ProjectPath(path, "!project.yaml").isFile() && hecl::ProjectPath(path, "!pool.yaml").isFile()) {
|
if (hecl::ProjectPath(path, "!project.yaml").isFile() && hecl::ProjectPath(path, "!pool.yaml").isFile()) {
|
||||||
/* Avoid redundant filesystem access for re-caches */
|
/* Avoid redundant filesystem access for re-caches */
|
||||||
if (m_pathToTag.find(path.hash()) == m_pathToTag.cend()) {
|
if (m_pathToTag.find(path.hash()) == m_pathToTag.cend()) {
|
||||||
urde::SObjectTag pathTag(SBIG('AGSC'), path.parsedHash32());
|
metaforce::SObjectTag pathTag(SBIG('AGSC'), path.parsedHash32());
|
||||||
insertPathTag(cacheWriter, pathTag, path);
|
insertPathTag(cacheWriter, pathTag, path);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1138,7 +1138,7 @@ void SpecBase::backgroundIndexProc() {
|
||||||
if (node.m_seqChildren.size() >= 2) {
|
if (node.m_seqChildren.size() >= 2) {
|
||||||
unsigned long id = strtoul(child.first.c_str(), nullptr, 16);
|
unsigned long id = strtoul(child.first.c_str(), nullptr, 16);
|
||||||
hecl::FourCC type(node.m_seqChildren[0]->m_scalarString.c_str());
|
hecl::FourCC type(node.m_seqChildren[0]->m_scalarString.c_str());
|
||||||
urde::SObjectTag pathTag(type, id);
|
metaforce::SObjectTag pathTag(type, id);
|
||||||
for (auto I = node.m_seqChildren.begin() + 1, E = node.m_seqChildren.end(); I != E; ++I) {
|
for (auto I = node.m_seqChildren.begin() + 1, E = node.m_seqChildren.end(); I != E; ++I) {
|
||||||
hecl::ProjectPath path(m_project.getProjectWorkingPath(), (*I)->m_scalarString);
|
hecl::ProjectPath path(m_project.getProjectWorkingPath(), (*I)->m_scalarString);
|
||||||
if (!path.isNone())
|
if (!path.isNone())
|
||||||
|
@ -1166,7 +1166,7 @@ void SpecBase::backgroundIndexProc() {
|
||||||
m_catalogTagToNames.reserve(nameReader.getRootNode()->m_mapChildren.size());
|
m_catalogTagToNames.reserve(nameReader.getRootNode()->m_mapChildren.size());
|
||||||
for (const auto& child : nameReader.getRootNode()->m_mapChildren) {
|
for (const auto& child : nameReader.getRootNode()->m_mapChildren) {
|
||||||
unsigned long id = strtoul(child.second->m_scalarString.c_str(), nullptr, 16);
|
unsigned long id = strtoul(child.second->m_scalarString.c_str(), nullptr, 16);
|
||||||
auto search = m_tagToPath.find(urde::SObjectTag(FourCC(), uint32_t(id)));
|
auto search = m_tagToPath.find(metaforce::SObjectTag(FourCC(), uint32_t(id)));
|
||||||
if (search != m_tagToPath.cend()) {
|
if (search != m_tagToPath.cend()) {
|
||||||
std::string chLower = child.first;
|
std::string chLower = child.first;
|
||||||
std::transform(chLower.cbegin(), chLower.cend(), chLower.begin(), tolower);
|
std::transform(chLower.cbegin(), chLower.cend(), chLower.begin(), tolower);
|
||||||
|
@ -1224,7 +1224,7 @@ void SpecBase::WriteVersionInfo(hecl::Database::Project& project, const hecl::Pr
|
||||||
hecl::ProjectPath versionPath(pakPath, _SYS_STR("version.yaml"));
|
hecl::ProjectPath versionPath(pakPath, _SYS_STR("version.yaml"));
|
||||||
versionPath.makeDirChain(false);
|
versionPath.makeDirChain(false);
|
||||||
|
|
||||||
URDEVersionInfo info;
|
MetaforceVersionInfo info;
|
||||||
info.version = m_version;
|
info.version = m_version;
|
||||||
info.region = m_region;
|
info.region = m_region;
|
||||||
info.game = m_game;
|
info.game = m_game;
|
||||||
|
|
|
@ -57,7 +57,7 @@ struct SpecBase : hecl::Database::IDataSpec {
|
||||||
virtual bool extractFromDisc(nod::DiscBase& disc, bool force, const hecl::MultiProgressPrinter& progress) = 0;
|
virtual bool extractFromDisc(nod::DiscBase& disc, bool force, const hecl::MultiProgressPrinter& progress) = 0;
|
||||||
|
|
||||||
/* Convert path to object tag */
|
/* Convert path to object tag */
|
||||||
virtual urde::SObjectTag buildTagFromPath(const hecl::ProjectPath& path) const = 0;
|
virtual metaforce::SObjectTag buildTagFromPath(const hecl::ProjectPath& path) const = 0;
|
||||||
|
|
||||||
/* Even if PC spec is being cooked, this will return the vanilla GCN spec */
|
/* Even if PC spec is being cooked, this will return the vanilla GCN spec */
|
||||||
virtual const hecl::Database::DataSpecEntry& getOriginalSpec() const = 0;
|
virtual const hecl::Database::DataSpecEntry& getOriginalSpec() const = 0;
|
||||||
|
@ -121,15 +121,15 @@ struct SpecBase : hecl::Database::IDataSpec {
|
||||||
|
|
||||||
virtual void buildWorldPakList(const hecl::ProjectPath& worldPath, const hecl::ProjectPath& worldPathCooked,
|
virtual void buildWorldPakList(const hecl::ProjectPath& worldPath, const hecl::ProjectPath& worldPathCooked,
|
||||||
hecl::blender::Token& btok, athena::io::FileWriter& w,
|
hecl::blender::Token& btok, athena::io::FileWriter& w,
|
||||||
std::vector<urde::SObjectTag>& listOut, atUint64& resTableOffset,
|
std::vector<metaforce::SObjectTag>& listOut, atUint64& resTableOffset,
|
||||||
std::unordered_map<urde::CAssetId, std::vector<uint8_t>>& mlvlData) {}
|
std::unordered_map<metaforce::CAssetId, std::vector<uint8_t>>& mlvlData) {}
|
||||||
virtual void buildPakList(hecl::blender::Token& btok, athena::io::FileWriter& w,
|
virtual void buildPakList(hecl::blender::Token& btok, athena::io::FileWriter& w,
|
||||||
const std::vector<urde::SObjectTag>& list,
|
const std::vector<metaforce::SObjectTag>& list,
|
||||||
const std::vector<std::pair<urde::SObjectTag, std::string>>& nameList,
|
const std::vector<std::pair<metaforce::SObjectTag, std::string>>& nameList,
|
||||||
atUint64& resTableOffset) {}
|
atUint64& resTableOffset) {}
|
||||||
virtual void writePakFileIndex(athena::io::FileWriter& w, const std::vector<urde::SObjectTag>& tags,
|
virtual void writePakFileIndex(athena::io::FileWriter& w, const std::vector<metaforce::SObjectTag>& tags,
|
||||||
const std::vector<std::tuple<size_t, size_t, bool>>& index, atUint64 resTableOffset) {}
|
const std::vector<std::tuple<size_t, size_t, bool>>& index, atUint64 resTableOffset) {}
|
||||||
virtual std::pair<std::unique_ptr<uint8_t[]>, size_t> compressPakData(const urde::SObjectTag& tag,
|
virtual std::pair<std::unique_ptr<uint8_t[]>, size_t> compressPakData(const metaforce::SObjectTag& tag,
|
||||||
const uint8_t* data, size_t len) {
|
const uint8_t* data, size_t len) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
@ -149,19 +149,19 @@ struct SpecBase : hecl::Database::IDataSpec {
|
||||||
void extractRandomStaticEntropy(const uint8_t* buf, const hecl::ProjectPath& pakPath);
|
void extractRandomStaticEntropy(const uint8_t* buf, const hecl::ProjectPath& pakPath);
|
||||||
|
|
||||||
/* Tag cache functions */
|
/* Tag cache functions */
|
||||||
urde::SObjectTag tagFromPath(const hecl::ProjectPath& path) const;
|
metaforce::SObjectTag tagFromPath(const hecl::ProjectPath& path) const;
|
||||||
hecl::ProjectPath pathFromTag(const urde::SObjectTag& tag) const;
|
hecl::ProjectPath pathFromTag(const metaforce::SObjectTag& tag) const;
|
||||||
bool waitForTagReady(const urde::SObjectTag& tag, const hecl::ProjectPath*& pathOut);
|
bool waitForTagReady(const metaforce::SObjectTag& tag, const hecl::ProjectPath*& pathOut);
|
||||||
const urde::SObjectTag* getResourceIdByName(std::string_view name) const;
|
const metaforce::SObjectTag* getResourceIdByName(std::string_view name) const;
|
||||||
hecl::FourCC getResourceTypeById(urde::CAssetId id) const;
|
hecl::FourCC getResourceTypeById(metaforce::CAssetId id) const;
|
||||||
void enumerateResources(const std::function<bool(const urde::SObjectTag&)>& lambda) const;
|
void enumerateResources(const std::function<bool(const metaforce::SObjectTag&)>& lambda) const;
|
||||||
void enumerateNamedResources(const std::function<bool(std::string_view, const urde::SObjectTag&)>& lambda) const;
|
void enumerateNamedResources(const std::function<bool(std::string_view, const metaforce::SObjectTag&)>& lambda) const;
|
||||||
void cancelBackgroundIndex();
|
void cancelBackgroundIndex();
|
||||||
void beginBackgroundIndex();
|
void beginBackgroundIndex();
|
||||||
bool backgroundIndexRunning() const { return m_backgroundRunning; }
|
bool backgroundIndexRunning() const { return m_backgroundRunning; }
|
||||||
void waitForIndexComplete() const;
|
void waitForIndexComplete() const;
|
||||||
|
|
||||||
virtual void getTagListForFile(const char* pakName, std::vector<urde::SObjectTag>& out) const {}
|
virtual void getTagListForFile(const char* pakName, std::vector<metaforce::SObjectTag>& out) const {}
|
||||||
|
|
||||||
SpecBase(const hecl::Database::DataSpecEntry* specEntry, hecl::Database::Project& project, bool pc);
|
SpecBase(const hecl::Database::DataSpecEntry* specEntry, hecl::Database::Project& project, bool pc);
|
||||||
~SpecBase();
|
~SpecBase();
|
||||||
|
@ -171,10 +171,10 @@ protected:
|
||||||
bool m_pc;
|
bool m_pc;
|
||||||
hecl::ProjectPath m_masterShader;
|
hecl::ProjectPath m_masterShader;
|
||||||
|
|
||||||
std::unordered_multimap<urde::SObjectTag, hecl::ProjectPath> m_tagToPath;
|
std::unordered_multimap<metaforce::SObjectTag, hecl::ProjectPath> m_tagToPath;
|
||||||
std::unordered_map<hecl::Hash, urde::SObjectTag> m_pathToTag;
|
std::unordered_map<hecl::Hash, metaforce::SObjectTag> m_pathToTag;
|
||||||
std::unordered_map<std::string, urde::SObjectTag> m_catalogNameToTag;
|
std::unordered_map<std::string, metaforce::SObjectTag> m_catalogNameToTag;
|
||||||
std::unordered_map<urde::SObjectTag, std::unordered_set<std::string>> m_catalogTagToNames;
|
std::unordered_map<metaforce::SObjectTag, std::unordered_set<std::string>> m_catalogTagToNames;
|
||||||
void clearTagCache();
|
void clearTagCache();
|
||||||
|
|
||||||
hecl::blender::Token m_backgroundBlender;
|
hecl::blender::Token m_backgroundBlender;
|
||||||
|
@ -183,7 +183,7 @@ protected:
|
||||||
bool m_backgroundRunning = false;
|
bool m_backgroundRunning = false;
|
||||||
|
|
||||||
void readCatalog(const hecl::ProjectPath& catalogPath, athena::io::YAMLDocWriter& nameWriter);
|
void readCatalog(const hecl::ProjectPath& catalogPath, athena::io::YAMLDocWriter& nameWriter);
|
||||||
void insertPathTag(athena::io::YAMLDocWriter& cacheWriter, const urde::SObjectTag& tag, const hecl::ProjectPath& path,
|
void insertPathTag(athena::io::YAMLDocWriter& cacheWriter, const metaforce::SObjectTag& tag, const hecl::ProjectPath& path,
|
||||||
bool dump = true);
|
bool dump = true);
|
||||||
bool addFileToIndex(const hecl::ProjectPath& path, athena::io::YAMLDocWriter& cacheWriter);
|
bool addFileToIndex(const hecl::ProjectPath& path, athena::io::YAMLDocWriter& cacheWriter);
|
||||||
void backgroundIndexRecursiveProc(const hecl::ProjectPath& path, athena::io::YAMLDocWriter& cacheWriter,
|
void backgroundIndexRecursiveProc(const hecl::ProjectPath& path, athena::io::YAMLDocWriter& cacheWriter,
|
||||||
|
@ -192,13 +192,13 @@ protected:
|
||||||
int level);
|
int level);
|
||||||
void backgroundIndexProc();
|
void backgroundIndexProc();
|
||||||
|
|
||||||
void recursiveBuildResourceList(std::vector<urde::SObjectTag>& listOut,
|
void recursiveBuildResourceList(std::vector<metaforce::SObjectTag>& listOut,
|
||||||
std::unordered_set<urde::SObjectTag>& addedTags, const hecl::ProjectPath& path,
|
std::unordered_set<metaforce::SObjectTag>& addedTags, const hecl::ProjectPath& path,
|
||||||
hecl::blender::Token& btok);
|
hecl::blender::Token& btok);
|
||||||
void copyBuildListData(std::vector<std::tuple<size_t, size_t, bool>>& fileIndex,
|
void copyBuildListData(std::vector<std::tuple<size_t, size_t, bool>>& fileIndex,
|
||||||
const std::vector<urde::SObjectTag>& buildList, const hecl::Database::DataSpecEntry* entry,
|
const std::vector<metaforce::SObjectTag>& buildList, const hecl::Database::DataSpecEntry* entry,
|
||||||
bool fast, const hecl::MultiProgressPrinter& progress, athena::io::FileWriter& pakOut,
|
bool fast, const hecl::MultiProgressPrinter& progress, athena::io::FileWriter& pakOut,
|
||||||
const std::unordered_map<urde::CAssetId, std::vector<uint8_t>>& mlvlData);
|
const std::unordered_map<metaforce::CAssetId, std::vector<uint8_t>>& mlvlData);
|
||||||
|
|
||||||
std::unique_ptr<nod::DiscBase> m_disc;
|
std::unique_ptr<nod::DiscBase> m_disc;
|
||||||
bool m_isWii{};
|
bool m_isWii{};
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include "DNACommon/DPSC.hpp"
|
#include "DNACommon/DPSC.hpp"
|
||||||
#include "DNACommon/DGRP.hpp"
|
#include "DNACommon/DGRP.hpp"
|
||||||
#include "DNACommon/MAPU.hpp"
|
#include "DNACommon/MAPU.hpp"
|
||||||
#include "DNACommon/URDEVersionInfo.hpp"
|
#include "DNACommon/MetaforceVersionInfo.hpp"
|
||||||
#include "DNACommon/Tweaks/TweakWriter.hpp"
|
#include "DNACommon/Tweaks/TweakWriter.hpp"
|
||||||
#include "DNAMP1/Tweaks/CTweakPlayerRes.hpp"
|
#include "DNAMP1/Tweaks/CTweakPlayerRes.hpp"
|
||||||
#include "DNAMP1/Tweaks/CTweakGunRes.hpp"
|
#include "DNAMP1/Tweaks/CTweakGunRes.hpp"
|
||||||
|
@ -57,7 +57,7 @@ namespace DataSpec {
|
||||||
|
|
||||||
using namespace std::literals;
|
using namespace std::literals;
|
||||||
|
|
||||||
static logvisor::Module Log("urde::SpecMP1");
|
static logvisor::Module Log("metaforce::SpecMP1");
|
||||||
extern hecl::Database::DataSpecEntry SpecEntMP1;
|
extern hecl::Database::DataSpecEntry SpecEntMP1;
|
||||||
extern hecl::Database::DataSpecEntry SpecEntMP1PC;
|
extern hecl::Database::DataSpecEntry SpecEntMP1PC;
|
||||||
extern hecl::Database::DataSpecEntry SpecEntMP1ORIG;
|
extern hecl::Database::DataSpecEntry SpecEntMP1ORIG;
|
||||||
|
@ -473,7 +473,7 @@ struct SpecMP1 : SpecBase {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
urde::SObjectTag buildTagFromPath(const hecl::ProjectPath& path) const override {
|
metaforce::SObjectTag buildTagFromPath(const hecl::ProjectPath& path) const override {
|
||||||
if (hecl::StringUtils::EndsWith(path.getAuxInfo(), _SYS_STR(".CSKR")))
|
if (hecl::StringUtils::EndsWith(path.getAuxInfo(), _SYS_STR(".CSKR")))
|
||||||
return {SBIG('CSKR'), path.parsedHash32()};
|
return {SBIG('CSKR'), path.parsedHash32()};
|
||||||
else if (hecl::StringUtils::EndsWith(path.getAuxInfo(), _SYS_STR(".ANIM")))
|
else if (hecl::StringUtils::EndsWith(path.getAuxInfo(), _SYS_STR(".ANIM")))
|
||||||
|
@ -542,7 +542,7 @@ struct SpecMP1 : SpecBase {
|
||||||
athena::io::YAMLDocReader reader;
|
athena::io::YAMLDocReader reader;
|
||||||
yaml_parser_set_input_file(reader.getParser(), fp.get());
|
yaml_parser_set_input_file(reader.getParser(), fp.get());
|
||||||
|
|
||||||
urde::SObjectTag resTag;
|
metaforce::SObjectTag resTag;
|
||||||
if (reader.ClassTypeOperation([&](std::string_view className) {
|
if (reader.ClassTypeOperation([&](std::string_view className) {
|
||||||
if (className == DNAParticle::GPSM<UniqueID32>::DNAType()) {
|
if (className == DNAParticle::GPSM<UniqueID32>::DNAType()) {
|
||||||
resTag.type = SBIG('PART');
|
resTag.type = SBIG('PART');
|
||||||
|
@ -634,7 +634,7 @@ struct SpecMP1 : SpecBase {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
void getTagListForFile(const char* pakName, std::vector<urde::SObjectTag>& out) const override {
|
void getTagListForFile(const char* pakName, std::vector<metaforce::SObjectTag>& out) const override {
|
||||||
std::string pathPrefix("MP1/");
|
std::string pathPrefix("MP1/");
|
||||||
pathPrefix += pakName;
|
pathPrefix += pakName;
|
||||||
pathPrefix += '/';
|
pathPrefix += '/';
|
||||||
|
@ -992,9 +992,9 @@ struct SpecMP1 : SpecBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
void buildWorldPakList(const hecl::ProjectPath& worldPath, const hecl::ProjectPath& worldPathCooked,
|
void buildWorldPakList(const hecl::ProjectPath& worldPath, const hecl::ProjectPath& worldPathCooked,
|
||||||
hecl::blender::Token& btok, athena::io::FileWriter& w, std::vector<urde::SObjectTag>& listOut,
|
hecl::blender::Token& btok, athena::io::FileWriter& w, std::vector<metaforce::SObjectTag>& listOut,
|
||||||
atUint64& resTableOffset,
|
atUint64& resTableOffset,
|
||||||
std::unordered_map<urde::CAssetId, std::vector<uint8_t>>& mlvlData) override {
|
std::unordered_map<metaforce::CAssetId, std::vector<uint8_t>>& mlvlData) override {
|
||||||
DNAMP1::MLVL mlvl;
|
DNAMP1::MLVL mlvl;
|
||||||
{
|
{
|
||||||
athena::io::FileReader r(worldPathCooked.getAbsolutePath());
|
athena::io::FileReader r(worldPathCooked.getAbsolutePath());
|
||||||
|
@ -1016,7 +1016,7 @@ struct SpecMP1 : SpecBase {
|
||||||
}
|
}
|
||||||
listOut.reserve(count);
|
listOut.reserve(count);
|
||||||
|
|
||||||
urde::SObjectTag worldTag = tagFromPath(worldPath.getWithExtension(_SYS_STR(".*"), true));
|
metaforce::SObjectTag worldTag = tagFromPath(worldPath.getWithExtension(_SYS_STR(".*"), true));
|
||||||
|
|
||||||
w.writeUint32Big(m_pc ? 0x80030005 : 0x00030005);
|
w.writeUint32Big(m_pc ? 0x80030005 : 0x00030005);
|
||||||
w.writeUint32Big(0);
|
w.writeUint32Big(0);
|
||||||
|
@ -1030,19 +1030,19 @@ struct SpecMP1 : SpecBase {
|
||||||
nameEnt.name = parentDir.getLastComponentUTF8();
|
nameEnt.name = parentDir.getLastComponentUTF8();
|
||||||
nameEnt.write(w);
|
nameEnt.write(w);
|
||||||
|
|
||||||
std::unordered_set<urde::CAssetId> addedTags;
|
std::unordered_set<metaforce::CAssetId> addedTags;
|
||||||
for (auto& area : mlvl.areas) {
|
for (auto& area : mlvl.areas) {
|
||||||
urde::SObjectTag areaTag(FOURCC('MREA'), area.areaMREAId.toUint64());
|
metaforce::SObjectTag areaTag(FOURCC('MREA'), area.areaMREAId.toUint64());
|
||||||
|
|
||||||
bool dupeRes = false;
|
bool dupeRes = false;
|
||||||
if (hecl::ProjectPath areaDir = pathFromTag(areaTag).getParentPath())
|
if (hecl::ProjectPath areaDir = pathFromTag(areaTag).getParentPath())
|
||||||
dupeRes = hecl::ProjectPath(areaDir, _SYS_STR("!duperes")).isFile();
|
dupeRes = hecl::ProjectPath(areaDir, _SYS_STR("!duperes")).isFile();
|
||||||
|
|
||||||
urde::SObjectTag nameTag(FOURCC('STRG'), area.areaNameId.toUint64());
|
metaforce::SObjectTag nameTag(FOURCC('STRG'), area.areaNameId.toUint64());
|
||||||
if (nameTag)
|
if (nameTag)
|
||||||
listOut.push_back(nameTag);
|
listOut.push_back(nameTag);
|
||||||
for (const auto& dep : area.deps) {
|
for (const auto& dep : area.deps) {
|
||||||
urde::CAssetId newId = dep.id.toUint64();
|
metaforce::CAssetId newId = dep.id.toUint64();
|
||||||
if (dupeRes || addedTags.find(newId) == addedTags.end()) {
|
if (dupeRes || addedTags.find(newId) == addedTags.end()) {
|
||||||
listOut.emplace_back(dep.type, newId);
|
listOut.emplace_back(dep.type, newId);
|
||||||
addedTags.insert(newId);
|
addedTags.insert(newId);
|
||||||
|
@ -1077,18 +1077,18 @@ struct SpecMP1 : SpecBase {
|
||||||
area.depLayers = std::move(strippedDepLayers);
|
area.depLayers = std::move(strippedDepLayers);
|
||||||
}
|
}
|
||||||
|
|
||||||
urde::SObjectTag nameTag(FOURCC('STRG'), mlvl.worldNameId.toUint64());
|
metaforce::SObjectTag nameTag(FOURCC('STRG'), mlvl.worldNameId.toUint64());
|
||||||
if (nameTag)
|
if (nameTag)
|
||||||
listOut.push_back(nameTag);
|
listOut.push_back(nameTag);
|
||||||
|
|
||||||
urde::SObjectTag savwTag(FOURCC('SAVW'), mlvl.saveWorldId.toUint64());
|
metaforce::SObjectTag savwTag(FOURCC('SAVW'), mlvl.saveWorldId.toUint64());
|
||||||
if (savwTag) {
|
if (savwTag) {
|
||||||
if (hecl::ProjectPath savwPath = pathFromTag(savwTag))
|
if (hecl::ProjectPath savwPath = pathFromTag(savwTag))
|
||||||
m_project.cookPath(savwPath, {}, false, true);
|
m_project.cookPath(savwPath, {}, false, true);
|
||||||
listOut.push_back(savwTag);
|
listOut.push_back(savwTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
urde::SObjectTag mapTag(FOURCC('MAPW'), mlvl.worldMap.toUint64());
|
metaforce::SObjectTag mapTag(FOURCC('MAPW'), mlvl.worldMap.toUint64());
|
||||||
if (mapTag) {
|
if (mapTag) {
|
||||||
if (hecl::ProjectPath mapPath = pathFromTag(mapTag)) {
|
if (hecl::ProjectPath mapPath = pathFromTag(mapTag)) {
|
||||||
m_project.cookPath(mapPath, {}, false, true);
|
m_project.cookPath(mapPath, {}, false, true);
|
||||||
|
@ -1111,7 +1111,7 @@ struct SpecMP1 : SpecBase {
|
||||||
listOut.push_back(mapTag);
|
listOut.push_back(mapTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
urde::SObjectTag skyboxTag(FOURCC('CMDL'), mlvl.worldSkyboxId.toUint64());
|
metaforce::SObjectTag skyboxTag(FOURCC('CMDL'), mlvl.worldSkyboxId.toUint64());
|
||||||
if (skyboxTag) {
|
if (skyboxTag) {
|
||||||
listOut.push_back(skyboxTag);
|
listOut.push_back(skyboxTag);
|
||||||
hecl::ProjectPath skyboxPath = pathFromTag(skyboxTag);
|
hecl::ProjectPath skyboxPath = pathFromTag(skyboxTag);
|
||||||
|
@ -1119,7 +1119,7 @@ struct SpecMP1 : SpecBase {
|
||||||
auto data = btok.getBlenderConnection().beginData();
|
auto data = btok.getBlenderConnection().beginData();
|
||||||
std::vector<hecl::ProjectPath> textures = data.getTextures();
|
std::vector<hecl::ProjectPath> textures = data.getTextures();
|
||||||
for (const auto& tex : textures) {
|
for (const auto& tex : textures) {
|
||||||
urde::SObjectTag texTag = tagFromPath(tex);
|
metaforce::SObjectTag texTag = tagFromPath(tex);
|
||||||
if (!texTag)
|
if (!texTag)
|
||||||
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Unable to resolve {}")), tex.getRelativePath());
|
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Unable to resolve {}")), tex.getRelativePath());
|
||||||
listOut.push_back(texTag);
|
listOut.push_back(texTag);
|
||||||
|
@ -1151,8 +1151,8 @@ struct SpecMP1 : SpecBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void buildPakList(hecl::blender::Token& btok, athena::io::FileWriter& w, const std::vector<urde::SObjectTag>& list,
|
void buildPakList(hecl::blender::Token& btok, athena::io::FileWriter& w, const std::vector<metaforce::SObjectTag>& list,
|
||||||
const std::vector<std::pair<urde::SObjectTag, std::string>>& nameList,
|
const std::vector<std::pair<metaforce::SObjectTag, std::string>>& nameList,
|
||||||
atUint64& resTableOffset) override {
|
atUint64& resTableOffset) override {
|
||||||
w.writeUint32Big(m_pc ? 0x80030005 : 0x00030005);
|
w.writeUint32Big(m_pc ? 0x80030005 : 0x00030005);
|
||||||
w.writeUint32Big(0);
|
w.writeUint32Big(0);
|
||||||
|
@ -1180,13 +1180,13 @@ struct SpecMP1 : SpecBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void writePakFileIndex(athena::io::FileWriter& w, const std::vector<urde::SObjectTag>& tags,
|
void writePakFileIndex(athena::io::FileWriter& w, const std::vector<metaforce::SObjectTag>& tags,
|
||||||
const std::vector<std::tuple<size_t, size_t, bool>>& index, atUint64 resTableOffset) override {
|
const std::vector<std::tuple<size_t, size_t, bool>>& index, atUint64 resTableOffset) override {
|
||||||
w.seek(resTableOffset, athena::SeekOrigin::Begin);
|
w.seek(resTableOffset, athena::SeekOrigin::Begin);
|
||||||
|
|
||||||
auto it = tags.begin();
|
auto it = tags.begin();
|
||||||
for (const auto& item : index) {
|
for (const auto& item : index) {
|
||||||
const urde::SObjectTag& tag = *it++;
|
const metaforce::SObjectTag& tag = *it++;
|
||||||
DNAMP1::PAK::Entry ent;
|
DNAMP1::PAK::Entry ent;
|
||||||
ent.compressed = atUint32(std::get<2>(item));
|
ent.compressed = atUint32(std::get<2>(item));
|
||||||
ent.type = tag.type;
|
ent.type = tag.type;
|
||||||
|
@ -1197,7 +1197,7 @@ struct SpecMP1 : SpecBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::pair<std::unique_ptr<uint8_t[]>, size_t> compressPakData(const urde::SObjectTag& tag, const uint8_t* data,
|
std::pair<std::unique_ptr<uint8_t[]>, size_t> compressPakData(const metaforce::SObjectTag& tag, const uint8_t* data,
|
||||||
size_t len) override {
|
size_t len) override {
|
||||||
bool doCompress = false;
|
bool doCompress = false;
|
||||||
switch (tag.type.toUint32()) {
|
switch (tag.type.toUint32()) {
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include "DNACommon/MAPU.hpp"
|
#include "DNACommon/MAPU.hpp"
|
||||||
#include "DNACommon/PATH.hpp"
|
#include "DNACommon/PATH.hpp"
|
||||||
#include "DNACommon/TXTR.hpp"
|
#include "DNACommon/TXTR.hpp"
|
||||||
#include "DNACommon/URDEVersionInfo.hpp"
|
#include "DNACommon/MetaforceVersionInfo.hpp"
|
||||||
|
|
||||||
#include "hecl/ClientProcess.hpp"
|
#include "hecl/ClientProcess.hpp"
|
||||||
#include "hecl/Blender/Connection.hpp"
|
#include "hecl/Blender/Connection.hpp"
|
||||||
|
@ -25,7 +25,7 @@ namespace DataSpec {
|
||||||
|
|
||||||
using namespace std::literals;
|
using namespace std::literals;
|
||||||
|
|
||||||
static logvisor::Module Log("urde::SpecMP2");
|
static logvisor::Module Log("metaforce::SpecMP2");
|
||||||
extern hecl::Database::DataSpecEntry SpecEntMP2;
|
extern hecl::Database::DataSpecEntry SpecEntMP2;
|
||||||
extern hecl::Database::DataSpecEntry SpecEntMP2ORIG;
|
extern hecl::Database::DataSpecEntry SpecEntMP2ORIG;
|
||||||
|
|
||||||
|
@ -350,7 +350,7 @@ struct SpecMP2 : SpecBase {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
urde::SObjectTag buildTagFromPath(const hecl::ProjectPath& path) const override { return {}; }
|
metaforce::SObjectTag buildTagFromPath(const hecl::ProjectPath& path) const override { return {}; }
|
||||||
|
|
||||||
void cookMesh(const hecl::ProjectPath& out, const hecl::ProjectPath& in, BlendStream& ds, bool fast,
|
void cookMesh(const hecl::ProjectPath& out, const hecl::ProjectPath& in, BlendStream& ds, bool fast,
|
||||||
hecl::blender::Token& btok, FCookProgress progress) override {}
|
hecl::blender::Token& btok, FCookProgress progress) override {}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include "DataSpec/DNAMP3/MAPA.hpp"
|
#include "DataSpec/DNAMP3/MAPA.hpp"
|
||||||
#include "DataSpec/DNAMP2/STRG.hpp"
|
#include "DataSpec/DNAMP2/STRG.hpp"
|
||||||
#include "DataSpec/DNACommon/TXTR.hpp"
|
#include "DataSpec/DNACommon/TXTR.hpp"
|
||||||
#include "DataSpec/DNACommon/URDEVersionInfo.hpp"
|
#include "DataSpec/DNACommon/MetaforceVersionInfo.hpp"
|
||||||
|
|
||||||
#include "hecl/ClientProcess.hpp"
|
#include "hecl/ClientProcess.hpp"
|
||||||
#include "hecl/Blender/Connection.hpp"
|
#include "hecl/Blender/Connection.hpp"
|
||||||
|
@ -22,7 +22,7 @@ namespace DataSpec {
|
||||||
|
|
||||||
using namespace std::literals;
|
using namespace std::literals;
|
||||||
|
|
||||||
static logvisor::Module Log("urde::SpecMP3");
|
static logvisor::Module Log("metaforce::SpecMP3");
|
||||||
extern hecl::Database::DataSpecEntry SpecEntMP3;
|
extern hecl::Database::DataSpecEntry SpecEntMP3;
|
||||||
extern hecl::Database::DataSpecEntry SpecEntMP3ORIG;
|
extern hecl::Database::DataSpecEntry SpecEntMP3ORIG;
|
||||||
|
|
||||||
|
@ -516,7 +516,7 @@ struct SpecMP3 : SpecBase {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
urde::SObjectTag buildTagFromPath(const hecl::ProjectPath& path) const override { return {}; }
|
metaforce::SObjectTag buildTagFromPath(const hecl::ProjectPath& path) const override { return {}; }
|
||||||
|
|
||||||
void cookMesh(const hecl::ProjectPath& out, const hecl::ProjectPath& in, BlendStream& ds, bool fast,
|
void cookMesh(const hecl::ProjectPath& out, const hecl::ProjectPath& in, BlendStream& ds, bool fast,
|
||||||
hecl::blender::Token& btok, FCookProgress progress) override {}
|
hecl::blender::Token& btok, FCookProgress progress) override {}
|
||||||
|
|
|
@ -5,8 +5,8 @@ add_subdirectory(badging)
|
||||||
unset(URDE_PLAT_LIBS)
|
unset(URDE_PLAT_LIBS)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
configure_file(platforms/win/urde.rc.in "${CMAKE_CURRENT_SOURCE_DIR}/platforms/win/urde.rc" @ONLY)
|
configure_file(platforms/win/metaforce.rc.in "${CMAKE_CURRENT_SOURCE_DIR}/platforms/win/metaforce.rc" @ONLY)
|
||||||
set(PLAT_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/platforms/win/urde.rc" platforms/win/urde.manifest)
|
set(PLAT_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/platforms/win/metaforce.rc" platforms/win/metaforce.manifest)
|
||||||
if(WINDOWS_STORE)
|
if(WINDOWS_STORE)
|
||||||
set(UWP_ASSETS
|
set(UWP_ASSETS
|
||||||
platforms/win/Assets/LargeTile.scale-100.png
|
platforms/win/Assets/LargeTile.scale-100.png
|
||||||
|
@ -39,11 +39,11 @@ if(WIN32)
|
||||||
platforms/win/Assets/Square150x150Logo.scale-150.png
|
platforms/win/Assets/Square150x150Logo.scale-150.png
|
||||||
platforms/win/Assets/Square150x150Logo.scale-200.png
|
platforms/win/Assets/Square150x150Logo.scale-200.png
|
||||||
platforms/win/Assets/Square150x150Logo.scale-400.png
|
platforms/win/Assets/Square150x150Logo.scale-400.png
|
||||||
platforms/win/Assets/urde.scale-100.png
|
platforms/win/Assets/metaforce.scale-100.png
|
||||||
platforms/win/Assets/urde.scale-125.png
|
platforms/win/Assets/metaforce.scale-125.png
|
||||||
platforms/win/Assets/urde.scale-150.png
|
platforms/win/Assets/metaforce.scale-150.png
|
||||||
platforms/win/Assets/urde.scale-200.png
|
platforms/win/Assets/metaforce.scale-200.png
|
||||||
platforms/win/Assets/urde.scale-400.png
|
platforms/win/Assets/metaforce.scale-400.png
|
||||||
platforms/win/Assets/WideTile.scale-100.png
|
platforms/win/Assets/WideTile.scale-100.png
|
||||||
platforms/win/Assets/WideTile.scale-125.png
|
platforms/win/Assets/WideTile.scale-125.png
|
||||||
platforms/win/Assets/WideTile.scale-150.png
|
platforms/win/Assets/WideTile.scale-150.png
|
||||||
|
@ -84,8 +84,8 @@ target_include_directories(metaforce PUBLIC
|
||||||
${CMAKE_BINARY_DIR})
|
${CMAKE_BINARY_DIR})
|
||||||
|
|
||||||
target_link_libraries(metaforce
|
target_link_libraries(metaforce
|
||||||
UrdeIcons
|
MetaforceIcons
|
||||||
UrdeBadging
|
MetaforceBadging
|
||||||
RuntimeCommon
|
RuntimeCommon
|
||||||
amuse
|
amuse
|
||||||
RetroDataSpec
|
RetroDataSpec
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include "zeus/CVector3f.hpp"
|
#include "zeus/CVector3f.hpp"
|
||||||
#include "zeus/Math.hpp"
|
#include "zeus/Math.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
class Camera {
|
class Camera {
|
||||||
zeus::CFrustum m_frustum;
|
zeus::CFrustum m_frustum;
|
||||||
zeus::CProjection m_projection;
|
zeus::CProjection m_projection;
|
||||||
|
@ -22,4 +22,4 @@ public:
|
||||||
|
|
||||||
virtual void think() {}
|
virtual void think() {}
|
||||||
};
|
};
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "GameMode.hpp"
|
#include "GameMode.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
void GameMode::think() { ViewerSpace::think(); }
|
void GameMode::think() { ViewerSpace::think(); }
|
||||||
|
|
||||||
void GameMode::View::draw(boo::IGraphicsCommandQueue* gfxQ) {
|
void GameMode::View::draw(boo::IGraphicsCommandQueue* gfxQ) {
|
||||||
|
@ -8,4 +8,4 @@ void GameMode::View::draw(boo::IGraphicsCommandQueue* gfxQ) {
|
||||||
m_gMode.m_main->Draw();
|
m_gMode.m_main->Draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include "ViewManager.hpp"
|
#include "ViewManager.hpp"
|
||||||
#include "Runtime/IMain.hpp"
|
#include "Runtime/IMain.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
class GameMode : public ViewerSpace {
|
class GameMode : public ViewerSpace {
|
||||||
std::shared_ptr<IMain> m_main;
|
std::shared_ptr<IMain> m_main;
|
||||||
|
|
||||||
|
@ -51,4 +51,4 @@ public:
|
||||||
|
|
||||||
bool usesToolbar() const override { return m_state.showToolbar; }
|
bool usesToolbar() const override { return m_state.showToolbar; }
|
||||||
};
|
};
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#include "InformationCenter.hpp"
|
#include "InformationCenter.hpp"
|
||||||
|
|
||||||
namespace urde {}
|
namespace metaforce {}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include "Space.hpp"
|
#include "Space.hpp"
|
||||||
#include "ViewManager.hpp"
|
#include "ViewManager.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
class InformationCenter : public ViewerSpace {
|
class InformationCenter : public ViewerSpace {
|
||||||
struct State : Space::State {
|
struct State : Space::State {
|
||||||
AT_DECL_DNA_YAMLV
|
AT_DECL_DNA_YAMLV
|
||||||
|
@ -47,4 +47,4 @@ public:
|
||||||
|
|
||||||
bool usesToolbar() const override { return true; }
|
bool usesToolbar() const override { return true; }
|
||||||
};
|
};
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
#include "ModelViewer.hpp"
|
#include "ModelViewer.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
|
|
||||||
void ModelViewer::View::resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) {
|
void ModelViewer::View::resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) {
|
||||||
specter::View::resized(root, sub);
|
specter::View::resized(root, sub);
|
||||||
m_scissorRect = sub;
|
m_scissorRect = sub;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include "ViewManager.hpp"
|
#include "ViewManager.hpp"
|
||||||
#include "Camera.hpp"
|
#include "Camera.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
class ModelViewer : public ViewerSpace {
|
class ModelViewer : public ViewerSpace {
|
||||||
struct State : Space::State {
|
struct State : Space::State {
|
||||||
AT_DECL_DNA_YAMLV
|
AT_DECL_DNA_YAMLV
|
||||||
|
@ -17,7 +17,7 @@ class ModelViewer : public ViewerSpace {
|
||||||
} m_state;
|
} m_state;
|
||||||
|
|
||||||
const Space::State& spaceState() const override { return m_state; }
|
const Space::State& spaceState() const override { return m_state; }
|
||||||
std::unique_ptr<urde::CLineRenderer> m_lineRenderer;
|
std::unique_ptr<metaforce::CLineRenderer> m_lineRenderer;
|
||||||
struct View : specter::View {
|
struct View : specter::View {
|
||||||
ModelViewer& m_mv;
|
ModelViewer& m_mv;
|
||||||
boo::SWindowRect m_scissorRect;
|
boo::SWindowRect m_scissorRect;
|
||||||
|
@ -33,7 +33,7 @@ class ModelViewer : public ViewerSpace {
|
||||||
public:
|
public:
|
||||||
ModelViewer(ViewManager& vm, Space* parent) : ViewerSpace(vm, Class::ModelViewer, parent) {
|
ModelViewer(ViewManager& vm, Space* parent) : ViewerSpace(vm, Class::ModelViewer, parent) {
|
||||||
reloadState();
|
reloadState();
|
||||||
m_lineRenderer.reset(new urde::CLineRenderer(urde::CLineRenderer::EPrimitiveMode::LineStrip, 4, nullptr, true));
|
m_lineRenderer.reset(new metaforce::CLineRenderer(metaforce::CLineRenderer::EPrimitiveMode::LineStrip, 4, nullptr, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
ModelViewer(ViewManager& vm, Space* parent, const ModelViewer& other) : ModelViewer(vm, parent) {
|
ModelViewer(ViewManager& vm, Space* parent, const ModelViewer& other) : ModelViewer(vm, parent) {
|
||||||
|
@ -61,4 +61,4 @@ public:
|
||||||
bool usesToolbar() const override { return true; }
|
bool usesToolbar() const override { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#include "ParticleEditor.hpp"
|
#include "ParticleEditor.hpp"
|
||||||
|
|
||||||
namespace urde {}
|
namespace metaforce {}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include "Space.hpp"
|
#include "Space.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
|
|
||||||
class EffectEditor : public EditorSpace {
|
class EffectEditor : public EditorSpace {
|
||||||
struct State : Space::State {
|
struct State : Space::State {
|
||||||
|
@ -29,4 +29,4 @@ public:
|
||||||
bool usesToolbar() const override { return true; }
|
bool usesToolbar() const override { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include "hecl/Blender/Connection.hpp"
|
#include "hecl/Blender/Connection.hpp"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
static logvisor::Module Log("URDE::ProjectManager");
|
static logvisor::Module Log("URDE::ProjectManager");
|
||||||
ProjectManager* ProjectManager::g_SharedManager = nullptr;
|
ProjectManager* ProjectManager::g_SharedManager = nullptr;
|
||||||
|
|
||||||
|
@ -113,8 +113,8 @@ bool ProjectManager::openProject(hecl::SystemStringView path) {
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const hecl::ProjectPath urdeSpacesPath(*m_proj, _SYS_STR(".hecl/urde_spaces.yaml"));
|
const hecl::ProjectPath metaforceSpacesPath(*m_proj, _SYS_STR(".hecl/metaforce_spaces.yaml"));
|
||||||
athena::io::FileReader reader(urdeSpacesPath.getAbsolutePath());
|
athena::io::FileReader reader(metaforceSpacesPath.getAbsolutePath());
|
||||||
|
|
||||||
if (!reader.isOpen()) {
|
if (!reader.isOpen()) {
|
||||||
return makeProj(true);
|
return makeProj(true);
|
||||||
|
@ -126,7 +126,7 @@ bool ProjectManager::openProject(hecl::SystemStringView path) {
|
||||||
};
|
};
|
||||||
|
|
||||||
yaml_parser_set_input(r.getParser(), readHandler, &reader);
|
yaml_parser_set_input(r.getParser(), readHandler, &reader);
|
||||||
if (!r.ValidateClassType("UrdeSpacesState")) {
|
if (!r.ValidateClassType("MetaforceSpacesState")) {
|
||||||
return makeProj(true);
|
return makeProj(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ bool ProjectManager::saveProject() {
|
||||||
if (!m_proj)
|
if (!m_proj)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
hecl::ProjectPath oldSpacesPath(*m_proj, _SYS_STR(".hecl/~urde_spaces.yaml"));
|
hecl::ProjectPath oldSpacesPath(*m_proj, _SYS_STR(".hecl/~metaforce_spaces.yaml"));
|
||||||
athena::io::FileWriter writer(oldSpacesPath.getAbsolutePath());
|
athena::io::FileWriter writer(oldSpacesPath.getAbsolutePath());
|
||||||
if (!writer.isOpen())
|
if (!writer.isOpen())
|
||||||
return false;
|
return false;
|
||||||
|
@ -155,7 +155,7 @@ bool ProjectManager::saveProject() {
|
||||||
if (!w.finish(&writer))
|
if (!w.finish(&writer))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
hecl::ProjectPath newSpacesPath(*m_proj, _SYS_STR(".hecl/urde_spaces.yaml"));
|
hecl::ProjectPath newSpacesPath(*m_proj, _SYS_STR(".hecl/metaforce_spaces.yaml"));
|
||||||
|
|
||||||
hecl::Unlink(newSpacesPath.getAbsolutePath().data());
|
hecl::Unlink(newSpacesPath.getAbsolutePath().data());
|
||||||
hecl::Rename(oldSpacesPath.getAbsolutePath().data(), newSpacesPath.getAbsolutePath().data());
|
hecl::Rename(oldSpacesPath.getAbsolutePath().data(), newSpacesPath.getAbsolutePath().data());
|
||||||
|
@ -197,4 +197,4 @@ void ProjectManager::shutdown() {
|
||||||
hecl::blender::Connection::Shutdown();
|
hecl::blender::Connection::Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include "hecl/Runtime.hpp"
|
#include "hecl/Runtime.hpp"
|
||||||
#include "MP1/MP1.hpp"
|
#include "MP1/MP1.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
class ViewManager;
|
class ViewManager;
|
||||||
|
|
||||||
using ConfigReader = athena::io::YAMLDocReader;
|
using ConfigReader = athena::io::YAMLDocReader;
|
||||||
|
@ -55,4 +55,4 @@ public:
|
||||||
void shutdown();
|
void shutdown();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
#undef min
|
#undef min
|
||||||
#undef max
|
#undef max
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
static logvisor::Module Log("urde::ProjectResourceFactoryBase");
|
static logvisor::Module Log("metaforce::ProjectResourceFactoryBase");
|
||||||
|
|
||||||
void ProjectResourceFactoryBase::BeginBackgroundIndex(hecl::Database::Project& proj,
|
void ProjectResourceFactoryBase::BeginBackgroundIndex(hecl::Database::Project& proj,
|
||||||
const hecl::Database::DataSpecEntry& origSpec,
|
const hecl::Database::DataSpecEntry& origSpec,
|
||||||
|
@ -47,7 +47,7 @@ CFactoryFnReturn ProjectResourceFactoryBase::BuildSync(const SObjectTag& tag, co
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectResourceFactoryBase::AsyncTask::EnsurePath(const urde::SObjectTag& tag, const hecl::ProjectPath& path) {
|
void ProjectResourceFactoryBase::AsyncTask::EnsurePath(const metaforce::SObjectTag& tag, const hecl::ProjectPath& path) {
|
||||||
if (!m_workingPath) {
|
if (!m_workingPath) {
|
||||||
m_workingPath = path;
|
m_workingPath = path;
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ void ProjectResourceFactoryBase::AsyncTask::EnsurePath(const urde::SObjectTag& t
|
||||||
m_cookedPath = path.getCookedPath(*m_parent.m_origSpec);
|
m_cookedPath = path.getCookedPath(*m_parent.m_origSpec);
|
||||||
if (!m_cookedPath.isFile() || m_cookedPath.getModtime() < path.getModtime()) {
|
if (!m_cookedPath.isFile() || m_cookedPath.getModtime() < path.getModtime()) {
|
||||||
/* Last chance type validation */
|
/* Last chance type validation */
|
||||||
urde::SObjectTag verifyTag = m_parent.TagFromPath(path);
|
metaforce::SObjectTag verifyTag = m_parent.TagFromPath(path);
|
||||||
if (verifyTag.type != tag.type) {
|
if (verifyTag.type != tag.type) {
|
||||||
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("{}: expected type '{}', found '{}'")), path.getRelativePath(),
|
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("{}: expected type '{}', found '{}'")), path.getRelativePath(),
|
||||||
tag.type, verifyTag.type);
|
tag.type, verifyTag.type);
|
||||||
|
@ -181,7 +181,7 @@ bool ProjectResourceFactoryBase::PrepForReadSync(const SObjectTag& tag, const he
|
||||||
cooked = path.getCookedPath(*m_origSpec);
|
cooked = path.getCookedPath(*m_origSpec);
|
||||||
if (!cooked.isFile() || cooked.getModtime() < path.getModtime()) {
|
if (!cooked.isFile() || cooked.getModtime() < path.getModtime()) {
|
||||||
/* Last chance type validation */
|
/* Last chance type validation */
|
||||||
urde::SObjectTag verifyTag = TagFromPath(path);
|
metaforce::SObjectTag verifyTag = TagFromPath(path);
|
||||||
if (verifyTag.type != tag.type) {
|
if (verifyTag.type != tag.type) {
|
||||||
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("{}: expected type '{}', found '{}'")), path.getRelativePath(),
|
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("{}: expected type '{}', found '{}'")), path.getRelativePath(),
|
||||||
tag.type, verifyTag.type);
|
tag.type, verifyTag.type);
|
||||||
|
@ -211,8 +211,8 @@ bool ProjectResourceFactoryBase::PrepForReadSync(const SObjectTag& tag, const he
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<urde::IObj> ProjectResourceFactoryBase::Build(const urde::SObjectTag& tag,
|
std::unique_ptr<metaforce::IObj> ProjectResourceFactoryBase::Build(const metaforce::SObjectTag& tag,
|
||||||
const urde::CVParamTransfer& paramXfer,
|
const metaforce::CVParamTransfer& paramXfer,
|
||||||
CObjectReference* selfRef) {
|
CObjectReference* selfRef) {
|
||||||
if (!tag.id.IsValid())
|
if (!tag.id.IsValid())
|
||||||
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id on type '{}'"), tag.type);
|
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id on type '{}'"), tag.type);
|
||||||
|
@ -261,17 +261,17 @@ std::unique_ptr<urde::IObj> ProjectResourceFactoryBase::Build(const urde::SObjec
|
||||||
return BuildSync(tag, *resPath, paramXfer, selfRef);
|
return BuildSync(tag, *resPath, paramXfer, selfRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<AsyncTask> ProjectResourceFactoryBase::BuildAsyncInternal(const urde::SObjectTag& tag,
|
std::shared_ptr<AsyncTask> ProjectResourceFactoryBase::BuildAsyncInternal(const metaforce::SObjectTag& tag,
|
||||||
const urde::CVParamTransfer& paramXfer,
|
const metaforce::CVParamTransfer& paramXfer,
|
||||||
std::unique_ptr<urde::IObj>* objOut,
|
std::unique_ptr<metaforce::IObj>* objOut,
|
||||||
CObjectReference* selfRef) {
|
CObjectReference* selfRef) {
|
||||||
if (m_asyncLoadMap.find(tag) != m_asyncLoadMap.end())
|
if (m_asyncLoadMap.find(tag) != m_asyncLoadMap.end())
|
||||||
return {};
|
return {};
|
||||||
return _AddTask(std::make_unique<AsyncTask>(*this, tag, objOut, paramXfer, selfRef));
|
return _AddTask(std::make_unique<AsyncTask>(*this, tag, objOut, paramXfer, selfRef));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectResourceFactoryBase::BuildAsync(const urde::SObjectTag& tag, const urde::CVParamTransfer& paramXfer,
|
void ProjectResourceFactoryBase::BuildAsync(const metaforce::SObjectTag& tag, const metaforce::CVParamTransfer& paramXfer,
|
||||||
std::unique_ptr<urde::IObj>* objOut, CObjectReference* selfRef) {
|
std::unique_ptr<metaforce::IObj>* objOut, CObjectReference* selfRef) {
|
||||||
if (!tag.id.IsValid())
|
if (!tag.id.IsValid())
|
||||||
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id on type '{}'"), tag.type);
|
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id on type '{}'"), tag.type);
|
||||||
|
|
||||||
|
@ -295,27 +295,27 @@ u32 ProjectResourceFactoryBase::ResourceSize(const SObjectTag& tag) {
|
||||||
return fr->length();
|
return fr->length();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<urde::IDvdRequest> ProjectResourceFactoryBase::LoadResourceAsync(const urde::SObjectTag& tag,
|
std::shared_ptr<metaforce::IDvdRequest> ProjectResourceFactoryBase::LoadResourceAsync(const metaforce::SObjectTag& tag,
|
||||||
void* target) {
|
void* target) {
|
||||||
if (!tag.id.IsValid())
|
if (!tag.id.IsValid())
|
||||||
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
|
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
|
||||||
if (m_asyncLoadMap.find(tag) != m_asyncLoadMap.end())
|
if (m_asyncLoadMap.find(tag) != m_asyncLoadMap.end())
|
||||||
return {};
|
return {};
|
||||||
return std::static_pointer_cast<urde::IDvdRequest>(
|
return std::static_pointer_cast<metaforce::IDvdRequest>(
|
||||||
_AddTask(std::make_shared<AsyncTask>(*this, tag, reinterpret_cast<u8*>(target))));
|
_AddTask(std::make_shared<AsyncTask>(*this, tag, reinterpret_cast<u8*>(target))));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<urde::IDvdRequest> ProjectResourceFactoryBase::LoadResourcePartAsync(const urde::SObjectTag& tag,
|
std::shared_ptr<metaforce::IDvdRequest> ProjectResourceFactoryBase::LoadResourcePartAsync(const metaforce::SObjectTag& tag,
|
||||||
u32 off, u32 size, void* target) {
|
u32 off, u32 size, void* target) {
|
||||||
if (!tag.id.IsValid())
|
if (!tag.id.IsValid())
|
||||||
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
|
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
|
||||||
if (m_asyncLoadMap.find(tag) != m_asyncLoadMap.end())
|
if (m_asyncLoadMap.find(tag) != m_asyncLoadMap.end())
|
||||||
return {};
|
return {};
|
||||||
return std::static_pointer_cast<urde::IDvdRequest>(
|
return std::static_pointer_cast<metaforce::IDvdRequest>(
|
||||||
_AddTask(std::make_shared<AsyncTask>(*this, tag, reinterpret_cast<u8*>(target), size, off)));
|
_AddTask(std::make_shared<AsyncTask>(*this, tag, reinterpret_cast<u8*>(target), size, off)));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<u8[]> ProjectResourceFactoryBase::LoadResourceSync(const urde::SObjectTag& tag) {
|
std::unique_ptr<u8[]> ProjectResourceFactoryBase::LoadResourceSync(const metaforce::SObjectTag& tag) {
|
||||||
if (!tag.id.IsValid())
|
if (!tag.id.IsValid())
|
||||||
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
|
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
|
||||||
|
|
||||||
|
@ -332,7 +332,7 @@ std::unique_ptr<u8[]> ProjectResourceFactoryBase::LoadResourceSync(const urde::S
|
||||||
return fr->readUBytes(fr->length());
|
return fr->readUBytes(fr->length());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<u8[]> ProjectResourceFactoryBase::LoadNewResourcePartSync(const urde::SObjectTag& tag, u32 off,
|
std::unique_ptr<u8[]> ProjectResourceFactoryBase::LoadNewResourcePartSync(const metaforce::SObjectTag& tag, u32 off,
|
||||||
u32 size) {
|
u32 size) {
|
||||||
if (!tag.id.IsValid())
|
if (!tag.id.IsValid())
|
||||||
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
|
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
|
||||||
|
@ -352,7 +352,7 @@ std::unique_ptr<u8[]> ProjectResourceFactoryBase::LoadNewResourcePartSync(const
|
||||||
return fr->readUBytes(sz);
|
return fr->readUBytes(sz);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<AsyncTask> ProjectResourceFactoryBase::CookResourceAsync(const urde::SObjectTag& tag) {
|
std::shared_ptr<AsyncTask> ProjectResourceFactoryBase::CookResourceAsync(const metaforce::SObjectTag& tag) {
|
||||||
if (!tag.id.IsValid())
|
if (!tag.id.IsValid())
|
||||||
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
|
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
|
||||||
if (m_asyncLoadMap.find(tag) != m_asyncLoadMap.end())
|
if (m_asyncLoadMap.find(tag) != m_asyncLoadMap.end())
|
||||||
|
@ -360,9 +360,9 @@ std::shared_ptr<AsyncTask> ProjectResourceFactoryBase::CookResourceAsync(const u
|
||||||
return _AddTask(std::make_shared<AsyncTask>(*this, tag));
|
return _AddTask(std::make_shared<AsyncTask>(*this, tag));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectResourceFactoryBase::CancelBuild(const urde::SObjectTag& tag) { _RemoveTask(tag); }
|
void ProjectResourceFactoryBase::CancelBuild(const metaforce::SObjectTag& tag) { _RemoveTask(tag); }
|
||||||
|
|
||||||
bool ProjectResourceFactoryBase::CanBuild(const urde::SObjectTag& tag) {
|
bool ProjectResourceFactoryBase::CanBuild(const metaforce::SObjectTag& tag) {
|
||||||
if (!tag.id.IsValid())
|
if (!tag.id.IsValid())
|
||||||
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
|
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
|
||||||
|
|
||||||
|
@ -376,7 +376,7 @@ bool ProjectResourceFactoryBase::CanBuild(const urde::SObjectTag& tag) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const urde::SObjectTag* ProjectResourceFactoryBase::GetResourceIdByName(std::string_view name) const {
|
const metaforce::SObjectTag* ProjectResourceFactoryBase::GetResourceIdByName(std::string_view name) const {
|
||||||
return static_cast<DataSpec::SpecBase&>(*m_cookSpec).getResourceIdByName(name);
|
return static_cast<DataSpec::SpecBase&>(*m_cookSpec).getResourceIdByName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -464,4 +464,4 @@ void ProjectResourceFactoryBase::AsyncIdle() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -16,14 +16,14 @@
|
||||||
#include <hecl/ClientProcess.hpp>
|
#include <hecl/ClientProcess.hpp>
|
||||||
#include <hecl/Database.hpp>
|
#include <hecl/Database.hpp>
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
|
|
||||||
class ProjectResourceFactoryBase : public IFactory {
|
class ProjectResourceFactoryBase : public IFactory {
|
||||||
friend class ProjectResourcePool;
|
friend class ProjectResourcePool;
|
||||||
hecl::ClientProcess& m_clientProc;
|
hecl::ClientProcess& m_clientProc;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
struct AsyncTask : urde::IDvdRequest {
|
struct AsyncTask : metaforce::IDvdRequest {
|
||||||
ProjectResourceFactoryBase& m_parent;
|
ProjectResourceFactoryBase& m_parent;
|
||||||
|
|
||||||
SObjectTag x0_tag;
|
SObjectTag x0_tag;
|
||||||
|
@ -63,7 +63,7 @@ public:
|
||||||
/* Cook only */
|
/* Cook only */
|
||||||
AsyncTask(ProjectResourceFactoryBase& parent, const SObjectTag& tag) : m_parent(parent), x0_tag(tag) {}
|
AsyncTask(ProjectResourceFactoryBase& parent, const SObjectTag& tag) : m_parent(parent), x0_tag(tag) {}
|
||||||
|
|
||||||
void EnsurePath(const urde::SObjectTag& tag, const hecl::ProjectPath& path);
|
void EnsurePath(const metaforce::SObjectTag& tag, const hecl::ProjectPath& path);
|
||||||
void CookComplete();
|
void CookComplete();
|
||||||
bool AsyncPump();
|
bool AsyncPump();
|
||||||
void WaitUntilComplete() override;
|
void WaitUntilComplete() override;
|
||||||
|
@ -78,7 +78,7 @@ protected:
|
||||||
const hecl::Database::DataSpecEntry* m_pcSpec = nullptr;
|
const hecl::Database::DataSpecEntry* m_pcSpec = nullptr;
|
||||||
/* Used to resolve cooked paths */
|
/* Used to resolve cooked paths */
|
||||||
std::unique_ptr<hecl::Database::IDataSpec> m_cookSpec;
|
std::unique_ptr<hecl::Database::IDataSpec> m_cookSpec;
|
||||||
urde::CFactoryMgr m_factoryMgr;
|
metaforce::CFactoryMgr m_factoryMgr;
|
||||||
|
|
||||||
std::list<std::shared_ptr<AsyncTask>> m_asyncLoadList;
|
std::list<std::shared_ptr<AsyncTask>> m_asyncLoadList;
|
||||||
std::unordered_map<SObjectTag, std::list<std::shared_ptr<AsyncTask>>::iterator> m_asyncLoadMap;
|
std::unordered_map<SObjectTag, std::list<std::shared_ptr<AsyncTask>>::iterator> m_asyncLoadMap;
|
||||||
|
@ -98,7 +98,7 @@ protected:
|
||||||
bool PrepForReadSync(const SObjectTag& tag, const hecl::ProjectPath& path,
|
bool PrepForReadSync(const SObjectTag& tag, const hecl::ProjectPath& path,
|
||||||
std::optional<athena::io::FileReader>& fr);
|
std::optional<athena::io::FileReader>& fr);
|
||||||
|
|
||||||
bool WaitForTagReady(const urde::SObjectTag& tag, const hecl::ProjectPath*& pathOut) {
|
bool WaitForTagReady(const metaforce::SObjectTag& tag, const hecl::ProjectPath*& pathOut) {
|
||||||
return static_cast<DataSpec::SpecBase&>(*m_cookSpec).waitForTagReady(tag, pathOut);
|
return static_cast<DataSpec::SpecBase&>(*m_cookSpec).waitForTagReady(tag, pathOut);
|
||||||
}
|
}
|
||||||
SObjectTag TagFromPath(const hecl::ProjectPath& path) const {
|
SObjectTag TagFromPath(const hecl::ProjectPath& path) const {
|
||||||
|
@ -120,18 +120,18 @@ protected:
|
||||||
bool SyncCook(const hecl::ProjectPath& working);
|
bool SyncCook(const hecl::ProjectPath& working);
|
||||||
CFactoryFnReturn BuildSync(const SObjectTag& tag, const hecl::ProjectPath& path, const CVParamTransfer& paramXfer,
|
CFactoryFnReturn BuildSync(const SObjectTag& tag, const hecl::ProjectPath& path, const CVParamTransfer& paramXfer,
|
||||||
CObjectReference* selfRef);
|
CObjectReference* selfRef);
|
||||||
std::shared_ptr<AsyncTask> BuildAsyncInternal(const urde::SObjectTag&, const urde::CVParamTransfer&,
|
std::shared_ptr<AsyncTask> BuildAsyncInternal(const metaforce::SObjectTag&, const metaforce::CVParamTransfer&,
|
||||||
std::unique_ptr<urde::IObj>*, CObjectReference* selfRef);
|
std::unique_ptr<metaforce::IObj>*, CObjectReference* selfRef);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ProjectResourceFactoryBase(hecl::ClientProcess& clientProc) : m_clientProc(clientProc) {}
|
ProjectResourceFactoryBase(hecl::ClientProcess& clientProc) : m_clientProc(clientProc) {}
|
||||||
std::unique_ptr<urde::IObj> Build(const urde::SObjectTag&, const urde::CVParamTransfer&,
|
std::unique_ptr<metaforce::IObj> Build(const metaforce::SObjectTag&, const metaforce::CVParamTransfer&,
|
||||||
CObjectReference* selfRef) override;
|
CObjectReference* selfRef) override;
|
||||||
void BuildAsync(const urde::SObjectTag&, const urde::CVParamTransfer&, std::unique_ptr<urde::IObj>*,
|
void BuildAsync(const metaforce::SObjectTag&, const metaforce::CVParamTransfer&, std::unique_ptr<metaforce::IObj>*,
|
||||||
CObjectReference* selfRef) override;
|
CObjectReference* selfRef) override;
|
||||||
void CancelBuild(const urde::SObjectTag&) override;
|
void CancelBuild(const metaforce::SObjectTag&) override;
|
||||||
bool CanBuild(const urde::SObjectTag&) override;
|
bool CanBuild(const metaforce::SObjectTag&) override;
|
||||||
const urde::SObjectTag* GetResourceIdByName(std::string_view) const override;
|
const metaforce::SObjectTag* GetResourceIdByName(std::string_view) const override;
|
||||||
FourCC GetResourceTypeById(CAssetId id) const override;
|
FourCC GetResourceTypeById(CAssetId id) const override;
|
||||||
hecl::ProjectPath GetCookedPath(const hecl::ProjectPath& working, bool pcTarget) const {
|
hecl::ProjectPath GetCookedPath(const hecl::ProjectPath& working, bool pcTarget) const {
|
||||||
return static_cast<DataSpec::SpecBase&>(*m_cookSpec).getCookedPath(working, pcTarget);
|
return static_cast<DataSpec::SpecBase&>(*m_cookSpec).getCookedPath(working, pcTarget);
|
||||||
|
@ -141,13 +141,13 @@ public:
|
||||||
void EnumerateNamedResources(const std::function<bool(std::string_view, const SObjectTag&)>& lambda) const override;
|
void EnumerateNamedResources(const std::function<bool(std::string_view, const SObjectTag&)>& lambda) const override;
|
||||||
|
|
||||||
u32 ResourceSize(const SObjectTag& tag) override;
|
u32 ResourceSize(const SObjectTag& tag) override;
|
||||||
std::shared_ptr<urde::IDvdRequest> LoadResourceAsync(const urde::SObjectTag& tag, void* target) override;
|
std::shared_ptr<metaforce::IDvdRequest> LoadResourceAsync(const metaforce::SObjectTag& tag, void* target) override;
|
||||||
std::shared_ptr<urde::IDvdRequest> LoadResourcePartAsync(const urde::SObjectTag& tag, u32 off, u32 size,
|
std::shared_ptr<metaforce::IDvdRequest> LoadResourcePartAsync(const metaforce::SObjectTag& tag, u32 off, u32 size,
|
||||||
void* target) override;
|
void* target) override;
|
||||||
std::unique_ptr<u8[]> LoadResourceSync(const urde::SObjectTag& tag) override;
|
std::unique_ptr<u8[]> LoadResourceSync(const metaforce::SObjectTag& tag) override;
|
||||||
std::unique_ptr<u8[]> LoadNewResourcePartSync(const urde::SObjectTag& tag, u32 off, u32 size) override;
|
std::unique_ptr<u8[]> LoadNewResourcePartSync(const metaforce::SObjectTag& tag, u32 off, u32 size) override;
|
||||||
|
|
||||||
std::shared_ptr<AsyncTask> CookResourceAsync(const urde::SObjectTag& tag);
|
std::shared_ptr<AsyncTask> CookResourceAsync(const metaforce::SObjectTag& tag);
|
||||||
|
|
||||||
template <typename ItType>
|
template <typename ItType>
|
||||||
bool AsyncPumpTask(ItType& it);
|
bool AsyncPumpTask(ItType& it);
|
||||||
|
@ -160,4 +160,4 @@ public:
|
||||||
~ProjectResourceFactoryBase() override { Shutdown(); }
|
~ProjectResourceFactoryBase() override { Shutdown(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -43,7 +43,7 @@ extern hecl::Database::DataSpecEntry SpecEntMP1;
|
||||||
extern hecl::Database::DataSpecEntry SpecEntMP1PC;
|
extern hecl::Database::DataSpecEntry SpecEntMP1PC;
|
||||||
} // namespace DataSpec
|
} // namespace DataSpec
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
|
|
||||||
ProjectResourceFactoryMP1::ProjectResourceFactoryMP1(hecl::ClientProcess& clientProc)
|
ProjectResourceFactoryMP1::ProjectResourceFactoryMP1(hecl::ClientProcess& clientProc)
|
||||||
: ProjectResourceFactoryBase(clientProc) {
|
: ProjectResourceFactoryBase(clientProc) {
|
||||||
|
@ -81,4 +81,4 @@ void ProjectResourceFactoryMP1::IndexMP1Resources(hecl::Database::Project& proj,
|
||||||
BeginBackgroundIndex(proj, DataSpec::SpecEntMP1, DataSpec::SpecEntMP1PC);
|
BeginBackgroundIndex(proj, DataSpec::SpecEntMP1, DataSpec::SpecEntMP1PC);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include "Editor/ProjectResourceFactoryBase.hpp"
|
#include "Editor/ProjectResourceFactoryBase.hpp"
|
||||||
#include "Runtime/CToken.hpp"
|
#include "Runtime/CToken.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
class MP1OriginalIDs;
|
class MP1OriginalIDs;
|
||||||
class CSimplePool;
|
class CSimplePool;
|
||||||
|
|
||||||
|
@ -13,4 +13,4 @@ public:
|
||||||
void IndexMP1Resources(hecl::Database::Project& proj, CSimplePool& sp);
|
void IndexMP1Resources(hecl::Database::Project& proj, CSimplePool& sp);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "Resource.hpp"
|
#include "Resource.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
|
|
||||||
Space::Class Resource::DeduceDefaultSpaceClass(const hecl::ProjectPath& path) {
|
Space::Class Resource::DeduceDefaultSpaceClass(const hecl::ProjectPath& path) {
|
||||||
athena::io::FileReader r(path.getAbsolutePath(), 32 * 1024, false);
|
athena::io::FileReader r(path.getAbsolutePath(), 32 * 1024, false);
|
||||||
|
@ -9,4 +9,4 @@ Space::Class Resource::DeduceDefaultSpaceClass(const hecl::ProjectPath& path) {
|
||||||
return Space::Class::None;
|
return Space::Class::None;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include "hecl/Database.hpp"
|
#include "hecl/Database.hpp"
|
||||||
#include "Space.hpp"
|
#include "Space.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
|
|
||||||
/** Combines a ProjectPath with actively used Space references
|
/** Combines a ProjectPath with actively used Space references
|
||||||
*
|
*
|
||||||
|
@ -43,4 +43,4 @@ private:
|
||||||
std::unique_ptr<Node> m_rootNode;
|
std::unique_ptr<Node> m_rootNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "ResourceBrowser.hpp"
|
#include "ResourceBrowser.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
#define BROWSER_MARGIN 8
|
#define BROWSER_MARGIN 8
|
||||||
|
|
||||||
bool ResourceBrowser::navigateToPath(const hecl::ProjectPath& pathIn) {
|
bool ResourceBrowser::navigateToPath(const hecl::ProjectPath& pathIn) {
|
||||||
|
@ -67,4 +67,4 @@ void ResourceBrowser::View::resized(const boo::SWindowRect& root, const boo::SWi
|
||||||
}
|
}
|
||||||
void ResourceBrowser::View::draw(boo::IGraphicsCommandQueue* gfxQ) { m_resListing.m_view->draw(gfxQ); }
|
void ResourceBrowser::View::draw(boo::IGraphicsCommandQueue* gfxQ) { m_resListing.m_view->draw(gfxQ); }
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include "specter/PathButtons.hpp"
|
#include "specter/PathButtons.hpp"
|
||||||
#include "specter/Table.hpp"
|
#include "specter/Table.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
|
|
||||||
class ResourceBrowser : public Space, public specter::IPathButtonsBinding {
|
class ResourceBrowser : public Space, public specter::IPathButtonsBinding {
|
||||||
struct State : Space::State {
|
struct State : Space::State {
|
||||||
|
@ -202,4 +202,4 @@ public:
|
||||||
unsigned toolbarUnits() const override { return 2; }
|
unsigned toolbarUnits() const override { return 2; }
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include "icons/icons.hpp"
|
#include "icons/icons.hpp"
|
||||||
#include "specter/Menu.hpp"
|
#include "specter/Menu.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
static logvisor::Module Log("URDE::Space");
|
static logvisor::Module Log("URDE::Space");
|
||||||
|
|
||||||
Space::Space(ViewManager& vm, Class cls, Space* parent)
|
Space::Space(ViewManager& vm, Class cls, Space* parent)
|
||||||
|
@ -259,4 +259,4 @@ void Space::SpaceMenuNode::SubNode::activated(const boo::SWindowCoord& coord) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -16,7 +16,7 @@ class ViewResources;
|
||||||
class Toolbar;
|
class Toolbar;
|
||||||
struct Icon;
|
struct Icon;
|
||||||
} // namespace specter
|
} // namespace specter
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
class ViewManager;
|
class ViewManager;
|
||||||
class RootSpace;
|
class RootSpace;
|
||||||
class SplitSpace;
|
class SplitSpace;
|
||||||
|
@ -374,4 +374,4 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#include "badging/Badging.hpp"
|
#include "badging/Badging.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
|
|
||||||
#define SPLASH_WIDTH 555
|
#define SPLASH_WIDTH 555
|
||||||
#define SPLASH_HEIGHT 300
|
#define SPLASH_HEIGHT 300
|
||||||
|
@ -268,4 +268,4 @@ void SplashScreen::draw(boo::IGraphicsCommandQueue* gfxQ) {
|
||||||
m_fileBrowser.m_view->draw(gfxQ);
|
m_fileBrowser.m_view->draw(gfxQ);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
#include "ViewManager.hpp"
|
#include "ViewManager.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
static logvisor::Module Log("specter::SplashScreen");
|
static logvisor::Module Log("specter::SplashScreen");
|
||||||
|
|
||||||
class SplashScreen : public specter::ModalWindow {
|
class SplashScreen : public specter::ModalWindow {
|
||||||
|
@ -161,4 +161,4 @@ public:
|
||||||
void draw(boo::IGraphicsCommandQueue* gfxQ) override;
|
void draw(boo::IGraphicsCommandQueue* gfxQ) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -23,7 +23,7 @@ using YAMLNode = athena::io::YAMLNode;
|
||||||
|
|
||||||
extern hecl::SystemString ExeDir;
|
extern hecl::SystemString ExeDir;
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
|
|
||||||
void ViewManager::InitMP1(MP1::CMain& main) {
|
void ViewManager::InitMP1(MP1::CMain& main) {
|
||||||
main.Init(m_fileStoreManager, &m_cvarManager, m_mainWindow.get(), m_voiceEngine.get(), *m_amuseAllocWrapper);
|
main.Init(m_fileStoreManager, &m_cvarManager, m_mainWindow.get(), m_voiceEngine.get(), *m_amuseAllocWrapper);
|
||||||
|
@ -39,7 +39,7 @@ void ViewManager::InitMP1(MP1::CMain& main) {
|
||||||
|
|
||||||
void ViewManager::TestGameView::resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) {
|
void ViewManager::TestGameView::resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) {
|
||||||
specter::View::resized(root, sub);
|
specter::View::resized(root, sub);
|
||||||
urde::CGraphics::SetViewportResolution({sub.size[0], sub.size[1]});
|
metaforce::CGraphics::SetViewportResolution({sub.size[0], sub.size[1]});
|
||||||
if (m_debugText) {
|
if (m_debugText) {
|
||||||
boo::SWindowRect newSub = sub;
|
boo::SWindowRect newSub = sub;
|
||||||
newSub.location[1] = 5 * m_vm.m_viewResources.pixelFactor();
|
newSub.location[1] = 5 * m_vm.m_viewResources.pixelFactor();
|
||||||
|
@ -68,7 +68,7 @@ void ViewManager::TestGameView::think() {
|
||||||
overlayText += fmt::format(FMT_STRING("Frame: {}\n"), g_StateManager->GetUpdateFrameIndex());
|
overlayText += fmt::format(FMT_STRING("Frame: {}\n"), g_StateManager->GetUpdateFrameIndex());
|
||||||
|
|
||||||
if (m_vm.m_cvarCommons.m_debugOverlayShowFramerate->toBoolean())
|
if (m_vm.m_cvarCommons.m_debugOverlayShowFramerate->toBoolean())
|
||||||
overlayText += fmt::format(FMT_STRING("FPS: {}\n"), urde::CGraphics::GetFPS());
|
overlayText += fmt::format(FMT_STRING("FPS: {}\n"), metaforce::CGraphics::GetFPS());
|
||||||
|
|
||||||
if (m_vm.m_cvarCommons.m_debugOverlayShowInGameTime->toBoolean()) {
|
if (m_vm.m_cvarCommons.m_debugOverlayShowInGameTime->toBoolean()) {
|
||||||
double igt = g_GameState->GetTotalPlayTime();
|
double igt = g_GameState->GetTotalPlayTime();
|
||||||
|
@ -113,12 +113,12 @@ void ViewManager::TestGameView::think() {
|
||||||
if (m_vm.m_cvarCommons.m_debugOverlayWorldInfo->toBoolean()) {
|
if (m_vm.m_cvarCommons.m_debugOverlayWorldInfo->toBoolean()) {
|
||||||
TLockedToken<CStringTable> tbl =
|
TLockedToken<CStringTable> tbl =
|
||||||
g_SimplePool->GetObj({FOURCC('STRG'), g_StateManager->GetWorld()->IGetStringTableAssetId()});
|
g_SimplePool->GetObj({FOURCC('STRG'), g_StateManager->GetWorld()->IGetStringTableAssetId()});
|
||||||
const urde::TAreaId aId = g_GameState->CurrentWorldState().GetCurrentAreaId();
|
const metaforce::TAreaId aId = g_GameState->CurrentWorldState().GetCurrentAreaId();
|
||||||
overlayText += fmt::format(FMT_STRING("World: 0x{}{}, Area: {}\n"), g_GameState->CurrentWorldAssetId(),
|
overlayText += fmt::format(FMT_STRING("World: 0x{}{}, Area: {}\n"), g_GameState->CurrentWorldAssetId(),
|
||||||
(tbl.IsLoaded() ? (" " + hecl::Char16ToUTF8(tbl->GetString(0))).c_str() : ""), aId);
|
(tbl.IsLoaded() ? (" " + hecl::Char16ToUTF8(tbl->GetString(0))).c_str() : ""), aId);
|
||||||
}
|
}
|
||||||
|
|
||||||
const urde::TAreaId aId = g_GameState->CurrentWorldState().GetCurrentAreaId();
|
const metaforce::TAreaId aId = g_GameState->CurrentWorldState().GetCurrentAreaId();
|
||||||
if (m_vm.m_cvarCommons.m_debugOverlayAreaInfo->toBoolean() && g_StateManager->GetWorld() &&
|
if (m_vm.m_cvarCommons.m_debugOverlayAreaInfo->toBoolean() && g_StateManager->GetWorld() &&
|
||||||
g_StateManager->GetWorld()->DoesAreaExist(aId)) {
|
g_StateManager->GetWorld()->DoesAreaExist(aId)) {
|
||||||
const auto& layerStates = g_GameState->CurrentWorldState().GetLayerState();
|
const auto& layerStates = g_GameState->CurrentWorldState().GetLayerState();
|
||||||
|
@ -139,7 +139,7 @@ void ViewManager::TestGameView::think() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_vm.m_cvarCommons.m_debugOverlayShowRandomStats->toBoolean()) {
|
if (m_vm.m_cvarCommons.m_debugOverlayShowRandomStats->toBoolean()) {
|
||||||
overlayText += fmt::format(FMT_STRING("CRandom16::Next calls: {}\n"), urde::CRandom16::GetNumNextCalls());
|
overlayText += fmt::format(FMT_STRING("CRandom16::Next calls: {}\n"), metaforce::CRandom16::GetNumNextCalls());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_vm.m_cvarCommons.m_debugOverlayShowResourceStats->toBoolean())
|
if (m_vm.m_cvarCommons.m_debugOverlayShowResourceStats->toBoolean())
|
||||||
|
@ -420,4 +420,4 @@ void ViewManager::stop() {
|
||||||
m_fontCache.destroyAtlases();
|
m_fontCache.destroyAtlases();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -26,7 +26,7 @@ namespace hecl {
|
||||||
class PipelineConverterBase;
|
class PipelineConverterBase;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
class SplashScreen;
|
class SplashScreen;
|
||||||
|
|
||||||
class ViewManager final : public specter::IViewManager {
|
class ViewManager final : public specter::IViewManager {
|
||||||
|
@ -196,4 +196,4 @@ public:
|
||||||
void deferOpenProject(const hecl::SystemString& path) { m_deferedProject = path; }
|
void deferOpenProject(const hecl::SystemString& path) { m_deferedProject = path; }
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
extern "C" uint8_t URDE_BADGE[];
|
extern "C" uint8_t URDE_BADGE[];
|
||||||
extern "C" size_t URDE_BADGE_SZ;
|
extern "C" size_t URDE_BADGE_SZ;
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
static logvisor::Module Log("URDE::badging");
|
static logvisor::Module Log("URDE::badging");
|
||||||
static specter::Icon g_BadgeIcon;
|
static specter::Icon g_BadgeIcon;
|
||||||
|
|
||||||
|
@ -42,4 +42,4 @@ void DestroyBadging() { g_BadgeIcon.m_tex.reset(); }
|
||||||
|
|
||||||
specter::Icon& GetBadge() { return g_BadgeIcon; }
|
specter::Icon& GetBadge() { return g_BadgeIcon; }
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
|
|
||||||
#include "specter/ViewResources.hpp"
|
#include "specter/ViewResources.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
void InitializeBadging(specter::ViewResources& viewRes);
|
void InitializeBadging(specter::ViewResources& viewRes);
|
||||||
void DestroyBadging();
|
void DestroyBadging();
|
||||||
|
|
||||||
specter::Icon& GetBadge();
|
specter::Icon& GetBadge();
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
||||||
#ifndef BADGE_PHRASE
|
#ifndef BADGE_PHRASE
|
||||||
#define BADGE_PHRASE "Prototype"
|
#define BADGE_PHRASE "Prototype"
|
||||||
|
|
|
@ -13,22 +13,22 @@ target_include_directories(packbadge PRIVATE ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_D
|
||||||
##################
|
##################
|
||||||
|
|
||||||
# Add all targets to the build-tree export set
|
# Add all targets to the build-tree export set
|
||||||
export(TARGETS packbadge FILE "${CMAKE_CURRENT_BINARY_DIR}/urde-packbadgeTargets.cmake")
|
export(TARGETS packbadge FILE "${CMAKE_CURRENT_BINARY_DIR}/metaforce-packbadgeTargets.cmake")
|
||||||
|
|
||||||
# Export the package for use from the build-tree
|
# Export the package for use from the build-tree
|
||||||
# (this registers the build-tree with a global CMake-registry)
|
# (this registers the build-tree with a global CMake-registry)
|
||||||
export(PACKAGE urde-packbadge)
|
export(PACKAGE metaforce-packbadge)
|
||||||
|
|
||||||
# Create the atdnaConfig.cmake
|
# Create the atdnaConfig.cmake
|
||||||
# ... for the build tree
|
# ... for the build tree
|
||||||
configure_file(urde-packbadgeConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/urde-packbadgeConfig.cmake" @ONLY)
|
configure_file(metaforce-packbadgeConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/metaforce-packbadgeConfig.cmake" @ONLY)
|
||||||
# ... for the install tree
|
# ... for the install tree
|
||||||
configure_file(urde-packbadgeConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/urde-packbadgeConfig.cmake" @ONLY)
|
configure_file(metaforce-packbadgeConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/metaforce-packbadgeConfig.cmake" @ONLY)
|
||||||
# ... for both
|
# ... for both
|
||||||
configure_file(urde-packbadgeConfigVersion.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/urde-packbadgeConfigVersion.cmake" @ONLY)
|
configure_file(metaforce-packbadgeConfigVersion.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/metaforce-packbadgeConfigVersion.cmake" @ONLY)
|
||||||
|
|
||||||
else()
|
else()
|
||||||
find_package(urde-packbadge REQUIRED)
|
find_package(metaforce-packbadge REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_custom_command(OUTPUT badge.bin COMMAND $<TARGET_FILE:packbadge>
|
add_custom_command(OUTPUT badge.bin COMMAND $<TARGET_FILE:packbadge>
|
||||||
|
@ -37,7 +37,7 @@ add_custom_command(OUTPUT badge.bin COMMAND $<TARGET_FILE:packbadge>
|
||||||
MAIN_DEPENDENCY badge.png COMMENT "Generating badge.bin")
|
MAIN_DEPENDENCY badge.png COMMENT "Generating badge.bin")
|
||||||
|
|
||||||
bintoc(badge.cpp ${CMAKE_CURRENT_BINARY_DIR}/badge.bin URDE_BADGE)
|
bintoc(badge.cpp ${CMAKE_CURRENT_BINARY_DIR}/badge.bin URDE_BADGE)
|
||||||
add_library(UrdeBadging
|
add_library(MetaforceBadging
|
||||||
badge.cpp badge.bin
|
badge.cpp badge.bin
|
||||||
Badging.hpp Badging.cpp)
|
Badging.hpp Badging.cpp)
|
||||||
target_link_libraries(UrdeBadging PUBLIC specter)
|
target_link_libraries(MetaforceBadging PUBLIC specter)
|
||||||
|
|
|
@ -5,5 +5,5 @@ get_filename_component(PACKBADGE_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||||
|
|
||||||
# Our library dependencies (contains definitions for IMPORTED targets)
|
# Our library dependencies (contains definitions for IMPORTED targets)
|
||||||
if(NOT TARGET packbadge AND NOT packbadge_BINARY_DIR)
|
if(NOT TARGET packbadge AND NOT packbadge_BINARY_DIR)
|
||||||
include("${PACKBADGE_CMAKE_DIR}/urde-packbadgeTargets.cmake")
|
include("${PACKBADGE_CMAKE_DIR}/metaforce-packbadgeTargets.cmake")
|
||||||
endif()
|
endif()
|
|
@ -12,22 +12,22 @@ target_include_directories(packicons PRIVATE ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_D
|
||||||
##################
|
##################
|
||||||
|
|
||||||
# Add all targets to the build-tree export set
|
# Add all targets to the build-tree export set
|
||||||
export(TARGETS packicons FILE "${CMAKE_CURRENT_BINARY_DIR}/urde-packiconsTargets.cmake")
|
export(TARGETS packicons FILE "${CMAKE_CURRENT_BINARY_DIR}/metaforce-packiconsTargets.cmake")
|
||||||
|
|
||||||
# Export the package for use from the build-tree
|
# Export the package for use from the build-tree
|
||||||
# (this registers the build-tree with a global CMake-registry)
|
# (this registers the build-tree with a global CMake-registry)
|
||||||
export(PACKAGE urde-packicons)
|
export(PACKAGE metaforce-packicons)
|
||||||
|
|
||||||
# Create the atdnaConfig.cmake
|
# Create the atdnaConfig.cmake
|
||||||
# ... for the build tree
|
# ... for the build tree
|
||||||
configure_file(urde-packiconsConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/urde-packiconsConfig.cmake" @ONLY)
|
configure_file(metaforce-packiconsConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/metaforce-packiconsConfig.cmake" @ONLY)
|
||||||
# ... for the install tree
|
# ... for the install tree
|
||||||
configure_file(urde-packiconsConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/urde-packiconsConfig.cmake" @ONLY)
|
configure_file(metaforce-packiconsConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/metaforce-packiconsConfig.cmake" @ONLY)
|
||||||
# ... for both
|
# ... for both
|
||||||
configure_file(urde-packiconsConfigVersion.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/urde-packiconsConfigVersion.cmake" @ONLY)
|
configure_file(metaforce-packiconsConfigVersion.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/metaforce-packiconsConfigVersion.cmake" @ONLY)
|
||||||
|
|
||||||
else()
|
else()
|
||||||
find_package(urde-packicons REQUIRED)
|
find_package(metaforce-packicons REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
unset(INKSCAPE_BIN CACHE)
|
unset(INKSCAPE_BIN CACHE)
|
||||||
|
@ -59,5 +59,5 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
bintoc(icons_dat.cpp ${CMAKE_CURRENT_BINARY_DIR}/icons.bin URDE_ICONS)
|
bintoc(icons_dat.cpp ${CMAKE_CURRENT_BINARY_DIR}/icons.bin URDE_ICONS)
|
||||||
add_library(UrdeIcons icons.cpp icons.hpp icons.bin icons_dat.cpp)
|
add_library(MetaforceIcons icons.cpp icons.hpp icons.bin icons_dat.cpp)
|
||||||
target_link_libraries(UrdeIcons PUBLIC specter)
|
target_link_libraries(MetaforceIcons PUBLIC specter)
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
extern "C" uint8_t URDE_ICONS[];
|
extern "C" uint8_t URDE_ICONS[];
|
||||||
extern "C" size_t URDE_ICONS_SZ;
|
extern "C" size_t URDE_ICONS_SZ;
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
static logvisor::Module Log("URDE::icons");
|
static logvisor::Module Log("URDE::icons");
|
||||||
|
|
||||||
specter::IconAtlas<8, 8> g_IconAtlas;
|
specter::IconAtlas<8, 8> g_IconAtlas;
|
||||||
|
@ -91,4 +91,4 @@ specter::Icon& GetIcon(MonoIcon icon) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include "specter/Icon.hpp"
|
#include "specter/Icon.hpp"
|
||||||
#include "specter/ViewResources.hpp"
|
#include "specter/ViewResources.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
void InitializeIcons(specter::ViewResources& viewRes);
|
void InitializeIcons(specter::ViewResources& viewRes);
|
||||||
void DestroyIcons();
|
void DestroyIcons();
|
||||||
|
|
||||||
|
@ -30,4 +30,4 @@ enum class MonoIcon {
|
||||||
};
|
};
|
||||||
specter::Icon& GetIcon(MonoIcon icon);
|
specter::Icon& GetIcon(MonoIcon icon);
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -5,5 +5,5 @@ get_filename_component(PACKICONS_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||||
|
|
||||||
# Our library dependencies (contains definitions for IMPORTED targets)
|
# Our library dependencies (contains definitions for IMPORTED targets)
|
||||||
if(NOT TARGET packicons AND NOT packicons_BINARY_DIR)
|
if(NOT TARGET packicons AND NOT packicons_BINARY_DIR)
|
||||||
include("${PACKICONS_CMAKE_DIR}/urde-packiconsTargets.cmake")
|
include("${PACKICONS_CMAKE_DIR}/metaforce-packiconsTargets.cmake")
|
||||||
endif()
|
endif()
|
|
@ -16,7 +16,7 @@ static void AthenaExc(athena::error::Level level, const char* file, const char*,
|
||||||
AthenaLog.vreport(logvisor::Level(level), fmt, args);
|
AthenaLog.vreport(logvisor::Level(level), fmt, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
static logvisor::Module Log{"Metaforce"};
|
static logvisor::Module Log{"Metaforce"};
|
||||||
|
|
||||||
static hecl::SystemString CPUFeatureString(const zeus::CPUInfo& cpuInf) {
|
static hecl::SystemString CPUFeatureString(const zeus::CPUInfo& cpuInf) {
|
||||||
|
@ -119,7 +119,7 @@ struct Application : boo::IApplicationCallback {
|
||||||
int64_t getTargetFrameTime() { return m_cvarCommons.getVariableFrameTime() ? 0 : 1000000000L / 60; }
|
int64_t getTargetFrameTime() { return m_cvarCommons.getVariableFrameTime() ? 0 : 1000000000L / 60; }
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
||||||
static hecl::SystemChar CwdBuf[1024];
|
static hecl::SystemChar CwdBuf[1024];
|
||||||
hecl::SystemString ExeDir;
|
hecl::SystemString ExeDir;
|
||||||
|
@ -129,11 +129,11 @@ static void SetupBasics(bool logging) {
|
||||||
if (!result.first) {
|
if (!result.first) {
|
||||||
#if _WIN32 && !WINDOWS_STORE
|
#if _WIN32 && !WINDOWS_STORE
|
||||||
std::wstring msg = fmt::format(FMT_STRING(L"ERROR: This build of Metaforce requires the following CPU features:\n{}\n"),
|
std::wstring msg = fmt::format(FMT_STRING(L"ERROR: This build of Metaforce requires the following CPU features:\n{}\n"),
|
||||||
urde::CPUFeatureString(result.second));
|
metaforce::CPUFeatureString(result.second));
|
||||||
MessageBoxW(nullptr, msg.c_str(), L"CPU error", MB_OK | MB_ICONERROR);
|
MessageBoxW(nullptr, msg.c_str(), L"CPU error", MB_OK | MB_ICONERROR);
|
||||||
#else
|
#else
|
||||||
fmt::print(stderr, FMT_STRING("ERROR: This build of Metaforce requires the following CPU features:\n{}\n"),
|
fmt::print(stderr, FMT_STRING("ERROR: This build of Metaforce requires the following CPU features:\n{}\n"),
|
||||||
urde::CPUFeatureString(result.second));
|
metaforce::CPUFeatureString(result.second));
|
||||||
#endif
|
#endif
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
@ -202,7 +202,7 @@ int main(int argc, const boo::SystemChar** argv)
|
||||||
/* Handle -j argument */
|
/* Handle -j argument */
|
||||||
hecl::SetCpuCountOverride(argc, argv);
|
hecl::SetCpuCountOverride(argc, argv);
|
||||||
|
|
||||||
urde::Application appCb(fileMgr, cvarMgr, cvarCmns);
|
metaforce::Application appCb(fileMgr, cvarMgr, cvarCmns);
|
||||||
int ret = boo::ApplicationRun(boo::IApplication::EPlatformType::Auto, appCb, _SYS_STR("metaforce"),
|
int ret = boo::ApplicationRun(boo::IApplication::EPlatformType::Auto, appCb, _SYS_STR("metaforce"),
|
||||||
_SYS_STR("Metaforce"), argc, argv, appCb.getGraphicsApi(), appCb.getSamples(),
|
_SYS_STR("Metaforce"), argc, argv, appCb.getGraphicsApi(), appCb.getSamples(),
|
||||||
appCb.getAnisotropy(), appCb.getDeepColor(), appCb.getTargetFrameTime(), false);
|
appCb.getAnisotropy(), appCb.getDeepColor(), appCb.getTargetFrameTime(), false);
|
||||||
|
@ -217,9 +217,9 @@ using namespace Windows::ApplicationModel::Core;
|
||||||
|
|
||||||
[Platform::MTAThread] int WINAPIV main(Platform::Array<Platform::String ^> ^ params) {
|
[Platform::MTAThread] int WINAPIV main(Platform::Array<Platform::String ^> ^ params) {
|
||||||
SetupBasics(false);
|
SetupBasics(false);
|
||||||
urde::Application appCb;
|
metaforce::Application appCb;
|
||||||
auto viewProvider =
|
auto viewProvider =
|
||||||
ref new boo::ViewProvider(appCb, _SYS_STR("urde"), _SYS_STR("URDE"), _SYS_STR("urde"), params, false);
|
ref new boo::ViewProvider(appCb, _SYS_STR("metaforce"), _SYS_STR("Metaforce"), _SYS_STR("metaforce"), params, false);
|
||||||
CoreApplication::Run(viewProvider);
|
CoreApplication::Run(viewProvider);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Before Width: | Height: | Size: 637 KiB After Width: | Height: | Size: 637 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 203 KiB After Width: | Height: | Size: 203 KiB |
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
|
@ -7,11 +7,11 @@ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/Editor/platforms/freedesktop/maini
|
||||||
COMMAND $<TARGET_FILE:mkwmicon>
|
COMMAND $<TARGET_FILE:mkwmicon>
|
||||||
ARGS ${CMAKE_BINARY_DIR}/Editor/platforms/freedesktop/mainicon_netwm.bin
|
ARGS ${CMAKE_BINARY_DIR}/Editor/platforms/freedesktop/mainicon_netwm.bin
|
||||||
DEPENDS
|
DEPENDS
|
||||||
${CMAKE_SOURCE_DIR}/Editor/platforms/freedesktop/128x128/apps/urde.png
|
${CMAKE_SOURCE_DIR}/Editor/platforms/freedesktop/128x128/apps/metaforce.png
|
||||||
${CMAKE_SOURCE_DIR}/Editor/platforms/freedesktop/64x64/apps/urde.png
|
${CMAKE_SOURCE_DIR}/Editor/platforms/freedesktop/64x64/apps/metaforce.png
|
||||||
${CMAKE_SOURCE_DIR}/Editor/platforms/freedesktop/48x48/apps/urde.png
|
${CMAKE_SOURCE_DIR}/Editor/platforms/freedesktop/48x48/apps/metaforce.png
|
||||||
${CMAKE_SOURCE_DIR}/Editor/platforms/freedesktop/32x32/apps/urde.png
|
${CMAKE_SOURCE_DIR}/Editor/platforms/freedesktop/32x32/apps/metaforce.png
|
||||||
${CMAKE_SOURCE_DIR}/Editor/platforms/freedesktop/16x16/apps/urde.png
|
${CMAKE_SOURCE_DIR}/Editor/platforms/freedesktop/16x16/apps/metaforce.png
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/Editor/platforms/freedesktop
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/Editor/platforms/freedesktop
|
||||||
COMMENT "Generating mainicon_netwm.bin")
|
COMMENT "Generating mainicon_netwm.bin")
|
||||||
bintoc(mainicon_netwm.cpp ${CMAKE_BINARY_DIR}/Editor/platforms/freedesktop/mainicon_netwm.bin MAINICON_NETWM)
|
bintoc(mainicon_netwm.cpp ${CMAKE_BINARY_DIR}/Editor/platforms/freedesktop/mainicon_netwm.bin MAINICON_NETWM)
|
||||||
|
|
|
@ -49,7 +49,7 @@ int main(int argc, char* argv[])
|
||||||
printf("Rendering main icon @%dx%d\n", *d, *d);
|
printf("Rendering main icon @%dx%d\n", *d, *d);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
snprintf(command, 2048, "%dx%d/apps/urde.png", *d, *d);
|
snprintf(command, 2048, "%dx%d/apps/metaforce.png", *d, *d);
|
||||||
FILE* fp = fopen(command, "rb");
|
FILE* fp = fopen(command, "rb");
|
||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
Name=URDE
|
Name=URDE
|
||||||
GenericName=Game Data Editor
|
GenericName=Game Data Editor
|
||||||
Comment=Edit 3D assets from games by Retro Studios
|
Comment=Edit 3D assets from games by Retro Studios
|
||||||
Exec=urde
|
Exec=metaforce
|
||||||
Icon=urde
|
Icon=metaforce
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Type=Application
|
Type=Application
|
||||||
Categories=Graphics;3DGraphics;
|
Categories=Graphics;3DGraphics;
|
||||||
|
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
@ -1,11 +1,11 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap4="http://schemas.microsoft.com/appx/manifest/uap/windows10/4" xmlns:pm="http://schemas.microsoft.com/appx/2014/phone/manifest" IgnorableNamespaces="uap uap4 pm">
|
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap4="http://schemas.microsoft.com/appx/manifest/uap/windows10/4" xmlns:pm="http://schemas.microsoft.com/appx/2014/phone/manifest" IgnorableNamespaces="uap uap4 pm">
|
||||||
<Identity Name="AxioDL.URDE" Version="1.0.0.0" Publisher="CN=AxioDL" />
|
<Identity Name="AxioDL.Metaforce" Version="1.0.0.0" Publisher="CN=AxioDL" />
|
||||||
<pm:PhoneIdentity PhoneProductId="97E278C0-4527-453D-AE03-375B1FAA0B19" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
|
<pm:PhoneIdentity PhoneProductId="97E278C0-4527-453D-AE03-375B1FAA0B19" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
|
||||||
<Properties>
|
<Properties>
|
||||||
<DisplayName>URDE</DisplayName>
|
<DisplayName>Metaforce</DisplayName>
|
||||||
<PublisherDisplayName>AxioDL</PublisherDisplayName>
|
<PublisherDisplayName>AxioDL</PublisherDisplayName>
|
||||||
<Logo>Assets\urde.png</Logo>
|
<Logo>Assets\metaforce.png</Logo>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Dependencies>
|
<Dependencies>
|
||||||
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.14393.0" MaxVersionTested="10.0.16299.0" />
|
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.14393.0" MaxVersionTested="10.0.16299.0" />
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
</Resources>
|
</Resources>
|
||||||
<Applications>
|
<Applications>
|
||||||
<Application Id="URDE" Executable="$targetnametoken$.exe" EntryPoint="URDE.App">
|
<Application Id="URDE" Executable="$targetnametoken$.exe" EntryPoint="URDE.App">
|
||||||
<uap:VisualElements DisplayName="URDE" Description="Game engine recreation for Metroid Prime" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" BackgroundColor="#333333">
|
<uap:VisualElements DisplayName="Metaforce" Description="Game engine recreation for Metroid Prime" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" BackgroundColor="#333333">
|
||||||
<uap:DefaultTile Square310x310Logo="Assets\LargeTile.png" Wide310x150Logo="Assets\WideTile.png" Square71x71Logo="Assets\SmallTile.png" ShortName="URDE">
|
<uap:DefaultTile Square310x310Logo="Assets\LargeTile.png" Wide310x150Logo="Assets\WideTile.png" Square71x71Logo="Assets\SmallTile.png" ShortName="URDE">
|
||||||
<uap:ShowNameOnTiles>
|
<uap:ShowNameOnTiles>
|
||||||
<uap:ShowOn Tile="square150x150Logo" />
|
<uap:ShowOn Tile="square150x150Logo" />
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
static urde::MP1::CNESEmulator* EmulatorInst = nullptr;
|
static metaforce::MP1::CNESEmulator* EmulatorInst = nullptr;
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ int audioUpdate() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace urde::MP1 {
|
namespace metaforce::MP1 {
|
||||||
|
|
||||||
bool CNESEmulator::EmulatorConstructed = false;
|
bool CNESEmulator::EmulatorConstructed = false;
|
||||||
static logvisor::Module Log("CNESEmulator");
|
static logvisor::Module Log("CNESEmulator");
|
||||||
|
@ -781,4 +781,4 @@ void CNESEmulator::LoadPassword(const u8* state) {
|
||||||
x38_passwordPending = true;
|
x38_passwordPending = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace urde::MP1
|
} // namespace metaforce::MP1
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include "boo/audiodev/IAudioVoice.hpp"
|
#include "boo/audiodev/IAudioVoice.hpp"
|
||||||
#include "zeus/CMatrix4f.hpp"
|
#include "zeus/CMatrix4f.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
struct CFinalInput;
|
struct CFinalInput;
|
||||||
class IDvdRequest;
|
class IDvdRequest;
|
||||||
|
|
||||||
|
@ -86,4 +86,4 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace MP1
|
} // namespace MP1
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include "Graphics/CGraphics.hpp"
|
#include "Graphics/CGraphics.hpp"
|
||||||
#include "hecl/Pipeline.hpp"
|
#include "hecl/Pipeline.hpp"
|
||||||
|
|
||||||
namespace urde::MP1 {
|
namespace metaforce::MP1 {
|
||||||
|
|
||||||
boo::ObjToken<boo::IShaderPipeline> CNESShader::g_Pipeline;
|
boo::ObjToken<boo::IShaderPipeline> CNESShader::g_Pipeline;
|
||||||
|
|
||||||
|
@ -21,4 +21,4 @@ boo::ObjToken<boo::IShaderDataBinding> CNESShader::BuildShaderDataBinding(boo::I
|
||||||
|
|
||||||
void CNESShader::Shutdown() { g_Pipeline.reset(); }
|
void CNESShader::Shutdown() { g_Pipeline.reset(); }
|
||||||
|
|
||||||
} // namespace urde::MP1
|
} // namespace metaforce::MP1
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include "boo/graphicsdev/IGraphicsDataFactory.hpp"
|
#include "boo/graphicsdev/IGraphicsDataFactory.hpp"
|
||||||
|
|
||||||
namespace urde::MP1 {
|
namespace metaforce::MP1 {
|
||||||
|
|
||||||
class CNESShader {
|
class CNESShader {
|
||||||
public:
|
public:
|
||||||
|
@ -17,4 +17,4 @@ public:
|
||||||
static boo::ObjToken<boo::IShaderPipeline> g_Pipeline;
|
static boo::ObjToken<boo::IShaderPipeline> g_Pipeline;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace urde::MP1
|
} // namespace metaforce::MP1
|
||||||
|
|
|
@ -23,7 +23,7 @@ Everything else is much too experimental to make portable/stable release builds
|
||||||
* Extract ISO: `hecl extract [path].iso -o mp1`
|
* Extract ISO: `hecl extract [path].iso -o mp1`
|
||||||
* `mp1` can be substituted with the directory name of your choice
|
* `mp1` can be substituted with the directory name of your choice
|
||||||
* Repackage game for Metaforce: `cd mp1; hecl package`
|
* Repackage game for Metaforce: `cd mp1; hecl package`
|
||||||
* Run Metaforce: `urde mp1/out`
|
* Run Metaforce: `metaforce mp1/out`
|
||||||
|
|
||||||
### Usage (Wii versions)
|
### Usage (Wii versions)
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ NFS files dumped from Metroid Prime Trilogy on Wii U VC can be used directly wit
|
||||||
* `mpt` can be substituted with the directory name of your choice
|
* `mpt` can be substituted with the directory name of your choice
|
||||||
* Repackage game for Metaforce: `cd mpt; hecl package MP1`
|
* Repackage game for Metaforce: `cd mpt; hecl package MP1`
|
||||||
* The `MP1` parameter is important here.
|
* The `MP1` parameter is important here.
|
||||||
* Run Metaforce: `urde mpt/out`
|
* Run Metaforce: `metaforce mpt/out`
|
||||||
|
|
||||||
#### Metaforce options (non-exhaustive)
|
#### Metaforce options (non-exhaustive)
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
|
|
||||||
amuse::AudioGroupData CAudioGroupSet::LoadData() {
|
amuse::AudioGroupData CAudioGroupSet::LoadData() {
|
||||||
const auto readU32 = [](const u8* ptr) {
|
const auto readU32 = [](const u8* ptr) {
|
||||||
|
@ -33,9 +33,9 @@ amuse::AudioGroupData CAudioGroupSet::LoadData() {
|
||||||
|
|
||||||
CAudioGroupSet::CAudioGroupSet(std::unique_ptr<u8[]>&& in) : m_buffer(std::move(in)), m_data(LoadData()) {}
|
CAudioGroupSet::CAudioGroupSet(std::unique_ptr<u8[]>&& in) : m_buffer(std::move(in)), m_data(LoadData()) {}
|
||||||
|
|
||||||
CFactoryFnReturn FAudioGroupSetDataFactory(const urde::SObjectTag& tag, std::unique_ptr<u8[]>&& in, u32 len,
|
CFactoryFnReturn FAudioGroupSetDataFactory(const metaforce::SObjectTag& tag, std::unique_ptr<u8[]>&& in, u32 len,
|
||||||
const urde::CVParamTransfer& vparms, CObjectReference* selfRef) {
|
const metaforce::CVParamTransfer& vparms, CObjectReference* selfRef) {
|
||||||
return TToken<CAudioGroupSet>::GetIObjObjectFor(std::make_unique<CAudioGroupSet>(std::move(in)));
|
return TToken<CAudioGroupSet>::GetIObjObjectFor(std::make_unique<CAudioGroupSet>(std::move(in)));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
#include <amuse/AudioGroupData.hpp>
|
#include <amuse/AudioGroupData.hpp>
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
|
|
||||||
class CAudioGroupSet {
|
class CAudioGroupSet {
|
||||||
std::unique_ptr<u8[]> m_buffer;
|
std::unique_ptr<u8[]> m_buffer;
|
||||||
|
@ -26,7 +26,7 @@ public:
|
||||||
std::string_view GetName() const { return x20_name; }
|
std::string_view GetName() const { return x20_name; }
|
||||||
};
|
};
|
||||||
|
|
||||||
CFactoryFnReturn FAudioGroupSetDataFactory(const urde::SObjectTag& tag, std::unique_ptr<u8[]>&& in, u32 len,
|
CFactoryFnReturn FAudioGroupSetDataFactory(const metaforce::SObjectTag& tag, std::unique_ptr<u8[]>&& in, u32 len,
|
||||||
const urde::CVParamTransfer& vparms, CObjectReference* selfRef);
|
const metaforce::CVParamTransfer& vparms, CObjectReference* selfRef);
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include "Runtime/CSimplePool.hpp"
|
#include "Runtime/CSimplePool.hpp"
|
||||||
#include "Runtime/Audio/CAudioGroupSet.hpp"
|
#include "Runtime/Audio/CAudioGroupSet.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
namespace {
|
namespace {
|
||||||
std::unordered_map<std::string, TLockedToken<CAudioGroupSet>> mpGroupSetDB;
|
std::unordered_map<std::string, TLockedToken<CAudioGroupSet>> mpGroupSetDB;
|
||||||
std::unordered_map<CAssetId, std::string> mpGroupSetResNameDB;
|
std::unordered_map<CAssetId, std::string> mpGroupSetResNameDB;
|
||||||
|
@ -96,4 +96,4 @@ void CAudioSys::SetDefaultVolumeScale(s16 scale) { s_DefaultVolumeScale = scale;
|
||||||
|
|
||||||
void CAudioSys::SetVolumeScale(s16 scale) { s_VolumeScale = scale; }
|
void CAudioSys::SetVolumeScale(s16 scale) { s_VolumeScale = scale; }
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include <boo/audiodev/IAudioVoiceEngine.hpp>
|
#include <boo/audiodev/IAudioVoiceEngine.hpp>
|
||||||
#include <zeus/CVector3f.hpp>
|
#include <zeus/CVector3f.hpp>
|
||||||
|
|
||||||
namespace urde {
|
namespace metaforce {
|
||||||
class CAudioGroupSet;
|
class CAudioGroupSet;
|
||||||
class CSimplePool;
|
class CSimplePool;
|
||||||
|
|
||||||
|
@ -65,4 +65,4 @@ public:
|
||||||
static void SetVolumeScale(s16 scale);
|
static void SetVolumeScale(s16 scale);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace metaforce
|
||||||
|
|