mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
Templatify Normal Loader functions.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -79,36 +79,6 @@ private:
|
||||
};
|
||||
|
||||
static Set m_Table[NUM_NRM_TYPE][NUM_NRM_INDICES][NUM_NRM_ELEMENTS][NUM_NRM_FORMAT];
|
||||
|
||||
// direct
|
||||
static void LOADERDECL Normal_DirectByte();
|
||||
static void LOADERDECL Normal_DirectShort();
|
||||
static void LOADERDECL Normal_DirectFloat();
|
||||
static void LOADERDECL Normal_DirectByte3();
|
||||
static void LOADERDECL Normal_DirectShort3();
|
||||
static void LOADERDECL Normal_DirectFloat3();
|
||||
|
||||
// index8
|
||||
static void LOADERDECL Normal_Index8_Byte();
|
||||
static void LOADERDECL Normal_Index8_Short();
|
||||
static void LOADERDECL Normal_Index8_Float();
|
||||
static void LOADERDECL Normal_Index8_Byte3_Indices1();
|
||||
static void LOADERDECL Normal_Index8_Short3_Indices1();
|
||||
static void LOADERDECL Normal_Index8_Float3_Indices1();
|
||||
static void LOADERDECL Normal_Index8_Byte3_Indices3();
|
||||
static void LOADERDECL Normal_Index8_Short3_Indices3();
|
||||
static void LOADERDECL Normal_Index8_Float3_Indices3();
|
||||
|
||||
// index16
|
||||
static void LOADERDECL Normal_Index16_Byte();
|
||||
static void LOADERDECL Normal_Index16_Short();
|
||||
static void LOADERDECL Normal_Index16_Float();
|
||||
static void LOADERDECL Normal_Index16_Byte3_Indices1();
|
||||
static void LOADERDECL Normal_Index16_Short3_Indices1();
|
||||
static void LOADERDECL Normal_Index16_Float3_Indices1();
|
||||
static void LOADERDECL Normal_Index16_Byte3_Indices3();
|
||||
static void LOADERDECL Normal_Index16_Short3_Indices3();
|
||||
static void LOADERDECL Normal_Index16_Float3_Indices3();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -54,6 +54,8 @@ void LOADERDECL TexCoord_ReadDirect()
|
||||
template <typename I, typename T, int N>
|
||||
void LOADERDECL TexCoord_ReadIndex()
|
||||
{
|
||||
static_assert(!std::numeric_limits<I>::is_signed, "Only unsigned I is sane!");
|
||||
|
||||
auto const index = DataRead<I>();
|
||||
auto const data = reinterpret_cast<T*>(cached_arraybases[ARRAY_TEXCOORD0 + tcIndex] + (index * arraystrides[ARRAY_TEXCOORD0 + tcIndex]));
|
||||
reinterpret_cast<float*>(VertexManager::s_pCurBufferPointer)[0] = Common::FromBigEndian(data[0]) * tcScale[tcIndex];
|
||||
|
||||
Reference in New Issue
Block a user