Refactored PrimitiveType to enum class

dev
Tomasz Kapuściński 2021-12-05 12:26:34 +01:00
parent 7a555e19c4
commit 39c837d323
16 changed files with 72 additions and 72 deletions

View File

@ -257,15 +257,15 @@ enum FillMode
* \enum PrimitiveType
* \brief Type of primitive to render
*/
enum PrimitiveType
enum class PrimitiveType : unsigned char
{
PRIMITIVE_POINTS,
PRIMITIVE_LINES,
PRIMITIVE_LINE_STRIP,
PRIMITIVE_LINE_LOOP,
PRIMITIVE_TRIANGLES,
PRIMITIVE_TRIANGLE_STRIP,
PRIMITIVE_TRIANGLE_FAN
POINTS,
LINES,
LINE_STRIP,
LINE_LOOP,
TRIANGLES,
TRIANGLE_STRIP,
TRIANGLE_FAN
};
/**

View File

@ -33,7 +33,7 @@ namespace Gfx
{
class CVertexBuffer;
enum PrimitiveType;
enum class PrimitiveType : unsigned char;
struct Texture;
enum class TransparencyMode

View File

@ -177,7 +177,7 @@ void CCloud::Draw()
pos.x += size*2.0f;
}
device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, &vertices[0], vertexIndex);
device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, &vertices[0], vertexIndex);
m_engine->AddStatisticTriangle(vertexIndex - 2);
}

View File

@ -1691,9 +1691,9 @@ void CEngine::UpdateStaticBuffer(EngineBaseObjDataTier& p4)
{
PrimitiveType type;
if (p4.type == ENG_TRIANGLE_TYPE_TRIANGLES)
type = PRIMITIVE_TRIANGLES;
type = PrimitiveType::TRIANGLES;
else
type = PRIMITIVE_TRIANGLE_STRIP;
type = PrimitiveType::TRIANGLE_STRIP;
if (p4.buffer == nullptr)
{
@ -3643,7 +3643,7 @@ void CEngine::Draw3DScene()
for (const auto& line : m_displayGoto)
{
m_device->DrawPrimitive(PRIMITIVE_LINE_STRIP, line.data(), line.size());
m_device->DrawPrimitive(PrimitiveType::LINE_STRIP, line.data(), line.size());
}
}
m_displayGoto.clear();
@ -3794,7 +3794,7 @@ void CEngine::DrawCaptured3DScene()
auto renderer = m_device->GetUIRenderer();
renderer->SetTexture(m_capturedWorldTexture);
renderer->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, 4, vertices);
renderer->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, 4, vertices);
}
void CEngine::RenderDebugSphere(const Math::Sphere& sphere, const Math::Matrix& transform, const Gfx::Color& color)
@ -3919,7 +3919,7 @@ void CEngine::RenderPendingDebugDraws()
SetState(ENG_RSTATE_OPAQUE_COLOR);
m_device->DrawPrimitives(PRIMITIVE_LINE_STRIP,
m_device->DrawPrimitives(PrimitiveType::LINE_STRIP,
m_pendingDebugDraws.vertices.data(),
m_pendingDebugDraws.firsts.data(),
m_pendingDebugDraws.counts.data(),
@ -4230,12 +4230,12 @@ void CEngine::DrawObject(const EngineBaseObjDataTier& p4)
{
if (p4.type == ENG_TRIANGLE_TYPE_TRIANGLES)
{
m_device->DrawPrimitive(PRIMITIVE_TRIANGLES, p4.vertices.data(), p4.vertices.size());
m_device->DrawPrimitive(PrimitiveType::TRIANGLES, p4.vertices.data(), p4.vertices.size());
m_statisticTriangle += p4.vertices.size() / 3;
}
else
{
m_device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, p4.vertices.data(), p4.vertices.size() );
m_device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, p4.vertices.data(), p4.vertices.size() );
m_statisticTriangle += p4.vertices.size() - 2;
}
}
@ -4872,7 +4872,7 @@ void CEngine::DrawShadowSpots()
SetState(ENG_RSTATE_TTEXTURE_WHITE, Color(intensity, intensity, intensity, intensity));
}
m_device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, vertex, 4);
m_device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, vertex, 4);
AddStatisticTriangle(2);
}
@ -4929,7 +4929,7 @@ void CEngine::DrawBackgroundGradient(const Color& up, const Color& down)
VertexCol(Math::Vector(p2.x, p2.y, 0.0f), color[0])
};
m_device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, vertex, 4);
m_device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, vertex, 4);
AddStatisticTriangle(2);
}
@ -5009,7 +5009,7 @@ void CEngine::DrawBackgroundImage()
{ { p2.x, p2.y }, { u2, v1 } }
};
m_device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, vertices, 4);
m_device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, vertices, 4);
AddStatisticTriangle(2);
}
@ -5063,7 +5063,7 @@ void CEngine::DrawForegroundImage()
m_device->SetTransform(TRANSFORM_PROJECTION, m_matProjInterface);
m_device->SetTransform(TRANSFORM_WORLD, m_matWorldInterface);
m_device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, vertex, 4);
m_device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, vertex, 4);
AddStatisticTriangle(2);
}
@ -5100,7 +5100,7 @@ void CEngine::DrawOverColor()
VertexCol(Math::Vector(p2.x, p2.y, 0.0f), color[0])
};
m_device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, vertex, 4);
m_device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, vertex, 4);
AddStatisticTriangle(2);
m_device->Restore();
@ -5179,22 +5179,22 @@ void CEngine::DrawHighlight()
line[0].coord = Math::Vector(p1.x, p1.y + dy, 0.0f);
line[1].coord = Math::Vector(p1.x, p1.y, 0.0f);
line[2].coord = Math::Vector(p1.x + dx, p1.y, 0.0f);
m_device->DrawPrimitive(PRIMITIVE_LINE_STRIP, line, 3);
m_device->DrawPrimitive(PrimitiveType::LINE_STRIP, line, 3);
line[0].coord = Math::Vector(p2.x - dx, p1.y, 0.0f);
line[1].coord = Math::Vector(p2.x, p1.y, 0.0f);
line[2].coord = Math::Vector(p2.x, p1.y + dy, 0.0f);
m_device->DrawPrimitive(PRIMITIVE_LINE_STRIP, line, 3);
m_device->DrawPrimitive(PrimitiveType::LINE_STRIP, line, 3);
line[0].coord = Math::Vector(p2.x, p2.y - dy, 0.0f);
line[1].coord = Math::Vector(p2.x, p2.y, 0.0f);
line[2].coord = Math::Vector(p2.x - dx, p2.y, 0.0f);
m_device->DrawPrimitive(PRIMITIVE_LINE_STRIP, line, 3);
m_device->DrawPrimitive(PrimitiveType::LINE_STRIP, line, 3);
line[0].coord = Math::Vector(p1.x + dx, p2.y, 0.0f);
line[1].coord = Math::Vector(p1.x, p2.y, 0.0f);
line[2].coord = Math::Vector(p1.x, p2.y - dy, 0.0f);
m_device->DrawPrimitive(PRIMITIVE_LINE_STRIP, line, 3);
m_device->DrawPrimitive(PrimitiveType::LINE_STRIP, line, 3);
}
void CEngine::DrawMouse()
@ -5262,7 +5262,7 @@ void CEngine::DrawMouseSprite(Math::IntPoint pos, Math::IntPoint size, int icon)
{ { p2.x, p1.y }, { u2, v1 } }
};
m_device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, vertex, 4);
m_device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, vertex, 4);
AddStatisticTriangle(2);
}
@ -5292,7 +5292,7 @@ void CEngine::DrawStats()
{ { pos.x + width + margin.x, pos.y + height + margin.y }, {}, black }
};
m_device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, vertex, 4);
m_device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, vertex, 4);
SetState(ENG_RSTATE_TEXT);

View File

@ -288,7 +288,7 @@ void CLightning::Draw()
vertex[3] = Vertex(corner[3], n, Math::Point(texInf.x, texInf.y));
}
device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, vertex, 4);
device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, vertex, 4);
m_engine->AddStatisticTriangle(2);
p1 = p2;

View File

@ -2663,7 +2663,7 @@ void CParticle::TrackDraw(int i, ParticleType type)
vertex[3] = Vertex(corner[3], n, Math::Point(texInf.x, texInf.y));
}
m_device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, vertex, 4);
m_device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, vertex, 4);
m_engine->AddStatisticTriangle(2);
if (f2 < 0.0f) break;
@ -2695,7 +2695,7 @@ void CParticle::DrawParticleTriangle(int i)
mat.Set(3, 4, pos.z);
m_device->SetTransform(TRANSFORM_WORLD, mat);
m_device->DrawPrimitive(PRIMITIVE_TRIANGLES, m_triangle[i].triangle, 3);
m_device->DrawPrimitive(PrimitiveType::TRIANGLES, m_triangle[i].triangle, 3);
m_engine->AddStatisticTriangle(1);
}
@ -2741,7 +2741,7 @@ void CParticle::DrawParticleNorm(int i)
vertex[2] = Vertex(corner[3], n, Math::Point(m_particle[i].texSup.x, m_particle[i].texInf.y));
vertex[3] = Vertex(corner[2], n, Math::Point(m_particle[i].texInf.x, m_particle[i].texInf.y));
m_device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, vertex, 4);
m_device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, vertex, 4);
m_engine->AddStatisticTriangle(2);
}
else
@ -2792,7 +2792,7 @@ void CParticle::DrawParticleNorm(int i)
vertex[2] = Vertex(corner[3], n, Math::Point(m_particle[i].texSup.x, m_particle[i].texInf.y));
vertex[3] = Vertex(corner[2], n, Math::Point(m_particle[i].texInf.x, m_particle[i].texInf.y));
m_device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, vertex, 4, m_particle[i].color);
m_device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, vertex, 4, m_particle[i].color);
m_engine->AddStatisticTriangle(2);
}
}
@ -2856,7 +2856,7 @@ void CParticle::DrawParticleFlat(int i)
vertex[2] = Vertex(corner[3], n, Math::Point(m_particle[i].texSup.x, m_particle[i].texInf.y));
vertex[3] = Vertex(corner[2], n, Math::Point(m_particle[i].texInf.x, m_particle[i].texInf.y));
m_device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, vertex, 4);
m_device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, vertex, 4);
m_engine->AddStatisticTriangle(2);
}
@ -2943,7 +2943,7 @@ void CParticle::DrawParticleFog(int i)
vertex[2] = Vertex(corner[3], n, Math::Point(m_particle[i].texSup.x, m_particle[i].texInf.y));
vertex[3] = Vertex(corner[2], n, Math::Point(m_particle[i].texInf.x, m_particle[i].texInf.y));
m_device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, vertex, 4);
m_device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, vertex, 4);
m_engine->AddStatisticTriangle(2);
}
@ -3097,7 +3097,7 @@ void CParticle::DrawParticleRay(int i)
vertex[2] = Vertex(corner[3], n, Math::Point(texSup.x, texInf.y));
vertex[3] = Vertex(corner[2], n, Math::Point(texInf.x, texInf.y));
m_device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, vertex, 4);
m_device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, vertex, 4);
m_engine->AddStatisticTriangle(2);
}
adv += dim.x*2.0f;
@ -3197,7 +3197,7 @@ void CParticle::DrawParticleSphere(int i)
}
}
m_device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, vertex, j);
m_device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, vertex, j);
m_engine->AddStatisticTriangle(j);
m_engine->SetState(ENG_RSTATE_TTEXTURE_BLACK, IntensityToColor(m_particle[i].intensity));
@ -3292,7 +3292,7 @@ void CParticle::DrawParticleCylinder(int i)
}
}
m_device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, vertex, j);
m_device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, vertex, j);
m_engine->AddStatisticTriangle(j);
m_engine->SetState(ENG_RSTATE_TTEXTURE_BLACK, IntensityToColor(m_particle[i].intensity));
@ -3349,7 +3349,7 @@ void CParticle::DrawParticleWheel(int i)
vertex[2] = Vertex(pos[2], n, Math::Point(ts.x, ti.y));
vertex[3] = Vertex(pos[3], n, Math::Point(ti.x, ti.y));
m_device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, vertex, 4, TraceColorColor(m_wheelTrace[i].color));
m_device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, vertex, 4, TraceColorColor(m_wheelTrace[i].color));
m_engine->AddStatisticTriangle(2);
m_engine->SetState(ENG_RSTATE_OPAQUE_COLOR);
@ -3370,7 +3370,7 @@ void CParticle::DrawParticleWheel(int i)
vertex[2] = Vertex(pos[2], n);
vertex[3] = Vertex(pos[3], n);
m_device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, vertex, 4, TraceColorColor(m_wheelTrace[i].color));
m_device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, vertex, 4, TraceColorColor(m_wheelTrace[i].color));
m_engine->AddStatisticTriangle(2);
}
}

View File

@ -147,7 +147,7 @@ void CPlanet::Draw()
Vertex(Math::Vector(p2.x, p2.y, 0.0f), n, Math::Point(u2, v1))
};
device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, quad, 4);
device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, quad, 4);
m_engine->AddStatisticTriangle(2);
}
}

View File

@ -153,13 +153,13 @@ public:
for (const auto& quad : m_quads)
{
m_engine.GetDevice()->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, quad.vertices, 4);
m_engine.GetDevice()->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, quad.vertices, 4);
}
m_engine.GetDevice()->GetUIRenderer()->Flush();
//const Vertex* vertices = m_quads.front().vertices;
//m_engine.GetDevice()->DrawPrimitives(PRIMITIVE_TRIANGLE_STRIP, vertices, m_firsts.data(),
//m_engine.GetDevice()->DrawPrimitives(PrimitiveType::TRIANGLE_STRIP, vertices, m_firsts.data(),
// m_counts.data(), static_cast<int>(m_quads.size()), m_color);
m_engine.AddStatisticTriangle(static_cast<int>(m_quads.size() * 2));
m_quads.clear();
@ -1019,7 +1019,7 @@ void CText::DrawHighlight(FontMetaChar hl, Math::IntPoint pos, Math::IntPoint si
VertexCol(Math::Vector(p2.x, p1.y, 0.0f), grad[1])
};
m_device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, quad, 4);
m_device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, quad, 4);
m_engine->AddStatisticTriangle(2);
m_device->SetTextureEnabled(0, true);

View File

@ -306,7 +306,7 @@ void CWater::DrawBack()
VertexCol(Math::Vector(p2.x, p1.y, p2.z), white)
};
device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, vertices, 4);
device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, vertices, 4);
m_engine->AddStatisticTriangle(2);
m_engine->SetDeepView(deep, 0);
@ -420,7 +420,7 @@ void CWater::DrawSurf()
pos.x += size*2.0f;
}
device->DrawPrimitive(PRIMITIVE_TRIANGLE_STRIP, &vertices[0], vertexIndex);
device->DrawPrimitive(PrimitiveType::TRIANGLE_STRIP, &vertices[0], vertexIndex);
m_engine->AddStatisticTriangle(vertexIndex - 2);
}

View File

@ -140,12 +140,12 @@ void CGL33Device::DebugLights()
v[0].coord.y += 10.0f;
v[1].coord.y += 10.0f;
}
DrawPrimitive(PRIMITIVE_LINES, v, 2);
DrawPrimitive(PrimitiveType::LINES, v, 2);
v[0].coord = v[1].coord + Math::Normalize(v[0].coord - v[1].coord) * 50.0f;
glLineWidth(10.0f);
DrawPrimitive(PRIMITIVE_LINES, v, 2);
DrawPrimitive(PrimitiveType::LINES, v, 2);
glLineWidth(3.0f);
}
else if (l.type == LIGHT_POINT)
@ -159,14 +159,14 @@ void CGL33Device::DebugLights()
v[2].coord = l.position + Math::Vector( 1.0f, 1.0f, -1.0f) * 4.0f;
v[3].coord = l.position + Math::Vector(-1.0f, 1.0f, -1.0f) * 4.0f;
v[4].coord = l.position + Math::Vector(-1.0f, -1.0f, -1.0f) * 4.0f;
DrawPrimitive(PRIMITIVE_LINE_STRIP, v, 5);
DrawPrimitive(PrimitiveType::LINE_STRIP, v, 5);
v[0].coord = l.position + Math::Vector(-1.0f, -1.0f, 1.0f) * 4.0f;
v[1].coord = l.position + Math::Vector( 1.0f, -1.0f, 1.0f) * 4.0f;
v[2].coord = l.position + Math::Vector( 1.0f, 1.0f, 1.0f) * 4.0f;
v[3].coord = l.position + Math::Vector(-1.0f, 1.0f, 1.0f) * 4.0f;
v[4].coord = l.position + Math::Vector(-1.0f, -1.0f, 1.0f) * 4.0f;
DrawPrimitive(PRIMITIVE_LINE_STRIP, v, 5);
DrawPrimitive(PrimitiveType::LINE_STRIP, v, 5);
v[0].coord = l.position + Math::Vector(-1.0f, -1.0f, -1.0f) * 4.0f;
v[1].coord = l.position + Math::Vector(-1.0f, -1.0f, 1.0f) * 4.0f;
@ -176,7 +176,7 @@ void CGL33Device::DebugLights()
v[5].coord = l.position + Math::Vector( 1.0f, 1.0f, 1.0f) * 4.0f;
v[6].coord = l.position + Math::Vector(-1.0f, 1.0f, -1.0f) * 4.0f;
v[7].coord = l.position + Math::Vector(-1.0f, 1.0f, 1.0f) * 4.0f;
DrawPrimitive(PRIMITIVE_LINES, v, 8);
DrawPrimitive(PrimitiveType::LINES, v, 8);
}
else if (l.type == LIGHT_SPOT)
{
@ -189,13 +189,13 @@ void CGL33Device::DebugLights()
v[2].coord = l.position + Math::Vector( 1.0f, 0.0f, 1.0f) * 4.0f;
v[3].coord = l.position + Math::Vector(-1.0f, 0.0f, 1.0f) * 4.0f;
v[4].coord = l.position + Math::Vector(-1.0f, 0.0f, -1.0f) * 4.0f;
DrawPrimitive(PRIMITIVE_LINE_STRIP, v, 5);
DrawPrimitive(PrimitiveType::LINE_STRIP, v, 5);
v[0].coord = l.position;
v[1].coord = l.position + Math::Normalize(l.direction) * 100.0f;
glEnable(GL_LINE_STIPPLE);
glLineStipple(3.0, 0xFF);
DrawPrimitive(PRIMITIVE_LINES, v, 2);
DrawPrimitive(PrimitiveType::LINES, v, 2);
glDisable(GL_LINE_STIPPLE);
}
}

View File

@ -326,13 +326,13 @@ GLenum TranslateGfxPrimitive(PrimitiveType type)
GLenum flag = 0;
switch (type)
{
case PRIMITIVE_POINTS: flag = GL_POINTS; break;
case PRIMITIVE_LINES: flag = GL_LINES; break;
case PRIMITIVE_LINE_STRIP: flag = GL_LINE_STRIP; break;
case PRIMITIVE_LINE_LOOP: flag = GL_LINE_LOOP; break;
case PRIMITIVE_TRIANGLES: flag = GL_TRIANGLES; break;
case PRIMITIVE_TRIANGLE_STRIP: flag = GL_TRIANGLE_STRIP; break;
case PRIMITIVE_TRIANGLE_FAN: flag = GL_TRIANGLE_FAN; break;
case PrimitiveType::POINTS: flag = GL_POINTS; break;
case PrimitiveType::LINES: flag = GL_LINES; break;
case PrimitiveType::LINE_STRIP: flag = GL_LINE_STRIP; break;
case PrimitiveType::LINE_LOOP: flag = GL_LINE_LOOP; break;
case PrimitiveType::TRIANGLES: flag = GL_TRIANGLES; break;
case PrimitiveType::TRIANGLE_STRIP: flag = GL_TRIANGLE_STRIP; break;
case PrimitiveType::TRIANGLE_FAN: flag = GL_TRIANGLE_FAN; break;
default: assert(false); break;
}
return flag;

View File

@ -158,7 +158,7 @@ void CColor::Draw()
vertex[2] = { { p2.x, p1.y }, {}, col };
vertex[3] = { { p2.x, p2.y }, {}, col };
device->DrawPrimitive(Gfx::PRIMITIVE_TRIANGLE_STRIP, vertex, 4);
device->DrawPrimitive(Gfx::PrimitiveType::TRIANGLE_STRIP, vertex, 4);
m_engine->AddStatisticTriangle(2);
}

View File

@ -624,7 +624,7 @@ void CControl::DrawIcon(Math::Point pos, Math::Point dim, Math::Point uv1, Math:
vertex[2] = { { p2.x, p1.y }, { uv2.x, uv2.y } };
vertex[3] = { { p2.x, p2.y }, { uv2.x, uv1.y } };
device->DrawPrimitive(Gfx::PRIMITIVE_TRIANGLE_STRIP, vertex, 4);
device->DrawPrimitive(Gfx::PrimitiveType::TRIANGLE_STRIP, vertex, 4);
m_engine->AddStatisticTriangle(2);
}
else // 3 pieces?
@ -643,7 +643,7 @@ void CControl::DrawIcon(Math::Point pos, Math::Point dim, Math::Point uv1, Math:
vertex[6] = { { p2.x, p1.y }, { uv2.x, uv2.y } };
vertex[7] = { { p2.x, p2.y }, { uv2.x, uv1.y } };
device->DrawPrimitive(Gfx::PRIMITIVE_TRIANGLE_STRIP, vertex, 8);
device->DrawPrimitive(Gfx::PrimitiveType::TRIANGLE_STRIP, vertex, 8);
m_engine->AddStatisticTriangle(6);
}
else
@ -660,7 +660,7 @@ void CControl::DrawIcon(Math::Point pos, Math::Point dim, Math::Point uv1, Math:
vertex[6] = { { p2.x, p2.y }, { uv2.x, uv1.y } };
vertex[7] = { { p1.x, p2.y }, { uv1.x, uv1.y } };
device->DrawPrimitive(Gfx::PRIMITIVE_TRIANGLE_STRIP, vertex, 8);
device->DrawPrimitive(Gfx::PrimitiveType::TRIANGLE_STRIP, vertex, 8);
m_engine->AddStatisticTriangle(6);
}
}
@ -703,7 +703,7 @@ void CControl::DrawIcon(Math::Point pos, Math::Point dim, Math::Point uv1, Math:
vertices[6] = { { p2.x, p1.y }, { uv2.x, uv2.y } };
vertices[7] = { { p2.x, p3.y }, { uv2.x, uv2.y - ex } };
device->DrawPrimitive(Gfx::PRIMITIVE_TRIANGLE_STRIP, vertices, 8);
device->DrawPrimitive(Gfx::PrimitiveType::TRIANGLE_STRIP, vertices, 8);
m_engine->AddStatisticTriangle(6);
// Central horizontal band.
@ -716,7 +716,7 @@ void CControl::DrawIcon(Math::Point pos, Math::Point dim, Math::Point uv1, Math:
vertices[6] = { { p2.x, p3.y }, { uv2.x, uv2.y - ex } };
vertices[7] = { { p2.x, p4.y }, { uv2.x, uv1.y + ex } };
device->DrawPrimitive(Gfx::PRIMITIVE_TRIANGLE_STRIP, vertices, 8);
device->DrawPrimitive(Gfx::PrimitiveType::TRIANGLE_STRIP, vertices, 8);
m_engine->AddStatisticTriangle(6);
// Top horizontal band.
@ -729,7 +729,7 @@ void CControl::DrawIcon(Math::Point pos, Math::Point dim, Math::Point uv1, Math:
vertices[6] = { { p2.x, p4.y }, { uv2.x, uv1.y + ex } };
vertices[7] = { { p2.x, p2.y }, { uv2.x, uv1.y } };
device->DrawPrimitive(Gfx::PRIMITIVE_TRIANGLE_STRIP, vertices, 8);
device->DrawPrimitive(Gfx::PrimitiveType::TRIANGLE_STRIP, vertices, 8);
m_engine->AddStatisticTriangle(6);
}

View File

@ -1278,7 +1278,7 @@ void CEdit::DrawHorizontalGradient(Math::Point pos, Math::Point dim, Gfx::Color
{ { p2.x, p2.y }, {}, col2 }
};
m_engine->GetDevice()->DrawPrimitive(Gfx::PRIMITIVE_TRIANGLE_STRIP, quad, 4);
m_engine->GetDevice()->DrawPrimitive(Gfx::PrimitiveType::TRIANGLE_STRIP, quad, 4);
m_engine->AddStatisticTriangle(2);
}

View File

@ -965,7 +965,7 @@ void CMap::DrawTriangle(Math::Point p1, Math::Point p2, Math::Point p3, Math::Po
vertex[1] = { { p2.x, p2.y }, { uv1.x, uv2.y } };
vertex[2] = { { p3.x, p3.y }, { uv2.x, uv2.y } };
device->DrawPrimitive(Gfx::PRIMITIVE_TRIANGLES, vertex, 3);
device->DrawPrimitive(Gfx::PrimitiveType::TRIANGLES, vertex, 3);
m_engine->AddStatisticTriangle(1);
}
@ -983,7 +983,7 @@ void CMap::DrawPenta(Math::Point p1, Math::Point p2, Math::Point p3, Math::Point
vertex[3] = { { p3.x, p3.y }, { uv2.x, uv2.y } };
vertex[4] = { { p4.x, p4.y }, { uv2.x, uv2.y } };
device->DrawPrimitive(Gfx::PRIMITIVE_TRIANGLE_STRIP, vertex, 5);
device->DrawPrimitive(Gfx::PrimitiveType::TRIANGLE_STRIP, vertex, 5);
m_engine->AddStatisticTriangle(3);
}
@ -1019,7 +1019,7 @@ void CMap::DrawVertex(Math::Point uv1, Math::Point uv2, float zoom)
vertex[2] = { { p2.x, p1.y }, { uv2.x, uv2.y } };
vertex[3] = { { p2.x, p2.y }, { uv2.x, uv1.y } };
device->DrawPrimitive(Gfx::PRIMITIVE_TRIANGLE_STRIP, vertex, 4);
device->DrawPrimitive(Gfx::PrimitiveType::TRIANGLE_STRIP, vertex, 4);
m_engine->AddStatisticTriangle(2);
}

View File

@ -258,7 +258,7 @@ void CShortcut::DrawVertex(int icon, float zoom)
vertex[2] = { { p2.x, p1.y }, { u2, v2 } };
vertex[3] = { { p2.x, p2.y }, { u2, v1 } };
device->DrawPrimitive(Gfx::PRIMITIVE_TRIANGLE_STRIP, vertex, 4);
device->DrawPrimitive(Gfx::PrimitiveType::TRIANGLE_STRIP, vertex, 4);
m_engine->AddStatisticTriangle(2);
}