mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-21 11:21:04 +00:00
Convert r_particle to a class
This commit is contained in:
parent
7dfb46b8d9
commit
deae5bb1a6
4 changed files with 15 additions and 9 deletions
|
@ -710,7 +710,7 @@ namespace swrenderer
|
||||||
int shade = LIGHT2SHADE((floorlightlevel + ceilinglightlevel) / 2 + r_actualextralight);
|
int shade = LIGHT2SHADE((floorlightlevel + ceilinglightlevel) / 2 + r_actualextralight);
|
||||||
for (WORD i = ParticlesInSubsec[(unsigned int)(sub - subsectors)]; i != NO_PARTICLE; i = Particles[i].snext)
|
for (WORD i = ParticlesInSubsec[(unsigned int)(sub - subsectors)]; i != NO_PARTICLE; i = Particles[i].snext)
|
||||||
{
|
{
|
||||||
R_ProjectParticle(Particles + i, subsectors[sub - subsectors].sector, shade, FakeSide);
|
RenderParticle::Project(Particles + i, subsectors[sub - subsectors].sector, shade, FakeSide);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor);
|
||||||
|
|
||||||
namespace swrenderer
|
namespace swrenderer
|
||||||
{
|
{
|
||||||
void R_ProjectParticle(particle_t *particle, const sector_t *sector, int shade, WaterFakeSide fakeside)
|
void RenderParticle::Project(particle_t *particle, const sector_t *sector, int shade, WaterFakeSide fakeside)
|
||||||
{
|
{
|
||||||
double tr_x, tr_y;
|
double tr_x, tr_y;
|
||||||
double tx, ty;
|
double tx, ty;
|
||||||
|
@ -222,7 +222,7 @@ namespace swrenderer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void R_DrawParticle(vissprite_t *vis)
|
void RenderParticle::Render(vissprite_t *vis)
|
||||||
{
|
{
|
||||||
using namespace drawerargs;
|
using namespace drawerargs;
|
||||||
|
|
||||||
|
@ -236,7 +236,7 @@ namespace swrenderer
|
||||||
if (ycount <= 0 || countbase <= 0)
|
if (ycount <= 0 || countbase <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
R_DrawMaskedSegsBehindParticle(vis);
|
DrawMaskedSegsBehindParticle(vis);
|
||||||
|
|
||||||
uint32_t fg = LightBgra::shade_pal_index_simple(color, LightBgra::calc_light_multiplier(LIGHTSCALE(0, vis->Style.ColormapNum << FRACBITS)));
|
uint32_t fg = LightBgra::shade_pal_index_simple(color, LightBgra::calc_light_multiplier(LIGHTSCALE(0, vis->Style.ColormapNum << FRACBITS)));
|
||||||
|
|
||||||
|
@ -271,7 +271,7 @@ namespace swrenderer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void R_DrawMaskedSegsBehindParticle(const vissprite_t *vis)
|
void RenderParticle::DrawMaskedSegsBehindParticle(const vissprite_t *vis)
|
||||||
{
|
{
|
||||||
const int x1 = vis->x1;
|
const int x1 = vis->x1;
|
||||||
const int x2 = vis->x2;
|
const int x2 = vis->x2;
|
||||||
|
|
|
@ -18,7 +18,13 @@
|
||||||
|
|
||||||
namespace swrenderer
|
namespace swrenderer
|
||||||
{
|
{
|
||||||
void R_ProjectParticle(particle_t *, const sector_t *sector, int shade, WaterFakeSide fakeside);
|
class RenderParticle
|
||||||
void R_DrawParticle(vissprite_t *);
|
{
|
||||||
void R_DrawMaskedSegsBehindParticle(const vissprite_t *vis);
|
public:
|
||||||
|
static void Project(particle_t *, const sector_t *sector, int shade, WaterFakeSide fakeside);
|
||||||
|
static void Render(vissprite_t *);
|
||||||
|
|
||||||
|
private:
|
||||||
|
static void DrawMaskedSegsBehindParticle(const vissprite_t *vis);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -257,7 +257,7 @@ namespace swrenderer
|
||||||
// kg3D - reject invisible parts
|
// kg3D - reject invisible parts
|
||||||
if ((clip3d->fake3D & FAKE3D_CLIPBOTTOM) && spr->gpos.Z <= clip3d->sclipBottom) return;
|
if ((clip3d->fake3D & FAKE3D_CLIPBOTTOM) && spr->gpos.Z <= clip3d->sclipBottom) return;
|
||||||
if ((clip3d->fake3D & FAKE3D_CLIPTOP) && spr->gpos.Z >= clip3d->sclipTop) return;
|
if ((clip3d->fake3D & FAKE3D_CLIPTOP) && spr->gpos.Z >= clip3d->sclipTop) return;
|
||||||
R_DrawParticle(spr);
|
RenderParticle::Render(spr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue