diff options
| author | comex <comexk@gmail.com> | 2014-10-02 02:20:46 -0400 |
|---|---|---|
| committer | comex <comexk@gmail.com> | 2014-10-02 03:00:33 -0400 |
| commit | 7f6284c2fcea9d543b0eec44ea0f3ad36bd0c0aa (patch) | |
| tree | d73cbd161db505d2f2a03751a012790e4a832feb /Source/Core/VideoBackends/Software/Clipper.cpp | |
| parent | c98a3f62be12a7c6abaa0e1465382fdcb2efbab6 (diff) | |
Change a bunch of reference function arguments to pointers.
Per the coding style and sanity.
Diffstat (limited to 'Source/Core/VideoBackends/Software/Clipper.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Software/Clipper.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/Source/Core/VideoBackends/Software/Clipper.cpp b/Source/Core/VideoBackends/Software/Clipper.cpp index f0ef19cd4e..d498a5c355 100644 --- a/Source/Core/VideoBackends/Software/Clipper.cpp +++ b/Source/Core/VideoBackends/Software/Clipper.cpp @@ -113,10 +113,9 @@ namespace Clipper return cmask; } - static inline void AddInterpolatedVertex(float t, int out, int in, int& numVertices) + static inline void AddInterpolatedVertex(float t, int out, int in, int* numVertices) { - Vertices[numVertices]->Lerp(t, Vertices[out], Vertices[in]); - numVertices++; + Vertices[(*numVertices)++]->Lerp(t, Vertices[out], Vertices[in]); } #define DIFFERENT_SIGNS(x,y) ((x <= 0 && y > 0) || (x > 0 && y <= 0)) @@ -142,10 +141,10 @@ namespace Clipper if (DIFFERENT_SIGNS(dp, dpPrev)) { \ if (dp < 0) { \ float t = dp / (dp - dpPrev); \ - AddInterpolatedVertex(t, idx, idxPrev, numVertices); \ + AddInterpolatedVertex(t, idx, idxPrev, &numVertices); \ } else { \ float t = dpPrev / (dpPrev - dp); \ - AddInterpolatedVertex(t, idxPrev, idx, numVertices); \ + AddInterpolatedVertex(t, idxPrev, idx, &numVertices); \ } \ outlist[outcount++] = numVertices - 1; \ } \ @@ -187,7 +186,7 @@ namespace Clipper } \ } - static void ClipTriangle(int *indices, int &numIndices) + static void ClipTriangle(int *indices, int* numIndices) { int mask = 0; @@ -229,9 +228,9 @@ namespace Clipper indices[2] = inlist[2]; for (int j = 3; j < n; ++j) { - indices[numIndices++] = inlist[0]; - indices[numIndices++] = inlist[j - 1]; - indices[numIndices++] = inlist[j]; + indices[(*numIndices)++] = inlist[0]; + indices[(*numIndices)++] = inlist[j - 1]; + indices[(*numIndices)++] = inlist[j]; } } } @@ -276,13 +275,13 @@ namespace Clipper if (clip_mask[0]) { indices[0] = numVertices; - AddInterpolatedVertex(t0, 0, 1, numVertices); + AddInterpolatedVertex(t0, 0, 1, &numVertices); } if (clip_mask[1]) { indices[1] = numVertices; - AddInterpolatedVertex(t1, 1, 0, numVertices); + AddInterpolatedVertex(t1, 1, 0, &numVertices); } } @@ -315,7 +314,7 @@ namespace Clipper Vertices[2] = v2; } - ClipTriangle(indices, numIndices); + ClipTriangle(indices, &numIndices); for (int i = 0; i+3 <= numIndices; i+=3) { |
