2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 02:27:43 +00:00

various input class implementations

This commit is contained in:
Jack Andersen
2015-08-27 14:11:31 -10:00
parent 3616f14f94
commit ce42cdd3be
39 changed files with 836 additions and 226 deletions

View File

@@ -1,12 +1,36 @@
#include <LogVisor/LogVisor.hpp>
#include "CTweaks.hpp"
#include "CResFactory.hpp"
#include "CResLoader.hpp"
#include "GameGlobalObjects.hpp"
#include "DataSpec/DNAMP1/Tweaks/CTweakPlayerControl.hpp"
namespace Retro
{
ITweakPlayerControl* g_tweakPlayerControl = nullptr;
namespace MP1
{
LogVisor::LogModule Log("MP1::CTweaks");
static const SObjectTag& IDFromFactory(CResFactory& factory, const char* name)
{
const SObjectTag* tag = factory.GetResourceIdByName(name);
if (!tag)
Log.report(LogVisor::FatalError, "Tweak Asset not found when loading... '%s'", name);
return *tag;
}
void CTweaks::RegisterTweaks()
{
CResFactory& factory = *g_ResFactory;
CResLoader& loader = factory.GetLoader();
std::unique_ptr<CInputStream> strm;
strm.reset(loader.LoadNewResourceSync(IDFromFactory(factory, "PlayerControls"), nullptr));
TOneStatic<DNAMP1::CTweakPlayerControl> playerControl(*strm);
g_tweakPlayerControl = playerControl.GetAllocSpace();
}
void CTweaks::RegisterResourceTweaks()