mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-13 16:07:45 +00:00
- renamed classes before continuing.
This commit is contained in:
parent
72bc7693bd
commit
dad3c50ebd
10 changed files with 33 additions and 33 deletions
|
@ -122,8 +122,8 @@ void FSkyVertexBuffer::BindVBO()
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
FFlatVertexBuffer::FFlatVertexBuffer(int width, int height)
|
FGLFlatVertexBuffer::FGLFlatVertexBuffer(int width, int height)
|
||||||
: FFlatVertexGenerator(width, height)
|
: FFlatVertexBuffer(width, height)
|
||||||
{
|
{
|
||||||
mVertexBuffer = screen->CreateVertexBuffer();
|
mVertexBuffer = screen->CreateVertexBuffer();
|
||||||
mIndexBuffer = screen->CreateIndexBuffer();
|
mIndexBuffer = screen->CreateIndexBuffer();
|
||||||
|
@ -142,7 +142,7 @@ FFlatVertexBuffer::FFlatVertexBuffer(int width, int height)
|
||||||
Copy(0, NUM_RESERVED);
|
Copy(0, NUM_RESERVED);
|
||||||
}
|
}
|
||||||
|
|
||||||
FFlatVertexBuffer::~FFlatVertexBuffer()
|
FGLFlatVertexBuffer::~FGLFlatVertexBuffer()
|
||||||
{
|
{
|
||||||
delete mIndexBuffer;
|
delete mIndexBuffer;
|
||||||
delete mVertexBuffer;
|
delete mVertexBuffer;
|
||||||
|
@ -150,20 +150,20 @@ FFlatVertexBuffer::~FFlatVertexBuffer()
|
||||||
mVertexBuffer = nullptr;
|
mVertexBuffer = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FFlatVertexBuffer::Copy(int start, int count)
|
void FGLFlatVertexBuffer::Copy(int start, int count)
|
||||||
{
|
{
|
||||||
Map();
|
Map();
|
||||||
memcpy(GetBuffer(start), &vbo_shadowdata[0], count * sizeof(FFlatVertex));
|
memcpy(GetBuffer(start), &vbo_shadowdata[0], count * sizeof(FFlatVertex));
|
||||||
Unmap();
|
Unmap();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FFlatVertexBuffer::OutputResized(int width, int height)
|
void FGLFlatVertexBuffer::OutputResized(int width, int height)
|
||||||
{
|
{
|
||||||
FFlatVertexGenerator::OutputResized(width, height);
|
FFlatVertexBuffer::OutputResized(width, height);
|
||||||
Copy(4, 4);
|
Copy(4, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FFlatVertexBuffer::Bind(FRenderState &state)
|
void FGLFlatVertexBuffer::Bind(FRenderState &state)
|
||||||
{
|
{
|
||||||
state.SetVertexBuffer(mVertexBuffer, 0, 0);
|
state.SetVertexBuffer(mVertexBuffer, 0, 0);
|
||||||
state.SetIndexBuffer(mIndexBuffer);
|
state.SetIndexBuffer(mIndexBuffer);
|
||||||
|
@ -175,10 +175,10 @@ void FFlatVertexBuffer::Bind(FRenderState &state)
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
void FFlatVertexBuffer::CreateVBO()
|
void FGLFlatVertexBuffer::CreateVBO()
|
||||||
{
|
{
|
||||||
vbo_shadowdata.Resize(mNumReserved);
|
vbo_shadowdata.Resize(mNumReserved);
|
||||||
FFlatVertexGenerator::CreateVertices();
|
FFlatVertexBuffer::CreateVertices();
|
||||||
mCurIndex = mIndex = vbo_shadowdata.Size();
|
mCurIndex = mIndex = vbo_shadowdata.Size();
|
||||||
Copy(0, mIndex);
|
Copy(0, mIndex);
|
||||||
mIndexBuffer->SetData(ibo_data.Size() * sizeof(uint32_t), &ibo_data[0]);
|
mIndexBuffer->SetData(ibo_data.Size() * sizeof(uint32_t), &ibo_data[0]);
|
||||||
|
|
|
@ -86,7 +86,7 @@ public:
|
||||||
void EnableColorArray(bool on);
|
void EnableColorArray(bool on);
|
||||||
};
|
};
|
||||||
|
|
||||||
class FFlatVertexBuffer : public FFlatVertexGenerator
|
class FGLFlatVertexBuffer : public FFlatVertexBuffer
|
||||||
{
|
{
|
||||||
IVertexBuffer *mVertexBuffer;
|
IVertexBuffer *mVertexBuffer;
|
||||||
IIndexBuffer *mIndexBuffer;
|
IIndexBuffer *mIndexBuffer;
|
||||||
|
@ -103,8 +103,8 @@ class FFlatVertexBuffer : public FFlatVertexGenerator
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FFlatVertexBuffer(int width, int height);
|
FGLFlatVertexBuffer(int width, int height);
|
||||||
~FFlatVertexBuffer();
|
~FGLFlatVertexBuffer();
|
||||||
|
|
||||||
void OutputResized(int width, int height);
|
void OutputResized(int width, int height);
|
||||||
void Bind(FRenderState &state);
|
void Bind(FRenderState &state);
|
||||||
|
|
|
@ -54,7 +54,7 @@ void FGLRenderer::RenderScreenQuad()
|
||||||
{
|
{
|
||||||
mVBO->Bind(gl_RenderState);
|
mVBO->Bind(gl_RenderState);
|
||||||
gl_RenderState.ApplyBuffers();
|
gl_RenderState.ApplyBuffers();
|
||||||
glDrawArrays(GL_TRIANGLE_STRIP, FFlatVertexBuffer::PRESENT_INDEX, 4);
|
glDrawArrays(GL_TRIANGLE_STRIP, FGLFlatVertexBuffer::PRESENT_INDEX, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FGLRenderer::PostProcessScene(int fixedcm, const std::function<void()> &afterBloomDrawEndScene2D)
|
void FGLRenderer::PostProcessScene(int fixedcm, const std::function<void()> &afterBloomDrawEndScene2D)
|
||||||
|
|
|
@ -99,7 +99,7 @@ void FGLRenderer::Initialize(int width, int height)
|
||||||
glBindVertexArray(mVAOID);
|
glBindVertexArray(mVAOID);
|
||||||
FGLDebug::LabelObject(GL_VERTEX_ARRAY, mVAOID, "FGLRenderer.mVAOID");
|
FGLDebug::LabelObject(GL_VERTEX_ARRAY, mVAOID, "FGLRenderer.mVAOID");
|
||||||
|
|
||||||
mVBO = new FFlatVertexBuffer(width, height);
|
mVBO = new FGLFlatVertexBuffer(width, height);
|
||||||
mSkyVBO = new FSkyVertexBuffer;
|
mSkyVBO = new FSkyVertexBuffer;
|
||||||
mLights = new FLightBuffer();
|
mLights = new FLightBuffer();
|
||||||
mViewpoints = new GLViewpointBuffer;
|
mViewpoints = new GLViewpointBuffer;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
struct particle_t;
|
struct particle_t;
|
||||||
class FCanvasTexture;
|
class FCanvasTexture;
|
||||||
class FFlatVertexBuffer;
|
class FGLFlatVertexBuffer;
|
||||||
class FSkyVertexBuffer;
|
class FSkyVertexBuffer;
|
||||||
class OpenGLFrameBuffer;
|
class OpenGLFrameBuffer;
|
||||||
struct FDrawInfo;
|
struct FDrawInfo;
|
||||||
|
@ -69,7 +69,7 @@ public:
|
||||||
|
|
||||||
//FRotator mAngles;
|
//FRotator mAngles;
|
||||||
|
|
||||||
FFlatVertexBuffer *mVBO = nullptr;
|
FGLFlatVertexBuffer *mVBO = nullptr;
|
||||||
FSkyVertexBuffer *mSkyVBO = nullptr;
|
FSkyVertexBuffer *mSkyVBO = nullptr;
|
||||||
FLightBuffer *mLights = nullptr;
|
FLightBuffer *mLights = nullptr;
|
||||||
GLViewpointBuffer *mViewpoints = nullptr;
|
GLViewpointBuffer *mViewpoints = nullptr;
|
||||||
|
|
|
@ -319,7 +319,7 @@ void FDrawInfo::ClearScreen()
|
||||||
glDisable(GL_MULTISAMPLE);
|
glDisable(GL_MULTISAMPLE);
|
||||||
glDisable(GL_DEPTH_TEST);
|
glDisable(GL_DEPTH_TEST);
|
||||||
|
|
||||||
glDrawArrays(GL_TRIANGLE_STRIP, FFlatVertexBuffer::FULLSCREEN_INDEX, 4);
|
glDrawArrays(GL_TRIANGLE_STRIP, FGLFlatVertexBuffer::FULLSCREEN_INDEX, 4);
|
||||||
|
|
||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
if (multi) glEnable(GL_MULTISAMPLE);
|
if (multi) glEnable(GL_MULTISAMPLE);
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
FFlatVertexGenerator::FFlatVertexGenerator(int width, int height)
|
FFlatVertexBuffer::FFlatVertexBuffer(int width, int height)
|
||||||
{
|
{
|
||||||
vbo_shadowdata.Resize(NUM_RESERVED);
|
vbo_shadowdata.Resize(NUM_RESERVED);
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ FFlatVertexGenerator::FFlatVertexGenerator(int width, int height)
|
||||||
vbo_shadowdata[19].Set(32767.0f, -32767.0f, -32767.0f, 0, 0);
|
vbo_shadowdata[19].Set(32767.0f, -32767.0f, -32767.0f, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FFlatVertexGenerator::OutputResized(int width, int height)
|
void FFlatVertexBuffer::OutputResized(int width, int height)
|
||||||
{
|
{
|
||||||
vbo_shadowdata[4].Set(0, 0, 0, 0, 0);
|
vbo_shadowdata[4].Set(0, 0, 0, 0, 0);
|
||||||
vbo_shadowdata[5].Set(0, (float)height, 0, 0, 1);
|
vbo_shadowdata[5].Set(0, (float)height, 0, 0, 1);
|
||||||
|
@ -118,7 +118,7 @@ static F3DFloor *Find3DFloor(sector_t *target, sector_t *model)
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
int FFlatVertexGenerator::CreateIndexedSubsectorVertices(subsector_t *sub, const secplane_t &plane, int floor, int vi, FFlatVertexGenerator::FIndexGenerationInfo &gen)
|
int FFlatVertexBuffer::CreateIndexedSubsectorVertices(subsector_t *sub, const secplane_t &plane, int floor, int vi, FFlatVertexBuffer::FIndexGenerationInfo &gen)
|
||||||
{
|
{
|
||||||
if (sub->numlines < 3) return -1;
|
if (sub->numlines < 3) return -1;
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ int FFlatVertexGenerator::CreateIndexedSubsectorVertices(subsector_t *sub, const
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
int FFlatVertexGenerator::CreateIndexedSectorVertices(sector_t *sec, const secplane_t &plane, int floor, FFlatVertexGenerator::FIndexGenerationInfo &gen)
|
int FFlatVertexBuffer::CreateIndexedSectorVertices(sector_t *sec, const secplane_t &plane, int floor, FFlatVertexBuffer::FIndexGenerationInfo &gen)
|
||||||
{
|
{
|
||||||
int rt = ibo_data.Size();
|
int rt = ibo_data.Size();
|
||||||
int vi = vbo_shadowdata.Reserve(gen.vertices.Size());
|
int vi = vbo_shadowdata.Reserve(gen.vertices.Size());
|
||||||
|
@ -175,7 +175,7 @@ int FFlatVertexGenerator::CreateIndexedSectorVertices(sector_t *sec, const secpl
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
int FFlatVertexGenerator::CreateIndexedVertices(int h, sector_t *sec, const secplane_t &plane, int floor, TArray<FFlatVertexGenerator::FIndexGenerationInfo> &gen)
|
int FFlatVertexBuffer::CreateIndexedVertices(int h, sector_t *sec, const secplane_t &plane, int floor, TArray<FFlatVertexBuffer::FIndexGenerationInfo> &gen)
|
||||||
{
|
{
|
||||||
sec->vboindex[h] = vbo_shadowdata.Size();
|
sec->vboindex[h] = vbo_shadowdata.Size();
|
||||||
// First calculate the vertices for the sector itself
|
// First calculate the vertices for the sector itself
|
||||||
|
@ -221,7 +221,7 @@ int FFlatVertexGenerator::CreateIndexedVertices(int h, sector_t *sec, const secp
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
void FFlatVertexGenerator::CreateIndexedFlatVertices()
|
void FFlatVertexBuffer::CreateIndexedFlatVertices()
|
||||||
{
|
{
|
||||||
TArray<FIndexGenerationInfo> gen;
|
TArray<FIndexGenerationInfo> gen;
|
||||||
gen.Resize(level.sectors.Size());
|
gen.Resize(level.sectors.Size());
|
||||||
|
@ -270,7 +270,7 @@ void FFlatVertexGenerator::CreateIndexedFlatVertices()
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
void FFlatVertexGenerator::UpdatePlaneVertices(sector_t *sec, int plane)
|
void FFlatVertexBuffer::UpdatePlaneVertices(sector_t *sec, int plane)
|
||||||
{
|
{
|
||||||
int startvt = sec->vboindex[plane];
|
int startvt = sec->vboindex[plane];
|
||||||
int countvt = sec->vbocount[plane];
|
int countvt = sec->vbocount[plane];
|
||||||
|
@ -291,7 +291,7 @@ void FFlatVertexGenerator::UpdatePlaneVertices(sector_t *sec, int plane)
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
void FFlatVertexGenerator::CreateVertices()
|
void FFlatVertexBuffer::CreateVertices()
|
||||||
{
|
{
|
||||||
vbo_shadowdata.Resize(NUM_RESERVED);
|
vbo_shadowdata.Resize(NUM_RESERVED);
|
||||||
CreateIndexedFlatVertices();
|
CreateIndexedFlatVertices();
|
||||||
|
@ -303,7 +303,7 @@ void FFlatVertexGenerator::CreateVertices()
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
void FFlatVertexGenerator::CheckPlanes(sector_t *sector)
|
void FFlatVertexBuffer::CheckPlanes(sector_t *sector)
|
||||||
{
|
{
|
||||||
if (sector->GetPlaneTexZ(sector_t::ceiling) != sector->vboheight[sector_t::ceiling])
|
if (sector->GetPlaneTexZ(sector_t::ceiling) != sector->vboheight[sector_t::ceiling])
|
||||||
{
|
{
|
||||||
|
@ -324,7 +324,7 @@ void FFlatVertexGenerator::CheckPlanes(sector_t *sector)
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
void FFlatVertexGenerator::CheckUpdate(sector_t *sector)
|
void FFlatVertexBuffer::CheckUpdate(sector_t *sector)
|
||||||
{
|
{
|
||||||
CheckPlanes(sector);
|
CheckPlanes(sector);
|
||||||
sector_t *hs = sector->GetHeightSec();
|
sector_t *hs = sector->GetHeightSec();
|
||||||
|
|
|
@ -41,7 +41,7 @@ struct FFlatVertex
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class FFlatVertexGenerator
|
class FFlatVertexBuffer
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
TArray<FFlatVertex> vbo_shadowdata;
|
TArray<FFlatVertex> vbo_shadowdata;
|
||||||
|
@ -84,7 +84,7 @@ public:
|
||||||
NUM_RESERVED = 20
|
NUM_RESERVED = 20
|
||||||
};
|
};
|
||||||
|
|
||||||
FFlatVertexGenerator(int width, int height);
|
FFlatVertexBuffer(int width, int height);
|
||||||
|
|
||||||
void OutputResized(int width, int height);
|
void OutputResized(int width, int height);
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ struct FDynLightData;
|
||||||
struct HUDSprite;
|
struct HUDSprite;
|
||||||
class Clipper;
|
class Clipper;
|
||||||
class HWPortal;
|
class HWPortal;
|
||||||
class FFlatVertexGenerator;
|
class FFlatVertexBuffer;
|
||||||
class IRenderQueue;
|
class IRenderQueue;
|
||||||
class HWScenePortalBase;
|
class HWScenePortalBase;
|
||||||
class FRenderState;
|
class FRenderState;
|
||||||
|
@ -194,7 +194,7 @@ struct HWDrawInfo
|
||||||
BitArray CurrentMapSections; // this cannot be a single number, because a group of portals with the same displacement may link different sections.
|
BitArray CurrentMapSections; // this cannot be a single number, because a group of portals with the same displacement may link different sections.
|
||||||
area_t in_area;
|
area_t in_area;
|
||||||
fixed_t viewx, viewy; // since the nodes are still fixed point, keeping the view position also fixed point for node traversal is faster.
|
fixed_t viewx, viewy; // since the nodes are still fixed point, keeping the view position also fixed point for node traversal is faster.
|
||||||
FFlatVertexGenerator *mVBO; // this class needs access because the sector vertex updating is part of BSP traversal.
|
FFlatVertexBuffer *mVBO; // this class needs access because the sector vertex updating is part of BSP traversal.
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -187,8 +187,8 @@ void HWPortal::DrawPortalStencil(HWDrawInfo *di, FRenderState &state, int pass)
|
||||||
{
|
{
|
||||||
// The cap's depth handling needs special treatment so that it won't block further portal caps.
|
// The cap's depth handling needs special treatment so that it won't block further portal caps.
|
||||||
if (pass == STP_DepthRestore) di->SetDepthRange(1, 1);
|
if (pass == STP_DepthRestore) di->SetDepthRange(1, 1);
|
||||||
di->Draw(DT_TriangleFan, state, FFlatVertexGenerator::STENCILTOP_INDEX, 4);
|
di->Draw(DT_TriangleFan, state, FFlatVertexBuffer::STENCILTOP_INDEX, 4);
|
||||||
di->Draw(DT_TriangleFan, state, FFlatVertexGenerator::STENCILBOTTOM_INDEX, 4);
|
di->Draw(DT_TriangleFan, state, FFlatVertexBuffer::STENCILBOTTOM_INDEX, 4);
|
||||||
if (pass == STP_DepthRestore) di->SetDepthRange(0, 1);
|
if (pass == STP_DepthRestore) di->SetDepthRange(0, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue