mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-14 16:41:13 +00:00
Rename RenderBSP to RenderOpaquePass and RenderTranslucent to RenderTranslucentPass
This commit is contained in:
parent
6f1836b68b
commit
3f8e5d26b8
27 changed files with 93 additions and 93 deletions
|
@ -846,9 +846,9 @@ set( FASTMATH_PCH_SOURCES
|
|||
swrenderer/drawers/r_drawers.cpp
|
||||
swrenderer/drawers/r_thread.cpp
|
||||
swrenderer/scene/r_3dfloors.cpp
|
||||
swrenderer/scene/r_bsp.cpp
|
||||
swrenderer/scene/r_opaque_pass.cpp
|
||||
swrenderer/scene/r_portal.cpp
|
||||
swrenderer/scene/r_translucent.cpp
|
||||
swrenderer/scene/r_translucent_pass.cpp
|
||||
swrenderer/line/r_line.cpp
|
||||
swrenderer/line/r_walldraw.cpp
|
||||
swrenderer/line/r_wallsetup.cpp
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include "r_data/colormaps.h"
|
||||
#include "gl/dynlights/gl_dynlight.h"
|
||||
#include "swrenderer/drawers/r_draw_rgba.h"
|
||||
#include "swrenderer/scene/r_bsp.h"
|
||||
#include "swrenderer/scene/r_opaque_pass.h"
|
||||
#include "swrenderer/scene/r_3dfloors.h"
|
||||
#include "swrenderer/scene/r_portal.h"
|
||||
#include "swrenderer/segments/r_clipsegment.h"
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include "r_data/colormaps.h"
|
||||
#include "swrenderer/r_main.h"
|
||||
#include "swrenderer/r_memory.h"
|
||||
#include "swrenderer/scene/r_bsp.h"
|
||||
#include "swrenderer/scene/r_opaque_pass.h"
|
||||
#include "swrenderer/scene/r_3dfloors.h"
|
||||
#include "swrenderer/scene/r_portal.h"
|
||||
#include "swrenderer/line/r_line.h"
|
||||
|
@ -138,7 +138,7 @@ namespace swrenderer
|
|||
// kg3D - its fake, no transfer_heights
|
||||
if (!(clip3d->fake3D & FAKE3D_FAKEBACK))
|
||||
{ // killough 3/8/98, 4/4/98: hack for invisible ceilings / deep water
|
||||
backsector = RenderBSP::Instance()->FakeFlat(backsector, &tempsec, nullptr, nullptr, curline, WallC.sx1, WallC.sx2, rw_frontcz1, rw_frontcz2);
|
||||
backsector = RenderOpaquePass::Instance()->FakeFlat(backsector, &tempsec, nullptr, nullptr, curline, WallC.sx1, WallC.sx2, rw_frontcz1, rw_frontcz2);
|
||||
}
|
||||
doorclosed = false; // killough 4/16/98
|
||||
|
||||
|
@ -455,7 +455,7 @@ namespace swrenderer
|
|||
|
||||
// kg3D - backup for mid and fake walls
|
||||
draw_segment->bkup = R_NewOpening(stop - start);
|
||||
memcpy(openings + draw_segment->bkup, &RenderBSP::Instance()->ceilingclip[start], sizeof(short)*(stop - start));
|
||||
memcpy(openings + draw_segment->bkup, &RenderOpaquePass::Instance()->ceilingclip[start], sizeof(short)*(stop - start));
|
||||
|
||||
draw_segment->bFogBoundary = IsFogBoundary(frontsector, backsector);
|
||||
if (sidedef->GetTexture(side_t::mid).isValid() || draw_segment->bFakeBoundary)
|
||||
|
@ -567,13 +567,13 @@ namespace swrenderer
|
|||
if (((draw_segment->silhouette & SIL_TOP) || maskedtexture) && draw_segment->sprtopclip == -1)
|
||||
{
|
||||
draw_segment->sprtopclip = R_NewOpening(stop - start);
|
||||
memcpy(openings + draw_segment->sprtopclip, &RenderBSP::Instance()->ceilingclip[start], sizeof(short)*(stop - start));
|
||||
memcpy(openings + draw_segment->sprtopclip, &RenderOpaquePass::Instance()->ceilingclip[start], sizeof(short)*(stop - start));
|
||||
}
|
||||
|
||||
if (((draw_segment->silhouette & SIL_BOTTOM) || maskedtexture) && draw_segment->sprbottomclip == -1)
|
||||
{
|
||||
draw_segment->sprbottomclip = R_NewOpening(stop - start);
|
||||
memcpy(openings + draw_segment->sprbottomclip, &RenderBSP::Instance()->floorclip[start], sizeof(short)*(stop - start));
|
||||
memcpy(openings + draw_segment->sprbottomclip, &RenderOpaquePass::Instance()->floorclip[start], sizeof(short)*(stop - start));
|
||||
}
|
||||
|
||||
if (maskedtexture && curline->sidedef->GetTexture(side_t::mid).isValid())
|
||||
|
@ -969,8 +969,8 @@ namespace swrenderer
|
|||
R_SetColorMapLight(fixedcolormap, 0, 0);
|
||||
|
||||
// clip wall to the floor and ceiling
|
||||
auto ceilingclip = RenderBSP::Instance()->ceilingclip;
|
||||
auto floorclip = RenderBSP::Instance()->floorclip;
|
||||
auto ceilingclip = RenderOpaquePass::Instance()->ceilingclip;
|
||||
auto floorclip = RenderOpaquePass::Instance()->floorclip;
|
||||
for (x = x1; x < x2; ++x)
|
||||
{
|
||||
if (walltop[x] < ceilingclip[x])
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#include "swrenderer/drawers/r_drawers.h"
|
||||
#include "swrenderer/drawers/r_draw.h"
|
||||
#include "swrenderer/segments/r_drawsegment.h"
|
||||
#include "swrenderer/scene/r_bsp.h"
|
||||
#include "swrenderer/scene/r_opaque_pass.h"
|
||||
#include "swrenderer/scene/r_3dfloors.h"
|
||||
#include "swrenderer/scene/r_portal.h"
|
||||
#include "swrenderer/line/r_walldraw.h"
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include "cmdlib.h"
|
||||
#include "d_net.h"
|
||||
#include "g_level.h"
|
||||
#include "swrenderer/scene/r_bsp.h"
|
||||
#include "swrenderer/scene/r_opaque_pass.h"
|
||||
#include "r_flatplane.h"
|
||||
#include "swrenderer/scene/r_3dfloors.h"
|
||||
#include "v_palette.h"
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include "cmdlib.h"
|
||||
#include "d_net.h"
|
||||
#include "g_level.h"
|
||||
#include "swrenderer/scene/r_bsp.h"
|
||||
#include "swrenderer/scene/r_opaque_pass.h"
|
||||
#include "r_skyplane.h"
|
||||
#include "swrenderer/scene/r_3dfloors.h"
|
||||
#include "v_palette.h"
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include "cmdlib.h"
|
||||
#include "d_net.h"
|
||||
#include "g_level.h"
|
||||
#include "swrenderer/scene/r_bsp.h"
|
||||
#include "swrenderer/scene/r_opaque_pass.h"
|
||||
#include "r_slopeplane.h"
|
||||
#include "swrenderer/scene/r_3dfloors.h"
|
||||
#include "v_palette.h"
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include "g_level.h"
|
||||
#include "gl/dynlights/gl_dynlight.h"
|
||||
#include "swrenderer/r_main.h"
|
||||
#include "swrenderer/scene/r_bsp.h"
|
||||
#include "swrenderer/scene/r_opaque_pass.h"
|
||||
#include "swrenderer/scene/r_3dfloors.h"
|
||||
#include "swrenderer/scene/r_portal.h"
|
||||
#include "swrenderer/plane/r_flatplane.h"
|
||||
|
|
|
@ -37,13 +37,13 @@
|
|||
#include "r_main.h"
|
||||
#include "drawers/r_draw.h"
|
||||
#include "plane/r_flatplane.h"
|
||||
#include "scene/r_bsp.h"
|
||||
#include "scene/r_opaque_pass.h"
|
||||
#include "segments/r_drawsegment.h"
|
||||
#include "segments/r_portalsegment.h"
|
||||
#include "segments/r_clipsegment.h"
|
||||
#include "scene/r_3dfloors.h"
|
||||
#include "scene/r_portal.h"
|
||||
#include "scene/r_translucent.h"
|
||||
#include "scene/r_translucent_pass.h"
|
||||
#include "r_sky.h"
|
||||
#include "drawers/r_draw_rgba.h"
|
||||
#include "st_stuff.h"
|
||||
|
@ -385,7 +385,7 @@ void R_InitRenderer()
|
|||
|
||||
static void R_ShutdownRenderer()
|
||||
{
|
||||
RenderTranslucent::Deinit();
|
||||
RenderTranslucentPass::Deinit();
|
||||
R_DeinitPlanes();
|
||||
Clip3DFloors::Instance()->Cleanup();
|
||||
R_DeinitOpenings();
|
||||
|
@ -528,10 +528,10 @@ void R_RenderActorView (AActor *actor, bool dontmaplines)
|
|||
R_ClearClipSegs (0, viewwidth);
|
||||
R_ClearDrawSegs ();
|
||||
R_ClearPlanes (true);
|
||||
RenderTranslucent::Clear();
|
||||
RenderTranslucentPass::Clear();
|
||||
|
||||
// opening / clipping determination
|
||||
RenderBSP::Instance()->ClearClip();
|
||||
RenderOpaquePass::Instance()->ClearClip();
|
||||
R_FreeOpenings();
|
||||
|
||||
NetUpdate ();
|
||||
|
@ -544,7 +544,7 @@ void R_RenderActorView (AActor *actor, bool dontmaplines)
|
|||
r_dontmaplines = dontmaplines;
|
||||
|
||||
// [RH] Hack to make windows into underwater areas possible
|
||||
RenderBSP::Instance()->ResetFakingUnderwater();
|
||||
RenderOpaquePass::Instance()->ResetFakingUnderwater();
|
||||
|
||||
// [RH] Setup particles for this frame
|
||||
P_FindParticleSubsectors ();
|
||||
|
@ -558,7 +558,7 @@ void R_RenderActorView (AActor *actor, bool dontmaplines)
|
|||
}
|
||||
// Link the polyobjects right before drawing the scene to reduce the amounts of calls to this function
|
||||
PO_LinkToSubsectors();
|
||||
RenderBSP::Instance()->RenderScene();
|
||||
RenderOpaquePass::Instance()->RenderScene();
|
||||
Clip3DFloors::Instance()->ResetClip(); // reset clips (floor/ceiling)
|
||||
camera->renderflags = savedflags;
|
||||
WallCycles.Unclock();
|
||||
|
@ -577,7 +577,7 @@ void R_RenderActorView (AActor *actor, bool dontmaplines)
|
|||
NetUpdate ();
|
||||
|
||||
MaskedCycles.Clock();
|
||||
RenderTranslucent::Render();
|
||||
RenderTranslucentPass::Render();
|
||||
MaskedCycles.Unclock();
|
||||
|
||||
NetUpdate ();
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#include "v_video.h"
|
||||
#include "m_png.h"
|
||||
#include "r_swrenderer.h"
|
||||
#include "scene/r_bsp.h"
|
||||
#include "scene/r_opaque_pass.h"
|
||||
#include "scene/r_3dfloors.h"
|
||||
#include "scene/r_portal.h"
|
||||
#include "textures/textures.h"
|
||||
|
@ -477,6 +477,6 @@ void FSoftwareRenderer::RenderTextureView (FCanvasTexture *tex, AActor *viewpoin
|
|||
|
||||
sector_t *FSoftwareRenderer::FakeFlat(sector_t *sec, sector_t *tempsec, int *floorlightlevel, int *ceilinglightlevel)
|
||||
{
|
||||
return RenderBSP::Instance()->FakeFlat(sec, tempsec, floorlightlevel, ceilinglightlevel, nullptr, 0, 0, 0, 0);
|
||||
return RenderOpaquePass::Instance()->FakeFlat(sec, tempsec, floorlightlevel, ceilinglightlevel, nullptr, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "p_local.h"
|
||||
#include "c_dispatch.h"
|
||||
#include "swrenderer/r_main.h"
|
||||
#include "r_bsp.h"
|
||||
#include "r_opaque_pass.h"
|
||||
#include "c_cvars.h"
|
||||
#include "r_3dfloors.h"
|
||||
|
||||
|
@ -102,8 +102,8 @@ namespace swrenderer
|
|||
|
||||
curr = (ClipStack*)M_Malloc(sizeof(ClipStack));
|
||||
curr->next = 0;
|
||||
memcpy(curr->floorclip, RenderBSP::Instance()->floorclip, sizeof(short) * MAXWIDTH);
|
||||
memcpy(curr->ceilingclip, RenderBSP::Instance()->ceilingclip, sizeof(short) * MAXWIDTH);
|
||||
memcpy(curr->floorclip, RenderOpaquePass::Instance()->floorclip, sizeof(short) * MAXWIDTH);
|
||||
memcpy(curr->ceilingclip, RenderOpaquePass::Instance()->ceilingclip, sizeof(short) * MAXWIDTH);
|
||||
curr->ffloor = fakeFloor;
|
||||
assert(fakeFloor->floorclip == nullptr);
|
||||
assert(fakeFloor->ceilingclip == nullptr);
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
// State.
|
||||
#include "doomstat.h"
|
||||
#include "r_state.h"
|
||||
#include "r_bsp.h"
|
||||
#include "r_opaque_pass.h"
|
||||
#include "v_palette.h"
|
||||
#include "r_sky.h"
|
||||
#include "po_man.h"
|
||||
|
@ -64,13 +64,13 @@ EXTERN_CVAR(Bool, r_drawvoxels);
|
|||
|
||||
namespace swrenderer
|
||||
{
|
||||
RenderBSP *RenderBSP::Instance()
|
||||
RenderOpaquePass *RenderOpaquePass::Instance()
|
||||
{
|
||||
static RenderBSP bsp;
|
||||
return &bsp;
|
||||
static RenderOpaquePass instance;
|
||||
return &instance;
|
||||
}
|
||||
|
||||
sector_t *RenderBSP::FakeFlat(sector_t *sec, sector_t *tempsec, int *floorlightlevel, int *ceilinglightlevel, seg_t *backline, int backx1, int backx2, double frontcz1, double frontcz2)
|
||||
sector_t *RenderOpaquePass::FakeFlat(sector_t *sec, sector_t *tempsec, int *floorlightlevel, int *ceilinglightlevel, seg_t *backline, int backx1, int backx2, double frontcz1, double frontcz2)
|
||||
{
|
||||
// If player's view height is underneath fake floor, lower the
|
||||
// drawn ceiling to be just under the floor height, and replace
|
||||
|
@ -277,7 +277,7 @@ namespace swrenderer
|
|||
|
||||
// Checks BSP node/subtree bounding box.
|
||||
// Returns true if some part of the bbox might be visible.
|
||||
bool RenderBSP::CheckBBox(float *bspcoord)
|
||||
bool RenderOpaquePass::CheckBBox(float *bspcoord)
|
||||
{
|
||||
static const int checkcoord[12][4] =
|
||||
{
|
||||
|
@ -378,7 +378,7 @@ namespace swrenderer
|
|||
return R_IsWallSegmentVisible(sx1, sx2);
|
||||
}
|
||||
|
||||
void RenderBSP::AddPolyobjs(subsector_t *sub)
|
||||
void RenderOpaquePass::AddPolyobjs(subsector_t *sub)
|
||||
{
|
||||
if (sub->BSP == nullptr || sub->BSP->bDirty)
|
||||
{
|
||||
|
@ -395,7 +395,7 @@ namespace swrenderer
|
|||
}
|
||||
|
||||
// kg3D - add fake segs, never rendered
|
||||
void RenderBSP::FakeDrawLoop(subsector_t *sub, visplane_t *floorplane, visplane_t *ceilingplane)
|
||||
void RenderOpaquePass::FakeDrawLoop(subsector_t *sub, visplane_t *floorplane, visplane_t *ceilingplane)
|
||||
{
|
||||
int count;
|
||||
seg_t* line;
|
||||
|
@ -413,7 +413,7 @@ namespace swrenderer
|
|||
}
|
||||
}
|
||||
|
||||
void RenderBSP::RenderSubsector(subsector_t *sub)
|
||||
void RenderOpaquePass::RenderSubsector(subsector_t *sub)
|
||||
{
|
||||
// Determine floor/ceiling planes.
|
||||
// Add sprites of things in sector.
|
||||
|
@ -761,7 +761,7 @@ namespace swrenderer
|
|||
}
|
||||
}
|
||||
|
||||
void RenderBSP::RenderScene()
|
||||
void RenderOpaquePass::RenderScene()
|
||||
{
|
||||
InSubsector = nullptr;
|
||||
RenderBSPNode(nodes + numnodes - 1); // The head node is the last node output.
|
||||
|
@ -773,7 +773,7 @@ namespace swrenderer
|
|||
// Just call with BSP root and -1.
|
||||
// killough 5/2/98: reformatted, removed tail recursion
|
||||
|
||||
void RenderBSP::RenderBSPNode(void *node)
|
||||
void RenderOpaquePass::RenderBSPNode(void *node)
|
||||
{
|
||||
if (numnodes == 0)
|
||||
{
|
||||
|
@ -800,14 +800,14 @@ namespace swrenderer
|
|||
RenderSubsector((subsector_t *)((BYTE *)node - 1));
|
||||
}
|
||||
|
||||
void RenderBSP::ClearClip()
|
||||
void RenderOpaquePass::ClearClip()
|
||||
{
|
||||
// clip ceiling to console bottom
|
||||
fillshort(floorclip, viewwidth, viewheight);
|
||||
fillshort(ceilingclip, viewwidth, !screen->Accel2D && ConBottom > viewwindowy && !bRenderingToCanvas ? (ConBottom - viewwindowy) : 0);
|
||||
}
|
||||
|
||||
void RenderBSP::AddSprites(sector_t *sec, int lightlevel, WaterFakeSide fakeside)
|
||||
void RenderOpaquePass::AddSprites(sector_t *sec, int lightlevel, WaterFakeSide fakeside)
|
||||
{
|
||||
F3DFloor *fakeceiling = nullptr;
|
||||
F3DFloor *fakefloor = nullptr;
|
||||
|
@ -885,7 +885,7 @@ namespace swrenderer
|
|||
}
|
||||
}
|
||||
|
||||
bool RenderBSP::IsPotentiallyVisible(AActor *thing)
|
||||
bool RenderOpaquePass::IsPotentiallyVisible(AActor *thing)
|
||||
{
|
||||
// Don't waste time projecting sprites that are definitely not visible.
|
||||
if (thing == nullptr ||
|
||||
|
@ -906,7 +906,7 @@ namespace swrenderer
|
|||
return true;
|
||||
}
|
||||
|
||||
bool RenderBSP::GetThingSprite(AActor *thing, ThingSprite &sprite)
|
||||
bool RenderOpaquePass::GetThingSprite(AActor *thing, ThingSprite &sprite)
|
||||
{
|
||||
sprite.pos = thing->InterpolatedPosition(r_TicFracF);
|
||||
sprite.pos.Z += thing->GetBobOffset(r_TicFracF);
|
|
@ -48,10 +48,10 @@ namespace swrenderer
|
|||
int renderflags;
|
||||
};
|
||||
|
||||
class RenderBSP
|
||||
class RenderOpaquePass
|
||||
{
|
||||
public:
|
||||
static RenderBSP *Instance();
|
||||
static RenderOpaquePass *Instance();
|
||||
|
||||
void ClearClip();
|
||||
void RenderScene();
|
|
@ -49,8 +49,8 @@
|
|||
#include "swrenderer/segments/r_drawsegment.h"
|
||||
#include "swrenderer/plane/r_visibleplane.h"
|
||||
#include "swrenderer/things/r_visiblesprite.h"
|
||||
#include "swrenderer/scene/r_bsp.h"
|
||||
#include "swrenderer/scene/r_translucent.h"
|
||||
#include "swrenderer/scene/r_opaque_pass.h"
|
||||
#include "swrenderer/scene/r_translucent_pass.h"
|
||||
#include "swrenderer/r_main.h"
|
||||
#include "swrenderer/r_memory.h"
|
||||
|
||||
|
@ -178,8 +178,8 @@ namespace swrenderer
|
|||
WindowLeft = pl->left;
|
||||
WindowRight = pl->right;
|
||||
|
||||
auto ceilingclip = RenderBSP::Instance()->ceilingclip;
|
||||
auto floorclip = RenderBSP::Instance()->floorclip;
|
||||
auto ceilingclip = RenderOpaquePass::Instance()->ceilingclip;
|
||||
auto floorclip = RenderOpaquePass::Instance()->floorclip;
|
||||
for (i = pl->left; i < pl->right; i++)
|
||||
{
|
||||
if (pl->top[i] == 0x7fff)
|
||||
|
@ -225,7 +225,7 @@ namespace swrenderer
|
|||
viewposStack.Push(ViewPos);
|
||||
visplaneStack.Push(pl);
|
||||
|
||||
RenderBSP::Instance()->RenderScene();
|
||||
RenderOpaquePass::Instance()->RenderScene();
|
||||
Clip3DFloors::Instance()->ResetClip(); // reset clips (floor/ceiling)
|
||||
R_DrawPlanes();
|
||||
|
||||
|
@ -248,7 +248,7 @@ namespace swrenderer
|
|||
// Masked textures and planes need the view coordinates restored for proper positioning.
|
||||
viewposStack.Pop(ViewPos);
|
||||
|
||||
RenderTranslucent::Render();
|
||||
RenderTranslucentPass::Render();
|
||||
|
||||
ds_p = firstdrawseg;
|
||||
VisibleSpriteList::vissprite_p = VisibleSpriteList::firstvissprite;
|
||||
|
@ -441,12 +441,12 @@ namespace swrenderer
|
|||
CurrentPortalInSkybox = false; // first portal in a skybox should set this variable to false for proper clipping in skyboxes.
|
||||
|
||||
// first pass, set clipping
|
||||
auto ceilingclip = RenderBSP::Instance()->ceilingclip;
|
||||
auto floorclip = RenderBSP::Instance()->floorclip;
|
||||
auto ceilingclip = RenderOpaquePass::Instance()->ceilingclip;
|
||||
auto floorclip = RenderOpaquePass::Instance()->floorclip;
|
||||
memcpy(ceilingclip + pds->x1, &pds->ceilingclip[0], pds->len * sizeof(*ceilingclip));
|
||||
memcpy(floorclip + pds->x1, &pds->floorclip[0], pds->len * sizeof(*floorclip));
|
||||
|
||||
RenderBSP::Instance()->RenderScene();
|
||||
RenderOpaquePass::Instance()->RenderScene();
|
||||
Clip3DFloors::Instance()->ResetClip(); // reset clips (floor/ceiling)
|
||||
if (!savedvisibility && camera) camera->renderflags &= ~RF_INVISIBLE;
|
||||
|
||||
|
@ -470,7 +470,7 @@ namespace swrenderer
|
|||
NetUpdate();
|
||||
|
||||
MaskedCycles.Clock(); // [ZZ] count sprites in portals/mirrors along with normal ones.
|
||||
RenderTranslucent::Render(); // this is required since with portals there often will be cases when more than 80% of the view is inside a portal.
|
||||
RenderTranslucentPass::Render(); // this is required since with portals there often will be cases when more than 80% of the view is inside a portal.
|
||||
MaskedCycles.Unclock();
|
||||
|
||||
NetUpdate();
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include "swrenderer/things/r_playersprite.h"
|
||||
#include "swrenderer/segments/r_drawsegment.h"
|
||||
#include "swrenderer/scene/r_portal.h"
|
||||
#include "swrenderer/scene/r_translucent.h"
|
||||
#include "swrenderer/scene/r_translucent_pass.h"
|
||||
#include "swrenderer/plane/r_visibleplane.h"
|
||||
#include "swrenderer/r_memory.h"
|
||||
|
||||
|
@ -44,23 +44,23 @@ CVAR(Bool, r_fullbrightignoresectorcolor, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG
|
|||
|
||||
namespace swrenderer
|
||||
{
|
||||
bool RenderTranslucent::DrewAVoxel;
|
||||
TArray<drawseg_t *> RenderTranslucent::portaldrawsegs;
|
||||
bool RenderTranslucentPass::DrewAVoxel;
|
||||
TArray<drawseg_t *> RenderTranslucentPass::portaldrawsegs;
|
||||
|
||||
void RenderTranslucent::Deinit()
|
||||
void RenderTranslucentPass::Deinit()
|
||||
{
|
||||
VisibleSpriteList::Deinit();
|
||||
SortedVisibleSpriteList::Deinit();
|
||||
RenderVoxel::Deinit();
|
||||
}
|
||||
|
||||
void RenderTranslucent::Clear()
|
||||
void RenderTranslucentPass::Clear()
|
||||
{
|
||||
VisibleSpriteList::Clear();
|
||||
DrewAVoxel = false;
|
||||
}
|
||||
|
||||
void RenderTranslucent::CollectPortals()
|
||||
void RenderTranslucentPass::CollectPortals()
|
||||
{
|
||||
// This function collects all drawsegs that may be of interest to R_ClipSpriteColumnWithPortals
|
||||
// Having that function over the entire list of drawsegs can break down performance quite drastically.
|
||||
|
@ -90,7 +90,7 @@ namespace swrenderer
|
|||
}
|
||||
}
|
||||
|
||||
bool RenderTranslucent::ClipSpriteColumnWithPortals(int x, vissprite_t* spr)
|
||||
bool RenderTranslucentPass::ClipSpriteColumnWithPortals(int x, vissprite_t* spr)
|
||||
{
|
||||
RenderPortal *renderportal = RenderPortal::Instance();
|
||||
|
||||
|
@ -118,7 +118,7 @@ namespace swrenderer
|
|||
return false;
|
||||
}
|
||||
|
||||
void RenderTranslucent::DrawSprite(vissprite_t *spr)
|
||||
void RenderTranslucentPass::DrawSprite(vissprite_t *spr)
|
||||
{
|
||||
static short clipbot[MAXWIDTH];
|
||||
static short cliptop[MAXWIDTH];
|
||||
|
@ -523,7 +523,7 @@ namespace swrenderer
|
|||
spr->Style.ColormapNum = colormapnum;
|
||||
}
|
||||
|
||||
void RenderTranslucent::DrawMaskedSingle(bool renew)
|
||||
void RenderTranslucentPass::DrawMaskedSingle(bool renew)
|
||||
{
|
||||
RenderPortal *renderportal = RenderPortal::Instance();
|
||||
|
||||
|
@ -560,7 +560,7 @@ namespace swrenderer
|
|||
}
|
||||
}
|
||||
|
||||
void RenderTranslucent::Render()
|
||||
void RenderTranslucentPass::Render()
|
||||
{
|
||||
CollectPortals();
|
||||
SortedVisibleSpriteList::Sort(DrewAVoxel ? SortedVisibleSpriteList::sv_compare2d : SortedVisibleSpriteList::sv_compare, VisibleSpriteList::firstvissprite - VisibleSpriteList::vissprites);
|
|
@ -25,7 +25,7 @@ namespace swrenderer
|
|||
struct vissprite_t;
|
||||
struct drawseg_t;
|
||||
|
||||
class RenderTranslucent
|
||||
class RenderTranslucentPass
|
||||
{
|
||||
public:
|
||||
static void Deinit();
|
|
@ -26,7 +26,7 @@
|
|||
#include "p_effect.h"
|
||||
#include "doomstat.h"
|
||||
#include "r_state.h"
|
||||
#include "swrenderer/scene/r_bsp.h"
|
||||
#include "swrenderer/scene/r_opaque_pass.h"
|
||||
#include "v_palette.h"
|
||||
#include "r_sky.h"
|
||||
#include "po_man.h"
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include "swrenderer/r_memory.h"
|
||||
#include "swrenderer/drawers/r_draw.h"
|
||||
#include "swrenderer/scene/r_3dfloors.h"
|
||||
#include "swrenderer/scene/r_bsp.h"
|
||||
#include "swrenderer/scene/r_opaque_pass.h"
|
||||
#include "swrenderer/scene/r_portal.h"
|
||||
#include "swrenderer/line/r_wallsetup.h"
|
||||
#include "swrenderer/line/r_walldraw.h"
|
||||
|
@ -166,7 +166,7 @@ namespace swrenderer
|
|||
}
|
||||
|
||||
// killough 4/13/98: get correct lightlevel for 2s normal textures
|
||||
sec = RenderBSP::Instance()->FakeFlat(frontsector, &tempsec, nullptr, nullptr, nullptr, 0, 0, 0, 0);
|
||||
sec = RenderOpaquePass::Instance()->FakeFlat(frontsector, &tempsec, nullptr, nullptr, nullptr, 0, 0, 0, 0);
|
||||
|
||||
basecolormap = sec->ColorMap; // [RH] Set basecolormap
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "p_effect.h"
|
||||
#include "doomstat.h"
|
||||
#include "r_state.h"
|
||||
#include "swrenderer/scene/r_bsp.h"
|
||||
#include "swrenderer/scene/r_opaque_pass.h"
|
||||
#include "v_palette.h"
|
||||
#include "r_sky.h"
|
||||
#include "po_man.h"
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "a_sharedglobal.h"
|
||||
#include "d_net.h"
|
||||
#include "g_level.h"
|
||||
#include "swrenderer/scene/r_bsp.h"
|
||||
#include "swrenderer/scene/r_opaque_pass.h"
|
||||
#include "r_decal.h"
|
||||
#include "swrenderer/scene/r_3dfloors.h"
|
||||
#include "swrenderer/drawers/r_draw.h"
|
||||
|
@ -173,7 +173,7 @@ namespace swrenderer
|
|||
else if (pass == 0)
|
||||
{
|
||||
mceilingclip = walltop;
|
||||
mfloorclip = RenderBSP::Instance()->ceilingclip;
|
||||
mfloorclip = RenderOpaquePass::Instance()->ceilingclip;
|
||||
needrepeat = 1;
|
||||
}
|
||||
else
|
||||
|
@ -189,7 +189,7 @@ namespace swrenderer
|
|||
goto done;
|
||||
}
|
||||
mceilingclip = walltop;
|
||||
mfloorclip = RenderBSP::Instance()->ceilingclip;
|
||||
mfloorclip = RenderOpaquePass::Instance()->ceilingclip;
|
||||
break;
|
||||
|
||||
case RF_CLIPMID:
|
||||
|
@ -206,7 +206,7 @@ namespace swrenderer
|
|||
{
|
||||
goto done;
|
||||
}
|
||||
mceilingclip = RenderBSP::Instance()->floorclip;
|
||||
mceilingclip = RenderOpaquePass::Instance()->floorclip;
|
||||
mfloorclip = wallbottom;
|
||||
break;
|
||||
}
|
||||
|
@ -300,7 +300,7 @@ namespace swrenderer
|
|||
// If this sprite is RF_CLIPFULL on a two-sided line, needrepeat will
|
||||
// be set 1 if we need to draw on the lower wall. In all other cases,
|
||||
// needrepeat will be 0, and the while will fail.
|
||||
mceilingclip = RenderBSP::Instance()->floorclip;
|
||||
mceilingclip = RenderOpaquePass::Instance()->floorclip;
|
||||
mfloorclip = wallbottom;
|
||||
R_FinishSetPatchStyle();
|
||||
} while (needrepeat--);
|
||||
|
|
|
@ -38,9 +38,9 @@
|
|||
#include "colormatcher.h"
|
||||
#include "d_netinf.h"
|
||||
#include "p_effect.h"
|
||||
#include "swrenderer/scene/r_bsp.h"
|
||||
#include "swrenderer/scene/r_opaque_pass.h"
|
||||
#include "swrenderer/scene/r_3dfloors.h"
|
||||
#include "swrenderer/scene/r_translucent.h"
|
||||
#include "swrenderer/scene/r_translucent_pass.h"
|
||||
#include "swrenderer/drawers/r_draw_rgba.h"
|
||||
#include "swrenderer/drawers/r_draw_pal.h"
|
||||
#include "v_palette.h"
|
||||
|
@ -118,8 +118,8 @@ namespace swrenderer
|
|||
// entered, we don't need to clip it to drawsegs like a normal sprite.
|
||||
|
||||
// Clip particles behind walls.
|
||||
auto ceilingclip = RenderBSP::Instance()->ceilingclip;
|
||||
auto floorclip = RenderBSP::Instance()->floorclip;
|
||||
auto ceilingclip = RenderOpaquePass::Instance()->ceilingclip;
|
||||
auto floorclip = RenderOpaquePass::Instance()->floorclip;
|
||||
if (y1 < ceilingclip[x1]) y1 = ceilingclip[x1];
|
||||
if (y1 < ceilingclip[x2 - 1]) y1 = ceilingclip[x2 - 1];
|
||||
if (y2 >= floorclip[x1]) y2 = floorclip[x1] - 1;
|
||||
|
@ -254,7 +254,7 @@ namespace swrenderer
|
|||
{
|
||||
for (int x = x1; x < (x1 + countbase); x++, fracposx += fracstepx)
|
||||
{
|
||||
if (RenderTranslucent::ClipSpriteColumnWithPortals(x, vis))
|
||||
if (RenderTranslucentPass::ClipSpriteColumnWithPortals(x, vis))
|
||||
continue;
|
||||
uint32_t *dest = ylookup[yl] + x + (uint32_t*)dc_destorg;
|
||||
DrawerCommandQueue::QueueCommand<DrawParticleColumnRGBACommand>(dest, yl, spacing, ycount, fg, alpha, fracposx);
|
||||
|
@ -264,7 +264,7 @@ namespace swrenderer
|
|||
{
|
||||
for (int x = x1; x < (x1 + countbase); x++, fracposx += fracstepx)
|
||||
{
|
||||
if (RenderTranslucent::ClipSpriteColumnWithPortals(x, vis))
|
||||
if (RenderTranslucentPass::ClipSpriteColumnWithPortals(x, vis))
|
||||
continue;
|
||||
uint8_t *dest = ylookup[yl] + x + dc_destorg;
|
||||
DrawerCommandQueue::QueueCommand<DrawParticleColumnPalCommand>(dest, yl, spacing, ycount, fg, alpha, fracposx);
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "r_visiblesprite.h"
|
||||
#include "swrenderer/scene/r_bsp.h"
|
||||
#include "swrenderer/scene/r_opaque_pass.h"
|
||||
|
||||
namespace swrenderer
|
||||
{
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#include "colormatcher.h"
|
||||
#include "d_netinf.h"
|
||||
#include "p_effect.h"
|
||||
#include "swrenderer/scene/r_bsp.h"
|
||||
#include "swrenderer/scene/r_opaque_pass.h"
|
||||
#include "swrenderer/scene/r_3dfloors.h"
|
||||
#include "swrenderer/drawers/r_draw_rgba.h"
|
||||
#include "swrenderer/drawers/r_draw_pal.h"
|
||||
|
@ -127,7 +127,7 @@ namespace swrenderer
|
|||
else
|
||||
{ // This used to use camera->Sector but due to interpolation that can be incorrect
|
||||
// when the interpolated viewpoint is in a different sector than the camera.
|
||||
sec = RenderBSP::Instance()->FakeFlat(viewsector, &tempsec, &floorlight, &ceilinglight, nullptr, 0, 0, 0, 0);
|
||||
sec = RenderOpaquePass::Instance()->FakeFlat(viewsector, &tempsec, &floorlight, &ceilinglight, nullptr, 0, 0, 0, 0);
|
||||
|
||||
// [RH] set basecolormap
|
||||
basecolormap = sec->ColorMap;
|
||||
|
|
|
@ -38,9 +38,9 @@
|
|||
#include "colormatcher.h"
|
||||
#include "d_netinf.h"
|
||||
#include "p_effect.h"
|
||||
#include "swrenderer/scene/r_bsp.h"
|
||||
#include "swrenderer/scene/r_opaque_pass.h"
|
||||
#include "swrenderer/scene/r_3dfloors.h"
|
||||
#include "swrenderer/scene/r_translucent.h"
|
||||
#include "swrenderer/scene/r_translucent_pass.h"
|
||||
#include "swrenderer/drawers/r_draw_rgba.h"
|
||||
#include "swrenderer/drawers/r_draw_pal.h"
|
||||
#include "v_palette.h"
|
||||
|
@ -331,7 +331,7 @@ namespace swrenderer
|
|||
{
|
||||
while (x < x2)
|
||||
{
|
||||
if (ispsprite || !RenderTranslucent::ClipSpriteColumnWithPortals(x, vis))
|
||||
if (ispsprite || !RenderTranslucentPass::ClipSpriteColumnWithPortals(x, vis))
|
||||
R_DrawMaskedColumn(x, iscale, tex, frac, spryscale, sprtopscreen, sprflipvert, mfloorclip, mceilingclip, false);
|
||||
x++;
|
||||
frac += xiscale;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "swrenderer/line/r_line.h"
|
||||
#include "swrenderer/scene/r_bsp.h"
|
||||
#include "swrenderer/scene/r_opaque_pass.h"
|
||||
#include "swrenderer/things/r_visiblespritelist.h"
|
||||
|
||||
#define MINZ double((2048*4) / double(1 << 20))
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#include "swrenderer/things/r_visiblesprite.h"
|
||||
#include "swrenderer/things/r_voxel.h"
|
||||
#include "swrenderer/scene/r_portal.h"
|
||||
#include "swrenderer/scene/r_translucent.h"
|
||||
#include "swrenderer/scene/r_translucent_pass.h"
|
||||
#include "swrenderer/r_main.h"
|
||||
|
||||
EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor)
|
||||
|
@ -153,7 +153,7 @@ namespace swrenderer
|
|||
vis->voxel = voxel->Voxel;
|
||||
vis->bIsVoxel = true;
|
||||
vis->bWallSprite = false;
|
||||
RenderTranslucent::DrewAVoxel = true;
|
||||
RenderTranslucentPass::DrewAVoxel = true;
|
||||
|
||||
// The software renderer cannot invert the source without inverting the overlay
|
||||
// too. That means if the source is inverted, we need to do the reverse of what
|
||||
|
|
|
@ -38,9 +38,9 @@
|
|||
#include "colormatcher.h"
|
||||
#include "d_netinf.h"
|
||||
#include "p_effect.h"
|
||||
#include "swrenderer/scene/r_bsp.h"
|
||||
#include "swrenderer/scene/r_opaque_pass.h"
|
||||
#include "swrenderer/scene/r_3dfloors.h"
|
||||
#include "swrenderer/scene/r_translucent.h"
|
||||
#include "swrenderer/scene/r_translucent_pass.h"
|
||||
#include "swrenderer/drawers/r_draw_rgba.h"
|
||||
#include "swrenderer/drawers/r_draw_pal.h"
|
||||
#include "v_palette.h"
|
||||
|
@ -223,7 +223,7 @@ namespace swrenderer
|
|||
{ // calculate lighting
|
||||
R_SetColorMapLight(usecolormap, light, shade);
|
||||
}
|
||||
if (!RenderTranslucent::ClipSpriteColumnWithPortals(x, spr))
|
||||
if (!RenderTranslucentPass::ClipSpriteColumnWithPortals(x, spr))
|
||||
DrawColumn(x, WallSpriteTile, maskedScaleY, sprflipvert, mfloorclip, mceilingclip);
|
||||
light += lightstep;
|
||||
x++;
|
||||
|
|
Loading…
Reference in a new issue