mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Convert OpcodeDecoder::Opcode and OpcodeDecoder::Primitive to enum class
This commit is contained in:
@ -36,20 +36,21 @@ void SWVertexLoader::DrawCurrentBatch(u32 base_index, u32 num_indices, u32 base_
|
||||
{
|
||||
DebugUtil::OnObjectBegin();
|
||||
|
||||
u8 primitiveType = 0;
|
||||
using OpcodeDecoder::Primitive;
|
||||
Primitive primitive_type = Primitive::GX_DRAW_QUADS;
|
||||
switch (m_current_primitive_type)
|
||||
{
|
||||
case PrimitiveType::Points:
|
||||
primitiveType = OpcodeDecoder::GX_DRAW_POINTS;
|
||||
primitive_type = Primitive::GX_DRAW_POINTS;
|
||||
break;
|
||||
case PrimitiveType::Lines:
|
||||
primitiveType = OpcodeDecoder::GX_DRAW_LINES;
|
||||
primitive_type = Primitive::GX_DRAW_LINES;
|
||||
break;
|
||||
case PrimitiveType::Triangles:
|
||||
primitiveType = OpcodeDecoder::GX_DRAW_TRIANGLES;
|
||||
primitive_type = Primitive::GX_DRAW_TRIANGLES;
|
||||
break;
|
||||
case PrimitiveType::TriangleStrip:
|
||||
primitiveType = OpcodeDecoder::GX_DRAW_TRIANGLE_STRIP;
|
||||
primitive_type = Primitive::GX_DRAW_TRIANGLE_STRIP;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -57,7 +58,7 @@ void SWVertexLoader::DrawCurrentBatch(u32 base_index, u32 num_indices, u32 base_
|
||||
if (g_renderer->IsBBoxEnabled())
|
||||
g_renderer->BBoxFlush();
|
||||
|
||||
m_setup_unit.Init(primitiveType);
|
||||
m_setup_unit.Init(primitive_type);
|
||||
|
||||
// set all states with are stored within video sw
|
||||
for (int i = 0; i < 4; i++)
|
||||
|
@ -9,9 +9,9 @@
|
||||
#include "VideoBackends/Software/Clipper.h"
|
||||
#include "VideoCommon/OpcodeDecoding.h"
|
||||
|
||||
void SetupUnit::Init(u8 primitiveType)
|
||||
void SetupUnit::Init(OpcodeDecoder::Primitive primitive_type)
|
||||
{
|
||||
m_PrimType = primitiveType;
|
||||
m_PrimType = primitive_type;
|
||||
|
||||
m_VertexCounter = 0;
|
||||
m_VertPointer[0] = &m_Vertices[0];
|
||||
@ -28,31 +28,32 @@ OutputVertexData* SetupUnit::GetVertex()
|
||||
|
||||
void SetupUnit::SetupVertex()
|
||||
{
|
||||
using OpcodeDecoder::Primitive;
|
||||
switch (m_PrimType)
|
||||
{
|
||||
case OpcodeDecoder::GX_DRAW_QUADS:
|
||||
case Primitive::GX_DRAW_QUADS:
|
||||
SetupQuad();
|
||||
break;
|
||||
case OpcodeDecoder::GX_DRAW_QUADS_2:
|
||||
case Primitive::GX_DRAW_QUADS_2:
|
||||
WARN_LOG_FMT(VIDEO, "Non-standard primitive drawing command GL_DRAW_QUADS_2");
|
||||
SetupQuad();
|
||||
break;
|
||||
case OpcodeDecoder::GX_DRAW_TRIANGLES:
|
||||
case Primitive::GX_DRAW_TRIANGLES:
|
||||
SetupTriangle();
|
||||
break;
|
||||
case OpcodeDecoder::GX_DRAW_TRIANGLE_STRIP:
|
||||
case Primitive::GX_DRAW_TRIANGLE_STRIP:
|
||||
SetupTriStrip();
|
||||
break;
|
||||
case OpcodeDecoder::GX_DRAW_TRIANGLE_FAN:
|
||||
case Primitive::GX_DRAW_TRIANGLE_FAN:
|
||||
SetupTriFan();
|
||||
break;
|
||||
case OpcodeDecoder::GX_DRAW_LINES:
|
||||
case Primitive::GX_DRAW_LINES:
|
||||
SetupLine();
|
||||
break;
|
||||
case OpcodeDecoder::GX_DRAW_LINE_STRIP:
|
||||
case Primitive::GX_DRAW_LINE_STRIP:
|
||||
SetupLineStrip();
|
||||
break;
|
||||
case OpcodeDecoder::GX_DRAW_POINTS:
|
||||
case Primitive::GX_DRAW_POINTS:
|
||||
SetupPoint();
|
||||
break;
|
||||
}
|
||||
|
@ -6,9 +6,14 @@
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "VideoBackends/Software/NativeVertexFormat.h"
|
||||
|
||||
namespace OpcodeDecoder
|
||||
{
|
||||
enum class Primitive : u8;
|
||||
}
|
||||
|
||||
class SetupUnit
|
||||
{
|
||||
u8 m_PrimType = 0;
|
||||
OpcodeDecoder::Primitive m_PrimType{};
|
||||
int m_VertexCounter = 0;
|
||||
|
||||
OutputVertexData m_Vertices[3];
|
||||
@ -24,7 +29,7 @@ class SetupUnit
|
||||
void SetupPoint();
|
||||
|
||||
public:
|
||||
void Init(u8 primitiveType);
|
||||
void Init(OpcodeDecoder::Primitive primitive_type);
|
||||
|
||||
OutputVertexData* GetVertex();
|
||||
|
||||
|
Reference in New Issue
Block a user