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
This commit is contained in:
nodchip
2010-02-28 08:41:02 +00:00
parent ff8ce634e3
commit d348c33bf2
4 changed files with 88 additions and 113 deletions

View File

@ -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,},
},
};