diff --git a/source/build/include/build.h b/source/build/include/build.h index 432a020c8..b59c98051 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -331,7 +331,7 @@ typedef struct { int16_t angoff, pitch, roll; vec3_t pivot_offset, position_offset; uint8_t flags; - uint8_t xpanning, ypanning; + uint8_t xpanning, ypanning; // EDuke script hacks. uint8_t filler; uint32_t filler2; float alpha; diff --git a/source/build/src/glsurface.cpp b/source/build/src/glsurface.cpp index d9be935f4..d0fe897a1 100644 --- a/source/build/src/glsurface.cpp +++ b/source/build/src/glsurface.cpp @@ -10,6 +10,7 @@ #include "baselayer.h" #include "build.h" #include "tarray.h" +#include "flatvertices.h" #include "../../glbackend/glbackend.h" static TArray buffer; @@ -75,13 +76,5 @@ void glsurface_blitBuffer() bufferTexture->LoadTexture(buffer.Data()); GLInterface.BindTexture(0, bufferTexture, SamplerNoFilterClampXY); - - auto data = GLInterface.AllocVertices(4); - auto vt = data.second; - - vt[0].Set(-1.0f, 1.0f, 0.0f, 0.0f, 0.0f); //top-left - vt[1].Set(-1.0f, -1.0f, 0.0f, 0.0f, 1.0f); //bottom-left - vt[2].Set(1.0f, 1.0f, 0.0f, 1.0f, 0.0f); //top-right - vt[3].Set(1.0f, -1.0f, 0.0f, 1.0f, 1.0f); //bottom-right - GLInterface.DrawIm(DT_TRIANGLE_STRIP, data.first, 4); + GLInterface.Draw(DT_TRIANGLE_STRIP, FFlatVertexBuffer::PRESENT_INDEX, 4); } diff --git a/source/build/src/mdsprite.cpp b/source/build/src/mdsprite.cpp index c6cd880cb..d135a5ae9 100644 --- a/source/build/src/mdsprite.cpp +++ b/source/build/src/mdsprite.cpp @@ -15,6 +15,8 @@ #include "palette.h" #include "textures.h" #include "bitmap.h" +#include "v_video.h" +#include "flatvertices.h" #include "../../glbackend/glbackend.h" static int32_t curextra=MAXTILES; @@ -1454,8 +1456,8 @@ static void md3draw_handle_triangles(const md3surf_t *s, uint16_t *indexhandle, int32_t i; - auto data = GLInterface.AllocVertices(s->numtris * 3); - auto vt = data.second; + auto data = screen->mVertexData->AllocVertices(s->numtris * 3); + auto vt = data.first; for (i=s->numtris-1; i>=0; i--) { uint16_t tri = M ? M->indexes[i] : i; @@ -1470,7 +1472,7 @@ static void md3draw_handle_triangles(const md3surf_t *s, uint16_t *indexhandle, vt->SetVertex(vertlist[k].x, vertlist[k].y); } } - GLInterface.DrawIm(DT_TRIANGLES, data.first, s->numtris *3); + GLInterface.Draw(DT_TRIANGLES, data.second, s->numtris *3); #ifndef USE_GLEXT UNREFERENCED_PARAMETER(texunits); @@ -1638,9 +1640,6 @@ static int32_t polymost_md3draw(md3model_t *m, tspriteptr_t tspr) k3 = (float)sintable[sext->roll&2047] * (1.f/16384.f); } - float const xpanning = (float)sext->xpanning * (1.f/256.f); - float const ypanning = (float)sext->ypanning * (1.f/256.f); - int prevClamp = GLInterface.GetClamp(); GLInterface.SetClamp(0); @@ -1720,10 +1719,7 @@ static int32_t polymost_md3draw(md3model_t *m, tspriteptr_t tspr) } glow = hw_glowmapping ? mdloadskin((md2model_t *) m, tile2model[Ptile2tile(tspr->picnum, lpal)].skinnum, GLOWPAL, surfi, nullptr) : 0; } - GLInterface.SetModelTexture(tex, globalpal, xpanning, ypanning, det, detscale, glow); - - VSMatrix texmat(0); - texmat.translate(xpanning, ypanning, 1.0f); + GLInterface.SetModelTexture(tex, globalpal, det, detscale, glow); if (tspr->clipdist & TSPR_FLAGS_MDHACK) { diff --git a/source/build/src/polymost.cpp b/source/build/src/polymost.cpp index b577934d3..90ee8081e 100644 --- a/source/build/src/polymost.cpp +++ b/source/build/src/polymost.cpp @@ -16,6 +16,8 @@ Ken Silverman's official web site: http://www.advsys.net/ken #include "../../glbackend/glbackend.h" #include "c_cvars.h" #include "gamecvars.h" +#include "v_video.h" +#include "flatvertices.h" CVAR(Bool, hw_detailmapping, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Bool, hw_glowmapping, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) @@ -581,8 +583,8 @@ static void polymost_drawpoly(vec2f_t const * const dpxy, int32_t const n, int32 GLInterface.SetColor(pc[0], pc[1], pc[2], pc[3]); vec2f_t const scale = { 1.f / tsiz2.x, 1.f / tsiz2.y }; - auto data = GLInterface.AllocVertices(npoints); - auto vt = data.second; + auto data = screen->mVertexData->AllocVertices(npoints); + auto vt = data.first; for (bssize_t i = 0; i < npoints; ++i, vt++) { float const r = 1.f / dd[i]; @@ -599,7 +601,7 @@ static void polymost_drawpoly(vec2f_t const * const dpxy, int32_t const n, int32 r * (1.f / 1024.f)); } - GLInterface.DrawIm(DT_TRIANGLE_FAN, data.first, npoints); + GLInterface.Draw(DT_TRIANGLE_FAN, data.second, npoints); GLInterface.SetTinting(-1, 0xffffff, 0xffffff); GLInterface.UseDetailMapping(false); diff --git a/source/build/src/voxmodel.cpp b/source/build/src/voxmodel.cpp index 1e2123e14..8dc6dd486 100644 --- a/source/build/src/voxmodel.cpp +++ b/source/build/src/voxmodel.cpp @@ -10,6 +10,8 @@ #include "hightile.h" #include "polymost.h" #include "mdsprite.h" +#include "v_video.h" +#include "flatvertices.h" #include "palette.h" #include "../../glbackend/glbackend.h" @@ -1140,10 +1142,10 @@ int32_t polymost_voxdraw(voxmodel_t *m, tspriteptr_t const tspr) GLInterface.UseDetailMapping(false); #endif - auto data = GLInterface.AllocVertices(m->qcnt * 6); - auto vt = data.second; + auto data = screen->mVertexData->AllocVertices(m->qcnt * 6); + auto vt = data.first; - int qstart = 0; + int qstart = data.second; int qdone = 0; for (bssize_t i=0, fi=0; iqcnt; i++) { @@ -1152,7 +1154,7 @@ int32_t polymost_voxdraw(voxmodel_t *m, tspriteptr_t const tspr) f = 1 /*clut[fi++]*/; if (qdone > 0) { - GLInterface.DrawIm(DT_TRIANGLES, qstart, qdone * 6); + GLInterface.Draw(DT_TRIANGLES, qstart, qdone * 6); qstart += qdone * 6; qdone = 0; } @@ -1182,7 +1184,7 @@ int32_t polymost_voxdraw(voxmodel_t *m, tspriteptr_t const tspr) qdone++; } - GLInterface.DrawIm(DT_TRIANGLES, qstart, qdone * 6); + GLInterface.Draw(DT_TRIANGLES, qstart, qdone * 6); GLInterface.SetClamp(prevClamp); //------------ GLInterface.SetCull(Cull_None); diff --git a/source/common/2d/v_2ddrawer.h b/source/common/2d/v_2ddrawer.h index df71a8eec..8c282fa71 100644 --- a/source/common/2d/v_2ddrawer.h +++ b/source/common/2d/v_2ddrawer.h @@ -14,7 +14,7 @@ struct F2DPolygons TArray vertices; TArray indices; - unsigned AllocVertices(int num) // Allocates a triangle fan. There's no code that needs a triangle strip. + unsigned AllocVertices(int num) { auto vindex = vertices.Reserve(num); indices.Push(num); diff --git a/source/common/rendering/gl/system/gl_framebuffer.cpp b/source/common/rendering/gl/system/gl_framebuffer.cpp index b76b7bb35..affefa675 100644 --- a/source/common/rendering/gl/system/gl_framebuffer.cpp +++ b/source/common/rendering/gl/system/gl_framebuffer.cpp @@ -207,6 +207,7 @@ void OpenGLFrameBuffer::Update() Swap(); Super::Update(); + screen->mVertexData->Reset(); } //=========================================================================== diff --git a/source/common/rendering/hwrenderer/data/flatvertices.cpp b/source/common/rendering/hwrenderer/data/flatvertices.cpp index eae6a42e9..bdee1e5c1 100644 --- a/source/common/rendering/hwrenderer/data/flatvertices.cpp +++ b/source/common/rendering/hwrenderer/data/flatvertices.cpp @@ -36,6 +36,7 @@ #include "flatvertices.h" #include "v_video.h" #include "cmdlib.h" +#include "printf.h" #include "hwrenderer/data/buffers.h" //========================================================================== @@ -89,7 +90,7 @@ FFlatVertexBuffer::FFlatVertexBuffer(int width, int height) }; mVertexBuffer->SetFormat(1, 2, sizeof(FFlatVertex), format); - mIndex = mCurIndex = 0; + mIndex = mCurIndex = NUM_RESERVED; mNumReserved = NUM_RESERVED; Copy(0, NUM_RESERVED); } @@ -129,6 +130,25 @@ void FFlatVertexBuffer::OutputResized(int width, int height) // //========================================================================== +std::pair FFlatVertexBuffer::AllocVertices(unsigned int count) +{ + FFlatVertex *p = GetBuffer(); + auto index = mCurIndex.fetch_add(count); + auto offset = index; + if (index + count >= BUFFER_SIZE_TO_USE) + { + // If a single scene needs 2'000'000 vertices there must be something very wrong. + I_FatalError("Out of vertex memory. Tried to allocate more than %u vertices for a single frame", index + count); + } + return std::make_pair(p, index); +} + +//========================================================================== +// +// +// +//========================================================================== + void FFlatVertexBuffer::Copy(int start, int count) { Map(); diff --git a/source/common/rendering/hwrenderer/data/flatvertices.h b/source/common/rendering/hwrenderer/data/flatvertices.h index 58c383013..c53941ff1 100644 --- a/source/common/rendering/hwrenderer/data/flatvertices.h +++ b/source/common/rendering/hwrenderer/data/flatvertices.h @@ -24,6 +24,20 @@ struct FFlatVertex u = uu; v = vv; } + + void SetVertex(float _x, float _y, float _z = 0) + { + x = _x; + z = _y; + y = _z; + } + + void SetTexCoord(float _u = 0, float _v = 0) + { + u = _u; + v = _v; + } + }; class FFlatVertexBuffer diff --git a/source/common/rendering/v_framebuffer.cpp b/source/common/rendering/v_framebuffer.cpp index 3ccb89de2..f27ad9c23 100644 --- a/source/common/rendering/v_framebuffer.cpp +++ b/source/common/rendering/v_framebuffer.cpp @@ -46,6 +46,7 @@ #include "i_time.h" #include "v_2ddrawer.h" #include "build.h" +#include "../glbackend/glbackend.h" /* #include "hwrenderer/scene/hw_portal.h" #include "hwrenderer/utility/hw_clock.h" @@ -390,5 +391,8 @@ void DFrameBuffer::FinishScene() if (videoGetRenderMode() < REND_POLYMOST) return; assert(BufferLock > 0); if (--BufferLock == 0) + { mVertexData->Unmap(); + GLInterface.DoDraw(); + } } diff --git a/source/glbackend/gl_renderstate.h b/source/glbackend/gl_renderstate.h index ea912f20f..9174c8117 100644 --- a/source/glbackend/gl_renderstate.h +++ b/source/glbackend/gl_renderstate.h @@ -50,13 +50,14 @@ enum PRSFlags STF_CLEARCOLOR = 1024, STF_CLEARDEPTH = 2048, STF_VIEWPORTSET = 4096, - STF_SCISSORSET = 4096, + STF_SCISSORSET = 8192, }; struct PolymostRenderState { + int vindex, vcount, primtype; float Shade; float NumShades = 64.f; float ShadeDiv = 62.f; @@ -70,7 +71,7 @@ struct PolymostRenderState float Color[4] = { 1,1,1,1 }; short matrixIndex[NUMMATRICES] = { -1,-1,-1,-1,-1 }; PalEntry fullscreenTint = 0xffffff, hictint = 0xffffff, hictint_overlay = 0xffffff; - int hictint_flags = 0; + int hictint_flags = -1; int StateFlags = STF_COLORMASK|STF_DEPTHMASK; FRenderStyle Style{}; @@ -82,9 +83,5 @@ struct PolymostRenderState PalEntry FogColor; - IVertexBuffer* VertexBuffer = nullptr; - int VB_Offset[2] = {}; - IIndexBuffer* IndexBuffer = nullptr; - void Apply(PolymostShader *shader, GLState &oldstate); }; diff --git a/source/glbackend/gl_texture.cpp b/source/glbackend/gl_texture.cpp index 1b36948c2..b2fa7a6e1 100644 --- a/source/glbackend/gl_texture.cpp +++ b/source/glbackend/gl_texture.cpp @@ -150,7 +150,7 @@ FHardwareTexture* GLInstance::LoadTexture(FTexture* tex, int textype, int palid) // //=========================================================================== -bool GLInstance::SetTextureInternal(int picnum, FTexture* tex, int palette, int method, int sampleroverride, float xpanning, float ypanning, FTexture *det, float detscale, FTexture *glow) +bool GLInstance::SetTextureInternal(int picnum, FTexture* tex, int palette, int method, int sampleroverride, FTexture *det, float detscale, FTexture *glow) { if (tex->GetWidth() <= 0 || tex->GetHeight() <= 0) return false; int usepalette = fixpalette >= 1 ? fixpalette - 1 : curbasepal; @@ -158,6 +158,7 @@ bool GLInstance::SetTextureInternal(int picnum, FTexture* tex, int palette, int GLInterface.SetPalette(usepalette); GLInterface.SetPalswap(usepalswap); bool texbound[3] = {}; + int MatrixChange = 0; TextureType = hw_useindexedcolortextures? TT_INDEXED : TT_TRUECOLOR; @@ -209,13 +210,12 @@ bool GLInstance::SetTextureInternal(int picnum, FTexture* tex, int palette, int UseBrightmaps(false); BindTexture(0, mtex, sampler); - if (rep && (rep->scale.x != 1.0f || rep->scale.y != 1.0f || xpanning != 0 || ypanning != 0)) + // Needs a) testing and b) verification for correctness. This doesn't look like it makes sense. + if (rep && (rep->scale.x != 1.0f || rep->scale.y != 1.0f)) { - texmat.loadIdentity(); - texmat.translate(xpanning, ypanning, 0); - texmat.scale(rep->scale.x, rep->scale.y, 1.0f); - GLInterface.SetMatrix(Matrix_Texture, &texmat); - MatrixChange |= 1; + //texmat.loadIdentity(); + //texmat.scale(rep->scale.x, rep->scale.y, 1.0f); + //GLInterface.SetMatrix(Matrix_Texture, &texmat); } // Also load additional layers needed for this texture. @@ -239,16 +239,17 @@ bool GLInstance::SetTextureInternal(int picnum, FTexture* tex, int palette, int BindTexture(3, htex, SamplerRepeat); texbound[0] = true; - // Q: Pass the scale factor as a separate uniform to get rid of the additional matrix? + + /* todo: instead of a matrix, just pass a two-component uniform. Using a full matrix here is problematic. if (MatrixChange & 1) MatrixChange |= 2; else texmat.loadIdentity(); - if ((detscalex != 1.0f) || (detscaley != 1.0f)) { texmat.scale(detscalex, detscaley, 1.0f); MatrixChange |= 2; } if (MatrixChange & 2) GLInterface.SetMatrix(Matrix_Detail, &texmat); + */ } } if (hw_glowmapping && hw_hightile) diff --git a/source/glbackend/glbackend.cpp b/source/glbackend/glbackend.cpp index 91acf88f1..7257ce950 100644 --- a/source/glbackend/glbackend.cpp +++ b/source/glbackend/glbackend.cpp @@ -198,24 +198,25 @@ void GLInstance::ResetFrame() } +void GLInstance::SetVertexBuffer(IVertexBuffer* vb, int offset1, int offset2) +{ + int o[] = { offset1, offset2 }; + static_cast(vb)->Bind(o); +} + +void GLInstance::SetIndexBuffer(IIndexBuffer* vb) +{ + if (vb) static_cast(vb)->Bind(); + else glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); +} + void GLInstance::ClearBufferState() { - auto buffer = (screen->mVertexData->GetBufferObjects().first); - - SetVertexBuffer(buffer, 0, 0); + SetVertexBuffer(screen->mVertexData->GetBufferObjects().first, 0, 0); SetIndexBuffer(nullptr); - // Invalidate the pointers as well to make sure that if another buffer with the same address is used it actually gets bound. - LastVertexBuffer = (IVertexBuffer*)~intptr_t(0); - LastIndexBuffer = (IIndexBuffer*)~intptr_t(0); } -std::pair GLInstance::AllocVertices(size_t num) -{ - Buffer.resize(num); - return std::make_pair((size_t)0, Buffer.data()); -} - static GLint primtypes[] = { GL_TRIANGLES, @@ -224,37 +225,19 @@ static GLint primtypes[] = GL_LINES }; -void GLInstance::DrawIm(EDrawType type, size_t start, size_t count) -{ - // Todo: Based on the current tinting flags and the texture type (indexed texture and APPLYOVERPALSWAP not set) this may have to reset the palette for the draw call / texture creation. - bool applied = false; - - if (activeShader == polymostShader) - { - glVertexAttrib4fv(2, renderState.Color); - if (renderState.Color[3] != 1.f) renderState.Flags &= ~RF_Brightmapping; // The way the colormaps are set up means that brightmaps cannot be used on translucent content at all. - renderState.Apply(polymostShader, lastState); - } - glBegin(primtypes[type]); - auto p = &Buffer[start]; - for (size_t i = 0; i < count; i++, p++) - { - glVertexAttrib2f(1, p->u, p->v); - glVertexAttrib3f(0, p->x, p->y, p->z); - } - glEnd(); - - if (MatrixChange) - { - if (MatrixChange & 1) SetIdentityMatrix(Matrix_Texture); - if (MatrixChange & 2) SetIdentityMatrix(Matrix_Detail); - MatrixChange = 0; - } - matrixArray.Resize(1); -} - void GLInstance::Draw(EDrawType type, size_t start, size_t count) +{ + renderState.vindex = start; + renderState.vcount = count; + renderState.primtype = type; + rendercommands.Push(renderState); + SetIdentityMatrix(Matrix_Texture); + SetIdentityMatrix(Matrix_Detail); + renderState.StateFlags &= ~(STF_CLEARCOLOR | STF_CLEARDEPTH | STF_VIEWPORTSET | STF_SCISSORSET); +} + +void GLInstance::DrawElement(EDrawType type, size_t start, size_t count, PolymostRenderState &renderState) { // Todo: Based on the current tinting flags and the texture type (indexed texture and APPLYOVERPALSWAP not set) this may have to reset the palette for the draw call / texture creation. bool applied = false; @@ -264,28 +247,8 @@ void GLInstance::Draw(EDrawType type, size_t start, size_t count) glVertexAttrib4fv(2, renderState.Color); if (renderState.Color[3] != 1.f) renderState.Flags &= ~RF_Brightmapping; // The way the colormaps are set up means that brightmaps cannot be used on translucent content at all. renderState.Apply(polymostShader, lastState); - if (renderState.VertexBuffer != LastVertexBuffer || LastVB_Offset[0] != renderState.VB_Offset[0] || LastVB_Offset[1] != renderState.VB_Offset[1]) - { - if (renderState.VertexBuffer) - { - static_cast(renderState.VertexBuffer)->Bind(renderState.VB_Offset); - } - else glBindBuffer(GL_ARRAY_BUFFER, 0); - LastVertexBuffer = renderState.VertexBuffer; - LastVB_Offset[0] = renderState.VB_Offset[0]; - LastVB_Offset[1] = renderState.VB_Offset[1]; - } - if (renderState.IndexBuffer != LastIndexBuffer) - { - if (renderState.IndexBuffer) - { - static_cast(renderState.IndexBuffer)->Bind(); - } - else glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); - LastIndexBuffer = renderState.IndexBuffer; - } } - if (type != DT_LINES && renderState.IndexBuffer) + if (type != DT_LINES) { glDrawElements(primtypes[type], count, GL_UNSIGNED_INT, (void*)(intptr_t)(start * sizeof(uint32_t))); } @@ -293,13 +256,22 @@ void GLInstance::Draw(EDrawType type, size_t start, size_t count) { glDrawArrays(primtypes[type], start, count); } - if (MatrixChange) +} + +void GLInstance::DoDraw() +{ + for (auto& rs : rendercommands) { - if (MatrixChange & 1) SetIdentityMatrix(Matrix_Texture); - if (MatrixChange & 2) SetIdentityMatrix(Matrix_Detail); - MatrixChange = 0; + // Todo: Based on the current tinting flags and the texture type (indexed texture and APPLYOVERPALSWAP not set) this may have to reset the palette for the draw call / texture creation. + bool applied = false; + + glVertexAttrib4fv(2, rs.Color); + if (rs.Color[3] != 1.f) rs.Flags &= ~RF_Brightmapping; // The way the colormaps are set up means that brightmaps cannot be used on translucent content at all. + rs.Apply(polymostShader, lastState); + glDrawArrays(primtypes[rs.primtype], rs.vindex, rs.vcount); } - matrixArray.Resize(1); + rendercommands.Clear(); + matrixArray.Clear(); } diff --git a/source/glbackend/glbackend.h b/source/glbackend/glbackend.h index 9d869ba0c..14bfabfcf 100644 --- a/source/glbackend/glbackend.h +++ b/source/glbackend/glbackend.h @@ -95,34 +95,6 @@ struct glinfo_t { float maxanisotropy; }; -struct BaseVertex -{ - float x, y, z; - float u, v; - - void SetVertex(float _x, float _y, float _z = 0) - { - x = _x; - y = _y; - z = _z; - } - - void SetTexCoord(float _u = 0, float _v = 0) - { - u = _u; - v = _v; - } - - void Set(float _x, float _y, float _z = 0, float _u = 0, float _v = 0) - { - x = _x; - y = _y; - z = _z; - u = _u; - v = _v; - } -}; - enum EDrawType { DT_TRIANGLES, @@ -180,7 +152,7 @@ struct GLState class GLInstance { - std::vector Buffer; // cheap-ass implementation. The primary purpose is to get the GL accesses out of polymost.cpp, not writing something performant right away. + TArray rendercommands; int maxTextureSize; PaletteManager palmanager; int lastPalswapIndex = -1; @@ -193,10 +165,6 @@ class GLInstance // Cached GL state. GLState lastState; - IVertexBuffer* LastVertexBuffer = nullptr; - int LastVB_Offset[2] = {}; - IIndexBuffer* LastIndexBuffer = nullptr; - float mProjectionM5 = 1.0f; // needed by ssao PolymostRenderState renderState; FShader* activeShader; @@ -225,26 +193,18 @@ public: } GLInstance(); - std::pair AllocVertices(size_t num); - void DrawIm(EDrawType type, size_t start, size_t count); void Draw(EDrawType type, size_t start, size_t count); - + void DoDraw(); + void DrawElement(EDrawType type, size_t start, size_t count, PolymostRenderState& renderState); + FHardwareTexture* NewTexture(); void EnableNonTransparent255(bool on) { g_nontransparent255 = on; } - void SetVertexBuffer(IVertexBuffer* vb, int offset1, int offset2) - { - renderState.VertexBuffer = vb; - renderState.VB_Offset[0] = offset1; - renderState.VB_Offset[1] = offset2; - } - void SetIndexBuffer(IIndexBuffer* vb) - { - renderState.IndexBuffer = vb; - } + void SetVertexBuffer(IVertexBuffer* vb, int offset1, int offset2); + void SetIndexBuffer(IIndexBuffer* vb); void ClearBufferState(); float GetProjectionM5() { return mProjectionM5; } @@ -542,18 +502,18 @@ public: FHardwareTexture* CreateIndexedTexture(FTexture* tex); FHardwareTexture* CreateTrueColorTexture(FTexture* tex, int palid, bool checkfulltransparency = false, bool rgb8bit = false); FHardwareTexture *LoadTexture(FTexture* tex, int texturetype, int palid); - bool SetTextureInternal(int globalpicnum, FTexture* tex, int palette, int method, int sampleroverride, float xpanning, float ypanning, FTexture *det, float detscale, FTexture *glow); + bool SetTextureInternal(int globalpicnum, FTexture* tex, int palette, int method, int sampleroverride, FTexture *det, float detscale, FTexture *glow); bool SetNamedTexture(FTexture* tex, int palette, int sampleroverride); bool SetTexture(int globalpicnum, FTexture* tex, int palette, int method, int sampleroverride) { - return SetTextureInternal(globalpicnum, tex, palette, method, sampleroverride, 0, 0, nullptr, 1, nullptr); + return SetTextureInternal(globalpicnum, tex, palette, method, sampleroverride, nullptr, 1, nullptr); } - bool SetModelTexture(FTexture *tex, int palette, float xpanning, float ypanning, FTexture *det, float detscale, FTexture *glow) + bool SetModelTexture(FTexture *tex, int palette, FTexture *det, float detscale, FTexture *glow) { - return SetTextureInternal(-1, tex, palette, 8/*DAMETH_MODEL*/, -1, xpanning, ypanning, det, detscale, glow); + return SetTextureInternal(-1, tex, palette, 8/*DAMETH_MODEL*/, -1, det, detscale, glow); } }; diff --git a/source/glbackend/hw_draw2d.cpp b/source/glbackend/hw_draw2d.cpp index 9f2390ab4..7d4dfc87d 100644 --- a/source/glbackend/hw_draw2d.cpp +++ b/source/glbackend/hw_draw2d.cpp @@ -191,11 +191,11 @@ void GLInstance::Draw2D(F2DDrawer *drawer) { case F2DDrawer::DrawTypeTriangles: case F2DDrawer::DrawTypeRotateSprite: - Draw(DT_TRIANGLES, cmd.mIndexIndex, cmd.mIndexCount); + DrawElement(DT_TRIANGLES, cmd.mIndexIndex, cmd.mIndexCount, renderState); break; case F2DDrawer::DrawTypeLines: - Draw(DT_LINES, cmd.mVertIndex, cmd.mVertCount); + DrawElement(DT_LINES, cmd.mVertIndex, cmd.mVertCount, renderState); break; case F2DDrawer::DrawTypePoints: diff --git a/source/platform/win32/win32glvideo.cpp b/source/platform/win32/win32glvideo.cpp index b32d24c82..60982b48c 100644 --- a/source/platform/win32/win32glvideo.cpp +++ b/source/platform/win32/win32glvideo.cpp @@ -405,7 +405,7 @@ bool Win32GLVideo::InitHardware(HWND Window, int multisample) int prof = WGL_CONTEXT_CORE_PROFILE_BIT_ARB; const char *version = Args->CheckValue("-glversion"); - prof = WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; // At the moment the renderer still needs the compatibility profile. + //prof = WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; // At the moment the renderer still needs the compatibility profile. for (; prof <= WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; prof++) {