mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-10 05:47:43 +00:00
AGSC/ATBL/CSNG extracting and cooking
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include "DNACommon.hpp"
|
||||
#include "BlenderConnection.hpp"
|
||||
#include "hecl/Blender/BlenderConnection.hpp"
|
||||
#include "CMDL.hpp"
|
||||
#include "RigInverter.hpp"
|
||||
|
||||
@@ -53,7 +53,7 @@ bool ReadANCSToBlender(hecl::BlenderConnection& conn,
|
||||
if (cmdlE)
|
||||
{
|
||||
hecl::ProjectPath cmdlPath = pakRouter.getWorking(cmdlE);
|
||||
if (force || cmdlPath.getPathType() == hecl::ProjectPath::Type::None)
|
||||
if (force || cmdlPath.isNone())
|
||||
{
|
||||
if (!conn.createBlend(cmdlPath, hecl::BlenderConnection::BlendType::Mesh))
|
||||
return false;
|
||||
|
||||
64
DataSpec/DNACommon/ATBL.cpp
Normal file
64
DataSpec/DNACommon/ATBL.cpp
Normal file
@@ -0,0 +1,64 @@
|
||||
#include "ATBL.hpp"
|
||||
#include "Athena/Athena/DNAYaml.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAAudio
|
||||
{
|
||||
|
||||
bool ATBL::Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath)
|
||||
{
|
||||
size_t idxCount = rs.length() / 2;
|
||||
athena::io::YAMLDocWriter w("ATBL");
|
||||
for (size_t i=0 ; i<idxCount ; ++i)
|
||||
{
|
||||
uint16_t idx = rs.readUint16Big();
|
||||
if (idx == 0xffff)
|
||||
continue;
|
||||
char iStr[16];
|
||||
snprintf(iStr, 16, "0x%04X", int(i));
|
||||
w.writeUint16(iStr, idx);
|
||||
}
|
||||
|
||||
athena::io::FileWriter fw(outPath.getAbsolutePath());
|
||||
w.finish(&fw);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ATBL::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath)
|
||||
{
|
||||
athena::io::FileReader r(inPath.getAbsolutePath());
|
||||
if (r.hasError())
|
||||
return false;
|
||||
|
||||
athena::io::YAMLDocReader dr;
|
||||
if (!dr.parse(&r))
|
||||
return false;
|
||||
|
||||
unsigned long maxI = 0;
|
||||
for (const auto& pair : dr.getRootNode()->m_mapChildren)
|
||||
{
|
||||
unsigned long i = strtoul(pair.first.c_str(), nullptr, 0);
|
||||
maxI = std::max(maxI, i);
|
||||
}
|
||||
|
||||
std::vector<uint16_t> vecOut;
|
||||
vecOut.resize(maxI + 1, 0xffff);
|
||||
|
||||
for (const auto& pair : dr.getRootNode()->m_mapChildren)
|
||||
{
|
||||
unsigned long i = strtoul(pair.first.c_str(), nullptr, 0);
|
||||
vecOut[i] = hecl::SBig(uint16_t(strtoul(pair.second->m_scalarString.c_str(), nullptr, 0)));
|
||||
}
|
||||
|
||||
athena::io::FileWriter w(outPath.getAbsolutePath());
|
||||
if (w.hasError())
|
||||
return false;
|
||||
w.writeBytes(vecOut.data(), vecOut.size() * 2);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
22
DataSpec/DNACommon/ATBL.hpp
Normal file
22
DataSpec/DNACommon/ATBL.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef _DNACOMMON_ATBL_HPP_
|
||||
#define _DNACOMMON_ATBL_HPP_
|
||||
|
||||
#include "DNACommon.hpp"
|
||||
#include "PAK.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAAudio
|
||||
{
|
||||
|
||||
class ATBL
|
||||
{
|
||||
public:
|
||||
static bool Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath);
|
||||
static bool Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _DNACOMMON_ATBL_HPP_
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef _DNACOMMON_BABEDEAD_HPP_
|
||||
#define _DNACOMMON_BABEDEAD_HPP_
|
||||
|
||||
#include "BlenderConnection.hpp"
|
||||
#include "hecl/Blender/BlenderConnection.hpp"
|
||||
#include "zeus/Math.hpp"
|
||||
#include <cfloat>
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ void ReadMaterialSetToBlender_1_2(hecl::BlenderConnection::PyOutStream& os,
|
||||
const nod::Node* node;
|
||||
const typename PAKRouter::EntryType* texEntry = pakRouter.lookupEntry(tex, &node);
|
||||
hecl::ProjectPath txtrPath = pakRouter.getWorking(texEntry);
|
||||
if (txtrPath.getPathType() == hecl::ProjectPath::Type::None)
|
||||
if (!txtrPath.isNone())
|
||||
{
|
||||
PAKEntryReadStream rs = texEntry->beginReadStream(*node);
|
||||
TXTR::Extract(rs, txtrPath);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <hecl/Frontend.hpp>
|
||||
#include <hecl/Backend/GX.hpp>
|
||||
#include "PAK.hpp"
|
||||
#include "BlenderConnection.hpp"
|
||||
#include "hecl/Blender/BlenderConnection.hpp"
|
||||
#include "GX.hpp"
|
||||
#include "TXTR.hpp"
|
||||
#include "zeus/CAABox.hpp"
|
||||
|
||||
@@ -27,6 +27,7 @@ add_library(DNACommon
|
||||
ParticleCommon.cpp
|
||||
FONT.hpp FONT.cpp
|
||||
DGRP.hpp DGRP.cpp
|
||||
ATBL.hpp ATBL.cpp
|
||||
DeafBabe.hpp DeafBabe.cpp
|
||||
BabeDead.hpp BabeDead.cpp
|
||||
RigInverter.hpp RigInverter.cpp
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define _DNACOMMON_DEAFBABE_HPP_
|
||||
|
||||
#include "DNACommon.hpp"
|
||||
#include "BlenderConnection.hpp"
|
||||
#include "hecl/Blender/BlenderConnection.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
|
||||
@@ -100,7 +100,7 @@ bool ReadMAPAToBlender(hecl::BlenderConnection& conn,
|
||||
/* We're not in a world pak, so lets keep the original name */
|
||||
mapaPath = outPath;
|
||||
|
||||
if (!force && mapaPath.getPathType() == hecl::ProjectPath::Type::File)
|
||||
if (!force && mapaPath.isFile())
|
||||
return true;
|
||||
|
||||
if (!conn.createBlend(mapaPath, hecl::BlenderConnection::BlendType::MapArea))
|
||||
@@ -296,7 +296,7 @@ bool ReadMAPAToBlender(hecl::BlenderConnection& conn,
|
||||
|
||||
/* World background */
|
||||
hecl::ProjectPath worldBlend(outPath.getParentPath().getParentPath(), "!world.blend");
|
||||
if (worldBlend.getPathType() == hecl::ProjectPath::Type::File)
|
||||
if (worldBlend.isFile())
|
||||
os.linkBackground("//../!world.blend", "World");
|
||||
|
||||
os.centerView();
|
||||
|
||||
@@ -24,7 +24,7 @@ bool ReadMLVLToBlender(hecl::BlenderConnection& conn,
|
||||
else
|
||||
/* We're not in a world pak, so lets keep the original name */
|
||||
mlvlPath = outPath;
|
||||
if (!force && mlvlPath.getPathType() == hecl::ProjectPath::Type::File)
|
||||
if (!force && mlvlPath.isFile())
|
||||
return true;
|
||||
|
||||
/* Create World Blend */
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define __DNACOMMON_MLVL_HPP__
|
||||
|
||||
#include "DNACommon.hpp"
|
||||
#include "BlenderConnection.hpp"
|
||||
#include "hecl/Blender/BlenderConnection.hpp"
|
||||
#include "zeus/CVector3f.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
|
||||
@@ -268,6 +268,8 @@ hecl::ProjectPath PAKRouter<BRIDGETYPE>::getWorking(const EntryType* entry,
|
||||
#endif
|
||||
if (extractor.fileExts[0] && !extractor.fileExts[1])
|
||||
entName += extractor.fileExts[0];
|
||||
else if (extractor.fileExts[0])
|
||||
entName += _S(".*");
|
||||
return hecl::ProjectPath(pakPath, entName);
|
||||
}
|
||||
}
|
||||
@@ -285,6 +287,8 @@ hecl::ProjectPath PAKRouter<BRIDGETYPE>::getWorking(const EntryType* entry,
|
||||
#endif
|
||||
if (extractor.fileExts[0] && !extractor.fileExts[1])
|
||||
entName += extractor.fileExts[0];
|
||||
else if (extractor.fileExts[0])
|
||||
entName += _S(".*");
|
||||
if (bridge.getPAK().m_noShare)
|
||||
{
|
||||
return hecl::ProjectPath(pakPath, entName);
|
||||
@@ -307,6 +311,8 @@ hecl::ProjectPath PAKRouter<BRIDGETYPE>::getWorking(const EntryType* entry,
|
||||
hecl::SystemString entName = entBase;
|
||||
if (extractor.fileExts[0] && !extractor.fileExts[1])
|
||||
entName += extractor.fileExts[0];
|
||||
else if (extractor.fileExts[0])
|
||||
entName += _S(".*");
|
||||
hecl::ProjectPath sharedPath(m_sharedWorking, entName);
|
||||
m_sharedWorking.makeDir();
|
||||
return sharedPath;
|
||||
@@ -464,7 +470,7 @@ bool PAKRouter<BRIDGETYPE>::extractResources(const BRIDGETYPE& pakBridge, bool f
|
||||
|
||||
/* Extract first, so they start out invalid */
|
||||
hecl::ProjectPath cooked = getCooked(item);
|
||||
if (force || cooked.getPathType() == hecl::ProjectPath::Type::None)
|
||||
if (force || cooked.isNone())
|
||||
{
|
||||
PAKEntryReadStream s = item->beginReadStream(*node);
|
||||
FILE* fout = hecl::Fopen(cooked.getAbsolutePath().c_str(), _S("wb"));
|
||||
@@ -474,7 +480,7 @@ bool PAKRouter<BRIDGETYPE>::extractResources(const BRIDGETYPE& pakBridge, bool f
|
||||
|
||||
if (extractor.func_a) /* Doesn't need PAKRouter access */
|
||||
{
|
||||
if (force || working.getPathType() == hecl::ProjectPath::Type::None)
|
||||
if (force || working.isNone())
|
||||
{
|
||||
PAKEntryReadStream s = item->beginReadStream(*node);
|
||||
extractor.func_a(s, working);
|
||||
@@ -482,7 +488,7 @@ bool PAKRouter<BRIDGETYPE>::extractResources(const BRIDGETYPE& pakBridge, bool f
|
||||
}
|
||||
else if (extractor.func_b) /* Needs PAKRouter access */
|
||||
{
|
||||
if (force || working.getPathType() == hecl::ProjectPath::Type::None)
|
||||
if (force || working.isNone())
|
||||
{
|
||||
PAKEntryReadStream s = item->beginReadStream(*node);
|
||||
extractor.func_b(m_dataSpec, s, working, *this, *item, force, btok,
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
atUint64 bufEnd = m_pos + len;
|
||||
if (bufEnd > m_sz)
|
||||
len -= bufEnd - m_sz;
|
||||
memcpy(buf, m_buf.get() + m_pos, len);
|
||||
memmove(buf, m_buf.get() + m_pos, len);
|
||||
m_pos += len;
|
||||
return len;
|
||||
}
|
||||
@@ -84,10 +84,26 @@ struct ResExtractor
|
||||
std::function<bool(const SpecBase&, PAKEntryReadStream&, const hecl::ProjectPath&, PAKRouter<PAKBRIDGE>&,
|
||||
const typename PAKBRIDGE::PAKType::Entry&, bool, hecl::BlenderToken&,
|
||||
std::function<void(const hecl::SystemChar*)>)> func_b;
|
||||
const hecl::SystemChar* fileExts[4];
|
||||
unsigned weight;
|
||||
std::array<const hecl::SystemChar*, 6> fileExts = {};
|
||||
unsigned weight = 0;
|
||||
std::function<void(const SpecBase&, PAKEntryReadStream&, PAKRouter<PAKBRIDGE>&,
|
||||
typename PAKBRIDGE::PAKType::Entry&)> func_name;
|
||||
|
||||
ResExtractor() = default;
|
||||
|
||||
ResExtractor(std::function<bool(PAKEntryReadStream&, const hecl::ProjectPath&)>&& func,
|
||||
std::array<const hecl::SystemChar*, 6>&& fileExtsIn, unsigned weightin=0,
|
||||
std::function<void(const SpecBase&, PAKEntryReadStream&, PAKRouter<PAKBRIDGE>&,
|
||||
typename PAKBRIDGE::PAKType::Entry&)>&& nfunc={})
|
||||
: func_a(std::move(func)), fileExts(std::move(fileExtsIn)), weight(weightin), func_name(std::move(nfunc)) {}
|
||||
|
||||
ResExtractor(std::function<bool(const SpecBase&, PAKEntryReadStream&, const hecl::ProjectPath&, PAKRouter<PAKBRIDGE>&,
|
||||
const typename PAKBRIDGE::PAKType::Entry&, bool, hecl::BlenderToken&,
|
||||
std::function<void(const hecl::SystemChar*)>)>&& func,
|
||||
std::array<const hecl::SystemChar*, 6>&& fileExtsIn, unsigned weightin=0,
|
||||
std::function<void(const SpecBase&, PAKEntryReadStream&, PAKRouter<PAKBRIDGE>&,
|
||||
typename PAKBRIDGE::PAKType::Entry&)>&& nfunc={})
|
||||
: func_b(std::move(func)), fileExts(std::move(fileExtsIn)), weight(weightin), func_name(std::move(nfunc)) {}
|
||||
};
|
||||
|
||||
/** Level hierarchy representation */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "zeus/CVector3f.hpp"
|
||||
#include "zeus/CMatrix3f.hpp"
|
||||
#include "zeus/CQuaternion.hpp"
|
||||
#include "BlenderConnection.hpp"
|
||||
#include "hecl/Blender/BlenderConnection.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
#define __DNACOMMON_ITWEAKGUNRES_HPP__
|
||||
|
||||
#include "../DNACommon.hpp"
|
||||
#include "Runtime/IFactory.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
|
||||
struct ITweakGunRes : BigYAML
|
||||
{
|
||||
using ResId = int64_t;
|
||||
enum class EBeamId
|
||||
{
|
||||
Power,
|
||||
@@ -17,6 +19,94 @@ struct ITweakGunRes : BigYAML
|
||||
Phazon
|
||||
};
|
||||
|
||||
ResId x4_gunMotion;
|
||||
ResId x8_grappleArm;
|
||||
ResId xc_rightHand;
|
||||
|
||||
ResId x10_powerBeam;
|
||||
ResId x14_iceBeam;
|
||||
ResId x18_waveBeam;
|
||||
ResId x1c_plasmaBeam;
|
||||
ResId x20_phazonBeam;
|
||||
|
||||
ResId x24_holoTransition;
|
||||
|
||||
ResId x28_bombSet;
|
||||
ResId x2c_bombExplode;
|
||||
ResId x30_powerBombExplode;
|
||||
|
||||
/* Power, Ice, Wave, Plasma, Phazon / Beam, Ball */
|
||||
ResId x34_weapons[5][2];
|
||||
ResId x84_muzzle[5];
|
||||
ResId x94_charge[5];
|
||||
ResId xa4_auxMuzzle[5];
|
||||
|
||||
ResId xb4_grappleSegment;
|
||||
ResId xb8_grappleClaw;
|
||||
ResId xbc_grappleHit;
|
||||
ResId xc0_grappleMuzzle;
|
||||
ResId xc4_grappleSwoosh;
|
||||
|
||||
ResId GetBeamModel(EBeamId beam) const
|
||||
{
|
||||
int b = int(beam);
|
||||
if (b < 0 || b > 4)
|
||||
b = 0;
|
||||
switch (EBeamId(b))
|
||||
{
|
||||
case EBeamId::Power:
|
||||
default:
|
||||
return x10_powerBeam;
|
||||
case EBeamId::Ice:
|
||||
return x14_iceBeam;
|
||||
case EBeamId::Plasma:
|
||||
return x1c_plasmaBeam;
|
||||
case EBeamId::Wave:
|
||||
return x18_waveBeam;
|
||||
case EBeamId::Phazon:
|
||||
return x20_phazonBeam;
|
||||
}
|
||||
}
|
||||
|
||||
void ResolveResources(const urde::IFactory& factory)
|
||||
{
|
||||
x4_gunMotion = factory.GetResourceIdByName(GetGunMotion().c_str())->id;
|
||||
x8_grappleArm = factory.GetResourceIdByName(GetGrappleArm().c_str())->id;
|
||||
xc_rightHand = factory.GetResourceIdByName(GetRightHand().c_str())->id;
|
||||
|
||||
x10_powerBeam = factory.GetResourceIdByName(GetPowerBeam().c_str())->id;
|
||||
x14_iceBeam = factory.GetResourceIdByName(GetIceBeam().c_str())->id;
|
||||
x18_waveBeam = factory.GetResourceIdByName(GetWaveBeam().c_str())->id;
|
||||
x1c_plasmaBeam = factory.GetResourceIdByName(GetPlasmaBeam().c_str())->id;
|
||||
x20_phazonBeam = factory.GetResourceIdByName(GetPhazonBeam().c_str())->id;
|
||||
|
||||
x24_holoTransition = factory.GetResourceIdByName(GetHoloTransition().c_str())->id;
|
||||
|
||||
x28_bombSet = factory.GetResourceIdByName(GetBombSet().c_str())->id;
|
||||
x2c_bombExplode = factory.GetResourceIdByName(GetBombExplode().c_str())->id;
|
||||
x30_powerBombExplode = factory.GetResourceIdByName(GetPowerBombExplode().c_str())->id;
|
||||
|
||||
for (int i=0 ; i<5 ; ++i)
|
||||
for (int j=0 ; j<2 ; ++j)
|
||||
x34_weapons[i][j] = factory.GetResourceIdByName(GetWeapon(i, j).c_str())->id;
|
||||
|
||||
for (int i=0 ; i<5 ; ++i)
|
||||
x84_muzzle[i] = factory.GetResourceIdByName(GetMuzzleParticle(i).c_str())->id;
|
||||
|
||||
for (int i=0 ; i<5 ; ++i)
|
||||
x94_charge[i] = factory.GetResourceIdByName(GetChargeParticle(i).c_str())->id;
|
||||
|
||||
for (int i=0 ; i<5 ; ++i)
|
||||
xa4_auxMuzzle[i] = factory.GetResourceIdByName(GetAuxMuzzleParticle(i).c_str())->id;
|
||||
|
||||
xb4_grappleSegment = factory.GetResourceIdByName(GetGrappleSegmentParticle().c_str())->id;
|
||||
xb8_grappleClaw = factory.GetResourceIdByName(GetGrappleClawParticle().c_str())->id;
|
||||
xbc_grappleHit = factory.GetResourceIdByName(GetGrappleHitParticle().c_str())->id;
|
||||
xc0_grappleMuzzle = factory.GetResourceIdByName(GetGrappleMuzzleParticle().c_str())->id;
|
||||
xc4_grappleSwoosh = factory.GetResourceIdByName(GetGrappleSwooshParticle().c_str())->id;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual const std::string& GetGunMotion() const=0;
|
||||
virtual const std::string& GetGrappleArm() const=0;
|
||||
virtual const std::string& GetRightHand() const=0;
|
||||
@@ -33,61 +123,16 @@ struct ITweakGunRes : BigYAML
|
||||
virtual const std::string& GetBombExplode() const=0;
|
||||
virtual const std::string& GetPowerBombExplode() const=0;
|
||||
|
||||
virtual const std::string& GetPowerBeamWeapon() const=0;
|
||||
virtual const std::string& GetPowerBallWeapon() const=0;
|
||||
virtual const std::string& GetIceBeamWeapon() const=0;
|
||||
virtual const std::string& GetIceBallWeapon() const=0;
|
||||
virtual const std::string& GetWaveBeamWeapon() const=0;
|
||||
virtual const std::string& GetWaveBallWeapon() const=0;
|
||||
virtual const std::string& GetPlasmaBeamWeapon() const=0;
|
||||
virtual const std::string& GetPlasmaBallWeapon() const=0;
|
||||
virtual const std::string& GetPhazonBeamWeapon() const=0;
|
||||
virtual const std::string& GetPhazonBallWeapon() const=0;
|
||||
|
||||
virtual const std::string& GetPowerMuzzleParticle() const=0;
|
||||
virtual const std::string& GetIceMuzzleParticle() const=0;
|
||||
virtual const std::string& GetWaveMuzzleParticle() const=0;
|
||||
virtual const std::string& GetPlasmaMuzzleParticle() const=0;
|
||||
virtual const std::string& GetPhazonMuzzleParticle() const=0;
|
||||
|
||||
virtual const std::string& GetPowerChargeParticle() const=0;
|
||||
virtual const std::string& GetIceChargeParticle() const=0;
|
||||
virtual const std::string& GetWaveChargeParticle() const=0;
|
||||
virtual const std::string& GetPlasmaChargeParticle() const=0;
|
||||
virtual const std::string& GetPhazonChargeParticle() const=0;
|
||||
|
||||
virtual const std::string& GetPowerAuxMuzzleParticle() const=0;
|
||||
virtual const std::string& GetIceAuxMuzzleParticle() const=0;
|
||||
virtual const std::string& GetWaveAuxMuzzleParticle() const=0;
|
||||
virtual const std::string& GetPlasmaAuxMuzzleParticle() const=0;
|
||||
virtual const std::string& GetPhazonAuxMuzzleParticle() const=0;
|
||||
virtual const std::string& GetWeapon(size_t idx, bool ball) const=0;
|
||||
virtual const std::string& GetMuzzleParticle(size_t idx) const=0;
|
||||
virtual const std::string& GetChargeParticle(size_t idx) const=0;
|
||||
virtual const std::string& GetAuxMuzzleParticle(size_t idx) const=0;
|
||||
|
||||
virtual const std::string& GetGrappleSegmentParticle() const=0;
|
||||
virtual const std::string& GetGrappleClawParticle() const=0;
|
||||
virtual const std::string& GetGrappleHitParticle() const=0;
|
||||
virtual const std::string& GetGrappleMuzzleParticle() const=0;
|
||||
virtual const std::string& GetGrappleSwooshParticle() const=0;
|
||||
|
||||
const std::string& GetBeamModel(EBeamId beam) const
|
||||
{
|
||||
int b = int(beam);
|
||||
if (b < 0 || b > 4)
|
||||
b = 0;
|
||||
switch (EBeamId(b))
|
||||
{
|
||||
case EBeamId::Power:
|
||||
default:
|
||||
return GetPowerBeam();
|
||||
case EBeamId::Ice:
|
||||
return GetIceBeam();
|
||||
case EBeamId::Plasma:
|
||||
return GetPlasmaBeam();
|
||||
case EBeamId::Wave:
|
||||
return GetWaveBeam();
|
||||
case EBeamId::Phazon:
|
||||
return GetPhazonBeam();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
#define __DNACOMMON_ITWEAKPLAYERRES_HPP__
|
||||
|
||||
#include "../DNACommon.hpp"
|
||||
#include "Runtime/IFactory.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
|
||||
struct ITweakPlayerRes : BigYAML
|
||||
{
|
||||
using ResId = int64_t;
|
||||
enum class EBeamId
|
||||
{
|
||||
Power,
|
||||
@@ -17,6 +19,128 @@ struct ITweakPlayerRes : BigYAML
|
||||
Phazon
|
||||
};
|
||||
|
||||
ResId x4_saveStationIcon;
|
||||
ResId x8_missileStationIcon;
|
||||
ResId xc_elevatorIcon;
|
||||
|
||||
ResId x10_minesBreakFirstTopIcon;
|
||||
ResId x14_minesBreakFirstBottomIcon;
|
||||
ResId x18_minesBreakSecondTopIcon;
|
||||
ResId x1c_minesBreakSecondBottomIcon;
|
||||
|
||||
/* N, U, UL, L, DL, D, DR, R, UR */
|
||||
ResId x24_lStick[9];
|
||||
ResId x4c_cStick[9];
|
||||
|
||||
/* Out, In */
|
||||
ResId x74_lTrigger[2];
|
||||
ResId x80_rTrigger[2];
|
||||
ResId x8c_startButton[2];
|
||||
ResId x98_aButton[2];
|
||||
ResId xa4_bButton[2];
|
||||
ResId xb0_xButton[2];
|
||||
ResId xbc_yButton[2];
|
||||
|
||||
ResId xc4_ballTransitionsANCS;
|
||||
|
||||
/* Power, Ice, Wave, Plasma, Phazon */
|
||||
ResId xc8_ballTransitions[5];
|
||||
ResId xc8_cineGun[5];
|
||||
|
||||
float xf0_unkFloat;
|
||||
|
||||
ResId GetBeamBallTransitionModel(EBeamId beam) const
|
||||
{
|
||||
int b = int(beam);
|
||||
if (b < 0 || b > 4)
|
||||
b = 0;
|
||||
switch (EBeamId(b))
|
||||
{
|
||||
case EBeamId::Power:
|
||||
default:
|
||||
return xc8_ballTransitions[0];
|
||||
case EBeamId::Ice:
|
||||
return xc8_ballTransitions[1];
|
||||
case EBeamId::Plasma:
|
||||
return xc8_ballTransitions[3];
|
||||
case EBeamId::Wave:
|
||||
return xc8_ballTransitions[2];
|
||||
case EBeamId::Phazon:
|
||||
return xc8_ballTransitions[4];
|
||||
}
|
||||
}
|
||||
|
||||
ResId GetBeamCineModel(EBeamId beam) const
|
||||
{
|
||||
int b = int(beam);
|
||||
if (b < 0 || b > 4)
|
||||
b = 0;
|
||||
switch (EBeamId(b))
|
||||
{
|
||||
case EBeamId::Power:
|
||||
default:
|
||||
return xc8_cineGun[0];
|
||||
case EBeamId::Ice:
|
||||
return xc8_cineGun[1];
|
||||
case EBeamId::Plasma:
|
||||
return xc8_cineGun[3];
|
||||
case EBeamId::Wave:
|
||||
return xc8_cineGun[2];
|
||||
case EBeamId::Phazon:
|
||||
return xc8_cineGun[4];
|
||||
}
|
||||
}
|
||||
|
||||
void ResolveResources(const urde::IFactory& factory)
|
||||
{
|
||||
x4_saveStationIcon = factory.GetResourceIdByName(GetSaveStationIcon().c_str())->id;
|
||||
x8_missileStationIcon = factory.GetResourceIdByName(GetMissileStationIcon().c_str())->id;
|
||||
xc_elevatorIcon = factory.GetResourceIdByName(GetElevatorIcon().c_str())->id;
|
||||
|
||||
x10_minesBreakFirstTopIcon = factory.GetResourceIdByName(GetMinesBreakFirstTopIcon().c_str())->id;
|
||||
x14_minesBreakFirstBottomIcon = factory.GetResourceIdByName(GetMinesBreakFirstTopIcon().c_str())->id;
|
||||
x18_minesBreakSecondTopIcon = factory.GetResourceIdByName(GetMinesBreakFirstTopIcon().c_str())->id;
|
||||
x1c_minesBreakSecondBottomIcon = factory.GetResourceIdByName(GetMinesBreakFirstTopIcon().c_str())->id;
|
||||
|
||||
for (int i=0 ; i<9 ; ++i)
|
||||
x24_lStick[i] = factory.GetResourceIdByName(GetLStick(i).c_str())->id;
|
||||
|
||||
for (int i=0 ; i<9 ; ++i)
|
||||
x4c_cStick[i] = factory.GetResourceIdByName(GetCStick(i).c_str())->id;
|
||||
|
||||
for (int i=0 ; i<2 ; ++i)
|
||||
x74_lTrigger[i] = factory.GetResourceIdByName(GetLTrigger(i).c_str())->id;
|
||||
|
||||
for (int i=0 ; i<2 ; ++i)
|
||||
x80_rTrigger[i] = factory.GetResourceIdByName(GetRTrigger(i).c_str())->id;
|
||||
|
||||
for (int i=0 ; i<2 ; ++i)
|
||||
x8c_startButton[i] = factory.GetResourceIdByName(GetStartButton(i).c_str())->id;
|
||||
|
||||
for (int i=0 ; i<2 ; ++i)
|
||||
x98_aButton[i] = factory.GetResourceIdByName(GetAButton(i).c_str())->id;
|
||||
|
||||
for (int i=0 ; i<2 ; ++i)
|
||||
xa4_bButton[i] = factory.GetResourceIdByName(GetBButton(i).c_str())->id;
|
||||
|
||||
for (int i=0 ; i<2 ; ++i)
|
||||
xb0_xButton[i] = factory.GetResourceIdByName(GetXButton(i).c_str())->id;
|
||||
|
||||
for (int i=0 ; i<2 ; ++i)
|
||||
xbc_yButton[i] = factory.GetResourceIdByName(GetYButton(i).c_str())->id;
|
||||
|
||||
xc4_ballTransitionsANCS = factory.GetResourceIdByName(GetBallTransitionsANCS().c_str())->id;
|
||||
|
||||
for (int i=0 ; i<5 ; ++i)
|
||||
xc8_ballTransitions[i] = factory.GetResourceIdByName(GetBallTransitionModel(i).c_str())->id;
|
||||
|
||||
for (int i=0 ; i<5 ; ++i)
|
||||
xc8_cineGun[i] = factory.GetResourceIdByName(GetBeamCineModel(i).c_str())->id;
|
||||
|
||||
xf0_unkFloat = GetUnkFloat();
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual const std::string& GetSaveStationIcon() const=0;
|
||||
virtual const std::string& GetMissileStationIcon() const=0;
|
||||
virtual const std::string& GetElevatorIcon() const=0;
|
||||
@@ -26,96 +150,23 @@ struct ITweakPlayerRes : BigYAML
|
||||
virtual const std::string& GetMinesBreakSecondTopIcon() const=0;
|
||||
virtual const std::string& GetMinesBreakSecondBottomIcon() const=0;
|
||||
|
||||
virtual const std::string& GetLStickN() const=0;
|
||||
virtual const std::string& GetLStickU() const=0;
|
||||
virtual const std::string& GetLStickUL() const=0;
|
||||
virtual const std::string& GetLStickL() const=0;
|
||||
virtual const std::string& GetLStickDL() const=0;
|
||||
virtual const std::string& GetLStickD() const=0;
|
||||
virtual const std::string& GetLStickDR() const=0;
|
||||
virtual const std::string& GetLStickR() const=0;
|
||||
virtual const std::string& GetLStickUR() const=0;
|
||||
virtual const std::string& GetLStick(size_t idx) const=0;
|
||||
virtual const std::string& GetCStick(size_t idx) const=0;
|
||||
|
||||
virtual const std::string& GetCStickN() const=0;
|
||||
virtual const std::string& GetCStickU() const=0;
|
||||
virtual const std::string& GetCStickUL() const=0;
|
||||
virtual const std::string& GetCStickL() const=0;
|
||||
virtual const std::string& GetCStickDL() const=0;
|
||||
virtual const std::string& GetCStickD() const=0;
|
||||
virtual const std::string& GetCStickDR() const=0;
|
||||
virtual const std::string& GetCStickR() const=0;
|
||||
virtual const std::string& GetCStickUR() const=0;
|
||||
|
||||
virtual const std::string& GetLTriggerOut() const=0;
|
||||
virtual const std::string& GetLTriggerIn() const=0;
|
||||
virtual const std::string& GetRTriggerOut() const=0;
|
||||
virtual const std::string& GetRTriggerIn() const=0;
|
||||
|
||||
virtual const std::string& GetStartButtonOut() const=0;
|
||||
virtual const std::string& GetStartButtonIn() const=0;
|
||||
virtual const std::string& GetAButtonOut() const=0;
|
||||
virtual const std::string& GetAButtonIn() const=0;
|
||||
virtual const std::string& GetBButtonOut() const=0;
|
||||
virtual const std::string& GetBButtonIn() const=0;
|
||||
virtual const std::string& GetXButtonOut() const=0;
|
||||
virtual const std::string& GetXButtonIn() const=0;
|
||||
virtual const std::string& GetYButtonOut() const=0;
|
||||
virtual const std::string& GetYButtonIn() const=0;
|
||||
virtual const std::string& GetLTrigger(size_t idx) const=0;
|
||||
virtual const std::string& GetRTrigger(size_t idx) const=0;
|
||||
virtual const std::string& GetStartButton(size_t idx) const=0;
|
||||
virtual const std::string& GetAButton(size_t idx) const=0;
|
||||
virtual const std::string& GetBButton(size_t idx) const=0;
|
||||
virtual const std::string& GetXButton(size_t idx) const=0;
|
||||
virtual const std::string& GetYButton(size_t idx) const=0;
|
||||
|
||||
virtual const std::string& GetBallTransitionsANCS() const=0;
|
||||
virtual const std::string& GetBallTransitionsPowerBeamModel() const=0;
|
||||
virtual const std::string& GetBallTransitionsIceBeamModel() const=0;
|
||||
virtual const std::string& GetBallTransitionsWaveBeamModel() const=0;
|
||||
virtual const std::string& GetBallTransitionsPlasmaBeamModel() const=0;
|
||||
virtual const std::string& GetBallTransitionsPhazonBeamModel() const=0;
|
||||
|
||||
virtual const std::string& GetPowerBeamCineModel() const=0;
|
||||
virtual const std::string& GetIceBeamCineModel() const=0;
|
||||
virtual const std::string& GetWaveBeamCineModel() const=0;
|
||||
virtual const std::string& GetPlasmaBeamCineModel() const=0;
|
||||
virtual const std::string& GetPhazonBeamCineModel() const=0;
|
||||
virtual const std::string& GetBallTransitionModel(size_t idx) const=0;
|
||||
virtual const std::string& GetBeamCineModel(size_t idx) const=0;
|
||||
|
||||
const std::string& GetBeamBallTransitionModel(EBeamId beam) const
|
||||
{
|
||||
int b = int(beam);
|
||||
if (b < 0 || b > 4)
|
||||
b = 0;
|
||||
switch (EBeamId(b))
|
||||
{
|
||||
case EBeamId::Power:
|
||||
default:
|
||||
return GetBallTransitionsPowerBeamModel();
|
||||
case EBeamId::Ice:
|
||||
return GetBallTransitionsIceBeamModel();
|
||||
case EBeamId::Plasma:
|
||||
return GetBallTransitionsPlasmaBeamModel();
|
||||
case EBeamId::Wave:
|
||||
return GetBallTransitionsWaveBeamModel();
|
||||
case EBeamId::Phazon:
|
||||
return GetBallTransitionsPhazonBeamModel();
|
||||
}
|
||||
}
|
||||
|
||||
const std::string& GetBeamCineModel(EBeamId beam) const
|
||||
{
|
||||
int b = int(beam);
|
||||
if (b < 0 || b > 4)
|
||||
b = 0;
|
||||
switch (EBeamId(b))
|
||||
{
|
||||
case EBeamId::Power:
|
||||
default:
|
||||
return GetPowerBeamCineModel();
|
||||
case EBeamId::Ice:
|
||||
return GetIceBeamCineModel();
|
||||
case EBeamId::Plasma:
|
||||
return GetPlasmaBeamCineModel();
|
||||
case EBeamId::Wave:
|
||||
return GetWaveBeamCineModel();
|
||||
case EBeamId::Phazon:
|
||||
return GetPhazonBeamCineModel();
|
||||
}
|
||||
}
|
||||
virtual float GetUnkFloat() const=0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user