mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 05:17:40 -07:00
Merge a371c8f1e0
into 7c1d2a64f4
This commit is contained in:
commit
e9d061eaca
@ -849,6 +849,8 @@ int ClipAgainstPlane(const GPU3D& gpu, Vertex* vertices, int nverts, int clipsta
|
|||||||
temp[1] = vertices[1];
|
temp[1] = vertices[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vertex holdit;
|
||||||
|
bool heldit = false;
|
||||||
for (int i = clipstart; i < nverts; i++)
|
for (int i = clipstart; i < nverts; i++)
|
||||||
{
|
{
|
||||||
prev = i-1; if (prev < 0) prev = nverts-1;
|
prev = i-1; if (prev < 0) prev = nverts-1;
|
||||||
@ -862,8 +864,16 @@ int ClipAgainstPlane(const GPU3D& gpu, Vertex* vertices, int nverts, int clipsta
|
|||||||
Vertex* vprev = &vertices[prev];
|
Vertex* vprev = &vertices[prev];
|
||||||
if (vprev->Position[comp] <= vprev->Position[3])
|
if (vprev->Position[comp] <= vprev->Position[3])
|
||||||
{
|
{
|
||||||
ClipSegment<comp, 1, attribs>(&temp[c], &vtx, vprev);
|
if (i == 0)
|
||||||
c++;
|
{
|
||||||
|
ClipSegment<comp, 1, attribs>(&holdit, &vtx, vprev);
|
||||||
|
heldit = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ClipSegment<comp, 1, attribs>(&temp[c], &vtx, vprev);
|
||||||
|
c++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Vertex* vnext = &vertices[next];
|
Vertex* vnext = &vertices[next];
|
||||||
@ -877,6 +887,12 @@ int ClipAgainstPlane(const GPU3D& gpu, Vertex* vertices, int nverts, int clipsta
|
|||||||
temp[c++] = vtx;
|
temp[c++] = vtx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (heldit)
|
||||||
|
{
|
||||||
|
temp[c++] = holdit;
|
||||||
|
}
|
||||||
|
heldit = false;
|
||||||
|
|
||||||
nverts = c; c = clipstart;
|
nverts = c; c = clipstart;
|
||||||
for (int i = clipstart; i < nverts; i++)
|
for (int i = clipstart; i < nverts; i++)
|
||||||
{
|
{
|
||||||
@ -889,8 +905,17 @@ int ClipAgainstPlane(const GPU3D& gpu, Vertex* vertices, int nverts, int clipsta
|
|||||||
Vertex* vprev = &temp[prev];
|
Vertex* vprev = &temp[prev];
|
||||||
if (vprev->Position[comp] >= -vprev->Position[3])
|
if (vprev->Position[comp] >= -vprev->Position[3])
|
||||||
{
|
{
|
||||||
ClipSegment<comp, -1, attribs>(&vertices[c], &vtx, vprev);
|
|
||||||
c++;
|
if (i == 0)
|
||||||
|
{
|
||||||
|
ClipSegment<comp, -1, attribs>(&holdit, &vtx, vprev);
|
||||||
|
heldit = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ClipSegment<comp, -1, attribs>(&vertices[c], &vtx, vprev);
|
||||||
|
c++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Vertex* vnext = &temp[next];
|
Vertex* vnext = &temp[next];
|
||||||
@ -903,6 +928,11 @@ int ClipAgainstPlane(const GPU3D& gpu, Vertex* vertices, int nverts, int clipsta
|
|||||||
else
|
else
|
||||||
vertices[c++] = vtx;
|
vertices[c++] = vtx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (heldit)
|
||||||
|
{
|
||||||
|
vertices[c++] = holdit;
|
||||||
|
}
|
||||||
|
|
||||||
// checkme
|
// checkme
|
||||||
for (int i = 0; i < c; i++)
|
for (int i = 0; i < c; i++)
|
||||||
|
Loading…
Reference in New Issue
Block a user