diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5865a4e93e..3e6e01a673 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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 diff --git a/src/swrenderer/line/r_fogboundary.cpp b/src/swrenderer/line/r_fogboundary.cpp index 1c8c92160a..edaa942655 100644 --- a/src/swrenderer/line/r_fogboundary.cpp +++ b/src/swrenderer/line/r_fogboundary.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" diff --git a/src/swrenderer/line/r_line.cpp b/src/swrenderer/line/r_line.cpp index 02514367e7..ccf65ef266 100644 --- a/src/swrenderer/line/r_line.cpp +++ b/src/swrenderer/line/r_line.cpp @@ -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]) diff --git a/src/swrenderer/line/r_walldraw.cpp b/src/swrenderer/line/r_walldraw.cpp index 29309f0223..f0320383a1 100644 --- a/src/swrenderer/line/r_walldraw.cpp +++ b/src/swrenderer/line/r_walldraw.cpp @@ -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" diff --git a/src/swrenderer/plane/r_flatplane.cpp b/src/swrenderer/plane/r_flatplane.cpp index af4c377975..af98b4169e 100644 --- a/src/swrenderer/plane/r_flatplane.cpp +++ b/src/swrenderer/plane/r_flatplane.cpp @@ -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" diff --git a/src/swrenderer/plane/r_skyplane.cpp b/src/swrenderer/plane/r_skyplane.cpp index b31445c140..0fbb5e5167 100644 --- a/src/swrenderer/plane/r_skyplane.cpp +++ b/src/swrenderer/plane/r_skyplane.cpp @@ -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" diff --git a/src/swrenderer/plane/r_slopeplane.cpp b/src/swrenderer/plane/r_slopeplane.cpp index 85afd1d33e..be101e2a29 100644 --- a/src/swrenderer/plane/r_slopeplane.cpp +++ b/src/swrenderer/plane/r_slopeplane.cpp @@ -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" diff --git a/src/swrenderer/plane/r_visibleplane.cpp b/src/swrenderer/plane/r_visibleplane.cpp index df937ffdfa..948859cb28 100644 --- a/src/swrenderer/plane/r_visibleplane.cpp +++ b/src/swrenderer/plane/r_visibleplane.cpp @@ -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" diff --git a/src/swrenderer/r_main.cpp b/src/swrenderer/r_main.cpp index a72e8214ac..c55303becb 100644 --- a/src/swrenderer/r_main.cpp +++ b/src/swrenderer/r_main.cpp @@ -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 (); diff --git a/src/swrenderer/r_swrenderer.cpp b/src/swrenderer/r_swrenderer.cpp index 7c6fc6b3fc..d11d6ee89a 100644 --- a/src/swrenderer/r_swrenderer.cpp +++ b/src/swrenderer/r_swrenderer.cpp @@ -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); } diff --git a/src/swrenderer/scene/r_3dfloors.cpp b/src/swrenderer/scene/r_3dfloors.cpp index dbfa6dfae4..23b4adabad 100644 --- a/src/swrenderer/scene/r_3dfloors.cpp +++ b/src/swrenderer/scene/r_3dfloors.cpp @@ -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); diff --git a/src/swrenderer/scene/r_bsp.cpp b/src/swrenderer/scene/r_opaque_pass.cpp similarity index 97% rename from src/swrenderer/scene/r_bsp.cpp rename to src/swrenderer/scene/r_opaque_pass.cpp index 6faab056d1..337942cc4f 100644 --- a/src/swrenderer/scene/r_bsp.cpp +++ b/src/swrenderer/scene/r_opaque_pass.cpp @@ -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); diff --git a/src/swrenderer/scene/r_bsp.h b/src/swrenderer/scene/r_opaque_pass.h similarity index 97% rename from src/swrenderer/scene/r_bsp.h rename to src/swrenderer/scene/r_opaque_pass.h index ebc59a865b..72c764d04c 100644 --- a/src/swrenderer/scene/r_bsp.h +++ b/src/swrenderer/scene/r_opaque_pass.h @@ -48,10 +48,10 @@ namespace swrenderer int renderflags; }; - class RenderBSP + class RenderOpaquePass { public: - static RenderBSP *Instance(); + static RenderOpaquePass *Instance(); void ClearClip(); void RenderScene(); diff --git a/src/swrenderer/scene/r_portal.cpp b/src/swrenderer/scene/r_portal.cpp index daa6769adb..88b9415ce4 100644 --- a/src/swrenderer/scene/r_portal.cpp +++ b/src/swrenderer/scene/r_portal.cpp @@ -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(); diff --git a/src/swrenderer/scene/r_translucent.cpp b/src/swrenderer/scene/r_translucent_pass.cpp similarity index 97% rename from src/swrenderer/scene/r_translucent.cpp rename to src/swrenderer/scene/r_translucent_pass.cpp index 7b47965055..3f5d69e03b 100644 --- a/src/swrenderer/scene/r_translucent.cpp +++ b/src/swrenderer/scene/r_translucent_pass.cpp @@ -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 RenderTranslucent::portaldrawsegs; + bool RenderTranslucentPass::DrewAVoxel; + TArray 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); diff --git a/src/swrenderer/scene/r_translucent.h b/src/swrenderer/scene/r_translucent_pass.h similarity index 97% rename from src/swrenderer/scene/r_translucent.h rename to src/swrenderer/scene/r_translucent_pass.h index 30ca656793..359a5002d6 100644 --- a/src/swrenderer/scene/r_translucent.h +++ b/src/swrenderer/scene/r_translucent_pass.h @@ -25,7 +25,7 @@ namespace swrenderer struct vissprite_t; struct drawseg_t; - class RenderTranslucent + class RenderTranslucentPass { public: static void Deinit(); diff --git a/src/swrenderer/segments/r_clipsegment.cpp b/src/swrenderer/segments/r_clipsegment.cpp index c1cc94de66..66dbc354f4 100644 --- a/src/swrenderer/segments/r_clipsegment.cpp +++ b/src/swrenderer/segments/r_clipsegment.cpp @@ -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" diff --git a/src/swrenderer/segments/r_drawsegment.cpp b/src/swrenderer/segments/r_drawsegment.cpp index 18530e157d..269154b9e3 100644 --- a/src/swrenderer/segments/r_drawsegment.cpp +++ b/src/swrenderer/segments/r_drawsegment.cpp @@ -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 diff --git a/src/swrenderer/segments/r_portalsegment.cpp b/src/swrenderer/segments/r_portalsegment.cpp index 476e6b0a35..a1bb2bb74a 100644 --- a/src/swrenderer/segments/r_portalsegment.cpp +++ b/src/swrenderer/segments/r_portalsegment.cpp @@ -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" diff --git a/src/swrenderer/things/r_decal.cpp b/src/swrenderer/things/r_decal.cpp index 46140bc3e2..59db70b8ce 100644 --- a/src/swrenderer/things/r_decal.cpp +++ b/src/swrenderer/things/r_decal.cpp @@ -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--); diff --git a/src/swrenderer/things/r_particle.cpp b/src/swrenderer/things/r_particle.cpp index fd4585aac7..079b229fc7 100644 --- a/src/swrenderer/things/r_particle.cpp +++ b/src/swrenderer/things/r_particle.cpp @@ -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(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(dest, yl, spacing, ycount, fg, alpha, fracposx); diff --git a/src/swrenderer/things/r_particle.h b/src/swrenderer/things/r_particle.h index 3f9f89df32..331716cec5 100644 --- a/src/swrenderer/things/r_particle.h +++ b/src/swrenderer/things/r_particle.h @@ -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 { diff --git a/src/swrenderer/things/r_playersprite.cpp b/src/swrenderer/things/r_playersprite.cpp index 07325bea3f..e53a9b2bc3 100644 --- a/src/swrenderer/things/r_playersprite.cpp +++ b/src/swrenderer/things/r_playersprite.cpp @@ -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; diff --git a/src/swrenderer/things/r_sprite.cpp b/src/swrenderer/things/r_sprite.cpp index edd7a24749..c75720afe2 100644 --- a/src/swrenderer/things/r_sprite.cpp +++ b/src/swrenderer/things/r_sprite.cpp @@ -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; diff --git a/src/swrenderer/things/r_visiblesprite.h b/src/swrenderer/things/r_visiblesprite.h index 06e50f2922..f655b35cec 100644 --- a/src/swrenderer/things/r_visiblesprite.h +++ b/src/swrenderer/things/r_visiblesprite.h @@ -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)) diff --git a/src/swrenderer/things/r_voxel.cpp b/src/swrenderer/things/r_voxel.cpp index c55f7439e0..da9adc6be6 100644 --- a/src/swrenderer/things/r_voxel.cpp +++ b/src/swrenderer/things/r_voxel.cpp @@ -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 diff --git a/src/swrenderer/things/r_wallsprite.cpp b/src/swrenderer/things/r_wallsprite.cpp index 8fc5ea0932..de4da612de 100644 --- a/src/swrenderer/things/r_wallsprite.cpp +++ b/src/swrenderer/things/r_wallsprite.cpp @@ -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++;