summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/IndexGenerator.cpp
diff options
context:
space:
mode:
authorhrydgard <hrydgard@gmail.com>2009-09-19 13:14:55 +0000
committerhrydgard <hrydgard@gmail.com>2009-09-19 13:14:55 +0000
commit7a8f6bdd6dd4d6aaa101f0d935a021b8ad327e92 (patch)
treec79c19e4cfa718a4cb2e814f561a3de0f34f8987 /Source/Core/VideoCommon/Src/IndexGenerator.cpp
parentdae1a68bfc1d2f4e2b08cecb09afd94894e85262 (diff)
D3D various: "Safe texture cache" option, texture replace instead of destroy/create when possible, a commented out "optimization" that didn't speed things up (use DrawPrimitive instead of DrawIndexedPrimitive when possible), reduce code duplication in Flush(), don't periodically clean out the shader caches since it's not really beneficial - shaders are cheap to keep. some code cleanup.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4302 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/IndexGenerator.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/IndexGenerator.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/Src/IndexGenerator.cpp b/Source/Core/VideoCommon/Src/IndexGenerator.cpp
index f18356f8e7..b2dd3efd49 100644
--- a/Source/Core/VideoCommon/Src/IndexGenerator.cpp
+++ b/Source/Core/VideoCommon/Src/IndexGenerator.cpp
@@ -31,6 +31,8 @@ void IndexGenerator::Start(unsigned short *startptr)
ptr = startptr;
index = 0;
numPrims = 0;
+ adds = 0;
+ onlyLists = true;
}
void IndexGenerator::AddList(int numVerts)
@@ -45,6 +47,7 @@ void IndexGenerator::AddList(int numVerts)
}
index += numVerts;
numPrims += numTris;
+ adds++;
}
void IndexGenerator::AddStrip(int numVerts)
@@ -61,6 +64,8 @@ void IndexGenerator::AddStrip(int numVerts)
}
index += numVerts;
numPrims += numTris;
+ adds++;
+ onlyLists = false;
}
void IndexGenerator::AddLineList(int numVerts)
@@ -74,6 +79,7 @@ void IndexGenerator::AddLineList(int numVerts)
}
index += numVerts;
numPrims += numLines;
+ adds++;
}
void IndexGenerator::AddLineStrip(int numVerts)
@@ -87,9 +93,10 @@ void IndexGenerator::AddLineStrip(int numVerts)
}
index += numVerts;
numPrims += numLines;
+ adds++;
+ onlyLists = false;
}
-
void IndexGenerator::AddFan(int numVerts)
{
int numTris = numVerts - 2;
@@ -102,6 +109,8 @@ void IndexGenerator::AddFan(int numVerts)
}
index += numVerts;
numPrims += numTris;
+ adds++;
+ onlyLists = false;
}
void IndexGenerator::AddQuads(int numVerts)
@@ -119,10 +128,13 @@ void IndexGenerator::AddQuads(int numVerts)
}
index += numVerts;
numPrims += numTris;
+ adds++;
+ onlyLists = false;
}
-
-void IndexGenerator::AddPointList(int numVerts)
+void IndexGenerator::AddPoints(int numVerts)
{
index += numVerts;
-} \ No newline at end of file
+ numPrims += numVerts;
+ adds++;
+}