2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 17:04:55 +00:00

Ensure directories are created late in extract

This commit is contained in:
Jack Andersen
2017-01-16 15:23:19 -10:00
parent d66d9a24f4
commit 56b24c39f0
50 changed files with 402 additions and 177 deletions

View File

@@ -36,21 +36,19 @@ enum class EArchMsgType
struct IArchMsgParm
{
virtual ~IArchMsgParm() {}
virtual ~IArchMsgParm() = default;
};
struct CArchMsgParmInt32 : IArchMsgParm
{
u32 x4_parm;
CArchMsgParmInt32(u32 parm) : x4_parm(parm) {}
virtual ~CArchMsgParmInt32() {}
};
struct CArchMsgParmVoidPtr : IArchMsgParm
{
void* x4_parm1;
CArchMsgParmVoidPtr(void* parm1) : x4_parm1(parm1) {}
virtual ~CArchMsgParmVoidPtr() {}
};
struct CArchMsgParmInt32Int32VoidPtr : IArchMsgParm
@@ -58,29 +56,33 @@ struct CArchMsgParmInt32Int32VoidPtr : IArchMsgParm
u32 x4_parm1;
u32 x8_parm2;
void* xc_parm3;
CArchMsgParmInt32Int32VoidPtr(u32 parm1, u32 parm2, void* parm3) : x4_parm1(parm1), x8_parm2(parm2), xc_parm3(parm3)
{
}
virtual ~CArchMsgParmInt32Int32VoidPtr() {}
CArchMsgParmInt32Int32VoidPtr(u32 parm1, u32 parm2, void* parm3)
: x4_parm1(parm1), x8_parm2(parm2), xc_parm3(parm3) {}
};
struct CArchMsgParmInt32Int32IOWin : IArchMsgParm
{
u32 x4_parm1;
u32 x8_parm2;
std::shared_ptr<CIOWin> xc_parm3;
CArchMsgParmInt32Int32IOWin(u32 parm1, u32 parm2, std::shared_ptr<CIOWin>&& parm3)
: x4_parm1(parm1), x8_parm2(parm2), xc_parm3(std::move(parm3)) {}
};
struct CArchMsgParmNull : IArchMsgParm
{
virtual ~CArchMsgParmNull() {}
};
struct CArchMsgParmReal32 : IArchMsgParm
{
float x4_parm;
CArchMsgParmReal32(float parm) : x4_parm(parm) {}
virtual ~CArchMsgParmReal32() {}
};
struct CArchMsgParmUserInput : IArchMsgParm
{
CFinalInput x4_parm;
CArchMsgParmUserInput(const CFinalInput& parm) : x4_parm(parm) {}
virtual ~CArchMsgParmUserInput() {}
};
struct CArchMsgParmControllerStatus : IArchMsgParm
@@ -88,8 +90,6 @@ struct CArchMsgParmControllerStatus : IArchMsgParm
u16 x4_parm1;
bool x6_parm2;
CArchMsgParmControllerStatus(u16 a, bool b) : x4_parm1(a), x6_parm2(b) {}
virtual ~CArchMsgParmControllerStatus() {}
};
class CArchitectureMessage
@@ -99,10 +99,9 @@ class CArchitectureMessage
std::shared_ptr<IArchMsgParm> x8_parm;
public:
CArchitectureMessage(EArchMsgTarget target, EArchMsgType type, IArchMsgParm* parm)
: x0_target(target), x4_type(type), x8_parm(parm)
{
}
CArchitectureMessage(EArchMsgTarget target, EArchMsgType type,
std::shared_ptr<IArchMsgParm>&& parm)
: x0_target(target), x4_type(type), x8_parm(std::move(parm)) {}
EArchMsgTarget GetTarget() const { return x0_target; }
EArchMsgType GetType() const { return x4_type; }
@@ -118,11 +117,13 @@ class MakeMsg
public:
static CArchitectureMessage CreateQuitGameplay(EArchMsgTarget target)
{
return CArchitectureMessage(target, EArchMsgType::QuitGameplay, new CArchMsgParmNull());
return CArchitectureMessage(target, EArchMsgType::QuitGameplay,
std::make_shared<CArchMsgParmNull>());
}
static CArchitectureMessage CreateControllerStatus(EArchMsgTarget target, u16 a, bool b)
{
return CArchitectureMessage(target, EArchMsgType::ControllerStatus, new CArchMsgParmControllerStatus(a, b));
return CArchitectureMessage(target, EArchMsgType::ControllerStatus,
std::make_shared<CArchMsgParmControllerStatus>(a, b));
}
static const CArchMsgParmInt32& GetParmNewGameflowState(const CArchitectureMessage& msg)
{
@@ -134,7 +135,8 @@ public:
}
static CArchitectureMessage CreateUserInput(EArchMsgTarget target, const CFinalInput& input)
{
return CArchitectureMessage(target, EArchMsgType::UserInput, new CArchMsgParmUserInput(input));
return CArchitectureMessage(target, EArchMsgType::UserInput,
std::make_shared<CArchMsgParmUserInput>(input));
}
static const CArchMsgParmReal32& GetParmTimerTick(const CArchitectureMessage& msg)
{
@@ -142,20 +144,22 @@ public:
}
static CArchitectureMessage CreateTimerTick(EArchMsgTarget target, float val)
{
return CArchitectureMessage(target, EArchMsgType::TimerTick, new CArchMsgParmReal32(val));
return CArchitectureMessage(target, EArchMsgType::TimerTick,
std::make_shared<CArchMsgParmReal32>(val));
}
static const CArchMsgParmInt32Int32VoidPtr& GetParmChangeIOWinPriority(const CArchitectureMessage& msg)
{
return *msg.GetParm<CArchMsgParmInt32Int32VoidPtr>();
}
static const CArchMsgParmInt32Int32VoidPtr& GetParmCreateIOWin(const CArchitectureMessage& msg)
static const CArchMsgParmInt32Int32IOWin& GetParmCreateIOWin(const CArchitectureMessage& msg)
{
return *msg.GetParm<CArchMsgParmInt32Int32VoidPtr>();
return *msg.GetParm<CArchMsgParmInt32Int32IOWin>();
}
static CArchitectureMessage CreateCreateIOWin(EArchMsgTarget target, int pmin, int pmax, CIOWin* iowin)
static CArchitectureMessage CreateCreateIOWin(EArchMsgTarget target, int pmin, int pmax,
std::shared_ptr<CIOWin>&& iowin)
{
return CArchitectureMessage(target, EArchMsgType::CreateIOWin,
new CArchMsgParmInt32Int32VoidPtr(pmin, pmax, iowin));
std::make_shared<CArchMsgParmInt32Int32IOWin>(pmin, pmax, std::move(iowin)));
}
static const CArchMsgParmVoidPtr& GetParmDeleteIOWin(const CArchitectureMessage& msg)
{
@@ -163,12 +167,14 @@ public:
}
static CArchitectureMessage CreateFrameBegin(EArchMsgTarget target, const int& a)
{
return CArchitectureMessage(target, EArchMsgType::FrameBegin, new CArchMsgParmInt32(a));
return CArchitectureMessage(target, EArchMsgType::FrameBegin,
std::make_shared<CArchMsgParmInt32>(a));
}
/* URDE Messages */
static CArchitectureMessage CreateApplicationExit(EArchMsgTarget target)
{
return CArchitectureMessage(target, EArchMsgType::ApplicationExit, new CArchMsgParmNull());
return CArchitectureMessage(target, EArchMsgType::ApplicationExit,
std::make_shared<CArchMsgParmNull>());
}
};
}