mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Merge pull request #2721 from raven02/patch-12
Fix render-to-texture sizing in SW T&L
This commit is contained in:
commit
72b13d91f8
1 changed files with 13 additions and 4 deletions
|
@ -521,6 +521,11 @@ void TransformDrawEngine::SoftwareTransformAndDraw(
|
|||
vscale /= gstate_c.curTextureHeight;
|
||||
}
|
||||
|
||||
int w = 1 << (gstate.texsize[0] & 0xf);
|
||||
int h = 1 << ((gstate.texsize[0] >> 8) & 0xf);
|
||||
float widthFactor = (float) w / (float) gstate_c.curTextureWidth;
|
||||
float heightFactor = (float) h / (float) gstate_c.curTextureHeight;
|
||||
|
||||
Lighter lighter;
|
||||
float fog_end = getFloat24(gstate.fog1);
|
||||
float fog_slope = getFloat24(gstate.fog2);
|
||||
|
@ -725,10 +730,14 @@ void TransformDrawEngine::SoftwareTransformAndDraw(
|
|||
memcpy(&transformed[index].x, v, 3 * sizeof(float));
|
||||
transformed[index].fog = fogCoef;
|
||||
memcpy(&transformed[index].u, uv, 3 * sizeof(float));
|
||||
|
||||
if (gstate_c.flipTexture)
|
||||
transformed[index].v = 1.0f - transformed[index].v;
|
||||
|
||||
if (gstate_c.flipTexture) {
|
||||
if (throughmode) {
|
||||
transformed[index].v = 1.0f - transformed[index].v;
|
||||
} else {
|
||||
transformed[index].u = transformed[index].u * (float) widthFactor ;
|
||||
transformed[index].v = 1.0f - transformed[index].v * (float) heightFactor;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 4; i++) {
|
||||
transformed[index].color0[i] = c0[i] * 255.0f;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue