mirror of https://github.com/AxioDL/metaforce.git
Merge branch 'master' of https://github.com/AxioDL/PathShagged
This commit is contained in:
commit
02d605cbb9
|
@ -3,7 +3,7 @@ cmake_policy(SET CMP0054 NEW)
|
|||
project(PathShagged)
|
||||
if(MSVC)
|
||||
# Shaddup MSVC
|
||||
add_definitions(-DUNICODE=1 -D_UNICODE=1 -D__SSE__=1 -D_CRT_SECURE_NO_WARNINGS=1 -DD_SCL_SECURE_NO_WARNINGS=1 /wd4267 /wd4244 /wd4305)
|
||||
add_definitions(-DUNICODE=1 -D_UNICODE=1 -D__SSE__=1 -D_CRT_SECURE_NO_WARNINGS=1 -DD_SCL_SECURE_NO_WARNINGS=1 /wd4267 /wd4244 /wd4305 /MP)
|
||||
|
||||
# Link-time Code Generation for Release builds
|
||||
set(CMAKE_C_FLAGS_RELEASE "/DNDEBUG /O2 /Oy /GL /Gy /MD")
|
||||
|
|
|
@ -46,6 +46,7 @@ std::unique_ptr<pshag::IObj> ProjectResourceFactory::Build(const pshag::SObjectT
|
|||
if (search == m_resPaths.end())
|
||||
return {};
|
||||
|
||||
fprintf(stderr, "Loading resource %s\n", search->second.getRelativePath().c_str());
|
||||
Athena::io::FileReader fr(search->second.getAbsolutePath(), 32 * 1024, false);
|
||||
if (fr.hasError())
|
||||
return {};
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace URDE
|
|||
void ViewManager::BuildTestPART(pshag::IObjectStore& objStore)
|
||||
{
|
||||
//m_partGenDesc = objStore.GetObj({HECL::FOURCC('PART'), 0x972A5CD2});
|
||||
m_partGenDesc = objStore.GetObj("PART_EnvRainSplash");
|
||||
m_partGenDesc = objStore.GetObj("BusterSparks");
|
||||
m_partGen.reset(new pshag::CElementGen(m_partGenDesc,
|
||||
pshag::CElementGen::EModelOrientationType::Normal,
|
||||
pshag::CElementGen::EOptionalSystemFlags::None));
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
#include "CCharAnimTime.hpp"
|
||||
|
||||
namespace pshag
|
||||
{
|
||||
|
||||
}
|
|
@ -6,30 +6,41 @@ namespace pshag
|
|||
|
||||
class CCharAnimTime
|
||||
{
|
||||
float m_time;
|
||||
int m_unk; // enum?
|
||||
float m_time = 0.f;
|
||||
int m_unk = 2; // enum?
|
||||
public:
|
||||
CCharAnimTime() = default;
|
||||
CCharAnimTime(float time)
|
||||
: m_time(time),
|
||||
m_unk(m_time != 0.0 ? 0 : 2)
|
||||
m_unk(m_time != 0.f ? 0 : 2)
|
||||
{
|
||||
}
|
||||
|
||||
bool EqualsZero()
|
||||
bool EqualsZero() const
|
||||
{
|
||||
if (m_unk == 1 || m_unk == 2 || m_unk == 3)
|
||||
return false;
|
||||
|
||||
return (m_time == 0.0);
|
||||
return (m_time == 0.f);
|
||||
}
|
||||
|
||||
bool GreaterThanZero()
|
||||
bool GreaterThanZero() const
|
||||
{
|
||||
if (EqualsZero())
|
||||
return false;
|
||||
return (m_time != 0.0);
|
||||
return (m_time > 0.f);
|
||||
}
|
||||
#if 0
|
||||
#if 1
|
||||
bool operator ==(const CCharAnimTime& other) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool operator !=(const CCharAnimTime& other) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
bool operator>=(const CCharAnimTime& other)
|
||||
{
|
||||
if (*this == other)
|
||||
|
@ -46,15 +57,148 @@ public:
|
|||
return (*this < other);
|
||||
}
|
||||
|
||||
void operator*=(const CCharAnimTime& other)
|
||||
{ *this = *this * other; }
|
||||
|
||||
void operator+=(const CCharAnimTime& other)
|
||||
{ *this = *this + other; }
|
||||
|
||||
void operator+(const CCharAnimTime& other)
|
||||
bool operator >(const CCharAnimTime& other) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool operator <(const CCharAnimTime& other) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
CCharAnimTime& operator*=(const CCharAnimTime& other)
|
||||
{
|
||||
*this = *this * other;
|
||||
return *this;
|
||||
}
|
||||
|
||||
CCharAnimTime& operator+=(const CCharAnimTime& other)
|
||||
{
|
||||
*this = *this + other;
|
||||
return *this;
|
||||
}
|
||||
|
||||
CCharAnimTime operator+(const CCharAnimTime& other)
|
||||
{
|
||||
if (m_unk == 4 && other.m_unk == 4)
|
||||
{
|
||||
if (other.m_time != m_time)
|
||||
return CCharAnimTime();
|
||||
return *this;
|
||||
}
|
||||
else if (m_unk == 4)
|
||||
return *this;
|
||||
else if (other.m_unk == 4)
|
||||
return other;
|
||||
|
||||
if (!EqualsZero() || !other.EqualsZero())
|
||||
return CCharAnimTime(m_time + other.m_time);
|
||||
|
||||
int type = -1;
|
||||
if (m_unk != 3)
|
||||
{
|
||||
if (m_unk != 2)
|
||||
type = 1;
|
||||
else
|
||||
type = 0;
|
||||
}
|
||||
|
||||
int otherType = -1;
|
||||
if (other.m_unk != 3)
|
||||
{
|
||||
if (other.m_unk != 2)
|
||||
otherType = 1;
|
||||
else
|
||||
otherType = 0;
|
||||
}
|
||||
|
||||
type += otherType;
|
||||
if (type < 1)
|
||||
otherType = 1;
|
||||
else
|
||||
otherType = type;
|
||||
|
||||
if (otherType < -1)
|
||||
otherType = -1;
|
||||
|
||||
CCharAnimTime ret;
|
||||
if (otherType == -1)
|
||||
ret.m_unk = 3;
|
||||
else if (otherType == 0)
|
||||
ret.m_unk = 2;
|
||||
else
|
||||
ret.m_unk = 1;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
CCharAnimTime operator*(const CCharAnimTime& other)
|
||||
{
|
||||
if (m_unk == 4 && other.m_unk == 4)
|
||||
{
|
||||
if (other.m_time != m_time)
|
||||
return CCharAnimTime();
|
||||
return *this;
|
||||
}
|
||||
else if (m_unk == 4)
|
||||
return *this;
|
||||
else if (other.m_unk == 4)
|
||||
return other;
|
||||
|
||||
if (!EqualsZero() || !other.EqualsZero())
|
||||
return CCharAnimTime(m_time * other.m_time);
|
||||
|
||||
int type = -1;
|
||||
if (m_unk != 3)
|
||||
{
|
||||
if (m_unk != 2)
|
||||
type = 1;
|
||||
else
|
||||
type = 0;
|
||||
}
|
||||
|
||||
int otherType = -1;
|
||||
if (other.m_unk != 3)
|
||||
{
|
||||
if (other.m_unk != 2)
|
||||
otherType = 1;
|
||||
else
|
||||
otherType = 0;
|
||||
}
|
||||
|
||||
type += otherType;
|
||||
if (type < 1)
|
||||
otherType = 1;
|
||||
else
|
||||
otherType = type;
|
||||
|
||||
if (otherType < -1)
|
||||
otherType = -1;
|
||||
|
||||
CCharAnimTime ret;
|
||||
if (otherType == -1)
|
||||
ret.m_unk = 3;
|
||||
else if (otherType == 0)
|
||||
ret.m_unk = 2;
|
||||
else
|
||||
ret.m_unk = 1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
CCharAnimTime operator*(const float& other)
|
||||
{
|
||||
return CCharAnimTime();
|
||||
}
|
||||
|
||||
float operator/(const CCharAnimTime& other)
|
||||
{
|
||||
if (other.EqualsZero())
|
||||
return 0.f;
|
||||
|
||||
return m_time / other.m_time;
|
||||
}
|
||||
|
||||
#endif
|
||||
};
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
namespace pshag
|
||||
{
|
||||
LogVisor::LogModule LineRendererLog("pshag::CLineRenderer");
|
||||
|
||||
boo::IShaderPipeline* CLineRendererShaders::m_texAlpha = nullptr;
|
||||
boo::IShaderPipeline* CLineRendererShaders::m_texAdditive = nullptr;
|
||||
|
@ -107,7 +108,10 @@ CLineRenderer::CLineRenderer(EPrimitiveMode mode, u32 maxVerts, boo::ITexture* t
|
|||
: m_mode(mode), m_maxVerts(maxVerts)
|
||||
{
|
||||
if (maxVerts < 2)
|
||||
{
|
||||
LineRendererLog.report(LogVisor::FatalError, _S("maxVerts < 2, maxVerts = %i"), maxVerts);
|
||||
return;
|
||||
}
|
||||
m_textured = texture != nullptr;
|
||||
|
||||
u32 maxTriVerts;
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
#ifndef IRUNTIMEMAIN_HPP
|
||||
#define IRUNTIMEMAIN_HPP
|
||||
|
||||
namespace pshag
|
||||
{
|
||||
struct IRuntimeMain
|
||||
{
|
||||
void init() = 0;
|
||||
int proc() = 0;
|
||||
void stop() = 0;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // IRUNTIMEMAIN_HPP
|
|
@ -426,8 +426,9 @@ CElementGen::CElementGen(const TToken<CGenDescription>& gen,
|
|||
boo::ITexture* tex = nullptr;
|
||||
if (texr)
|
||||
tex = texr->GetValueTexture(0).GetObj()->GetBooTexture();
|
||||
int maxVerts = (x70_MAXP == 0 ? 256 : x70_MAXP);
|
||||
m_lineRenderer.reset(new CLineRenderer(CLineRenderer::EPrimitiveMode::Lines,
|
||||
x70_MAXP * 2, tex, x224_26_AAPH));
|
||||
maxVerts * 2, tex, x224_26_AAPH));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -13,6 +13,6 @@ int CParticleGlobals::g_ParticleLifetimePercentage = 0;
|
|||
float CParticleGlobals::g_ParticleLifetimePercentageReal = 0.0;
|
||||
float CParticleGlobals::g_ParticleLifetimePercentageRemainder = 0.0;
|
||||
|
||||
float* CParticleGlobals::g_papValues = nullptr;
|
||||
float CParticleGlobals::g_papValues[8] = { 0.f };
|
||||
CParticleGlobals::SParticleSystem* CParticleGlobals::g_currentParticleSystem = nullptr;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
g_ParticleLifetimePercentageRemainder = g_ParticleLifetimePercentageReal - g_ParticleLifetimePercentage;
|
||||
}
|
||||
|
||||
static float* g_papValues;
|
||||
static float g_papValues[8];
|
||||
|
||||
struct SParticleSystem
|
||||
{
|
||||
|
|
|
@ -231,61 +231,61 @@ bool CRECompareEquals::GetValue(int frame, float& valOut) const
|
|||
return false;
|
||||
}
|
||||
|
||||
bool CREParticleAccessParam1::GetValue(int frame, float& valOut) const
|
||||
bool CREParticleAccessParam1::GetValue(int /*frame*/, float& valOut) const
|
||||
{
|
||||
//valOut = CParticleGlobals::g_papValues[0];
|
||||
valOut = CParticleGlobals::g_papValues[0];
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CREParticleAccessParam2::GetValue(int frame, float& valOut) const
|
||||
bool CREParticleAccessParam2::GetValue(int /*frame*/, float& valOut) const
|
||||
{
|
||||
//valOut = CParticleGlobals::g_papValues[1];
|
||||
valOut = CParticleGlobals::g_papValues[1];
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CREParticleAccessParam3::GetValue(int frame, float& valOut) const
|
||||
bool CREParticleAccessParam3::GetValue(int /*frame*/, float& valOut) const
|
||||
{
|
||||
//valOut = CParticleGlobals::g_papValues[2];
|
||||
valOut = CParticleGlobals::g_papValues[2];
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CREParticleAccessParam4::GetValue(int frame, float& valOut) const
|
||||
bool CREParticleAccessParam4::GetValue(int /*frame*/, float& valOut) const
|
||||
{
|
||||
//valOut = CParticleGlobals::g_papValues[3];
|
||||
valOut = CParticleGlobals::g_papValues[3];
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CREParticleAccessParam5::GetValue(int frame, float& valOut) const
|
||||
bool CREParticleAccessParam5::GetValue(int /*frame*/, float& valOut) const
|
||||
{
|
||||
//valOut = CParticleGlobals::g_papValues[4];
|
||||
valOut = CParticleGlobals::g_papValues[4];
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CREParticleAccessParam6::GetValue(int frame, float& valOut) const
|
||||
bool CREParticleAccessParam6::GetValue(int /*frame*/, float& valOut) const
|
||||
{
|
||||
//valOut = CParticleGlobals::g_papValues[5];
|
||||
valOut = CParticleGlobals::g_papValues[5];
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CREParticleAccessParam7::GetValue(int frame, float& valOut) const
|
||||
bool CREParticleAccessParam7::GetValue(int /*frame*/, float& valOut) const
|
||||
{
|
||||
//valOut = CParticleGlobals::g_papValues[6];
|
||||
valOut = CParticleGlobals::g_papValues[6];
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CREParticleAccessParam8::GetValue(int frame, float& valOut) const
|
||||
bool CREParticleAccessParam8::GetValue(int /*frame*/, float& valOut) const
|
||||
{
|
||||
//valOut = CParticleGlobals::g_papValues[7];
|
||||
valOut = CParticleGlobals::g_papValues[7];
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CREPSLL::GetValue(int frame, float& valOut) const
|
||||
bool CREPSLL::GetValue(int /*frame*/, float& valOut) const
|
||||
{
|
||||
valOut = CElementGen::g_currentParticle->x2c_lineLengthOrSize;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CREPRLW::GetValue(int frame, float& valOut) const
|
||||
bool CREPRLW::GetValue(int /*frame*/, float& valOut) const
|
||||
{
|
||||
valOut = CElementGen::g_currentParticle->x30_lineWidthOrRota;
|
||||
return false;
|
||||
|
|
2
hecl
2
hecl
|
@ -1 +1 @@
|
|||
Subproject commit 9cbf88035f4e0b493f8cbb0a977c78ceebf7d603
|
||||
Subproject commit d7ba6810af60bccd41d42d1c06112c2f414b3f98
|
Loading…
Reference in New Issue