mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
reduce upload since of vertices if drawing quads
This commit is contained in:
parent
77b3c39553
commit
1167ab822c
|
@ -59,7 +59,7 @@ void CGraphics_Threaded::FlushVertices()
|
|||
|
||||
if(m_Drawing == DRAWING_QUADS)
|
||||
{
|
||||
if(g_Config.m_GfxQuadAsTriangle || m_UseOpenGL3_3)
|
||||
if(g_Config.m_GfxQuadAsTriangle && !m_UseOpenGL3_3)
|
||||
{
|
||||
Cmd.m_PrimType = CCommandBuffer::PRIMTYPE_TRIANGLES;
|
||||
Cmd.m_PrimCount = NumVerts/3;
|
||||
|
@ -594,11 +594,10 @@ void CGraphics_Threaded::QuadsDraw(CQuadItem *pArray, int Num)
|
|||
void CGraphics_Threaded::QuadsDrawTL(const CQuadItem *pArray, int Num)
|
||||
{
|
||||
CCommandBuffer::SPoint Center;
|
||||
Center.z = 0;
|
||||
|
||||
dbg_assert(m_Drawing == DRAWING_QUADS, "called Graphics()->QuadsDrawTL without begin");
|
||||
|
||||
if(g_Config.m_GfxQuadAsTriangle || m_UseOpenGL3_3)
|
||||
if(g_Config.m_GfxQuadAsTriangle && !m_UseOpenGL3_3)
|
||||
{
|
||||
for(int i = 0; i < Num; ++i)
|
||||
{
|
||||
|
@ -686,7 +685,7 @@ void CGraphics_Threaded::QuadsDrawFreeform(const CFreeformItem *pArray, int Num)
|
|||
{
|
||||
dbg_assert(m_Drawing == DRAWING_QUADS, "called Graphics()->QuadsDrawFreeform without begin");
|
||||
|
||||
if(g_Config.m_GfxQuadAsTriangle || m_UseOpenGL3_3)
|
||||
if(g_Config.m_GfxQuadAsTriangle && !m_UseOpenGL3_3)
|
||||
{
|
||||
for(int i = 0; i < Num; ++i)
|
||||
{
|
||||
|
@ -1256,10 +1255,6 @@ int CGraphics_Threaded::Init()
|
|||
m_pStorage = Kernel()->RequestInterface<IStorage>();
|
||||
m_pConsole = Kernel()->RequestInterface<IConsole>();
|
||||
|
||||
// Set all z to -5.0f
|
||||
for(int i = 0; i < MAX_VERTICES; i++)
|
||||
m_aVertices[i].m_Pos.z = -5.0f;
|
||||
|
||||
// init textures
|
||||
m_FirstFreeTexture = 0;
|
||||
for(int i = 0; i < MAX_TEXTURES-1; i++)
|
||||
|
|
|
@ -53,6 +53,7 @@ public:
|
|||
enum
|
||||
{
|
||||
MAX_TEXTURES=1024*4,
|
||||
MAX_VERTICES=32*1024,
|
||||
};
|
||||
|
||||
enum
|
||||
|
@ -140,7 +141,7 @@ public:
|
|||
//fix all alignments in any struct -- e.g. don't align to 8 bytes at 64bit code
|
||||
#pragma pack(push, 1)
|
||||
|
||||
struct SPoint { float x, y, z; };
|
||||
struct SPoint { float x, y; };
|
||||
struct STexCoord { float u, v; };
|
||||
struct SColor { float r, g, b, a; };
|
||||
|
||||
|
|
Loading…
Reference in a new issue