mirror of https://github.com/AxioDL/metaforce.git
Merge branch 'master' of https://github.com/AxioDL/PathShagged
This commit is contained in:
commit
6db378ea45
|
@ -6,6 +6,7 @@ make_dnalist(liblist
|
|||
CINF
|
||||
CSKR
|
||||
MREA
|
||||
PTLA
|
||||
DeafBabe)
|
||||
add_library(DNAMP2
|
||||
DNAMP2.hpp DNAMP2.cpp
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
#ifndef PTLA_HPP
|
||||
#define PTLA_HPP
|
||||
|
||||
#include "../DNACommon/DNACommon.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAMP2
|
||||
{
|
||||
struct PTLA : BigDNA
|
||||
{
|
||||
DECL_DNA
|
||||
Value<atUint32> magic;
|
||||
Value<atUint32> version;
|
||||
struct UnknownStruct1 : BigDNA
|
||||
{
|
||||
DECL_DNA
|
||||
Value<atUint32> count;
|
||||
struct Entry : BigDNA
|
||||
{
|
||||
DECL_DNA
|
||||
Value<float> unknown1;
|
||||
Value<float> unknown2;
|
||||
Value<float> unknown3;
|
||||
Value<float> unknown4;
|
||||
Value<atUint16> unknown5;
|
||||
Value<atUint16> unknown6;
|
||||
};
|
||||
Vector<Entry, DNA_COUNT(count)> entries;
|
||||
Value<atVec3f> unknown[2];
|
||||
};
|
||||
Value<atUint32> count1;
|
||||
Vector<UnknownStruct1, DNA_COUNT(count1)> entries1;
|
||||
|
||||
struct UnknownStruct2 : BigDNA
|
||||
{
|
||||
DECL_DNA
|
||||
Value<atUint32> count;
|
||||
struct Entry : BigDNA
|
||||
{
|
||||
DECL_DNA
|
||||
Value<float> unknown1;
|
||||
Value<float> unknown2;
|
||||
Value<float> unknown3;
|
||||
Value<float> unknown4;
|
||||
};
|
||||
Vector<Entry, DNA_COUNT(count)> entries;
|
||||
Value<atUint16> unknown;
|
||||
};
|
||||
Value<atUint32> count2;
|
||||
Vector<UnknownStruct2, DNA_COUNT(count2)> entries2;
|
||||
|
||||
Value<atUint32> shortCount1;
|
||||
Vector<atUint16, DNA_COUNT(shortCount1)> shorts1;
|
||||
|
||||
Value<atUint32> shortCount2;
|
||||
Vector<atUint16, DNA_COUNT(shortCount2)> shorts2;
|
||||
|
||||
struct UnknownStruct3 : BigDNA
|
||||
{
|
||||
DECL_DNA
|
||||
Value<atVec3f> unknown1[2];
|
||||
Value<atUint16> unknown2;
|
||||
Value<atUint16> unknown3;
|
||||
Value<atUint16> unknown4;
|
||||
};
|
||||
Value<atUint32> count3;
|
||||
Vector<UnknownStruct3, DNA_COUNT(count3)> entries3;
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif // PTLA_HPP
|
|
@ -72,6 +72,8 @@ public:
|
|||
const CKeyboardMouseControllerData& data,
|
||||
const CFinalInput& prevInput);
|
||||
CFinalInput& operator|=(const CFinalInput& other);
|
||||
bool operator==(const CFinalInput& other)
|
||||
{ return memcmp(this, &other, sizeof(CFinalInput)) == 0; }
|
||||
|
||||
bool PStart() const {return x2e_b31_PStart;}
|
||||
bool PR() const {return x2e_b26_PR;}
|
||||
|
|
|
@ -7,6 +7,12 @@ namespace pshag
|
|||
|
||||
void CInputGenerator::Update(float dt, CArchitectureQueue& queue)
|
||||
{
|
||||
if (m_firstFrame)
|
||||
{
|
||||
m_firstFrame = false;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Keyboard/Mouse first */
|
||||
CFinalInput kbInput = getFinalInput(0, dt);
|
||||
bool kbUsed = false;
|
||||
|
|
|
@ -32,6 +32,8 @@ class CInputGenerator : public boo::DeviceFinder
|
|||
m_lastUpdate = CFinalInput(idx, dt, m_data, m_lastUpdate);
|
||||
return m_lastUpdate;
|
||||
}
|
||||
|
||||
bool m_firstFrame = true;
|
||||
public:
|
||||
CInputGenerator(float leftDiv, float rightDiv)
|
||||
: boo::DeviceFinder({typeid(boo::DolphinSmashAdapter)}),
|
||||
|
|
|
@ -3,4 +3,7 @@ add_library(RuntimeCommonInput
|
|||
CKeyboardMouseController.hpp
|
||||
ControlMapper.hpp ControlMapper.cpp
|
||||
CInputGenerator.hpp CInputGenerator.cpp
|
||||
CFinalInput.hpp CFinalInput.cpp)
|
||||
CFinalInput.hpp CFinalInput.cpp
|
||||
CRumbleManager.hpp CRumbleManager.cpp
|
||||
CRumbleGenerator.hpp CRumbleGenerator.cpp
|
||||
CRumbleVoice.hpp CRumbleVoice.cpp)
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
#include "CRumbleGenerator.hpp"
|
||||
|
||||
namespace pshag
|
||||
{
|
||||
CRumbleGenerator::CRumbleGenerator()
|
||||
{
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
#ifndef CRUMBLEGENERATOR_HPP
|
||||
#define CRUMBLEGENERATOR_HPP
|
||||
|
||||
#include "CRumbleVoice.hpp"
|
||||
|
||||
namespace pshag
|
||||
{
|
||||
class CRumbleGenerator
|
||||
{
|
||||
public:
|
||||
CRumbleGenerator();
|
||||
void Update(float);
|
||||
void HardStopAll();
|
||||
};
|
||||
}
|
||||
|
||||
#endif // CRUMBLEGENERATOR_HPP
|
|
@ -0,0 +1,8 @@
|
|||
#include "CRumbleManager.hpp"
|
||||
|
||||
namespace pshag
|
||||
{
|
||||
|
||||
void CRumbleManager::Update(float dt) { x0_rumbleGenerator.Update(dt); }
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
#ifndef __PSHAG_CRUMBLEMANAGER_HPP__
|
||||
#define __PSHAG_CRUMBLEMANAGER_HPP__
|
||||
|
||||
#include "CRumbleGenerator.hpp"
|
||||
|
||||
namespace pshag
|
||||
{
|
||||
class CStateManager;
|
||||
class CRumbleManager
|
||||
{
|
||||
CRumbleGenerator x0_rumbleGenerator;
|
||||
public:
|
||||
CRumbleManager() = default;
|
||||
void Update(float);
|
||||
void StopRumble(u16) {}
|
||||
void Rumble(ERumbleFxId, CStateManager&, ERumblePriority priority);
|
||||
void Rumble(ERumbleFxId, float, CStateManager&, ERumblePriority priority);
|
||||
};
|
||||
}
|
||||
|
||||
#endif // __PSHAG_CRUMBLEMANAGER_HPP__
|
|
@ -0,0 +1,5 @@
|
|||
#include "CRumbleVoice.hpp"
|
||||
|
||||
namespace pshag
|
||||
{
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
#ifndef CRUMBLEVOICE_HPP
|
||||
#define CRUMBLEVOICE_HPP
|
||||
|
||||
#include "RetroTypes.hpp"
|
||||
|
||||
namespace pshag
|
||||
{
|
||||
enum class ERumbleFxId
|
||||
{
|
||||
|
||||
};
|
||||
enum class ERumblePriority
|
||||
{
|
||||
None
|
||||
};
|
||||
|
||||
struct SAdsrData;
|
||||
class CRumbleVoice
|
||||
{
|
||||
public:
|
||||
CRumbleVoice() {}
|
||||
CRumbleVoice(const SAdsrData& data);
|
||||
};
|
||||
|
||||
struct SAdsrData
|
||||
{
|
||||
float x0 = 0.f;
|
||||
float x4 = 0.f;
|
||||
float x8 = 0.f;
|
||||
float xc = 0.f;
|
||||
float x10 = 0.f;
|
||||
float x14 = 0.f;
|
||||
union
|
||||
{
|
||||
struct { bool x18_24 : 1; bool x18_25 : 1; };
|
||||
u8 dummy = 0;
|
||||
};
|
||||
|
||||
SAdsrData() = default;
|
||||
SAdsrData(float a, float b, float c, float d, float e, float f, bool g, bool h)
|
||||
: x0(a), x4(b), x8(c), xc(d), x10(e), x14(f)
|
||||
{
|
||||
x18_24 = g;
|
||||
x18_25 = h;
|
||||
}
|
||||
};
|
||||
|
||||
struct SAdsrDelta
|
||||
{
|
||||
enum class EPhase
|
||||
{
|
||||
Stop,
|
||||
Start,
|
||||
};
|
||||
|
||||
float x0 = 0.f;
|
||||
float x4 = 0.f;
|
||||
float x8 = 0.f;
|
||||
float xc = 0.f;
|
||||
float x10 = 0.f;
|
||||
ERumblePriority x1c_priority;
|
||||
EPhase x20_phase;
|
||||
|
||||
SAdsrDelta(EPhase phase, ERumblePriority priority)
|
||||
: x1c_priority(priority), x20_phase(phase)
|
||||
{}
|
||||
SAdsrDelta(EPhase phase)
|
||||
: x1c_priority(ERumblePriority::None), x20_phase(phase)
|
||||
{}
|
||||
|
||||
static SAdsrDelta Stopped() { return SAdsrDelta(EPhase::Stop); }
|
||||
static SAdsrDelta Start(ERumblePriority priority) { return SAdsrDelta(EPhase::Start, priority); }
|
||||
};
|
||||
}
|
||||
|
||||
#endif // CRUMBLEVOICE_HPP
|
|
@ -4,9 +4,15 @@
|
|||
|
||||
namespace pshag
|
||||
{
|
||||
std::unique_ptr<IObj> FDealDataFactory(const SObjectTag &tag, CInputStream &in, const CVParamTransfer &vparms)
|
||||
CDecalDescription* CDecalDataFactory::GetGeneratorDesc(CInputStream& in, CSimplePool* resPool)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<IObj> FDecalDataFactory(const SObjectTag &tag, CInputStream &in, const CVParamTransfer &vparms)
|
||||
{
|
||||
CSimplePool* sp = static_cast<CSimplePool*>(static_cast<TObjOwnerParam<IObjectStore*>*>(vparms.GetObj())->GetParam());
|
||||
return TToken<CDecalDescription>::GetIObjObjectFor(std::unique_ptr<CDecalDescription>(CDecalDataFactory::GetGeneratorDesc(in, sp)));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,6 +20,6 @@ public:
|
|||
static bool CreateDPSM(CDecalDescription* desc,CInputStream& in,CSimplePool* resPool);
|
||||
};
|
||||
|
||||
std::unique_ptr<IObj> FDealDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms);
|
||||
std::unique_ptr<IObj> FDecalDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms);
|
||||
}
|
||||
#endif // __PSHAG_CDECALDATAFACTORY_HPP__
|
||||
|
|
|
@ -132,7 +132,7 @@ void CParticleElectricDataFactory::LoadELSMTokens(CElectricDescription* desc)
|
|||
desc->x60_EPSM.m_gen = desc->x60_EPSM.m_token.GetObj();
|
||||
}
|
||||
|
||||
std::unique_ptr<pshag::IObj> FParticleElecrticFactory(const pshag::SObjectTag &tag, pshag::CInputStream &in, const pshag::CVParamTransfer &vparms)
|
||||
std::unique_ptr<IObj> FParticleElectricDataFactory(const SObjectTag &tag, CInputStream &in, const CVParamTransfer &vparms)
|
||||
{
|
||||
CSimplePool* sp = static_cast<CSimplePool*>(static_cast<TObjOwnerParam<IObjectStore*>*>(vparms.GetObj())->GetParam());
|
||||
return TToken<CElectricDescription>::GetIObjObjectFor(std::unique_ptr<CElectricDescription>(CParticleElectricDataFactory::GetGeneratorDesc(in, sp)));
|
||||
|
|
|
@ -78,6 +78,9 @@ bool CProjectileWeaponDataFactory::CreateWPSM(CWeaponDescription* desc, CInputSt
|
|||
desc->x2a_AP11 = CPF::GetBool(in);
|
||||
break;
|
||||
case SBIG('AP21'):
|
||||
desc->x2b_AP21 = CPF::GetBool(in);
|
||||
break;
|
||||
case SBIG('AS11'):
|
||||
desc->x2c_AS11 = CPF::GetBool(in);
|
||||
break;
|
||||
case SBIG('AS12'):
|
||||
|
|
Loading…
Reference in New Issue