Skip to content

Commit

Permalink
Fix Render-to-texture sizing in SW T&L
Browse files Browse the repository at this point in the history
  • Loading branch information
raven02 committed Jul 9, 2013
1 parent 7c3e171 commit dca4b1e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions GPU/GLES/TransformPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -725,9 +725,19 @@ void TransformDrawEngine::SoftwareTransformAndDraw(
memcpy(&transformed[index].x, v, 3 * sizeof(float));
transformed[index].fog = fogCoef;
memcpy(&transformed[index].u, uv, 3 * sizeof(float));
int w = 1 << (gstate.texsize[0] & 0xf);
int h = 1 << ((gstate.texsize[0] >> 8) & 0xf);

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 {
int widthFactor = gstate_c.curTextureWidth/w ;
int heightFactor = gstate_c.curTextureHeight/h;
transformed[index].u = transformed[index].u / widthFactor ;
transformed[index].v = 1.0f - transformed[index].v / heightFactor;
}
}

for (int i = 0; i < 4; i++) {
transformed[index].color0[i] = c0[i] * 255.0f;
Expand Down

0 comments on commit dca4b1e

Please sign in to comment.