summaryrefslogtreecommitdiff
path: root/src/renderergl2/tr_backend.c
diff options
context:
space:
mode:
authorSmileTheory <SmileTheory@gmail.com>2013-03-05 19:52:11 -0800
committerTim Angus <tim@ngus.net>2013-03-19 16:41:14 +0000
commit613beeac61078635e45fd2cb857cdb98ae9ae7ac (patch)
treee0bd94beca01293e3eaaa4c6cfa4013af399b4dc /src/renderergl2/tr_backend.c
parente02b6309db0b7d2f6e5c9788871330542653de54 (diff)
Simplify previous patch.
Diffstat (limited to 'src/renderergl2/tr_backend.c')
-rw-r--r--src/renderergl2/tr_backend.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/renderergl2/tr_backend.c b/src/renderergl2/tr_backend.c
index 47a35fc2..e83806ab 100644
--- a/src/renderergl2/tr_backend.c
+++ b/src/renderergl2/tr_backend.c
@@ -1186,18 +1186,18 @@ const void *RB_DrawSurfs( const void *data ) {
FBO_Bind(tr.screenShadowFbo);
- box[0] = (backEnd.refdef.x ) * tr.screenShadowFbo->width / (float)glConfig.vidWidth;
- box[1] = (glConfig.vidHeight - ( backEnd.refdef.y + backEnd.refdef.height )) * tr.screenShadowFbo->height / (float)glConfig.vidHeight;
- box[2] = (backEnd.refdef.width ) * tr.screenShadowFbo->width / (float)glConfig.vidWidth;
- box[3] = (backEnd.refdef.height) * tr.screenShadowFbo->height / (float)glConfig.vidHeight;
+ box[0] = backEnd.viewParms.viewportX * tr.screenShadowFbo->width / (float)glConfig.vidWidth;
+ box[1] = backEnd.viewParms.viewportY * tr.screenShadowFbo->height / (float)glConfig.vidHeight;
+ box[2] = backEnd.viewParms.viewportWidth * tr.screenShadowFbo->width / (float)glConfig.vidWidth;
+ box[3] = backEnd.viewParms.viewportHeight * tr.screenShadowFbo->height / (float)glConfig.vidHeight;
qglViewport(box[0], box[1], box[2], box[3]);
qglScissor(box[0], box[1], box[2], box[3]);
- box[0] = (backEnd.refdef.x ) / (float)glConfig.vidWidth;
- box[1] = 1.0 - (backEnd.refdef.y + backEnd.refdef.height) / (float)glConfig.vidHeight;
- box[2] = (backEnd.refdef.x + backEnd.refdef.width ) / (float)glConfig.vidWidth;
- box[3] = 1.0 - (backEnd.refdef.y ) / (float)glConfig.vidHeight;
+ box[0] = backEnd.viewParms.viewportX / (float)glConfig.vidWidth;
+ box[1] = backEnd.viewParms.viewportY / (float)glConfig.vidHeight;
+ box[2] = box[0] + backEnd.viewParms.viewportWidth / (float)glConfig.vidWidth;
+ box[3] = box[1] - backEnd.viewParms.viewportHeight / (float)glConfig.vidHeight;
texCoords[0][0] = box[0]; texCoords[0][1] = box[3];
texCoords[1][0] = box[2]; texCoords[1][1] = box[3];