diff options
| author | nodchip <nodchip@gmail.com> | 2010-02-28 08:41:02 +0000 |
|---|---|---|
| committer | nodchip <nodchip@gmail.com> | 2010-02-28 08:41:02 +0000 |
| commit | d348c33bf2f094ac8c541ee459e4edb029da4fb4 (patch) | |
| tree | 1afc0e06fffed611f49d855e1ad9dfe5337faf09 /Source/Core/VideoCommon/Src/VertexLoader_Position.cpp | |
| parent | ff8ce634e38e960234281134d668631439b17ab2 (diff) | |
Refactored VertexLoader::CompileVertexTranslator(). Now the vertex position loader is selected from a function table. I will apply the same kind of refactoring to texture coordinates loader. This is a pre-preparation to optimize texture coordinates loaders.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5139 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/VertexLoader_Position.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/VertexLoader_Position.cpp | 66 |
1 files changed, 62 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/Src/VertexLoader_Position.cpp b/Source/Core/VideoCommon/Src/VertexLoader_Position.cpp index 907a84cca9..b47567beed 100644 --- a/Source/Core/VideoCommon/Src/VertexLoader_Position.cpp +++ b/Source/Core/VideoCommon/Src/VertexLoader_Position.cpp @@ -15,9 +15,6 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ -#ifndef VERTEXLOADER_POSITION_H -#define VERTEXLOADER_POSITION_H - #include "Common.h" #include "VideoCommon.h" #include "VertexLoader.h" @@ -191,4 +188,65 @@ void LOADERDECL Pos_ReadIndex16_UShort2() {Pos_ReadIndex_Short<u16, false>(DataR void LOADERDECL Pos_ReadIndex16_Short2() {Pos_ReadIndex_Short<s16, false>(DataReadU16());} void LOADERDECL Pos_ReadIndex16_Float2() {Pos_ReadIndex_Float<false> (DataReadU16());} -#endif +ReadPosision tableReadPosition[4][8][2] = { + { + {NULL, NULL,}, + {NULL, NULL,}, + {NULL, NULL,}, + {NULL, NULL,}, + {NULL, NULL,}, + }, + { + {Pos_ReadDirect_UByte2, Pos_ReadDirect_UByte3,}, + {Pos_ReadDirect_Byte2, Pos_ReadDirect_Byte3,}, + {Pos_ReadDirect_UShort2, Pos_ReadDirect_UShort3,}, + {Pos_ReadDirect_Short2, Pos_ReadDirect_Short3,}, + {Pos_ReadDirect_Float2, Pos_ReadDirect_Float3,}, + }, + { + {Pos_ReadIndex8_UByte2, Pos_ReadIndex8_UByte3,}, + {Pos_ReadIndex8_Byte2, Pos_ReadIndex8_Byte3,}, + {Pos_ReadIndex8_UShort2, Pos_ReadIndex8_UShort3,}, + {Pos_ReadIndex8_Short2, Pos_ReadIndex8_Short3,}, + {Pos_ReadIndex8_Float2, Pos_ReadIndex8_Float3,}, + }, + { + {Pos_ReadIndex16_UByte2, Pos_ReadIndex16_UByte3,}, + {Pos_ReadIndex16_Byte2, Pos_ReadIndex16_Byte3,}, + {Pos_ReadIndex16_UShort2, Pos_ReadIndex16_UShort3,}, + {Pos_ReadIndex16_Short2, Pos_ReadIndex16_Short3,}, + {Pos_ReadIndex16_Float2, Pos_ReadIndex16_Float3,}, + }, +}; + +int tableVertexSize[4][8][2] = { + { + {0, 0,}, + {0, 0,}, + {0, 0,}, + {0, 0,}, + {0, 0,}, + }, + { + {2, 3,}, + {2, 3,}, + {4, 6,}, + {4, 6,}, + {8, 12,}, + }, + { + {1, 1,}, + {1, 1,}, + {1, 1,}, + {1, 1,}, + {1, 1,}, + }, + { + {2, 2,}, + {2, 2,}, + {2, 2,}, + {2, 2,}, + {2, 2,}, + }, +}; + |
