mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-10 21:16:24 +02:00
SoftGPU: Support flat shading for lines.
This commit is contained in:
1 parent
e4f2ff1464
commit
a26aaec528
1 file changed
+10
-3
@@ -1657,9 +1657,16 @@ void DrawLine(const VertexData &v0, const VertexData &v1)
|
||||
for (int i = 0; i <= steps; i++) {
|
||||
if (x >= scissorTL.x && y >= scissorTL.y && x <= scissorBR.x && y <= scissorBR.y) {
|
||||
// Interpolate between the two points.
|
||||
// TODO: gstate.getShadeMode() == GE_SHADE_GOURAUD
|
||||
Vec4<int> prim_color = (v0.color0 * (steps - i) + v1.color0 * i) / steps1;
|
||||
Vec3<int> sec_color = (v0.color1 * (steps - i) + v1.color1 * i) / steps1;
|
||||
Vec4<int> prim_color;
|
||||
Vec3<int> sec_color;
|
||||
if (gstate.getShadeMode() == GE_SHADE_GOURAUD) {
|
||||
prim_color = (v0.color0 * (steps - i) + v1.color0 * i) / steps1;
|
||||
sec_color = (v0.color1 * (steps - i) + v1.color1 * i) / steps1;
|
||||
} else {
|
||||
prim_color = v1.color0;
|
||||
sec_color = v1.color1;
|
||||
}
|
||||
|
||||
// TODO: UVGenMode?
|
||||
Vec2<float> tc = (v0.texturecoords * (float)(steps - i) + v1.texturecoords * (float)i) / steps1;
|
||||
|
||||
|
||||
Reference in new issue
Block a user