2015-08-28 00:11:31 +00:00
|
|
|
#include <LogVisor/LogVisor.hpp>
|
2015-08-17 05:26:58 +00:00
|
|
|
#include "CTweaks.hpp"
|
2015-08-28 00:11:31 +00:00
|
|
|
#include "CResFactory.hpp"
|
|
|
|
#include "CResLoader.hpp"
|
|
|
|
#include "GameGlobalObjects.hpp"
|
2015-08-29 01:30:47 +00:00
|
|
|
#include "DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp"
|
2015-08-28 00:11:31 +00:00
|
|
|
#include "DataSpec/DNAMP1/Tweaks/CTweakPlayerControl.hpp"
|
2015-08-17 05:26:58 +00:00
|
|
|
|
2015-08-17 22:05:00 +00:00
|
|
|
namespace Retro
|
|
|
|
{
|
2015-08-29 01:30:47 +00:00
|
|
|
ITweakPlayer* g_tweakPlayer = nullptr;
|
2015-08-28 00:11:31 +00:00
|
|
|
ITweakPlayerControl* g_tweakPlayerControl = nullptr;
|
|
|
|
|
2015-08-27 00:23:46 +00:00
|
|
|
namespace MP1
|
|
|
|
{
|
2015-08-17 22:05:00 +00:00
|
|
|
|
2015-08-28 00:11:31 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2015-08-17 05:26:58 +00:00
|
|
|
void CTweaks::RegisterTweaks()
|
|
|
|
{
|
2015-10-28 04:45:02 +00:00
|
|
|
#if 0
|
2015-08-28 00:11:31 +00:00
|
|
|
CResFactory& factory = *g_ResFactory;
|
|
|
|
CResLoader& loader = factory.GetLoader();
|
|
|
|
std::unique_ptr<CInputStream> strm;
|
|
|
|
|
2015-08-29 01:30:47 +00:00
|
|
|
strm.reset(loader.LoadNewResourceSync(IDFromFactory(factory, "Player"), nullptr));
|
|
|
|
TOneStatic<DNAMP1::CTweakPlayer> player(*strm);
|
|
|
|
g_tweakPlayer = player.GetAllocSpace();
|
|
|
|
|
2015-08-28 00:11:31 +00:00
|
|
|
strm.reset(loader.LoadNewResourceSync(IDFromFactory(factory, "PlayerControls"), nullptr));
|
|
|
|
TOneStatic<DNAMP1::CTweakPlayerControl> playerControl(*strm);
|
|
|
|
g_tweakPlayerControl = playerControl.GetAllocSpace();
|
2015-10-28 04:45:02 +00:00
|
|
|
#endif
|
2015-08-17 05:26:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CTweaks::RegisterResourceTweaks()
|
|
|
|
{
|
|
|
|
}
|
2015-08-17 22:05:00 +00:00
|
|
|
|
|
|
|
}
|
2015-08-27 00:23:46 +00:00
|
|
|
}
|