gfx3d: i've realized that the poly sorting must happen after clipping. there is no way to do this now, so to approximate really well, it, we will perspective divide the y values. fixes island of happiness shop menus.
This commit is contained in:
parent
119deba104
commit
4a19bac748
|
@ -2396,15 +2396,21 @@ static void gfx3d_doFlush()
|
||||||
|
|
||||||
//find the min and max y values for each poly.
|
//find the min and max y values for each poly.
|
||||||
//TODO - this could be a small waste of time if we are manual sorting the translucent polys
|
//TODO - this could be a small waste of time if we are manual sorting the translucent polys
|
||||||
|
//TODO - this _MUST_ be moved later in the pipeline, after clipping.
|
||||||
|
//the w-division here is just an approximation to fix the shop in harvest moon island of happiness
|
||||||
for(int i=0; i<polycount; i++)
|
for(int i=0; i<polycount; i++)
|
||||||
{
|
{
|
||||||
POLY &poly = polylist->list[i];
|
POLY &poly = polylist->list[i];
|
||||||
float verty = 0.0f;
|
float verty = vertlist->list[poly.vertIndexes[0]].y;
|
||||||
poly.miny = poly.maxy = vertlist->list[poly.vertIndexes[0]].y;
|
float vertw = vertlist->list[poly.vertIndexes[0]].w;
|
||||||
|
verty = (verty+vertw)/(2*vertw);
|
||||||
|
poly.miny = poly.maxy = (verty+vertw)/(2*vertw);
|
||||||
|
|
||||||
for(int j=1; j<poly.type; j++)
|
for(int j=1; j<poly.type; j++)
|
||||||
{
|
{
|
||||||
verty = vertlist->list[poly.vertIndexes[j]].y;
|
verty = vertlist->list[poly.vertIndexes[j]].y;
|
||||||
|
vertw = vertlist->list[poly.vertIndexes[j]].w;
|
||||||
|
verty = (verty+vertw)/(2*vertw);
|
||||||
poly.miny = min(poly.miny, verty);
|
poly.miny = min(poly.miny, verty);
|
||||||
poly.maxy = max(poly.maxy, verty);
|
poly.maxy = max(poly.maxy, verty);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue