2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-08-11 10:19:07 +00:00
This commit is contained in:
Jack Andersen 2016-02-27 20:56:08 -10:00
commit 02d605cbb9
12 changed files with 209 additions and 39 deletions

View File

@ -3,7 +3,7 @@ cmake_policy(SET CMP0054 NEW)
project(PathShagged) project(PathShagged)
if(MSVC) if(MSVC)
# Shaddup 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 # Link-time Code Generation for Release builds
set(CMAKE_C_FLAGS_RELEASE "/DNDEBUG /O2 /Oy /GL /Gy /MD") set(CMAKE_C_FLAGS_RELEASE "/DNDEBUG /O2 /Oy /GL /Gy /MD")

View File

@ -46,6 +46,7 @@ std::unique_ptr<pshag::IObj> ProjectResourceFactory::Build(const pshag::SObjectT
if (search == m_resPaths.end()) if (search == m_resPaths.end())
return {}; return {};
fprintf(stderr, "Loading resource %s\n", search->second.getRelativePath().c_str());
Athena::io::FileReader fr(search->second.getAbsolutePath(), 32 * 1024, false); Athena::io::FileReader fr(search->second.getAbsolutePath(), 32 * 1024, false);
if (fr.hasError()) if (fr.hasError())
return {}; return {};

View File

@ -21,7 +21,7 @@ namespace URDE
void ViewManager::BuildTestPART(pshag::IObjectStore& objStore) void ViewManager::BuildTestPART(pshag::IObjectStore& objStore)
{ {
//m_partGenDesc = objStore.GetObj({HECL::FOURCC('PART'), 0x972A5CD2}); //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, m_partGen.reset(new pshag::CElementGen(m_partGenDesc,
pshag::CElementGen::EModelOrientationType::Normal, pshag::CElementGen::EModelOrientationType::Normal,
pshag::CElementGen::EOptionalSystemFlags::None)); pshag::CElementGen::EOptionalSystemFlags::None));

View File

@ -0,0 +1,6 @@
#include "CCharAnimTime.hpp"
namespace pshag
{
}

View File

@ -6,30 +6,41 @@ namespace pshag
class CCharAnimTime class CCharAnimTime
{ {
float m_time; float m_time = 0.f;
int m_unk; // enum? int m_unk = 2; // enum?
public: public:
CCharAnimTime() = default;
CCharAnimTime(float time) CCharAnimTime(float time)
: m_time(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) if (m_unk == 1 || m_unk == 2 || m_unk == 3)
return false; return false;
return (m_time == 0.0); return (m_time == 0.f);
} }
bool GreaterThanZero() bool GreaterThanZero() const
{ {
if (EqualsZero()) if (EqualsZero())
return false; 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) bool operator>=(const CCharAnimTime& other)
{ {
if (*this == other) if (*this == other)
@ -46,15 +57,148 @@ public:
return (*this < other); return (*this < other);
} }
void operator*=(const CCharAnimTime& other) bool operator >(const CCharAnimTime& other) const
{ *this = *this * other; }
void operator+=(const CCharAnimTime& other)
{ *this = *this + other; }
void operator+(const CCharAnimTime& other)
{ {
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 #endif
}; };
} }

View File

@ -3,6 +3,7 @@
namespace pshag namespace pshag
{ {
LogVisor::LogModule LineRendererLog("pshag::CLineRenderer");
boo::IShaderPipeline* CLineRendererShaders::m_texAlpha = nullptr; boo::IShaderPipeline* CLineRendererShaders::m_texAlpha = nullptr;
boo::IShaderPipeline* CLineRendererShaders::m_texAdditive = 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) : m_mode(mode), m_maxVerts(maxVerts)
{ {
if (maxVerts < 2) if (maxVerts < 2)
{
LineRendererLog.report(LogVisor::FatalError, _S("maxVerts < 2, maxVerts = %i"), maxVerts);
return; return;
}
m_textured = texture != nullptr; m_textured = texture != nullptr;
u32 maxTriVerts; u32 maxTriVerts;

14
Runtime/IRuntimeMain.hpp Normal file
View File

@ -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

View File

@ -426,8 +426,9 @@ CElementGen::CElementGen(const TToken<CGenDescription>& gen,
boo::ITexture* tex = nullptr; boo::ITexture* tex = nullptr;
if (texr) if (texr)
tex = texr->GetValueTexture(0).GetObj()->GetBooTexture(); tex = texr->GetValueTexture(0).GetObj()->GetBooTexture();
int maxVerts = (x70_MAXP == 0 ? 256 : x70_MAXP);
m_lineRenderer.reset(new CLineRenderer(CLineRenderer::EPrimitiveMode::Lines, m_lineRenderer.reset(new CLineRenderer(CLineRenderer::EPrimitiveMode::Lines,
x70_MAXP * 2, tex, x224_26_AAPH)); maxVerts * 2, tex, x224_26_AAPH));
} }
else else
{ {

View File

@ -13,6 +13,6 @@ int CParticleGlobals::g_ParticleLifetimePercentage = 0;
float CParticleGlobals::g_ParticleLifetimePercentageReal = 0.0; float CParticleGlobals::g_ParticleLifetimePercentageReal = 0.0;
float CParticleGlobals::g_ParticleLifetimePercentageRemainder = 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; CParticleGlobals::SParticleSystem* CParticleGlobals::g_currentParticleSystem = nullptr;
} }

View File

@ -38,7 +38,7 @@ public:
g_ParticleLifetimePercentageRemainder = g_ParticleLifetimePercentageReal - g_ParticleLifetimePercentage; g_ParticleLifetimePercentageRemainder = g_ParticleLifetimePercentageReal - g_ParticleLifetimePercentage;
} }
static float* g_papValues; static float g_papValues[8];
struct SParticleSystem struct SParticleSystem
{ {

View File

@ -231,61 +231,61 @@ bool CRECompareEquals::GetValue(int frame, float& valOut) const
return false; 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; 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; 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; 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; 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; 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; 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; 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; return false;
} }
bool CREPSLL::GetValue(int frame, float& valOut) const bool CREPSLL::GetValue(int /*frame*/, float& valOut) const
{ {
valOut = CElementGen::g_currentParticle->x2c_lineLengthOrSize; valOut = CElementGen::g_currentParticle->x2c_lineLengthOrSize;
return false; return false;
} }
bool CREPRLW::GetValue(int frame, float& valOut) const bool CREPRLW::GetValue(int /*frame*/, float& valOut) const
{ {
valOut = CElementGen::g_currentParticle->x30_lineWidthOrRota; valOut = CElementGen::g_currentParticle->x30_lineWidthOrRota;
return false; return false;

2
hecl

@ -1 +1 @@
Subproject commit 9cbf88035f4e0b493f8cbb0a977c78ceebf7d603 Subproject commit d7ba6810af60bccd41d42d1c06112c2f414b3f98