mirror of https://github.com/AxioDL/metaforce.git
Implement CTweaks::RegisterResourceTweaks
This commit is contained in:
parent
6229fa6bfe
commit
d104c7eb45
|
@ -113,6 +113,9 @@ struct CTweakGunRes : ITweakGunRes
|
|||
const std::string& GetGrappleHitParticle() const { return m_grappleHit; }
|
||||
const std::string& GetGrappleMuzzleParticle() const { return m_grappleMuzzle; }
|
||||
const std::string& GetGrappleSwooshParticle() const { return m_grappleSwoosh; }
|
||||
|
||||
CTweakGunRes() = default;
|
||||
CTweakGunRes(athena::io::IStreamReader& in) { read(in); }
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -127,6 +127,9 @@ struct CTweakPlayerRes : ITweakPlayerRes
|
|||
const std::string& GetWaveBeamCineModel() const { return m_cineWave; }
|
||||
const std::string& GetPlasmaBeamCineModel() const { return m_cinePlasma; }
|
||||
const std::string& GetPhazonBeamCineModel() const { return m_cinePhazon; }
|
||||
|
||||
CTweakPlayerRes() = default;
|
||||
CTweakPlayerRes(athena::io::IStreamReader& in) { read(in); }
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -3,9 +3,13 @@
|
|||
#include "CResFactory.hpp"
|
||||
#include "CResLoader.hpp"
|
||||
#include "GameGlobalObjects.hpp"
|
||||
#include "Editor/ProjectManager.hpp"
|
||||
#include "Editor/ProjectResourceFactoryMP1.hpp"
|
||||
#include "DataSpec/DNAMP1/Tweaks/CTweakGame.hpp"
|
||||
#include "DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp"
|
||||
#include "DataSpec/DNAMP1/Tweaks/CTweakPlayerControl.hpp"
|
||||
#include "DataSpec/DNAMP1/Tweaks/CTweakGunRes.hpp"
|
||||
#include "DataSpec/DNAMP1/Tweaks/CTweakPlayerRes.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
|
@ -45,6 +49,24 @@ void CTweaks::RegisterTweaks()
|
|||
|
||||
void CTweaks::RegisterResourceTweaks()
|
||||
{
|
||||
#if 0
|
||||
CResFactory& factory = *dynamic_cast<CResFactory*>(g_ResFactory);
|
||||
CResLoader& loader = factory.GetLoader();
|
||||
std::unique_ptr<CInputStream> strm;
|
||||
strm.reset(loader.LoadNewResourceSync(IDFromFactory(factory, "GunRes")));
|
||||
g_tweakGunRes = new DataSpec::DNAMP1::CTweakGunRes(*strm);
|
||||
strm.reset(loader.LoadNewResourceSync(IDFromFactory(factory, "PlayerRes"), nullptr));
|
||||
g_tweakPlayerRes = new DataSpec::DNAMP1::CTweakPlayerRes(*strm);
|
||||
#else
|
||||
ProjectResourceFactoryMP1& factory = ProjectManager::g_SharedManager->resourceFactoryMP1();
|
||||
std::unique_ptr<CInputStream> strm;
|
||||
SObjectTag tag = *factory.GetResourceIdByName("GunRes");
|
||||
strm.reset(new CMemoryInStream(factory.LoadResourceSync(tag).release(), factory.ResourceSize(tag)));
|
||||
g_tweakGunRes = new DataSpec::DNAMP1::CTweakGunRes(*strm);
|
||||
tag = *factory.GetResourceIdByName("GunRes");
|
||||
strm.reset(new CMemoryInStream(factory.LoadResourceSync(tag).release(), factory.ResourceSize(tag)));
|
||||
g_tweakPlayerRes = new DataSpec::DNAMP1::CTweakPlayerRes(*strm);
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue