- renamed classes before continuing.

This commit is contained in:
Christoph Oelckers 2018-10-27 14:27:43 +02:00
parent 72bc7693bd
commit dad3c50ebd
10 changed files with 33 additions and 33 deletions

View file

@ -122,8 +122,8 @@ void FSkyVertexBuffer::BindVBO()
//
//==========================================================================
FFlatVertexBuffer::FFlatVertexBuffer(int width, int height)
: FFlatVertexGenerator(width, height)
FGLFlatVertexBuffer::FGLFlatVertexBuffer(int width, int height)
: FFlatVertexBuffer(width, height)
{
mVertexBuffer = screen->CreateVertexBuffer();
mIndexBuffer = screen->CreateIndexBuffer();
@ -142,7 +142,7 @@ FFlatVertexBuffer::FFlatVertexBuffer(int width, int height)
Copy(0, NUM_RESERVED);
}
FFlatVertexBuffer::~FFlatVertexBuffer()
FGLFlatVertexBuffer::~FGLFlatVertexBuffer()
{
delete mIndexBuffer;
delete mVertexBuffer;
@ -150,20 +150,20 @@ FFlatVertexBuffer::~FFlatVertexBuffer()
mVertexBuffer = nullptr;
}
void FFlatVertexBuffer::Copy(int start, int count)
void FGLFlatVertexBuffer::Copy(int start, int count)
{
Map();
memcpy(GetBuffer(start), &vbo_shadowdata[0], count * sizeof(FFlatVertex));
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);
}
void FFlatVertexBuffer::Bind(FRenderState &state)
void FGLFlatVertexBuffer::Bind(FRenderState &state)
{
state.SetVertexBuffer(mVertexBuffer, 0, 0);
state.SetIndexBuffer(mIndexBuffer);
@ -175,10 +175,10 @@ void FFlatVertexBuffer::Bind(FRenderState &state)
//
//==========================================================================
void FFlatVertexBuffer::CreateVBO()
void FGLFlatVertexBuffer::CreateVBO()
{
vbo_shadowdata.Resize(mNumReserved);
FFlatVertexGenerator::CreateVertices();
FFlatVertexBuffer::CreateVertices();
mCurIndex = mIndex = vbo_shadowdata.Size();
Copy(0, mIndex);
mIndexBuffer->SetData(ibo_data.Size() * sizeof(uint32_t), &ibo_data[0]);

View file

@ -86,7 +86,7 @@ public:
void EnableColorArray(bool on);
};
class FFlatVertexBuffer : public FFlatVertexGenerator
class FGLFlatVertexBuffer : public FFlatVertexBuffer
{
IVertexBuffer *mVertexBuffer;
IIndexBuffer *mIndexBuffer;
@ -103,8 +103,8 @@ class FFlatVertexBuffer : public FFlatVertexGenerator
public:
FFlatVertexBuffer(int width, int height);
~FFlatVertexBuffer();
FGLFlatVertexBuffer(int width, int height);
~FGLFlatVertexBuffer();
void OutputResized(int width, int height);
void Bind(FRenderState &state);

View file

@ -54,7 +54,7 @@ void FGLRenderer::RenderScreenQuad()
{
mVBO->Bind(gl_RenderState);
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)

View file

@ -99,7 +99,7 @@ void FGLRenderer::Initialize(int width, int height)
glBindVertexArray(mVAOID);
FGLDebug::LabelObject(GL_VERTEX_ARRAY, mVAOID, "FGLRenderer.mVAOID");
mVBO = new FFlatVertexBuffer(width, height);
mVBO = new FGLFlatVertexBuffer(width, height);
mSkyVBO = new FSkyVertexBuffer;
mLights = new FLightBuffer();
mViewpoints = new GLViewpointBuffer;

View file

@ -16,7 +16,7 @@
struct particle_t;
class FCanvasTexture;
class FFlatVertexBuffer;
class FGLFlatVertexBuffer;
class FSkyVertexBuffer;
class OpenGLFrameBuffer;
struct FDrawInfo;
@ -69,7 +69,7 @@ public:
//FRotator mAngles;
FFlatVertexBuffer *mVBO = nullptr;
FGLFlatVertexBuffer *mVBO = nullptr;
FSkyVertexBuffer *mSkyVBO = nullptr;
FLightBuffer *mLights = nullptr;
GLViewpointBuffer *mViewpoints = nullptr;

View file

@ -319,7 +319,7 @@ void FDrawInfo::ClearScreen()
glDisable(GL_MULTISAMPLE);
glDisable(GL_DEPTH_TEST);
glDrawArrays(GL_TRIANGLE_STRIP, FFlatVertexBuffer::FULLSCREEN_INDEX, 4);
glDrawArrays(GL_TRIANGLE_STRIP, FGLFlatVertexBuffer::FULLSCREEN_INDEX, 4);
glEnable(GL_DEPTH_TEST);
if (multi) glEnable(GL_MULTISAMPLE);

View file

@ -39,7 +39,7 @@
//
//==========================================================================
FFlatVertexGenerator::FFlatVertexGenerator(int width, int height)
FFlatVertexBuffer::FFlatVertexBuffer(int width, int height)
{
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);
}
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[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;
@ -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 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();
// 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;
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 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);
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])
{
@ -324,7 +324,7 @@ void FFlatVertexGenerator::CheckPlanes(sector_t *sector)
//
//==========================================================================
void FFlatVertexGenerator::CheckUpdate(sector_t *sector)
void FFlatVertexBuffer::CheckUpdate(sector_t *sector)
{
CheckPlanes(sector);
sector_t *hs = sector->GetHeightSec();

View file

@ -41,7 +41,7 @@ struct FFlatVertex
}
};
class FFlatVertexGenerator
class FFlatVertexBuffer
{
protected:
TArray<FFlatVertex> vbo_shadowdata;
@ -84,7 +84,7 @@ public:
NUM_RESERVED = 20
};
FFlatVertexGenerator(int width, int height);
FFlatVertexBuffer(int width, int height);
void OutputResized(int width, int height);

View file

@ -64,7 +64,7 @@ struct FDynLightData;
struct HUDSprite;
class Clipper;
class HWPortal;
class FFlatVertexGenerator;
class FFlatVertexBuffer;
class IRenderQueue;
class HWScenePortalBase;
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.
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.
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:

View file

@ -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.
if (pass == STP_DepthRestore) di->SetDepthRange(1, 1);
di->Draw(DT_TriangleFan, state, FFlatVertexGenerator::STENCILTOP_INDEX, 4);
di->Draw(DT_TriangleFan, state, FFlatVertexGenerator::STENCILBOTTOM_INDEX, 4);
di->Draw(DT_TriangleFan, state, FFlatVertexBuffer::STENCILTOP_INDEX, 4);
di->Draw(DT_TriangleFan, state, FFlatVertexBuffer::STENCILBOTTOM_INDEX, 4);
if (pass == STP_DepthRestore) di->SetDepthRange(0, 1);
}
}