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

Finish CGunWeapon

This commit is contained in:
Jack Andersen
2017-09-04 17:00:19 -10:00
parent 640623f3ef
commit 361aa1512b
38 changed files with 990 additions and 169 deletions

View File

@@ -18,6 +18,7 @@ static logvisor::Module Log("urde::CElementGen");
URDE_DECL_SPECIALIZE_SHADER(CElementGenShaders)
u16 CElementGen::g_GlobalSeed = 99;
bool CElementGen::g_subtractBlend = false;
int CElementGen::g_ParticleAliveCount;
int CElementGen::g_ParticleSystemAliveCount;
@@ -1152,16 +1153,20 @@ void CElementGen::RenderModels()
else
{
CModel* model = desc->x5c_x48_PMDL.m_token.GetObj();
if (desc->x44_31_x31_25_PMAB)
if (g_subtractBlend)
{
model->Draw({3, 0, 1, col});
model->Draw({5, 0, 1, zeus::CColor(1.f, 0.5f)});
}
else if (desc->x44_31_x31_25_PMAB)
{
model->Draw({7, 0, 1, col});
}
else
{
if (1.f == col.a)
model->Draw({0, 0, 3, zeus::CColor::skWhite});
else
model->Draw({4, 0, 1, col});
model->Draw({5, 0, 1, col});
}
}
@@ -1389,10 +1394,20 @@ void CElementGen::RenderParticles()
if (sMoveRedToAlphaBuffer && x26c_26_AAPH)
moveRedToAlphaBuffer = true;
if (moveRedToAlphaBuffer)
CGraphics::SetShaderDataBinding(m_redToAlphaDataBind);
if (g_subtractBlend)
{
if (moveRedToAlphaBuffer)
CGraphics::SetShaderDataBinding(m_redToAlphaSubDataBind);
else
CGraphics::SetShaderDataBinding(m_normalSubDataBind);
}
else
CGraphics::SetShaderDataBinding(m_normalDataBind);
{
if (moveRedToAlphaBuffer)
CGraphics::SetShaderDataBinding(m_redToAlphaDataBind);
else
CGraphics::SetShaderDataBinding(m_normalDataBind);
}
int mbspVal = std::max(1, x270_MBSP);

View File

@@ -27,8 +27,10 @@ class CParticleElectric;
class CElementGen : public CParticleGen
{
static u16 g_GlobalSeed;
static bool g_subtractBlend;
public:
static void SetGlobalSeed(u16 seed) { g_GlobalSeed = seed; }
static void SetSubtractBlend(bool s) { g_subtractBlend = s; }
enum class EModelOrientationType
{
Normal,
@@ -172,7 +174,9 @@ public:
boo::GraphicsDataToken m_gfxToken;
boo::IShaderDataBinding* m_normalDataBind = nullptr;
boo::IShaderDataBinding* m_normalSubDataBind = nullptr;
boo::IShaderDataBinding* m_redToAlphaDataBind = nullptr;
boo::IShaderDataBinding* m_redToAlphaSubDataBind = nullptr;
boo::IGraphicsBufferD* m_instBuf = nullptr;
boo::IGraphicsBufferD* m_uniformBuf = nullptr;