mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
D3D: Fix bugs in the shader cache, fixes crashes on x64. added some debugging stuff (only active in debug builds). assorted code cleanup.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4145 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -26,19 +26,18 @@ QUAD simulator
|
||||
021231 243453
|
||||
*/
|
||||
|
||||
|
||||
void IndexGenerator::Start(unsigned short *startptr)
|
||||
{
|
||||
ptr=startptr;
|
||||
index=0;
|
||||
numPrims=0;
|
||||
ptr = startptr;
|
||||
index = 0;
|
||||
numPrims = 0;
|
||||
}
|
||||
|
||||
void IndexGenerator::AddList(int numVerts)
|
||||
{
|
||||
int numTris = numVerts/3;
|
||||
if (numTris<=0) return;
|
||||
for (int i=0; i<numTris; i++)
|
||||
int numTris = numVerts / 3;
|
||||
if (numTris <= 0) return;
|
||||
for (int i = 0; i < numTris; i++)
|
||||
{
|
||||
*ptr++ = index+i*3;
|
||||
*ptr++ = index+i*3+1;
|
||||
@ -50,10 +49,10 @@ void IndexGenerator::AddList(int numVerts)
|
||||
|
||||
void IndexGenerator::AddStrip(int numVerts)
|
||||
{
|
||||
int numTris = numVerts-2;
|
||||
if (numTris<=0) return;
|
||||
int numTris = numVerts - 2;
|
||||
if (numTris <= 0) return;
|
||||
bool wind = false;
|
||||
for (int i=0; i<numTris; i++)
|
||||
for (int i = 0; i < numTris; i++)
|
||||
{
|
||||
*ptr++ = index+i;
|
||||
*ptr++ = index+i+(wind?2:1);
|
||||
@ -66,9 +65,9 @@ void IndexGenerator::AddStrip(int numVerts)
|
||||
|
||||
void IndexGenerator::AddLineList(int numVerts)
|
||||
{
|
||||
int numLines= numVerts/2;
|
||||
if (numLines<=0) return;
|
||||
for (int i=0; i<numLines; i++)
|
||||
int numLines= numVerts / 2;
|
||||
if (numLines <= 0) return;
|
||||
for (int i = 0; i < numLines; i++)
|
||||
{
|
||||
*ptr++ = index+i*2;
|
||||
*ptr++ = index+i*2+1;
|
||||
@ -79,9 +78,9 @@ void IndexGenerator::AddLineList(int numVerts)
|
||||
|
||||
void IndexGenerator::AddLineStrip(int numVerts)
|
||||
{
|
||||
int numLines = numVerts-1;
|
||||
if (numLines<=0) return;
|
||||
for (int i=0; i<numLines; i++)
|
||||
int numLines = numVerts - 1;
|
||||
if (numLines <= 0) return;
|
||||
for (int i = 0; i < numLines; i++)
|
||||
{
|
||||
*ptr++ = index+i;
|
||||
*ptr++ = index+i+1;
|
||||
@ -93,9 +92,9 @@ void IndexGenerator::AddLineStrip(int numVerts)
|
||||
|
||||
void IndexGenerator::AddFan(int numVerts)
|
||||
{
|
||||
int numTris = numVerts-2;
|
||||
if (numTris<=0) return;
|
||||
for (int i=0; i<numTris; i++)
|
||||
int numTris = numVerts - 2;
|
||||
if (numTris <= 0) return;
|
||||
for (int i = 0; i < numTris; i++)
|
||||
{
|
||||
*ptr++ = index;
|
||||
*ptr++ = index+i+1;
|
||||
@ -108,15 +107,15 @@ void IndexGenerator::AddFan(int numVerts)
|
||||
void IndexGenerator::AddQuads(int numVerts)
|
||||
{
|
||||
int numTris = (numVerts/4)*2;
|
||||
if (numTris<=0) return;
|
||||
for (int i=0; i<numTris/2; i++)
|
||||
if (numTris <= 0) return;
|
||||
for (int i = 0; i < numTris / 2; i++)
|
||||
{
|
||||
*ptr++=index+i*4;
|
||||
*ptr++=index+i*4+1;
|
||||
*ptr++=index+i*4+3;
|
||||
*ptr++=index+i*4+1;
|
||||
*ptr++=index+i*4+2;
|
||||
*ptr++=index+i*4+3;
|
||||
*ptr++ = index+i*4;
|
||||
*ptr++ = index+i*4+1;
|
||||
*ptr++ = index+i*4+3;
|
||||
*ptr++ = index+i*4+1;
|
||||
*ptr++ = index+i*4+2;
|
||||
*ptr++ = index+i*4+3;
|
||||
}
|
||||
index += numVerts;
|
||||
numPrims += numTris;
|
||||
|
Reference in New Issue
Block a user