fast commit :

make native mips loading an option to prevent performance lost in game that not need this functionality.( thanks to dorian.fevrier for point the performance lost.)
added a patch from  pierre@pirsoft.de to avoid vertex drops when index array is full in opengl implementation that do not support large index arrays

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5432 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Rodolfo Osvaldo Bogado
2010-05-04 14:43:30 +00:00
parent a8659054ac
commit 0ea01d8462
13 changed files with 83 additions and 18 deletions

View File

@ -126,9 +126,27 @@ int GetRemainingSize()
return MAXVBUFFERSIZE - (int)(s_pCurBufferPointer - LocalVBuffer);
}
int GetRemainingVertices(int primitive)
{
switch (primitive)
{
case GX_DRAW_QUADS:
case GX_DRAW_TRIANGLES:
case GX_DRAW_TRIANGLE_STRIP:
case GX_DRAW_TRIANGLE_FAN:
return (max_Index_size - IndexGenerator::GetTriangleindexLen())/3;
case GX_DRAW_LINE_STRIP:
case GX_DRAW_LINES:
return (max_Index_size - IndexGenerator::GetLineindexLen())/2;
case GX_DRAW_POINTS:
return (max_Index_size - IndexGenerator::GetPointindexLen());
default: return 0;
}
}
void AddVertices(int primitive, int numvertices)
{
if (numvertices < 0)
if (numvertices <= 0)
return;
switch (primitive)
{
@ -136,7 +154,7 @@ void AddVertices(int primitive, int numvertices)
case GX_DRAW_TRIANGLES:
case GX_DRAW_TRIANGLE_STRIP:
case GX_DRAW_TRIANGLE_FAN:
if(max_Index_size - IndexGenerator::GetTriangleindexLen() < 2 * numvertices)
if(max_Index_size - IndexGenerator::GetTriangleindexLen() < 3 * numvertices)
Flush();
break;
case GX_DRAW_LINE_STRIP: