mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Clean up no-inds rectange preview.
This commit is contained in:
parent
fcc77f525f
commit
5c08ab6bca
1 changed files with 10 additions and 10 deletions
|
@ -86,23 +86,23 @@ static void ExpandRectangles(std::vector<GPUDebugVertex> &vertices, std::vector<
|
||||||
static std::vector<GPUDebugVertex> newVerts;
|
static std::vector<GPUDebugVertex> newVerts;
|
||||||
static std::vector<u16> newInds;
|
static std::vector<u16> newInds;
|
||||||
|
|
||||||
|
bool useInds = true;
|
||||||
|
size_t numInds = indices.size();
|
||||||
if (indices.empty()) {
|
if (indices.empty()) {
|
||||||
// Ugh, let's just go the easy way.
|
useInds = false;
|
||||||
indices.resize(count);
|
numInds = count;
|
||||||
for (int i = 0; i < count; ++i) {
|
|
||||||
indices[i] = i;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
newVerts.resize(indices.size() * 2);
|
// Will need 4 coords and 6 points per rectangle (currently 2 each.)
|
||||||
newInds.resize(indices.size() * 3);
|
newVerts.resize(numInds * 2);
|
||||||
|
newInds.resize(numInds * 3);
|
||||||
|
|
||||||
u16 v = 0;
|
u16 v = 0;
|
||||||
GPUDebugVertex *vert = &newVerts[0];
|
GPUDebugVertex *vert = &newVerts[0];
|
||||||
u16 *ind = &newInds[0];
|
u16 *ind = &newInds[0];
|
||||||
for (size_t i = 0, end = indices.size(); i < end; i += 2) {
|
for (size_t i = 0, end = numInds; i < end; i += 2) {
|
||||||
const auto &orig_tl = vertices[indices[i]];
|
const auto &orig_tl = useInds ? vertices[indices[i]] : vertices[i];
|
||||||
const auto &orig_br = vertices[indices[i + 1]];
|
const auto &orig_br = useInds ? vertices[indices[i + 1]] : vertices[i + 1];
|
||||||
|
|
||||||
vert[0] = orig_br;
|
vert[0] = orig_br;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue