- renamed several data types in the hardware renderer that still had a GL prefix, although they are now generic.

This commit is contained in:
Christoph Oelckers 2019-03-22 19:54:19 +01:00
parent d03839dfef
commit 24a52d65a5
23 changed files with 282 additions and 282 deletions

View file

@ -38,7 +38,7 @@ namespace OpenGLRenderer
{
class FShader;
struct GLSectorPlane;
struct HWSectorPlane;
class FGLRenderState : public FRenderState
{

View file

@ -325,7 +325,7 @@ void OpenGLFrameBuffer::PrecacheMaterial(FMaterial *mat, int translation)
FModelRenderer *OpenGLFrameBuffer::CreateModelRenderer(int mli)
{
return new FGLModelRenderer(nullptr, gl_RenderState, mli);
return new FHWModelRenderer(nullptr, gl_RenderState, mli);
}
IVertexBuffer *OpenGLFrameBuffer::CreateVertexBuffer()

View file

@ -45,14 +45,14 @@
CVAR(Bool, gl_light_models, true, CVAR_ARCHIVE)
VSMatrix FGLModelRenderer::GetViewToWorldMatrix()
VSMatrix FHWModelRenderer::GetViewToWorldMatrix()
{
VSMatrix objectToWorldMatrix;
di->VPUniforms.mViewMatrix.inverseMatrix(objectToWorldMatrix);
return objectToWorldMatrix;
}
void FGLModelRenderer::BeginDrawModel(AActor *actor, FSpriteModelFrame *smf, const VSMatrix &objectToWorldMatrix, bool mirrored)
void FHWModelRenderer::BeginDrawModel(AActor *actor, FSpriteModelFrame *smf, const VSMatrix &objectToWorldMatrix, bool mirrored)
{
state.SetDepthFunc(DF_LEqual);
state.EnableTexture(true);
@ -69,7 +69,7 @@ void FGLModelRenderer::BeginDrawModel(AActor *actor, FSpriteModelFrame *smf, con
state.EnableModelMatrix(true);
}
void FGLModelRenderer::EndDrawModel(AActor *actor, FSpriteModelFrame *smf)
void FHWModelRenderer::EndDrawModel(AActor *actor, FSpriteModelFrame *smf)
{
state.EnableModelMatrix(false);
state.SetDepthFunc(DF_Less);
@ -77,7 +77,7 @@ void FGLModelRenderer::EndDrawModel(AActor *actor, FSpriteModelFrame *smf)
state.SetCulling(Cull_None);
}
void FGLModelRenderer::BeginDrawHUDModel(AActor *actor, const VSMatrix &objectToWorldMatrix, bool mirrored)
void FHWModelRenderer::BeginDrawHUDModel(AActor *actor, const VSMatrix &objectToWorldMatrix, bool mirrored)
{
state.SetDepthFunc(DF_LEqual);
@ -93,7 +93,7 @@ void FGLModelRenderer::BeginDrawHUDModel(AActor *actor, const VSMatrix &objectTo
state.EnableModelMatrix(true);
}
void FGLModelRenderer::EndDrawHUDModel(AActor *actor)
void FHWModelRenderer::EndDrawHUDModel(AActor *actor)
{
state.EnableModelMatrix(false);
@ -102,29 +102,29 @@ void FGLModelRenderer::EndDrawHUDModel(AActor *actor)
state.SetCulling(Cull_None);
}
IModelVertexBuffer *FGLModelRenderer::CreateVertexBuffer(bool needindex, bool singleframe)
IModelVertexBuffer *FHWModelRenderer::CreateVertexBuffer(bool needindex, bool singleframe)
{
return new FModelVertexBuffer(needindex, singleframe);
}
void FGLModelRenderer::SetInterpolation(double inter)
void FHWModelRenderer::SetInterpolation(double inter)
{
state.SetInterpolationFactor((float)inter);
}
void FGLModelRenderer::SetMaterial(FTexture *skin, bool clampNoFilter, int translation)
void FHWModelRenderer::SetMaterial(FTexture *skin, bool clampNoFilter, int translation)
{
FMaterial * tex = FMaterial::ValidateTexture(skin, false);
state.SetMaterial(tex, clampNoFilter ? CLAMP_NOFILTER : CLAMP_NONE, translation, -1);
state.SetLightIndex(modellightindex);
}
void FGLModelRenderer::DrawArrays(int start, int count)
void FHWModelRenderer::DrawArrays(int start, int count)
{
state.Draw(DT_Triangles, start, count);
}
void FGLModelRenderer::DrawElements(int numIndices, size_t offset)
void FHWModelRenderer::DrawElements(int numIndices, size_t offset)
{
state.DrawIndexed(DT_Triangles, int(offset / sizeof(unsigned int)), numIndices);
}
@ -216,7 +216,7 @@ void FModelVertexBuffer::UnlockIndexBuffer()
void FModelVertexBuffer::SetupFrame(FModelRenderer *renderer, unsigned int frame1, unsigned int frame2, unsigned int size)
{
auto &state = static_cast<FGLModelRenderer*>(renderer)->state;
auto &state = static_cast<FHWModelRenderer*>(renderer)->state;
state.SetVertexBuffer(mVertexBuffer, frame1, frame2);
if (mIndexBuffer) state.SetIndexBuffer(mIndexBuffer);
}

View file

@ -28,7 +28,7 @@
#include "r_data/models/models.h"
#include "hwrenderer/data/buffers.h"
class GLSprite;
class HWSprite;
struct HWDrawInfo;
class FRenderState;
@ -51,14 +51,14 @@ public:
void SetupFrame(FModelRenderer *renderer, unsigned int frame1, unsigned int frame2, unsigned int size) override;
};
class FGLModelRenderer : public FModelRenderer
class FHWModelRenderer : public FModelRenderer
{
friend class FModelVertexBuffer;
int modellightindex = -1;
HWDrawInfo *di;
FRenderState &state;
public:
FGLModelRenderer(HWDrawInfo *d, FRenderState &st, int mli) : modellightindex(mli), di(d), state(st)
FHWModelRenderer(HWDrawInfo *d, FRenderState &st, int mli) : modellightindex(mli), di(d), state(st)
{}
ModelRendererType GetType() const override { return GLModelRendererType; }
void BeginDrawModel(AActor *actor, FSpriteModelFrame *smf, const VSMatrix &objectToWorldMatrix, bool mirrored) override;

View file

@ -134,7 +134,7 @@ void HWDrawInfo::WorkerThread()
case RenderJob::WallJob:
{
GLWall wall;
HWWall wall;
SetupWall.Clock();
wall.sub = job->sub;
@ -161,7 +161,7 @@ void HWDrawInfo::WorkerThread()
case RenderJob::FlatJob:
{
GLFlat flat;
HWFlat flat;
SetupFlat.Clock();
flat.section = job->sub->section;
front = hw_FakeFlat(job->sub->render_sector, in_area, false);
@ -331,7 +331,7 @@ void HWDrawInfo::AddLine (seg_t *seg, bool portalclip)
}
else
{
GLWall wall;
HWWall wall;
SetupWall.Clock();
wall.sub = seg->Subsector;
wall.Process(this, seg, currentsector, backsector);
@ -532,7 +532,7 @@ void HWDrawInfo::RenderThings(subsector_t * sub, sector_t * sector)
// If this thing is in a map section that's not in view it can't possibly be visible
if (CurrentMapSections[thing->subsector->mapsection])
{
GLSprite sprite;
HWSprite sprite;
sprite.Process(this, thing, sector, in_area, false);
}
}
@ -551,7 +551,7 @@ void HWDrawInfo::RenderThings(subsector_t * sub, sector_t * sector)
}
}
GLSprite sprite;
HWSprite sprite;
sprite.Process(this, thing, sector, in_area, true);
}
}
@ -567,7 +567,7 @@ void HWDrawInfo::RenderParticles(subsector_t *sub, sector_t *front)
if (clipres == PClip_InFront) continue;
}
GLSprite sprite;
HWSprite sprite;
sprite.ProcessParticle(this, &Level->Particles[i], front);
}
SetupSprite.Unclock();
@ -702,7 +702,7 @@ void HWDrawInfo::DoSubsector(subsector_t * sub)
}
else
{
GLFlat flat;
HWFlat flat;
flat.section = sub->section;
SetupFlat.Clock();
flat.ProcessSector(this, fakesector);

View file

@ -44,7 +44,7 @@
//
//==========================================================================
void GLDecal::DrawDecal(HWDrawInfo *di, FRenderState &state)
void HWDecal::DrawDecal(HWDrawInfo *di, FRenderState &state)
{
auto tex = gltexture;
@ -129,7 +129,7 @@ void GLDecal::DrawDecal(HWDrawInfo *di, FRenderState &state)
//
//
//==========================================================================
void HWDrawInfo::DrawDecals(FRenderState &state, TArray<GLDecal *> &decals)
void HWDrawInfo::DrawDecals(FRenderState &state, TArray<HWDecal *> &decals)
{
side_t *wall = nullptr;
state.SetDepthMask(false);
@ -164,7 +164,7 @@ void HWDrawInfo::DrawDecals(FRenderState &state, TArray<GLDecal *> &decals)
//
//==========================================================================
void GLWall::DrawDecalsForMirror(HWDrawInfo *di, FRenderState &state, TArray<GLDecal *> &decals)
void HWWall::DrawDecalsForMirror(HWDrawInfo *di, FRenderState &state, TArray<HWDecal *> &decals)
{
state.SetDepthMask(false);
state.SetDepthBias(-1, -128);
@ -188,7 +188,7 @@ void GLWall::DrawDecalsForMirror(HWDrawInfo *di, FRenderState &state, TArray<GLD
//
//==========================================================================
void GLWall::ProcessDecal(HWDrawInfo *di, DBaseDecal *decal, const FVector3 &normal)
void HWWall::ProcessDecal(HWDrawInfo *di, DBaseDecal *decal, const FVector3 &normal)
{
line_t * line = seg->linedef;
side_t * side = seg->sidedef;
@ -384,7 +384,7 @@ void GLWall::ProcessDecal(HWDrawInfo *di, DBaseDecal *decal, const FVector3 &nor
for (i = 0; i < 4; i++) dv[i].v = vb - dv[i].v;
}
GLDecal *gldecal = di->AddDecal(type == RENDERWALL_MIRRORSURFACE);
HWDecal *gldecal = di->AddDecal(type == RENDERWALL_MIRRORSURFACE);
gldecal->gltexture = tex;
gldecal->decal = decal;
@ -428,7 +428,7 @@ void GLWall::ProcessDecal(HWDrawInfo *di, DBaseDecal *decal, const FVector3 &nor
//
//==========================================================================
void GLWall::ProcessDecals(HWDrawInfo *di)
void HWWall::ProcessDecals(HWDrawInfo *di)
{
if (seg->sidedef != nullptr)
{

View file

@ -406,9 +406,9 @@ void HWViewpointUniforms::SetDefaults()
//
//-----------------------------------------------------------------------------
GLDecal *HWDrawInfo::AddDecal(bool onmirror)
HWDecal *HWDrawInfo::AddDecal(bool onmirror)
{
auto decal = (GLDecal*)RenderDataAllocator.Alloc(sizeof(GLDecal));
auto decal = (HWDecal*)RenderDataAllocator.Alloc(sizeof(HWDecal));
Decals[onmirror ? 1 : 0].Push(decal);
return decal;
}

View file

@ -21,10 +21,10 @@ enum EDrawMode
struct FSectorPortalGroup;
struct FLinePortalSpan;
struct FFlatVertex;
class GLWall;
class GLFlat;
class GLSprite;
struct GLDecal;
class HWWall;
class HWFlat;
class HWSprite;
struct HWDecal;
class IShadowMap;
struct particle_t;
struct FDynLightData;
@ -148,7 +148,7 @@ struct HWDrawInfo
FRenderViewpoint Viewpoint;
HWViewpointUniforms VPUniforms; // per-viewpoint uniform state
TArray<HWPortal *> Portals;
TArray<GLDecal *> Decals[2]; // the second slot is for mirrors which get rendered in a separate pass.
TArray<HWDecal *> Decals[2]; // the second slot is for mirrors which get rendered in a separate pass.
TArray<HUDSprite> hudsprites; // These may just be stored by value.
TArray<MissingTextureInfo> MissingUpperTextures;
@ -299,19 +299,19 @@ public:
void SetupView(FRenderState &state, float vx, float vy, float vz, bool mirror, bool planemirror);
angle_t FrustumAngle();
void DrawDecals(FRenderState &state, TArray<GLDecal *> &decals);
void DrawDecals(FRenderState &state, TArray<HWDecal *> &decals);
void DrawPlayerSprites(bool hudModelStep, FRenderState &state);
void ProcessLowerMinisegs(TArray<seg_t *> &lowersegs);
void AddSubsectorToPortal(FSectorPortalGroup *portal, subsector_t *sub);
void AddWall(GLWall *w);
void AddMirrorSurface(GLWall *w);
void AddFlat(GLFlat *flat, bool fog);
void AddSprite(GLSprite *sprite, bool translucent);
void AddWall(HWWall *w);
void AddMirrorSurface(HWWall *w);
void AddFlat(HWFlat *flat, bool fog);
void AddSprite(HWSprite *sprite, bool translucent);
GLDecal *AddDecal(bool onmirror);
HWDecal *AddDecal(bool onmirror);
bool isSoftwareLighting() const
{

View file

@ -193,9 +193,9 @@ void HWDrawList::MakeSortList()
//==========================================================================
SortNode * HWDrawList::FindSortPlane(SortNode * head)
{
while (head->next && drawitems[head->itemindex].rendertype!=GLDIT_FLAT)
while (head->next && drawitems[head->itemindex].rendertype!=DrawType_FLAT)
head=head->next;
if (drawitems[head->itemindex].rendertype==GLDIT_FLAT) return head;
if (drawitems[head->itemindex].rendertype==DrawType_FLAT) return head;
return NULL;
}
@ -215,8 +215,8 @@ SortNode * HWDrawList::FindSortWall(SortNode * head)
while (node)
{
GLDrawItem * it = &drawitems[node->itemindex];
if (it->rendertype == GLDIT_WALL)
HWDrawItem * it = &drawitems[node->itemindex];
if (it->rendertype == DrawType_WALL)
{
float d = walls[it->index]->ViewDistance;
if (d > farthest) farthest = d;
@ -229,8 +229,8 @@ SortNode * HWDrawList::FindSortWall(SortNode * head)
farthest = (farthest + nearest) / 2;
while (node)
{
GLDrawItem * it = &drawitems[node->itemindex];
if (it->rendertype == GLDIT_WALL)
HWDrawItem * it = &drawitems[node->itemindex];
if (it->rendertype == DrawType_WALL)
{
float di = fabsf(walls[it->index]->ViewDistance - farthest);
if (!best || di < bestdist)
@ -251,8 +251,8 @@ SortNode * HWDrawList::FindSortWall(SortNode * head)
//==========================================================================
void HWDrawList::SortPlaneIntoPlane(SortNode * head,SortNode * sort)
{
GLFlat * fh= flats[drawitems[head->itemindex].index];
GLFlat * fs= flats[drawitems[sort->itemindex].index];
HWFlat * fh= flats[drawitems[head->itemindex].index];
HWFlat * fs= flats[drawitems[sort->itemindex].index];
if (fh->z==fs->z)
head->AddToEqual(sort);
@ -270,8 +270,8 @@ void HWDrawList::SortPlaneIntoPlane(SortNode * head,SortNode * sort)
//==========================================================================
void HWDrawList::SortWallIntoPlane(SortNode * head, SortNode * sort)
{
GLFlat * fh = flats[drawitems[head->itemindex].index];
GLWall * ws = walls[drawitems[sort->itemindex].index];
HWFlat * fh = flats[drawitems[head->itemindex].index];
HWWall * ws = walls[drawitems[sort->itemindex].index];
bool ceiling = fh->z > SortZ;
@ -279,14 +279,14 @@ void HWDrawList::SortWallIntoPlane(SortNode * head, SortNode * sort)
{
// We have to split this wall!
GLWall *w = NewWall();
HWWall *w = NewWall();
*w = *ws;
// Splitting is done in the shader with clip planes, if available
if (screen->hwcaps & RFL_NO_CLIP_PLANES)
{
ws->vertcount = 0; // invalidate current vertices.
float newtexv = ws->tcs[GLWall::UPLFT].v + ((ws->tcs[GLWall::LOLFT].v - ws->tcs[GLWall::UPLFT].v) / (ws->zbottom[0] - ws->ztop[0])) * (fh->z - ws->ztop[0]);
float newtexv = ws->tcs[HWWall::UPLFT].v + ((ws->tcs[HWWall::LOLFT].v - ws->tcs[HWWall::UPLFT].v) / (ws->zbottom[0] - ws->ztop[0])) * (fh->z - ws->ztop[0]);
// I make the very big assumption here that translucent walls in sloped sectors
// and 3D-floors never coexist in the same level - If that were the case this
@ -294,12 +294,12 @@ void HWDrawList::SortWallIntoPlane(SortNode * head, SortNode * sort)
if (!ceiling)
{
ws->ztop[1] = w->zbottom[1] = ws->ztop[0] = w->zbottom[0] = fh->z;
ws->tcs[GLWall::UPRGT].v = w->tcs[GLWall::LORGT].v = ws->tcs[GLWall::UPLFT].v = w->tcs[GLWall::LOLFT].v = newtexv;
ws->tcs[HWWall::UPRGT].v = w->tcs[HWWall::LORGT].v = ws->tcs[HWWall::UPLFT].v = w->tcs[HWWall::LOLFT].v = newtexv;
}
else
{
w->ztop[1] = ws->zbottom[1] = w->ztop[0] = ws->zbottom[0] = fh->z;
w->tcs[GLWall::UPLFT].v = ws->tcs[GLWall::LOLFT].v = w->tcs[GLWall::UPRGT].v = ws->tcs[GLWall::LORGT].v = newtexv;
w->tcs[HWWall::UPLFT].v = ws->tcs[HWWall::LOLFT].v = w->tcs[HWWall::UPRGT].v = ws->tcs[HWWall::LORGT].v = newtexv;
}
}
@ -328,8 +328,8 @@ void HWDrawList::SortWallIntoPlane(SortNode * head, SortNode * sort)
//==========================================================================
void HWDrawList::SortSpriteIntoPlane(SortNode * head, SortNode * sort)
{
GLFlat * fh = flats[drawitems[head->itemindex].index];
GLSprite * ss = sprites[drawitems[sort->itemindex].index];
HWFlat * fh = flats[drawitems[head->itemindex].index];
HWSprite * ss = sprites[drawitems[sort->itemindex].index];
bool ceiling = fh->z > SortZ;
@ -339,7 +339,7 @@ void HWDrawList::SortSpriteIntoPlane(SortNode * head, SortNode * sort)
if ((hiz > fh->z && loz < fh->z) || ss->modelframe)
{
// We have to split this sprite
GLSprite *s = NewSprite();
HWSprite *s = NewSprite();
*s = *ss;
// Splitting is done in the shader with clip planes, if available.
@ -385,7 +385,7 @@ void HWDrawList::SortSpriteIntoPlane(SortNode * head, SortNode * sort)
#define MIN_EQ (0.0005f)
// Lines start-end and fdiv must intersect.
inline double CalcIntersectionVertex(GLWall *w1, GLWall * w2)
inline double CalcIntersectionVertex(HWWall *w1, HWWall * w2)
{
float ax = w1->glseg.x1, ay = w1->glseg.y1;
float bx = w1->glseg.x2, by = w1->glseg.y2;
@ -396,8 +396,8 @@ inline double CalcIntersectionVertex(GLWall *w1, GLWall * w2)
void HWDrawList::SortWallIntoWall(HWDrawInfo *di, SortNode * head,SortNode * sort)
{
GLWall * wh= walls[drawitems[head->itemindex].index];
GLWall * ws= walls[drawitems[sort->itemindex].index];
HWWall * wh= walls[drawitems[head->itemindex].index];
HWWall * ws= walls[drawitems[sort->itemindex].index];
float v1=wh->PointOnSide(ws->glseg.x1,ws->glseg.y1);
float v2=wh->PointOnSide(ws->glseg.x2,ws->glseg.y2);
@ -430,12 +430,12 @@ void HWDrawList::SortWallIntoWall(HWDrawInfo *di, SortNode * head,SortNode * sor
float ix=(float)(ws->glseg.x1+r*(ws->glseg.x2-ws->glseg.x1));
float iy=(float)(ws->glseg.y1+r*(ws->glseg.y2-ws->glseg.y1));
float iu=(float)(ws->tcs[GLWall::UPLFT].u + r * (ws->tcs[GLWall::UPRGT].u - ws->tcs[GLWall::UPLFT].u));
float iu=(float)(ws->tcs[HWWall::UPLFT].u + r * (ws->tcs[HWWall::UPRGT].u - ws->tcs[HWWall::UPLFT].u));
float izt=(float)(ws->ztop[0]+r*(ws->ztop[1]-ws->ztop[0]));
float izb=(float)(ws->zbottom[0]+r*(ws->zbottom[1]-ws->zbottom[0]));
ws->vertcount = 0; // invalidate current vertices.
GLWall *w= NewWall();
HWWall *w= NewWall();
*w = *ws;
w->glseg.x1=ws->glseg.x2=ix;
@ -443,7 +443,7 @@ void HWDrawList::SortWallIntoWall(HWDrawInfo *di, SortNode * head,SortNode * sor
w->glseg.fracleft = ws->glseg.fracright = ws->glseg.fracleft + r*(ws->glseg.fracright - ws->glseg.fracleft);
w->ztop[0]=ws->ztop[1]=izt;
w->zbottom[0]=ws->zbottom[1]=izb;
w->tcs[GLWall::LOLFT].u = w->tcs[GLWall::UPLFT].u = ws->tcs[GLWall::LORGT].u = ws->tcs[GLWall::UPRGT].u = iu;
w->tcs[HWWall::LOLFT].u = w->tcs[HWWall::UPLFT].u = ws->tcs[HWWall::LORGT].u = ws->tcs[HWWall::UPRGT].u = iu;
ws->MakeVertices(di, false);
w->MakeVertices(di, false);
@ -474,7 +474,7 @@ EXTERN_CVAR(Int, gl_billboard_mode)
EXTERN_CVAR(Bool, gl_billboard_faces_camera)
EXTERN_CVAR(Bool, gl_billboard_particles)
inline double CalcIntersectionVertex(GLSprite *s, GLWall * w2)
inline double CalcIntersectionVertex(HWSprite *s, HWWall * w2)
{
float ax = s->x1, ay = s->y1;
float bx = s->x2, by = s->y2;
@ -485,8 +485,8 @@ inline double CalcIntersectionVertex(GLSprite *s, GLWall * w2)
void HWDrawList::SortSpriteIntoWall(HWDrawInfo *di, SortNode * head,SortNode * sort)
{
GLWall *wh= walls[drawitems[head->itemindex].index];
GLSprite * ss= sprites[drawitems[sort->itemindex].index];
HWWall *wh= walls[drawitems[head->itemindex].index];
HWSprite * ss= sprites[drawitems[sort->itemindex].index];
float v1 = wh->PointOnSide(ss->x1, ss->y1);
float v2 = wh->PointOnSide(ss->x2, ss->y2);
@ -539,7 +539,7 @@ void HWDrawList::SortSpriteIntoWall(HWDrawInfo *di, SortNode * head,SortNode * s
float iy=(float)(ss->y1 + r * (ss->y2-ss->y1));
float iu=(float)(ss->ul + r * (ss->ur-ss->ul));
GLSprite *s = NewSprite();
HWSprite *s = NewSprite();
*s = *ss;
s->x1=ss->x2=ix;
@ -582,8 +582,8 @@ void HWDrawList::SortSpriteIntoWall(HWDrawInfo *di, SortNode * head,SortNode * s
inline int HWDrawList::CompareSprites(SortNode * a,SortNode * b)
{
GLSprite * s1= sprites[drawitems[a->itemindex].index];
GLSprite * s2= sprites[drawitems[b->itemindex].index];
HWSprite * s1= sprites[drawitems[a->itemindex].index];
HWSprite * s2= sprites[drawitems[b->itemindex].index];
int res = s1->depth - s2->depth;
@ -643,15 +643,15 @@ SortNode * HWDrawList::DoSort(HWDrawInfo *di, SortNode * head)
next=node->next;
switch(drawitems[node->itemindex].rendertype)
{
case GLDIT_FLAT:
case DrawType_FLAT:
SortPlaneIntoPlane(head,node);
break;
case GLDIT_WALL:
case DrawType_WALL:
SortWallIntoPlane(head,node);
break;
case GLDIT_SPRITE:
case DrawType_SPRITE:
SortSpriteIntoPlane(head,node);
break;
}
@ -672,15 +672,15 @@ SortNode * HWDrawList::DoSort(HWDrawInfo *di, SortNode * head)
next=node->next;
switch(drawitems[node->itemindex].rendertype)
{
case GLDIT_WALL:
case DrawType_WALL:
SortWallIntoWall(di, head,node);
break;
case GLDIT_SPRITE:
case DrawType_SPRITE:
SortSpriteIntoWall(di, head, node);
break;
case GLDIT_FLAT: break;
case DrawType_FLAT: break;
}
node=next;
}
@ -718,10 +718,10 @@ void HWDrawList::SortWalls()
{
if (drawitems.Size() > 1)
{
std::sort(drawitems.begin(), drawitems.end(), [=](const GLDrawItem &a, const GLDrawItem &b) -> bool
std::sort(drawitems.begin(), drawitems.end(), [=](const HWDrawItem &a, const HWDrawItem &b) -> bool
{
GLWall * w1 = walls[a.index];
GLWall * w2 = walls[b.index];
HWWall * w1 = walls[a.index];
HWWall * w2 = walls[b.index];
if (w1->gltexture != w2->gltexture) return w1->gltexture < w2->gltexture;
return (w1->flags & 3) < (w2->flags & 3);
@ -734,10 +734,10 @@ void HWDrawList::SortFlats()
{
if (drawitems.Size() > 1)
{
std::sort(drawitems.begin(), drawitems.end(), [=](const GLDrawItem &a, const GLDrawItem &b)
std::sort(drawitems.begin(), drawitems.end(), [=](const HWDrawItem &a, const HWDrawItem &b)
{
GLFlat * w1 = flats[a.index];
GLFlat* w2 = flats[b.index];
HWFlat * w1 = flats[a.index];
HWFlat* w2 = flats[b.index];
return w1->gltexture < w2->gltexture;
});
}
@ -750,10 +750,10 @@ void HWDrawList::SortFlats()
//
//==========================================================================
GLWall *HWDrawList::NewWall()
HWWall *HWDrawList::NewWall()
{
auto wall = (GLWall*)RenderDataAllocator.Alloc(sizeof(GLWall));
drawitems.Push(GLDrawItem(GLDIT_WALL, walls.Push(wall)));
auto wall = (HWWall*)RenderDataAllocator.Alloc(sizeof(HWWall));
drawitems.Push(HWDrawItem(DrawType_WALL, walls.Push(wall)));
return wall;
}
@ -762,10 +762,10 @@ GLWall *HWDrawList::NewWall()
//
//
//==========================================================================
GLFlat *HWDrawList::NewFlat()
HWFlat *HWDrawList::NewFlat()
{
auto flat = (GLFlat*)RenderDataAllocator.Alloc(sizeof(GLFlat));
drawitems.Push(GLDrawItem(GLDIT_FLAT,flats.Push(flat)));
auto flat = (HWFlat*)RenderDataAllocator.Alloc(sizeof(HWFlat));
drawitems.Push(HWDrawItem(DrawType_FLAT,flats.Push(flat)));
return flat;
}
@ -774,10 +774,10 @@ GLFlat *HWDrawList::NewFlat()
//
//
//==========================================================================
GLSprite *HWDrawList::NewSprite()
HWSprite *HWDrawList::NewSprite()
{
auto sprite = (GLSprite*)RenderDataAllocator.Alloc(sizeof(GLSprite));
drawitems.Push(GLDrawItem(GLDIT_SPRITE, sprites.Push(sprite)));
auto sprite = (HWSprite*)RenderDataAllocator.Alloc(sizeof(HWSprite));
drawitems.Push(HWDrawItem(DrawType_SPRITE, sprites.Push(sprite)));
return sprite;
}
@ -790,27 +790,27 @@ void HWDrawList::DoDraw(HWDrawInfo *di, FRenderState &state, bool translucent, i
{
switch(drawitems[i].rendertype)
{
case GLDIT_FLAT:
case DrawType_FLAT:
{
GLFlat * f= flats[drawitems[i].index];
HWFlat * f= flats[drawitems[i].index];
RenderFlat.Clock();
f->DrawFlat(di, state, translucent);
RenderFlat.Unclock();
}
break;
case GLDIT_WALL:
case DrawType_WALL:
{
GLWall * w= walls[drawitems[i].index];
HWWall * w= walls[drawitems[i].index];
RenderWall.Clock();
w->DrawWall(di, state, translucent);
RenderWall.Unclock();
}
break;
case GLDIT_SPRITE:
case DrawType_SPRITE:
{
GLSprite * s= sprites[drawitems[i].index];
HWSprite * s= sprites[drawitems[i].index];
RenderSprite.Clock();
s->DrawSprite(di, state, translucent);
RenderSprite.Unclock();
@ -875,7 +875,7 @@ void HWDrawList::DrawSorted(HWDrawInfo *di, FRenderState &state, SortNode * head
state.GetClipSplit(clipsplit);
if (drawitems[head->itemindex].rendertype == GLDIT_FLAT)
if (drawitems[head->itemindex].rendertype == DrawType_FLAT)
{
z = flats[drawitems[head->itemindex].index]->z;
relation = z > di->Viewpoint.Pos.Z ? 1 : -1;

View file

@ -5,9 +5,9 @@
extern FMemArena RenderDataAllocator;
void ResetRenderDataAllocator();
struct HWDrawInfo;
class GLWall;
class GLFlat;
class GLSprite;
class HWWall;
class HWFlat;
class HWSprite;
class FRenderState;
//==========================================================================
@ -19,19 +19,19 @@ class FRenderState;
//
//==========================================================================
enum GLDrawItemType
enum HWDrawItemType
{
GLDIT_WALL,
GLDIT_FLAT,
GLDIT_SPRITE,
DrawType_WALL,
DrawType_FLAT,
DrawType_SPRITE,
};
struct GLDrawItem
struct HWDrawItem
{
GLDrawItemType rendertype;
HWDrawItemType rendertype;
int index;
GLDrawItem(GLDrawItemType _rendertype,int _index) : rendertype(_rendertype),index(_index) {}
HWDrawItem(HWDrawItemType _rendertype,int _index) : rendertype(_rendertype),index(_index) {}
};
struct SortNode
@ -60,10 +60,10 @@ struct SortNode
struct HWDrawList
{
//private:
TArray<GLWall*> walls;
TArray<GLFlat*> flats;
TArray<GLSprite*> sprites;
TArray<GLDrawItem> drawitems;
TArray<HWWall*> walls;
TArray<HWFlat*> flats;
TArray<HWSprite*> sprites;
TArray<HWDrawItem> drawitems;
int SortNodeStart;
float SortZ;
SortNode * sorted;
@ -87,9 +87,9 @@ public:
return drawitems.Size();
}
GLWall *NewWall();
GLFlat *NewFlat();
GLSprite *NewSprite();
HWWall *NewWall();
HWFlat *NewFlat();
HWSprite *NewSprite();
void Reset();
void SortWalls();
void SortFlats();

View file

@ -35,19 +35,19 @@ EXTERN_CVAR(Bool, gl_seamless)
//
//==========================================================================
void HWDrawInfo::AddWall(GLWall *wall)
void HWDrawInfo::AddWall(HWWall *wall)
{
if (wall->flags & GLWall::GLWF_TRANSLUCENT)
if (wall->flags & HWWall::HWF_TRANSLUCENT)
{
auto newwall = drawlists[GLDL_TRANSLUCENT].NewWall();
*newwall = *wall;
}
else
{
bool masked = GLWall::passflag[wall->type] == 1 ? false : (wall->gltexture && wall->gltexture->isMasked());
bool masked = HWWall::passflag[wall->type] == 1 ? false : (wall->gltexture && wall->gltexture->isMasked());
int list;
if ((wall->flags & GLWall::GLWF_SKYHACK && wall->type == RENDERWALL_M2S))
if ((wall->flags & HWWall::HWF_SKYHACK && wall->type == RENDERWALL_M2S))
{
list = GLDL_MASKEDWALLSOFS;
}
@ -66,7 +66,7 @@ void HWDrawInfo::AddWall(GLWall *wall)
//
//==========================================================================
void HWDrawInfo::AddMirrorSurface(GLWall *w)
void HWDrawInfo::AddMirrorSurface(HWWall *w)
{
w->type = RENDERWALL_MIRRORSURFACE;
auto newwall = drawlists[GLDL_TRANSLUCENTBORDER].NewWall();
@ -77,8 +77,8 @@ void HWDrawInfo::AddMirrorSurface(GLWall *w)
FVector3 v = newwall->glseg.Normal();
auto tcs = newwall->tcs;
tcs[GLWall::LOLFT].u = tcs[GLWall::LORGT].u = tcs[GLWall::UPLFT].u = tcs[GLWall::UPRGT].u = v.X;
tcs[GLWall::LOLFT].v = tcs[GLWall::LORGT].v = tcs[GLWall::UPLFT].v = tcs[GLWall::UPRGT].v = v.Z;
tcs[HWWall::LOLFT].u = tcs[HWWall::LORGT].u = tcs[HWWall::UPLFT].u = tcs[HWWall::UPRGT].u = v.X;
tcs[HWWall::LOLFT].v = tcs[HWWall::LORGT].v = tcs[HWWall::UPLFT].v = tcs[HWWall::UPRGT].v = v.Z;
newwall->MakeVertices(this, false);
newwall->ProcessDecals(this);
}
@ -92,7 +92,7 @@ void HWDrawInfo::AddMirrorSurface(GLWall *w)
//
//==========================================================================
void HWDrawInfo::AddFlat(GLFlat *flat, bool fog)
void HWDrawInfo::AddFlat(HWFlat *flat, bool fog)
{
int list;
@ -131,7 +131,7 @@ void HWDrawInfo::AddFlat(GLFlat *flat, bool fog)
//
//
//==========================================================================
void HWDrawInfo::AddSprite(GLSprite *sprite, bool translucent)
void HWDrawInfo::AddSprite(HWSprite *sprite, bool translucent)
{
int list;
// [BB] Allow models to be drawn in the GLDL_TRANSLUCENT pass.

View file

@ -13,8 +13,8 @@
#pragma warning(disable:4244)
#endif
struct GLHorizonInfo;
struct GLSkyInfo;
struct HWHorizonInfo;
struct HWSkyInfo;
struct F3DFloor;
class FMaterial;
struct FTexCoordInfo;
@ -26,7 +26,7 @@ class VSMatrix;
struct FSpriteModelFrame;
struct particle_t;
class FRenderState;
struct GLDecal;
struct HWDecal;
struct FSection;
enum area_t : int;
@ -69,7 +69,7 @@ enum PortalTypes
//
//==========================================================================
struct GLSectorPlane
struct HWSectorPlane
{
FTextureID texture;
secplane_t plane;
@ -91,7 +91,7 @@ struct GLSectorPlane
}
};
struct GLSeg
struct HWSeg
{
float x1,x2;
float y1,y2;
@ -114,21 +114,21 @@ struct texcoord
struct HWDrawInfo;
class GLWall
class HWWall
{
public:
static const char passflag[];
enum
{
GLWF_CLAMPX=1,
GLWF_CLAMPY=2,
GLWF_SKYHACK=4,
GLWF_GLOW=8, // illuminated by glowing flats
GLWF_NOSPLITUPPER=16,
GLWF_NOSPLITLOWER=32,
GLWF_NOSPLIT=64,
GLWF_TRANSLUCENT = 128
HWF_CLAMPX=1,
HWF_CLAMPY=2,
HWF_SKYHACK=4,
HWF_GLOW=8, // illuminated by glowing flats
HWF_NOSPLITUPPER=16,
HWF_NOSPLITLOWER=32,
HWF_NOSPLIT=64,
HWF_TRANSLUCENT = 128
};
enum
@ -154,7 +154,7 @@ public:
FMaterial *gltexture;
TArray<lightlist_t> *lightlist;
GLSeg glseg;
HWSeg glseg;
float ztop[2],zbottom[2];
texcoord tcs[4];
float alpha;
@ -178,8 +178,8 @@ public:
{
// it's either one of them but never more!
FSectorPortal *secportal; // sector portal (formerly skybox)
GLSkyInfo * sky; // for normal sky
GLHorizonInfo * horizon; // for horizon information
HWSkyInfo * sky; // for normal sky
HWHorizonInfo * horizon; // for horizon information
FSectorPortalGroup * portal; // stacked sector portals
secplane_t * planemirror; // for plane mirrors
FLinePortalSpan *lineportal; // line-to-line portals
@ -269,7 +269,7 @@ public:
void RenderMirrorSurface(HWDrawInfo *di, FRenderState &state);
void RenderTexturedWall(HWDrawInfo *di, FRenderState &state, int rflags);
void RenderTranslucentWall(HWDrawInfo *di, FRenderState &state);
void DrawDecalsForMirror(HWDrawInfo *di, FRenderState &state, TArray<GLDecal *> &decals);
void DrawDecalsForMirror(HWDrawInfo *di, FRenderState &state, TArray<HWDecal *> &decals);
public:
void Process(HWDrawInfo *di, seg_t *seg, sector_t *frontsector, sector_t *backsector);
@ -290,7 +290,7 @@ public:
//
//==========================================================================
class GLFlat
class HWFlat
{
public:
sector_t * sector;
@ -304,7 +304,7 @@ public:
ERenderStyle renderstyle;
float alpha;
GLSectorPlane plane;
HWSectorPlane plane;
int lightlevel;
bool stack;
bool ceiling;
@ -337,7 +337,7 @@ public:
//==========================================================================
class GLSprite
class HWSprite
{
public:
int lightlevel;
@ -398,7 +398,7 @@ struct DecalVertex
float u, v;
};
struct GLDecal
struct HWDecal
{
FMaterial *gltexture;
TArray<lightlist_t> *lightlist;
@ -425,7 +425,7 @@ inline float Dist2(float x1,float y1,float x2,float y2)
return sqrtf((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
bool hw_SetPlaneTextureRotation(const GLSectorPlane * secplane, FMaterial * gltexture, VSMatrix &mat);
bool hw_SetPlaneTextureRotation(const HWSectorPlane * secplane, FMaterial * gltexture, VSMatrix &mat);
void hw_GetDynModelLight(AActor *self, FDynLightData &modellightdata);
extern const float LARGE_VALUE;

View file

@ -56,7 +56,7 @@ CVAR(Int, gl_breaksec, -1, 0)
//
//==========================================================================
bool hw_SetPlaneTextureRotation(const GLSectorPlane * secplane, FMaterial * gltexture, VSMatrix &dest)
bool hw_SetPlaneTextureRotation(const HWSectorPlane * secplane, FMaterial * gltexture, VSMatrix &dest)
{
// only manipulate the texture matrix if needed.
if (!secplane->Offs.isZero() ||
@ -99,7 +99,7 @@ bool hw_SetPlaneTextureRotation(const GLSectorPlane * secplane, FMaterial * glte
//
//==========================================================================
void GLFlat::CreateSkyboxVertices(FFlatVertex *vert)
void HWFlat::CreateSkyboxVertices(FFlatVertex *vert)
{
float minx = FLT_MAX, miny = FLT_MAX;
float maxx = -FLT_MAX, maxy = -FLT_MAX;
@ -136,7 +136,7 @@ void GLFlat::CreateSkyboxVertices(FFlatVertex *vert)
//
//==========================================================================
void GLFlat::SetupLights(HWDrawInfo *di, FLightNode * node, FDynLightData &lightdata, int portalgroup)
void HWFlat::SetupLights(HWDrawInfo *di, FLightNode * node, FDynLightData &lightdata, int portalgroup)
{
Plane p;
@ -180,7 +180,7 @@ void GLFlat::SetupLights(HWDrawInfo *di, FLightNode * node, FDynLightData &light
//
//==========================================================================
void GLFlat::DrawSubsectors(HWDrawInfo *di, FRenderState &state)
void HWFlat::DrawSubsectors(HWDrawInfo *di, FRenderState &state)
{
if (di->Level->HasDynamicLights && screen->BuffersArePersistent() && !di->isFullbrightScene())
{
@ -201,7 +201,7 @@ void GLFlat::DrawSubsectors(HWDrawInfo *di, FRenderState &state)
//
//==========================================================================
void GLFlat::DrawOtherPlanes(HWDrawInfo *di, FRenderState &state)
void HWFlat::DrawOtherPlanes(HWDrawInfo *di, FRenderState &state)
{
state.SetMaterial(gltexture, CLAMP_NONE, 0, -1);
@ -229,7 +229,7 @@ void GLFlat::DrawOtherPlanes(HWDrawInfo *di, FRenderState &state)
//
//==========================================================================
void GLFlat::DrawFloodPlanes(HWDrawInfo *di, FRenderState &state)
void HWFlat::DrawFloodPlanes(HWDrawInfo *di, FRenderState &state)
{
// Flood gaps with the back side's ceiling/floor texture
// This requires a stencil because the projected plane interferes with
@ -291,7 +291,7 @@ void GLFlat::DrawFloodPlanes(HWDrawInfo *di, FRenderState &state)
//
//
//==========================================================================
void GLFlat::DrawFlat(HWDrawInfo *di, FRenderState &state, bool translucent)
void HWFlat::DrawFlat(HWDrawInfo *di, FRenderState &state, bool translucent)
{
#ifdef _DEBUG
if (sector->sectornum == gl_breaksec)
@ -363,13 +363,13 @@ void GLFlat::DrawFlat(HWDrawInfo *di, FRenderState &state, bool translucent)
//==========================================================================
//
// GLFlat::PutFlat
// HWFlat::PutFlat
//
// submit to the renderer
//
//==========================================================================
inline void GLFlat::PutFlat(HWDrawInfo *di, bool fog)
inline void HWFlat::PutFlat(HWDrawInfo *di, bool fog)
{
if (di->isFullbrightScene())
{
@ -392,7 +392,7 @@ inline void GLFlat::PutFlat(HWDrawInfo *di, bool fog)
//
//==========================================================================
void GLFlat::Process(HWDrawInfo *di, sector_t * model, int whichplane, bool fog)
void HWFlat::Process(HWDrawInfo *di, sector_t * model, int whichplane, bool fog)
{
plane.GetFromSector(model, whichplane);
if (whichplane != int(ceiling))
@ -436,7 +436,7 @@ void GLFlat::Process(HWDrawInfo *di, sector_t * model, int whichplane, bool fog)
//
//==========================================================================
void GLFlat::SetFrom3DFloor(F3DFloor *rover, bool top, bool underside)
void HWFlat::SetFrom3DFloor(F3DFloor *rover, bool top, bool underside)
{
F3DFloor::planeref & plane = top? rover->top : rover->bottom;
@ -471,7 +471,7 @@ void GLFlat::SetFrom3DFloor(F3DFloor *rover, bool top, bool underside)
//
//==========================================================================
void GLFlat::ProcessSector(HWDrawInfo *di, sector_t * frontsector, int which)
void HWFlat::ProcessSector(HWDrawInfo *di, sector_t * frontsector, int which)
{
lightlist_t * light;
FSectorPortal *port;

View file

@ -875,13 +875,13 @@ const char *HWPlaneMirrorPortal::GetName() { return origin->fC() < 0? "Planemirr
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
HWHorizonPortal::HWHorizonPortal(FPortalSceneState *s, GLHorizonInfo * pt, FRenderViewpoint &vp, bool local)
HWHorizonPortal::HWHorizonPortal(FPortalSceneState *s, HWHorizonInfo * pt, FRenderViewpoint &vp, bool local)
: HWPortal(s, local)
{
origin = pt;
// create the vertex data for this horizon portal.
GLSectorPlane * sp = &origin->plane;
HWSectorPlane * sp = &origin->plane;
const float vx = vp.Pos.X;
const float vy = vp.Pos.Y;
const float vz = vp.Pos.Z;
@ -948,7 +948,7 @@ void HWHorizonPortal::DrawContents(HWDrawInfo *di, FRenderState &state)
Clocker c(PortalAll);
FMaterial * gltexture;
GLSectorPlane * sp = &origin->plane;
HWSectorPlane * sp = &origin->plane;
auto &vp = di->Viewpoint;
gltexture = FMaterial::ValidateTexture(sp->texture, false, true);
@ -1018,14 +1018,14 @@ void HWEEHorizonPortal::DrawContents(HWDrawInfo *di, FRenderState &state)
if (sector->GetTexture(sector_t::floor) == skyflatnum ||
sector->GetTexture(sector_t::ceiling) == skyflatnum)
{
GLSkyInfo skyinfo;
HWSkyInfo skyinfo;
skyinfo.init(di, sector->sky, 0);
HWSkyPortal sky(screen->mSkyData, mState, &skyinfo, true);
sky.DrawContents(di, state);
}
if (sector->GetTexture(sector_t::ceiling) != skyflatnum)
{
GLHorizonInfo horz;
HWHorizonInfo horz;
horz.plane.GetFromSector(sector, sector_t::ceiling);
horz.lightlevel = hw_ClampLight(sector->GetCeilingLight());
horz.colormap = sector->Colormap;
@ -1039,7 +1039,7 @@ void HWEEHorizonPortal::DrawContents(HWDrawInfo *di, FRenderState &state)
}
if (sector->GetTexture(sector_t::floor) != skyflatnum)
{
GLHorizonInfo horz;
HWHorizonInfo horz;
horz.plane.GetFromSector(sector, sector_t::floor);
horz.lightlevel = hw_ClampLight(sector->GetFloorLight());
horz.colormap = sector->Colormap;

View file

@ -9,7 +9,7 @@
#include "hwrenderer/textures/hw_material.h"
struct GLSkyInfo
struct HWSkyInfo
{
float x_offset[2];
float y_offset; // doubleskies don't have a y-offset
@ -20,20 +20,20 @@ struct GLSkyInfo
bool sky2;
PalEntry fadecolor;
bool operator==(const GLSkyInfo & inf)
bool operator==(const HWSkyInfo & inf)
{
return !memcmp(this, &inf, sizeof(*this));
}
bool operator!=(const GLSkyInfo & inf)
bool operator!=(const HWSkyInfo & inf)
{
return !!memcmp(this, &inf, sizeof(*this));
}
void init(HWDrawInfo *di, int sky1, PalEntry fadecolor);
};
struct GLHorizonInfo
struct HWHorizonInfo
{
GLSectorPlane plane;
HWSectorPlane plane;
int lightlevel;
FColormap colormap;
PalEntry specialcolor;
@ -61,7 +61,7 @@ class HWPortal
public:
FPortalSceneState * mState;
TArray<GLWall> lines;
TArray<HWWall> lines;
BoundingRect boundingBox;
int planesused = 0;
@ -83,7 +83,7 @@ public:
void SetupStencil(HWDrawInfo *di, FRenderState &state, bool usestencil);
void RemoveStencil(HWDrawInfo *di, FRenderState &state, bool usestencil);
void AddLine(GLWall * l)
void AddLine(HWWall * l)
{
lines.Push(*l);
boundingBox.addVertex(l->glseg.x1, l->glseg.y1);
@ -103,8 +103,8 @@ struct FPortalSceneState
int PlaneMirrorMode = 0;
bool inskybox = 0;
UniqueList<GLSkyInfo> UniqueSkies;
UniqueList<GLHorizonInfo> UniqueHorizons;
UniqueList<HWSkyInfo> UniqueSkies;
UniqueList<HWHorizonInfo> UniqueHorizons;
UniqueList<secplane_t> UniquePlaneMirrors;
int skyboxrecursion = 0;
@ -313,7 +313,7 @@ public:
struct HWHorizonPortal : public HWPortal
{
GLHorizonInfo * origin;
HWHorizonInfo * origin;
unsigned int voffset;
unsigned int vcount;
friend struct HWEEHorizonPortal;
@ -327,7 +327,7 @@ protected:
public:
HWHorizonPortal(FPortalSceneState *state, GLHorizonInfo * pt, FRenderViewpoint &vp, bool local = false);
HWHorizonPortal(FPortalSceneState *state, HWHorizonInfo * pt, FRenderViewpoint &vp, bool local = false);
};
struct HWEEHorizonPortal : public HWPortal
@ -353,7 +353,7 @@ public:
struct HWSkyPortal : public HWPortal
{
GLSkyInfo * origin;
HWSkyInfo * origin;
FSkyVertexBuffer *vertexBuffer;
friend struct HWEEHorizonPortal;
@ -371,7 +371,7 @@ protected:
public:
HWSkyPortal(FSkyVertexBuffer *vertexbuffer, FPortalSceneState *state, GLSkyInfo * pt, bool local = false)
HWSkyPortal(FSkyVertexBuffer *vertexbuffer, FPortalSceneState *state, HWSkyInfo * pt, bool local = false)
: HWPortal(state, local)
{
origin = pt;

View file

@ -51,7 +51,7 @@ void HWDrawInfo::DispatchRenderHacks()
TMap<int, gl_subsectorrendernode*>::Pair *pair;
TMap<int, gl_floodrendernode*>::Pair *fpair;
TMap<int, gl_subsectorrendernode*>::Iterator ofi(otherFloorPlanes);
GLFlat glflat;
HWFlat glflat;
glflat.section = nullptr;
while (ofi.NextPair(pair))
{
@ -1114,7 +1114,7 @@ void HWDrawInfo::ProcessLowerMinisegs(TArray<seg_t *> &lowersegs)
for(unsigned int j=0;j<lowersegs.Size();j++)
{
seg_t * seg=lowersegs[j];
GLWall wall;
HWWall wall;
wall.ProcessLowerMiniseg(this, seg, seg->Subsector->render_sector, seg->PartnerSeg->Subsector->render_sector);
rendered_lines++;
}

View file

@ -415,7 +415,7 @@ public:
else mAlphaThreshold = thresh - 0.001f;
}
void SetPlaneTextureRotation(GLSectorPlane *plane, FMaterial *texture)
void SetPlaneTextureRotation(HWSectorPlane *plane, FMaterial *texture)
{
if (hw_SetPlaneTextureRotation(plane, texture, mTextureMatrix))
{

View file

@ -41,7 +41,7 @@ CVAR(Bool,gl_noskyboxes, false, 0)
//
//==========================================================================
void GLSkyInfo::init(HWDrawInfo *di, int sky1, PalEntry FadeColor)
void HWSkyInfo::init(HWDrawInfo *di, int sky1, PalEntry FadeColor)
{
memset(this, 0, sizeof(*this));
if ((sky1 & PL_SKYFLAT) && (sky1 & (PL_SKYFLAT - 1)))
@ -108,7 +108,7 @@ void GLSkyInfo::init(HWDrawInfo *di, int sky1, PalEntry FadeColor)
//
//==========================================================================
void GLWall::SkyPlane(HWDrawInfo *di, sector_t *sector, int plane, bool allowreflect)
void HWWall::SkyPlane(HWDrawInfo *di, sector_t *sector, int plane, bool allowreflect)
{
int ptype = -1;
@ -118,7 +118,7 @@ void GLWall::SkyPlane(HWDrawInfo *di, sector_t *sector, int plane, bool allowref
// Either a regular sky or a skybox with skyboxes disabled
if ((sportal == nullptr && sector->GetTexture(plane) == skyflatnum) || (gl_noskyboxes && sportal != nullptr && sportal->mType == PORTS_SKYVIEWPOINT))
{
GLSkyInfo skyinfo;
HWSkyInfo skyinfo;
skyinfo.init(di, sector->sky, Colormap.FadeColor);
ptype = PORTALTYPE_SKY;
sky = &skyinfo;
@ -173,10 +173,10 @@ void GLWall::SkyPlane(HWDrawInfo *di, sector_t *sector, int plane, bool allowref
//
//==========================================================================
void GLWall::SkyLine(HWDrawInfo *di, sector_t *fs, line_t *line)
void HWWall::SkyLine(HWDrawInfo *di, sector_t *fs, line_t *line)
{
FSectorPortal *secport = line->GetTransferredPortal();
GLSkyInfo skyinfo;
HWSkyInfo skyinfo;
int ptype;
// JUSTHIT is used as an indicator that a skybox is in use.
@ -207,7 +207,7 @@ void GLWall::SkyLine(HWDrawInfo *di, sector_t *fs, line_t *line)
//
//==========================================================================
void GLWall::SkyNormal(HWDrawInfo *di, sector_t * fs,vertex_t * v1,vertex_t * v2)
void HWWall::SkyNormal(HWDrawInfo *di, sector_t * fs,vertex_t * v1,vertex_t * v2)
{
ztop[0]=ztop[1]=32768.0f;
zbottom[0]=zceil[0];
@ -226,7 +226,7 @@ void GLWall::SkyNormal(HWDrawInfo *di, sector_t * fs,vertex_t * v1,vertex_t * v2
//
//==========================================================================
void GLWall::SkyTop(HWDrawInfo *di, seg_t * seg,sector_t * fs,sector_t * bs,vertex_t * v1,vertex_t * v2)
void HWWall::SkyTop(HWDrawInfo *di, seg_t * seg,sector_t * fs,sector_t * bs,vertex_t * v1,vertex_t * v2)
{
if (fs->GetTexture(sector_t::ceiling)==skyflatnum)
{
@ -276,7 +276,7 @@ void GLWall::SkyTop(HWDrawInfo *di, seg_t * seg,sector_t * fs,sector_t * bs,vert
{
zbottom[0] = bs->ceilingplane.ZatPoint(v1);
zbottom[1] = bs->ceilingplane.ZatPoint(v2);
flags|=GLWF_SKYHACK; // mid textures on such lines need special treatment!
flags|=HWF_SKYHACK; // mid textures on such lines need special treatment!
}
}
else
@ -320,7 +320,7 @@ void GLWall::SkyTop(HWDrawInfo *di, seg_t * seg,sector_t * fs,sector_t * bs,vert
//
//==========================================================================
void GLWall::SkyBottom(HWDrawInfo *di, seg_t * seg,sector_t * fs,sector_t * bs,vertex_t * v1,vertex_t * v2)
void HWWall::SkyBottom(HWDrawInfo *di, seg_t * seg,sector_t * fs,sector_t * bs,vertex_t * v1,vertex_t * v2)
{
if (fs->GetTexture(sector_t::floor)==skyflatnum)
{
@ -355,7 +355,7 @@ void GLWall::SkyBottom(HWDrawInfo *di, seg_t * seg,sector_t * fs,sector_t * bs,v
{
ztop[0] = bs->floorplane.ZatPoint(v1);
ztop[1] = bs->floorplane.ZatPoint(v2);
flags |= GLWF_SKYHACK; // mid textures on such lines need special treatment!
flags |= HWF_SKYHACK; // mid textures on such lines need special treatment!
}
}
else

View file

@ -72,7 +72,7 @@ EXTERN_CVAR(Float, transsouls)
//
//==========================================================================
void GLSprite::DrawSprite(HWDrawInfo *di, FRenderState &state, bool translucent)
void HWSprite::DrawSprite(HWDrawInfo *di, FRenderState &state, bool translucent)
{
bool additivefog = false;
bool foglayer = false;
@ -269,7 +269,7 @@ void GLSprite::DrawSprite(HWDrawInfo *di, FRenderState &state, bool translucent)
}
else
{
FGLModelRenderer renderer(di, state, dynlightindex);
FHWModelRenderer renderer(di, state, dynlightindex);
renderer.RenderModel(x, y, z, modelframe, actor, di->Viewpoint.TicFrac);
state.SetVertexBuffer(screen->mVertexData);
}
@ -307,7 +307,7 @@ void GLSprite::DrawSprite(HWDrawInfo *di, FRenderState &state, bool translucent)
//
//==========================================================================
bool GLSprite::CalculateVertices(HWDrawInfo *di, FVector3 *v, DVector3 *vp)
bool HWSprite::CalculateVertices(HWDrawInfo *di, FVector3 *v, DVector3 *vp)
{
const auto &HWAngles = di->Viewpoint.HWAngles;
if (actor != nullptr && (actor->renderflags & RF_SPRITETYPEMASK) == RF_FLATSPRITE)
@ -456,7 +456,7 @@ bool GLSprite::CalculateVertices(HWDrawInfo *di, FVector3 *v, DVector3 *vp)
//
//==========================================================================
inline void GLSprite::PutSprite(HWDrawInfo *di, bool translucent)
inline void HWSprite::PutSprite(HWDrawInfo *di, bool translucent)
{
// That's a lot of checks...
if (modelframe && !modelframe->isVoxel && RenderStyle.BlendOp != STYLEOP_Shadow && gl_light_sprites && di->Level->HasDynamicLights && !di->isFullbrightScene() && !fullbright)
@ -481,7 +481,7 @@ inline void GLSprite::PutSprite(HWDrawInfo *di, bool translucent)
//
//==========================================================================
void GLSprite::CreateVertices(HWDrawInfo *di)
void HWSprite::CreateVertices(HWDrawInfo *di)
{
if (modelframe == nullptr)
{
@ -506,9 +506,9 @@ void GLSprite::CreateVertices(HWDrawInfo *di)
//
//==========================================================================
void GLSprite::SplitSprite(HWDrawInfo *di, sector_t * frontsector, bool translucent)
void HWSprite::SplitSprite(HWDrawInfo *di, sector_t * frontsector, bool translucent)
{
GLSprite copySprite;
HWSprite copySprite;
double lightbottom;
unsigned int i;
bool put=false;
@ -555,7 +555,7 @@ void GLSprite::SplitSprite(HWDrawInfo *di, sector_t * frontsector, bool transluc
//
//==========================================================================
void GLSprite::PerformSpriteClipAdjustment(AActor *thing, const DVector2 &thingpos, float spriteheight)
void HWSprite::PerformSpriteClipAdjustment(AActor *thing, const DVector2 &thingpos, float spriteheight)
{
const float NO_VAL = 100000000.0f;
bool clipthing = (thing->player || thing->flags3&MF3_ISMONSTER || thing->IsKindOf(NAME_Inventory)) && (thing->flags&MF_ICECORPSE || !(thing->flags&MF_CORPSE));
@ -655,7 +655,7 @@ void GLSprite::PerformSpriteClipAdjustment(AActor *thing, const DVector2 &thingp
//
//==========================================================================
void GLSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t in_area, int thruportal)
void HWSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t in_area, int thruportal)
{
sector_t rs;
sector_t * rendersector;
@ -1109,7 +1109,7 @@ void GLSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t
//
//==========================================================================
void GLSprite::ProcessParticle (HWDrawInfo *di, particle_t *particle, sector_t *sector)//, int shade, int fakeside)
void HWSprite::ProcessParticle (HWDrawInfo *di, particle_t *particle, sector_t *sector)//, int shade, int fakeside)
{
if (particle->alpha==0) return;
@ -1288,7 +1288,7 @@ void HWDrawInfo::ProcessActorsInPortal(FLinePortalSpan *glport, area_t in_area)
th->SetXYZ(newpos);
th->Prev += newpos - savedpos;
GLSprite spr;
HWSprite spr;
// This is called from the worker thread and must not alter the fake sector cache.
spr.Process(this, th, hw_FakeFlat(th->Sector, in_area, false, &fakesector), in_area, 2);
th->Angles.Yaw = savedangle;

View file

@ -49,7 +49,7 @@
//
//==========================================================================
void GLWall::RenderWall(HWDrawInfo *di, FRenderState &state, int textured)
void HWWall::RenderWall(HWDrawInfo *di, FRenderState &state, int textured)
{
assert(vertcount > 0);
state.SetLightIndex(dynlightindex);
@ -63,7 +63,7 @@ void GLWall::RenderWall(HWDrawInfo *di, FRenderState &state, int textured)
//
//==========================================================================
void GLWall::RenderFogBoundary(HWDrawInfo *di, FRenderState &state)
void HWWall::RenderFogBoundary(HWDrawInfo *di, FRenderState &state)
{
if (gl_fogmode && !di->isFullbrightScene())
{
@ -73,7 +73,7 @@ void GLWall::RenderFogBoundary(HWDrawInfo *di, FRenderState &state)
state.SetEffect(EFF_FOGBOUNDARY);
state.AlphaFunc(Alpha_GEqual, 0.f);
state.SetDepthBias(-1, -128);
RenderWall(di, state, GLWall::RWF_BLANK);
RenderWall(di, state, HWWall::RWF_BLANK);
state.ClearDepthBias();
state.SetEffect(EFF_NONE);
state.EnableDrawBufferAttachments(true);
@ -86,7 +86,7 @@ void GLWall::RenderFogBoundary(HWDrawInfo *di, FRenderState &state)
//
//
//==========================================================================
void GLWall::RenderMirrorSurface(HWDrawInfo *di, FRenderState &state)
void HWWall::RenderMirrorSurface(HWDrawInfo *di, FRenderState &state)
{
if (!TexMan.mirrorTexture.isValid()) return;
@ -105,8 +105,8 @@ void GLWall::RenderMirrorSurface(HWDrawInfo *di, FRenderState &state)
FMaterial * pat = FMaterial::ValidateTexture(TexMan.mirrorTexture, false, false);
state.SetMaterial(pat, CLAMP_NONE, 0, -1);
flags &= ~GLWall::GLWF_GLOW;
RenderWall(di, state, GLWall::RWF_BLANK);
flags &= ~HWWall::HWF_GLOW;
RenderWall(di, state, HWWall::RWF_BLANK);
state.EnableTextureMatrix(false);
state.SetEffect(EFF_NONE);
@ -144,12 +144,12 @@ static const uint8_t renderwalltotier[] =
side_t::mid,
};
void GLWall::RenderTexturedWall(HWDrawInfo *di, FRenderState &state, int rflags)
void HWWall::RenderTexturedWall(HWDrawInfo *di, FRenderState &state, int rflags)
{
int tmode = state.GetTextureMode();
int rel = rellight + getExtraLight();
if (flags & GLWall::GLWF_GLOW)
if (flags & HWWall::HWF_GLOW)
{
state.EnableGlow(true);
state.SetGlowParams(topglowcolor, bottomglowcolor);
@ -159,7 +159,7 @@ void GLWall::RenderTexturedWall(HWDrawInfo *di, FRenderState &state, int rflags)
if (type == RENDERWALL_M2SNF)
{
if (flags & GLWall::GLWF_CLAMPY)
if (flags & HWWall::HWF_CLAMPY)
{
if (tmode == TM_NORMAL) state.SetTextureMode(TM_CLAMPY);
}
@ -216,7 +216,7 @@ void GLWall::RenderTexturedWall(HWDrawInfo *di, FRenderState &state, int rflags)
for (unsigned i = 0; i < lightlist->Size(); i++)
{
secplane_t &lowplane = i == (*lightlist).Size() - 1 ? frontsector->floorplane : (*lightlist)[i + 1].plane;
// this must use the exact same calculation method as GLWall::Process etc.
// this must use the exact same calculation method as HWWall::Process etc.
float low1 = lowplane.ZatPoint(vertexes[0]);
float low2 = lowplane.ZatPoint(vertexes[1]);
@ -251,14 +251,14 @@ void GLWall::RenderTexturedWall(HWDrawInfo *di, FRenderState &state, int rflags)
//
//==========================================================================
void GLWall::RenderTranslucentWall(HWDrawInfo *di, FRenderState &state)
void HWWall::RenderTranslucentWall(HWDrawInfo *di, FRenderState &state)
{
state.SetRenderStyle(RenderStyle);
if (gltexture)
{
if (!gltexture->tex->GetTranslucency()) state.AlphaFunc(Alpha_GEqual, gl_mask_threshold);
else state.AlphaFunc(Alpha_GEqual, 0.f);
RenderTexturedWall(di, state, GLWall::RWF_TEXTURED | GLWall::RWF_NOSPLIT);
RenderTexturedWall(di, state, HWWall::RWF_TEXTURED | HWWall::RWF_NOSPLIT);
}
else
{
@ -266,7 +266,7 @@ void GLWall::RenderTranslucentWall(HWDrawInfo *di, FRenderState &state)
di->SetColor(state, lightlevel, 0, false, Colormap, fabsf(alpha));
di->SetFog(state, lightlevel, 0, false, &Colormap, RenderStyle == STYLE_Add);
state.EnableTexture(false);
RenderWall(di, state, GLWall::RWF_NOSPLIT);
RenderWall(di, state, HWWall::RWF_NOSPLIT);
state.EnableTexture(true);
}
state.SetRenderStyle(STYLE_Translucent);
@ -277,7 +277,7 @@ void GLWall::RenderTranslucentWall(HWDrawInfo *di, FRenderState &state)
//
//
//==========================================================================
void GLWall::DrawWall(HWDrawInfo *di, FRenderState &state, bool translucent)
void HWWall::DrawWall(HWDrawInfo *di, FRenderState &state, bool translucent)
{
if (screen->BuffersArePersistent())
{
@ -285,13 +285,13 @@ void GLWall::DrawWall(HWDrawInfo *di, FRenderState &state, bool translucent)
{
SetupLights(di, lightdata);
}
MakeVertices(di, !!(flags & GLWall::GLWF_TRANSLUCENT));
MakeVertices(di, !!(flags & HWWall::HWF_TRANSLUCENT));
}
state.SetNormal(glseg.Normal());
if (!translucent)
{
RenderTexturedWall(di, state, GLWall::RWF_TEXTURED);
RenderTexturedWall(di, state, HWWall::RWF_TEXTURED);
}
else
{
@ -318,7 +318,7 @@ void GLWall::DrawWall(HWDrawInfo *di, FRenderState &state, bool translucent)
//
//==========================================================================
void GLWall::SetupLights(HWDrawInfo *di, FDynLightData &lightdata)
void HWWall::SetupLights(HWDrawInfo *di, FDynLightData &lightdata)
{
lightdata.Clear();
@ -414,7 +414,7 @@ void GLWall::SetupLights(HWDrawInfo *di, FDynLightData &lightdata)
}
const char GLWall::passflag[] = {
const char HWWall::passflag[] = {
0, //RENDERWALL_NONE,
1, //RENDERWALL_TOP, // unmasked
1, //RENDERWALL_M1S, // unmasked
@ -432,7 +432,7 @@ const char GLWall::passflag[] = {
//
//
//==========================================================================
void GLWall::PutWall(HWDrawInfo *di, bool translucent)
void HWWall::PutWall(HWDrawInfo *di, bool translucent)
{
if (gltexture && gltexture->tex->GetTranslucency() && passflag[type] == 2)
{
@ -440,7 +440,7 @@ void GLWall::PutWall(HWDrawInfo *di, bool translucent)
}
if (translucent)
{
flags |= GLWF_TRANSLUCENT;
flags |= HWF_TRANSLUCENT;
ViewDistance = (di->Viewpoint.Pos - (seg->linedef->v1->fPos() + seg->linedef->Delta() / 2)).XY().LengthSquared();
}
@ -452,7 +452,7 @@ void GLWall::PutWall(HWDrawInfo *di, bool translucent)
}
if (di->isFullbrightScene() || (Colormap.LightColor.isWhite() && lightlevel == 255))
flags &= ~GLWF_GLOW;
flags &= ~HWF_GLOW;
if (!screen->BuffersArePersistent())
{
@ -476,7 +476,7 @@ void GLWall::PutWall(HWDrawInfo *di, bool translucent)
// make sure that following parts of the same linedef do not get this one's vertex and lighting info.
vertcount = 0;
dynlightindex = -1;
flags &= ~GLWF_TRANSLUCENT;
flags &= ~HWF_TRANSLUCENT;
}
//==========================================================================
@ -485,7 +485,7 @@ void GLWall::PutWall(HWDrawInfo *di, bool translucent)
//
//==========================================================================
void GLWall::PutPortal(HWDrawInfo *di, int ptype, int plane)
void HWWall::PutPortal(HWDrawInfo *di, int ptype, int plane)
{
auto pstate = screen->mPortalState;
HWPortal * portal = nullptr;
@ -602,7 +602,7 @@ void GLWall::PutPortal(HWDrawInfo *di, int ptype, int plane)
//
//==========================================================================
void GLWall::Put3DWall(HWDrawInfo *di, lightlist_t * lightlist, bool translucent)
void HWWall::Put3DWall(HWDrawInfo *di, lightlist_t * lightlist, bool translucent)
{
// only modify the light di->Level-> if it doesn't originate from the seg's frontsector. This is to account for light transferring effects
if (lightlist->p_lightlevel != &seg->sidedef->sector->lightlevel)
@ -622,7 +622,7 @@ void GLWall::Put3DWall(HWDrawInfo *di, lightlist_t * lightlist, bool translucent
//
//==========================================================================
bool GLWall::SplitWallComplex(HWDrawInfo *di, sector_t * frontsector, bool translucent, float& maplightbottomleft, float& maplightbottomright)
bool HWWall::SplitWallComplex(HWDrawInfo *di, sector_t * frontsector, bool translucent, float& maplightbottomleft, float& maplightbottomright)
{
// check for an intersection with the upper plane
if ((maplightbottomleft<ztop[0] && maplightbottomright>ztop[1]) ||
@ -646,7 +646,7 @@ bool GLWall::SplitWallComplex(HWDrawInfo *di, sector_t * frontsector, bool trans
else
{
// split the wall in two at the intersection and recursively split both halves
GLWall copyWall1 = *this, copyWall2 = *this;
HWWall copyWall1 = *this, copyWall2 = *this;
copyWall1.glseg.x2 = copyWall2.glseg.x1 = glseg.x1 + coeff * (glseg.x2 - glseg.x1);
copyWall1.glseg.y2 = copyWall2.glseg.y1 = glseg.y1 + coeff * (glseg.y2 - glseg.y1);
@ -687,7 +687,7 @@ bool GLWall::SplitWallComplex(HWDrawInfo *di, sector_t * frontsector, bool trans
else
{
// split the wall in two at the intersection and recursively split both halves
GLWall copyWall1 = *this, copyWall2 = *this;
HWWall copyWall1 = *this, copyWall2 = *this;
copyWall1.glseg.x2 = copyWall2.glseg.x1 = glseg.x1 + coeff * (glseg.x2 - glseg.x1);
copyWall1.glseg.y2 = copyWall2.glseg.y1 = glseg.y1 + coeff * (glseg.y2 - glseg.y1);
@ -708,7 +708,7 @@ bool GLWall::SplitWallComplex(HWDrawInfo *di, sector_t * frontsector, bool trans
return false;
}
void GLWall::SplitWall(HWDrawInfo *di, sector_t * frontsector, bool translucent)
void HWWall::SplitWall(HWDrawInfo *di, sector_t * frontsector, bool translucent)
{
float maplightbottomleft;
float maplightbottomright;
@ -783,10 +783,10 @@ void GLWall::SplitWall(HWDrawInfo *di, sector_t * frontsector, bool translucent)
if (maplightbottomleft<=ztop[0] && maplightbottomright<=ztop[1] &&
(maplightbottomleft!=ztop[0] || maplightbottomright!=ztop[1]))
{
GLWall copyWall1 = *this;
HWWall copyWall1 = *this;
copyWall1.flags |= GLWF_NOSPLITLOWER;
flags |= GLWF_NOSPLITUPPER;
copyWall1.flags |= HWF_NOSPLITLOWER;
flags |= HWF_NOSPLITUPPER;
ztop[0]=copyWall1.zbottom[0]=maplightbottomleft;
ztop[1]=copyWall1.zbottom[1]=maplightbottomright;
tcs[UPLFT].v=copyWall1.tcs[LOLFT].v=copyWall1.tcs[UPLFT].v+
@ -808,7 +808,7 @@ void GLWall::SplitWall(HWDrawInfo *di, sector_t * frontsector, bool translucent)
out:
lightlevel=origlight;
Colormap=origcm;
flags &= ~GLWF_NOSPLITUPPER;
flags &= ~HWF_NOSPLITUPPER;
this->lightlist = NULL;
//::SplitWall.Unclock();
}
@ -819,9 +819,9 @@ out:
//
//
//==========================================================================
bool GLWall::DoHorizon(HWDrawInfo *di, seg_t * seg,sector_t * fs, vertex_t * v1,vertex_t * v2)
bool HWWall::DoHorizon(HWDrawInfo *di, seg_t * seg,sector_t * fs, vertex_t * v1,vertex_t * v2)
{
GLHorizonInfo hi;
HWHorizonInfo hi;
lightlist_t * light;
// ZDoom doesn't support slopes in a horizon sector so I won't either!
@ -895,7 +895,7 @@ bool GLWall::DoHorizon(HWDrawInfo *di, seg_t * seg,sector_t * fs, vertex_t * v1,
//
//
//==========================================================================
bool GLWall::SetWallCoordinates(seg_t * seg, FTexCoordInfo *tci, float texturetop,
bool HWWall::SetWallCoordinates(seg_t * seg, FTexCoordInfo *tci, float texturetop,
float topleft, float topright, float bottomleft, float bottomright, float t_ofs)
{
//
@ -1003,7 +1003,7 @@ bool GLWall::SetWallCoordinates(seg_t * seg, FTexCoordInfo *tci, float textureto
{
bool normalize = false;
if (gltexture->tex->isHardwareCanvas()) normalize = true;
else if (flags & GLWF_CLAMPY)
else if (flags & HWF_CLAMPY)
{
// for negative scales we can get negative coordinates here.
normalize = (tcs[UPLFT].v > tcs[LOLFT].v || tcs[UPRGT].v > tcs[LORGT].v);
@ -1027,7 +1027,7 @@ bool GLWall::SetWallCoordinates(seg_t * seg, FTexCoordInfo *tci, float textureto
//
//==========================================================================
void GLWall::CheckTexturePosition(FTexCoordInfo *tci)
void HWWall::CheckTexturePosition(FTexCoordInfo *tci)
{
float sub;
@ -1053,7 +1053,7 @@ void GLWall::CheckTexturePosition(FTexCoordInfo *tci)
if ((tcs[UPLFT].v == 0.f && tcs[UPRGT].v == 0.f && tcs[LOLFT].v <= 1.f && tcs[LORGT].v <= 1.f) ||
(tcs[UPLFT].v >= 0.f && tcs[UPRGT].v >= 0.f && tcs[LOLFT].v == 1.f && tcs[LORGT].v == 1.f))
{
flags |= GLWF_CLAMPY;
flags |= HWF_CLAMPY;
}
}
else
@ -1074,7 +1074,7 @@ void GLWall::CheckTexturePosition(FTexCoordInfo *tci)
if ((tcs[LOLFT].v == 0.f && tcs[LORGT].v == 0.f && tcs[UPLFT].v <= 1.f && tcs[UPRGT].v <= 1.f) ||
(tcs[LOLFT].v >= 0.f && tcs[LORGT].v >= 0.f && tcs[UPLFT].v == 1.f && tcs[UPRGT].v == 1.f))
{
flags |= GLWF_CLAMPY;
flags |= HWF_CLAMPY;
}
}
@ -1090,7 +1090,7 @@ void GLWall::CheckTexturePosition(FTexCoordInfo *tci)
if ((tcs[UPLFT].u == 0.f && tcs[LOLFT].u == 0.f && tcs[UPRGT].u <= 1.f && tcs[LORGT].u <= 1.f) ||
(tcs[UPLFT].u >= 0.f && tcs[LOLFT].u >= 0.f && tcs[UPRGT].u == 1.f && tcs[LORGT].u == 1.f))
{
flags |= GLWF_CLAMPX;
flags |= HWF_CLAMPX;
}
}
}
@ -1106,7 +1106,7 @@ static void GetTexCoordInfo(FMaterial *tex, FTexCoordInfo *tci, side_t *side, in
// Handle one sided walls, upper and lower texture
//
//==========================================================================
void GLWall::DoTexture(HWDrawInfo *di, int _type,seg_t * seg, int peg,
void HWWall::DoTexture(HWDrawInfo *di, int _type,seg_t * seg, int peg,
float ceilingrefheight,float floorrefheight,
float topleft,float topright,
float bottomleft,float bottomright,
@ -1115,7 +1115,7 @@ void GLWall::DoTexture(HWDrawInfo *di, int _type,seg_t * seg, int peg,
if (topleft<=bottomleft && topright<=bottomright) return;
// The Vertex values can be destroyed in this function and must be restored aferward!
GLSeg glsave=glseg;
HWSeg glsave=glseg;
float flh=ceilingrefheight-floorrefheight;
int texpos;
uint8_t savedflags = flags;
@ -1171,7 +1171,7 @@ void GLWall::DoTexture(HWDrawInfo *di, int _type,seg_t * seg, int peg,
//
//==========================================================================
void GLWall::DoMidTexture(HWDrawInfo *di, seg_t * seg, bool drawfogboundary,
void HWWall::DoMidTexture(HWDrawInfo *di, seg_t * seg, bool drawfogboundary,
sector_t * front, sector_t * back,
sector_t * realfront, sector_t * realback,
float fch1, float fch2, float ffh1, float ffh2,
@ -1180,7 +1180,7 @@ void GLWall::DoMidTexture(HWDrawInfo *di, seg_t * seg, bool drawfogboundary,
{
FTexCoordInfo tci;
float topleft,bottomleft,topright,bottomright;
GLSeg glsave=glseg;
HWSeg glsave=glseg;
float texturetop, texturebottom;
bool wrap = (seg->linedef->flags&ML_WRAP_MIDTEX) || (seg->sidedef->Flags&WALLF_WRAP_MIDTEX);
bool mirrory = false;
@ -1350,15 +1350,15 @@ void GLWall::DoMidTexture(HWDrawInfo *di, seg_t * seg, bool drawfogboundary,
if ((textureoffset == 0 && righttex <= tci.mRenderWidth) ||
(textureoffset >= 0 && righttex == tci.mRenderWidth))
{
flags |= GLWF_CLAMPX;
flags |= HWF_CLAMPX;
}
else
{
flags &= ~GLWF_CLAMPX;
flags &= ~HWF_CLAMPX;
}
if (!wrap)
{
flags |= GLWF_CLAMPY;
flags |= HWF_CLAMPY;
}
}
if (mirrory)
@ -1375,14 +1375,14 @@ void GLWall::DoMidTexture(HWDrawInfo *di, seg_t * seg, bool drawfogboundary,
//
if (drawfogboundary)
{
flags |= GLWF_NOSPLITUPPER|GLWF_NOSPLITLOWER;
flags |= HWF_NOSPLITUPPER|HWF_NOSPLITLOWER;
type=RENDERWALL_FOGBOUNDARY;
FMaterial *savetex = gltexture;
gltexture = NULL;
PutWall(di, true);
if (!savetex)
{
flags &= ~(GLWF_NOSPLITUPPER|GLWF_NOSPLITLOWER);
flags &= ~(HWF_NOSPLITUPPER|HWF_NOSPLITLOWER);
return;
}
gltexture = savetex;
@ -1424,7 +1424,7 @@ void GLWall::DoMidTexture(HWDrawInfo *di, seg_t * seg, bool drawfogboundary,
//
FloatRect *splitrect;
int v = gltexture->GetAreas(&splitrect);
if (seg->frontsector == seg->backsector) flags |= GLWF_NOSPLIT; // we don't need to do vertex splits if a line has both sides in the same sector
if (seg->frontsector == seg->backsector) flags |= HWF_NOSPLIT; // we don't need to do vertex splits if a line has both sides in the same sector
if (v>0 && !drawfogboundary && !(seg->linedef->flags&ML_WRAP_MIDTEX))
{
// split the poly!
@ -1446,7 +1446,7 @@ void GLWall::DoMidTexture(HWDrawInfo *di, seg_t * seg, bool drawfogboundary,
// the current segment is above the top line of the splittable area
if (splitbot<=splittopv) continue;
GLWall split = *this;
HWWall split = *this;
// the top line of the current segment is inside the splittable area
// use the splitrect's top as top of this segment
@ -1490,7 +1490,7 @@ void GLWall::DoMidTexture(HWDrawInfo *di, seg_t * seg, bool drawfogboundary,
}
// restore some values that have been altered in this function
glseg=glsave;
flags&=~(GLWF_CLAMPX|GLWF_CLAMPY|GLWF_NOSPLITUPPER|GLWF_NOSPLITLOWER);
flags&=~(HWF_CLAMPX|HWF_CLAMPY|HWF_NOSPLITUPPER|HWF_NOSPLITLOWER);
RenderStyle = STYLE_Normal;
}
@ -1500,7 +1500,7 @@ void GLWall::DoMidTexture(HWDrawInfo *di, seg_t * seg, bool drawfogboundary,
//
//
//==========================================================================
void GLWall::BuildFFBlock(HWDrawInfo *di, seg_t * seg, F3DFloor * rover,
void HWWall::BuildFFBlock(HWDrawInfo *di, seg_t * seg, F3DFloor * rover,
float ff_topleft, float ff_topright,
float ff_bottomleft, float ff_bottomright)
{
@ -1601,7 +1601,7 @@ void GLWall::BuildFFBlock(HWDrawInfo *di, seg_t * seg, F3DFloor * rover,
alpha = 1.0f;
lightlevel = savelight;
Colormap = savecolor;
flags &= ~GLWF_CLAMPY;
flags &= ~HWF_CLAMPY;
}
@ -1611,7 +1611,7 @@ void GLWall::BuildFFBlock(HWDrawInfo *di, seg_t * seg, F3DFloor * rover,
//
//==========================================================================
__forceinline void GLWall::GetPlanePos(F3DFloor::planeref *planeref, float &left, float &right)
__forceinline void HWWall::GetPlanePos(F3DFloor::planeref *planeref, float &left, float &right)
{
left=planeref->plane->ZatPoint(vertexes[0]);
right=planeref->plane->ZatPoint(vertexes[1]);
@ -1622,7 +1622,7 @@ __forceinline void GLWall::GetPlanePos(F3DFloor::planeref *planeref, float &left
//
//
//==========================================================================
void GLWall::InverseFloors(HWDrawInfo *di, seg_t * seg, sector_t * frontsector,
void HWWall::InverseFloors(HWDrawInfo *di, seg_t * seg, sector_t * frontsector,
float topleft, float topright,
float bottomleft, float bottomright)
{
@ -1673,7 +1673,7 @@ void GLWall::InverseFloors(HWDrawInfo *di, seg_t * seg, sector_t * frontsector,
//
//
//==========================================================================
void GLWall::ClipFFloors(HWDrawInfo *di, seg_t * seg, F3DFloor * ffloor, sector_t * frontsector,
void HWWall::ClipFFloors(HWDrawInfo *di, seg_t * seg, F3DFloor * ffloor, sector_t * frontsector,
float topleft, float topright,
float bottomleft, float bottomright)
{
@ -1747,7 +1747,7 @@ done:
//
//
//==========================================================================
void GLWall::DoFFloorBlocks(HWDrawInfo *di, seg_t * seg, sector_t * frontsector, sector_t * backsector,
void HWWall::DoFFloorBlocks(HWDrawInfo *di, seg_t * seg, sector_t * frontsector, sector_t * backsector,
float fch1, float fch2, float ffh1, float ffh2,
float bch1, float bch2, float bfh1, float bfh2)
@ -1836,7 +1836,7 @@ void GLWall::DoFFloorBlocks(HWDrawInfo *di, seg_t * seg, sector_t * frontsector,
//
//
//==========================================================================
void GLWall::Process(HWDrawInfo *di, seg_t *seg, sector_t * frontsector, sector_t * backsector)
void HWWall::Process(HWDrawInfo *di, seg_t *seg, sector_t * frontsector, sector_t * backsector)
{
vertex_t * v1, *v2;
float fch1;
@ -1916,7 +1916,7 @@ void GLWall::Process(HWDrawInfo *di, seg_t *seg, sector_t * frontsector, sector_
}
v1 = seg->v1;
v2 = seg->v2;
flags |= GLWF_NOSPLITUPPER | GLWF_NOSPLITLOWER; // seg-splitting not needed for single segs.
flags |= HWF_NOSPLITUPPER | HWF_NOSPLITLOWER; // seg-splitting not needed for single segs.
}
@ -1954,7 +1954,7 @@ void GLWall::Process(HWDrawInfo *di, seg_t *seg, sector_t * frontsector, sector_
gltexture = NULL;
if (frontsector->GetWallGlow(topglowcolor, bottomglowcolor)) flags |= GLWF_GLOW;
if (frontsector->GetWallGlow(topglowcolor, bottomglowcolor)) flags |= HWF_GLOW;
zfloor[0] = ffh1 = segfront->floorplane.ZatPoint(v1);
zfloor[1] = ffh2 = segfront->floorplane.ZatPoint(v2);
@ -2151,7 +2151,7 @@ void GLWall::Process(HWDrawInfo *di, seg_t *seg, sector_t * frontsector, sector_
//
//
//==========================================================================
void GLWall::ProcessLowerMiniseg(HWDrawInfo *di, seg_t *seg, sector_t * frontsector, sector_t * backsector)
void HWWall::ProcessLowerMiniseg(HWDrawInfo *di, seg_t *seg, sector_t * frontsector, sector_t * backsector)
{
if (frontsector->GetTexture(sector_t::floor) == skyflatnum) return;
lightlist = NULL;
@ -2190,7 +2190,7 @@ void GLWall::ProcessLowerMiniseg(HWDrawInfo *di, seg_t *seg, sector_t * frontsec
RenderStyle = STYLE_Normal;
Colormap = frontsector->Colormap;
if (frontsector->GetWallGlow(topglowcolor, bottomglowcolor)) flags |= GLWF_GLOW;
if (frontsector->GetWallGlow(topglowcolor, bottomglowcolor)) flags |= HWF_GLOW;
dynlightindex = -1;
zfloor[0] = zfloor[1] = ffh;

View file

@ -34,7 +34,7 @@ EXTERN_CVAR(Bool, gl_seamless)
//
//==========================================================================
void GLWall::SplitUpperEdge(FFlatVertex *&ptr)
void HWWall::SplitUpperEdge(FFlatVertex *&ptr)
{
side_t *sidedef = seg->sidedef;
float polyw = glseg.fracright - glseg.fracleft;
@ -68,7 +68,7 @@ void GLWall::SplitUpperEdge(FFlatVertex *&ptr)
//
//==========================================================================
void GLWall::SplitLowerEdge(FFlatVertex *&ptr)
void HWWall::SplitLowerEdge(FFlatVertex *&ptr)
{
side_t *sidedef = seg->sidedef;
float polyw = glseg.fracright - glseg.fracleft;
@ -102,7 +102,7 @@ void GLWall::SplitLowerEdge(FFlatVertex *&ptr)
//
//==========================================================================
void GLWall::SplitLeftEdge(FFlatVertex *&ptr)
void HWWall::SplitLeftEdge(FFlatVertex *&ptr)
{
if (vertexes[0] == NULL) return;
@ -136,7 +136,7 @@ void GLWall::SplitLeftEdge(FFlatVertex *&ptr)
//
//==========================================================================
void GLWall::SplitRightEdge(FFlatVertex *&ptr)
void HWWall::SplitRightEdge(FFlatVertex *&ptr)
{
if (vertexes[1] == NULL) return;
@ -170,7 +170,7 @@ void GLWall::SplitRightEdge(FFlatVertex *&ptr)
//
//==========================================================================
int GLWall::CreateVertices(FFlatVertex *&ptr, bool split)
int HWWall::CreateVertices(FFlatVertex *&ptr, bool split)
{
auto oo = ptr;
ptr->Set(glseg.x1, zbottom[0], glseg.y1, tcs[LOLFT].u, tcs[LOLFT].v);
@ -178,13 +178,13 @@ int GLWall::CreateVertices(FFlatVertex *&ptr, bool split)
if (split && glseg.fracleft == 0) SplitLeftEdge(ptr);
ptr->Set(glseg.x1, ztop[0], glseg.y1, tcs[UPLFT].u, tcs[UPLFT].v);
ptr++;
if (split && !(flags & GLWF_NOSPLITUPPER && seg->sidedef->numsegs > 1)) SplitUpperEdge(ptr);
if (split && !(flags & HWF_NOSPLITUPPER && seg->sidedef->numsegs > 1)) SplitUpperEdge(ptr);
ptr->Set(glseg.x2, ztop[1], glseg.y2, tcs[UPRGT].u, tcs[UPRGT].v);
ptr++;
if (split && glseg.fracright == 1) SplitRightEdge(ptr);
ptr->Set(glseg.x2, zbottom[1], glseg.y2, tcs[LORGT].u, tcs[LORGT].v);
ptr++;
if (split && !(flags & GLWF_NOSPLITLOWER) && seg->sidedef->numsegs > 1) SplitLowerEdge(ptr);
if (split && !(flags & HWF_NOSPLITLOWER) && seg->sidedef->numsegs > 1) SplitLowerEdge(ptr);
return int(ptr - oo);
}
@ -195,7 +195,7 @@ int GLWall::CreateVertices(FFlatVertex *&ptr, bool split)
//
//==========================================================================
void GLWall::CountLeftEdge(unsigned &ptr)
void HWWall::CountLeftEdge(unsigned &ptr)
{
if (vertexes[0] == NULL) return;
@ -220,7 +220,7 @@ void GLWall::CountLeftEdge(unsigned &ptr)
//
//==========================================================================
void GLWall::CountRightEdge(unsigned &ptr)
void HWWall::CountRightEdge(unsigned &ptr)
{
if (vertexes[1] == NULL) return;
@ -245,14 +245,14 @@ void GLWall::CountRightEdge(unsigned &ptr)
//
//==========================================================================
int GLWall::CountVertices()
int HWWall::CountVertices()
{
unsigned ptr = 4;
if (glseg.fracleft == 0) CountLeftEdge(ptr);
if (glseg.fracright == 1) CountRightEdge(ptr);
// This may allocate a few vertices too many in case of a split linedef but this is a rare case that isn't worth the required overhead for a precise calculation.
if (!(flags & GLWF_NOSPLITUPPER)) ptr += seg->sidedef->numsegs - 1;
if (!(flags & GLWF_NOSPLITLOWER)) ptr += seg->sidedef->numsegs - 1;
if (!(flags & HWF_NOSPLITUPPER)) ptr += seg->sidedef->numsegs - 1;
if (!(flags & HWF_NOSPLITLOWER)) ptr += seg->sidedef->numsegs - 1;
return (int)ptr;
}
@ -262,11 +262,11 @@ int GLWall::CountVertices()
//
//==========================================================================
void GLWall::MakeVertices(HWDrawInfo *di, bool nosplit)
void HWWall::MakeVertices(HWDrawInfo *di, bool nosplit)
{
if (vertcount == 0)
{
bool split = (gl_seamless && !nosplit && seg->sidedef != nullptr && !(seg->sidedef->Flags & WALLF_POLYOBJ) && !(flags & GLWF_NOSPLIT));
bool split = (gl_seamless && !nosplit && seg->sidedef != nullptr && !(seg->sidedef->Flags & WALLF_POLYOBJ) && !(flags & HWF_NOSPLIT));
auto ret = screen->mVertexData->AllocVertices(split ? CountVertices() : 4);
vertindex = ret.second;
vertcount = CreateVertices(ret.first, split);

View file

@ -87,7 +87,7 @@ void HWDrawInfo::DrawPSprite(HUDSprite *huds, FRenderState &state)
{
state.AlphaFunc(Alpha_GEqual, 0);
FGLModelRenderer renderer(this, state, huds->lightindex);
FHWModelRenderer renderer(this, state, huds->lightindex);
renderer.RenderHUDModel(huds->weapon, huds->mx, huds->my);
state.SetVertexBuffer(screen->mVertexData);
}

View file

@ -623,7 +623,7 @@ IHardwareTexture *VulkanFrameBuffer::CreateHardwareTexture()
FModelRenderer *VulkanFrameBuffer::CreateModelRenderer(int mli)
{
return new FGLModelRenderer(nullptr, *GetRenderState(), mli);
return new FHWModelRenderer(nullptr, *GetRenderState(), mli);
}
IVertexBuffer *VulkanFrameBuffer::CreateVertexBuffer()