Skip to content

Commit

Permalink
VertexLoader_TextCoord: Tidy up public function definitions
Browse files Browse the repository at this point in the history
We can use u32 instead of unsigned int to shorten up these definitions
and make them much nicer to read.

While we're at it, change the size array to house u32 elements
to match the return value of the function.
  • Loading branch information
lioncash committed May 30, 2019
1 parent 9569c79 commit 2452747
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
12 changes: 5 additions & 7 deletions Source/Core/VideoCommon/VertexLoader_TextCoord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ constexpr TPipelineFunction s_table_read_tex_coord[4][8][2] = {
},
};

constexpr int s_table_read_tex_coord_vertex_size[4][8][2] = {
constexpr u32 s_table_read_tex_coord_vertex_size[4][8][2] = {
{
{0, 0},
{0, 0},
Expand Down Expand Up @@ -211,16 +211,14 @@ constexpr int s_table_read_tex_coord_vertex_size[4][8][2] = {
};
} // Anonymous namespace

unsigned int VertexLoader_TextCoord::GetSize(u64 _type, unsigned int _format,
unsigned int _elements)
u32 VertexLoader_TextCoord::GetSize(u64 type, u32 format, u32 elements)
{
return s_table_read_tex_coord_vertex_size[_type][_format][_elements];
return s_table_read_tex_coord_vertex_size[type][format][elements];
}

TPipelineFunction VertexLoader_TextCoord::GetFunction(u64 _type, unsigned int _format,
unsigned int _elements)
TPipelineFunction VertexLoader_TextCoord::GetFunction(u64 type, u32 format, u32 elements)
{
return s_table_read_tex_coord[_type][_format][_elements];
return s_table_read_tex_coord[type][format][elements];
}

TPipelineFunction VertexLoader_TextCoord::GetDummyFunction()
Expand Down
7 changes: 2 additions & 5 deletions Source/Core/VideoCommon/VertexLoader_TextCoord.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@
class VertexLoader_TextCoord
{
public:
// GetSize
static unsigned int GetSize(u64 _type, unsigned int _format, unsigned int _elements);
static u32 GetSize(u64 type, u32 format, u32 elements);

// GetFunction
static TPipelineFunction GetFunction(u64 _type, unsigned int _format, unsigned int _elements);
static TPipelineFunction GetFunction(u64 type, u32 format, u32 elements);

// GetDummyFunction
// It is important to synchronize tcIndex.
static TPipelineFunction GetDummyFunction();
};

0 comments on commit 2452747

Please sign in to comment.