DXGL r673 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r672‎ | r673 | r674 >
Date:00:26, 24 July 2016
Author:admin
Status:new
Tags:
Comment:
Fix regression from r672, wasn't supposed to be flipped in the first place.
Modified paths:
  • /ddraw/glRenderer.cpp (modified) (history)

Diff [purge]

Index: ddraw/glRenderer.cpp
@@ -1936,6 +1936,7 @@
19371937 glTexture *ztexture = NULL;
19381938 GLint zlevel = 0;
19391939 GLfloat mulx, muly;
 1940+ GLsizei x1, y1, x2, y2;
19401941 if (cmd->zbuffer)
19411942 {
19421943 ztexture = cmd->zbuffer;
@@ -1974,13 +1975,15 @@
19751976 if (cmd->targetlevel == 0 && (cmd->target->levels[0].ddsd.dwWidth != cmd->target->bigwidth) ||
19761977 (cmd->target->levels[0].ddsd.dwHeight != cmd->target->bigheight))
19771978 {
1978 - mulx = cmd->target->bigwidth / cmd->target->levels[0].ddsd.dwWidth;
1979 - muly = cmd->target->bigheight / cmd->target->levels[0].ddsd.dwHeight;
 1979+ mulx = (GLfloat)cmd->target->bigwidth / (GLfloat)cmd->target->levels[0].ddsd.dwWidth;
 1980+ muly = (GLfloat)cmd->target->bigheight / (GLfloat)cmd->target->levels[0].ddsd.dwHeight;
19801981 for (DWORD i = 0; i < cmd->dwCount; i++)
19811982 {
1982 - glUtil_SetScissor(This->util, TRUE, cmd->lpRects[i].x1*mulx,
1983 - (cmd->target->bigheight - (GLsizei)((GLfloat)cmd->lpRects[i].y1*muly)),
1984 - cmd->lpRects[i].x2*mulx, (cmd->target->bigheight - ((GLfloat)cmd->lpRects[i].y2*muly)));
 1983+ x1 = (GLsizei)((GLfloat)cmd->lpRects[i].x1) * mulx;
 1984+ x2 = ((GLsizei)((GLfloat)cmd->lpRects[i].x2) * mulx) - x1;
 1985+ y1 = (GLsizei)((GLfloat)cmd->lpRects[i].y1) * muly;
 1986+ y2 = ((GLsizei)((GLfloat)cmd->lpRects[i].y2) * muly) - y1;
 1987+ glUtil_SetScissor(This->util, TRUE, x1, y1, x2, y2);
19851988 glClear(clearbits);
19861989 }
19871990 }
@@ -1988,10 +1991,8 @@
19891992 {
19901993 for (DWORD i = 0; i < cmd->dwCount; i++)
19911994 {
1992 - glUtil_SetScissor(This->util, TRUE, cmd->lpRects[i].x1,
1993 - cmd->target->levels[cmd->targetlevel].ddsd.dwHeight - cmd->lpRects[i].y1,
1994 - cmd->lpRects[i].x2,
1995 - cmd->target->levels[cmd->targetlevel].ddsd.dwHeight - cmd->lpRects[i].y2);
 1995+ glUtil_SetScissor(This->util, TRUE, cmd->lpRects[i].x1, cmd->lpRects[i].y1,
 1996+ (cmd->lpRects[i].x2 - cmd->lpRects[i].x1), cmd->lpRects[i].y2 - cmd->lpRects[i].y1);
19961997 glClear(clearbits);
19971998 }
19981999 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r672Isolate glRenderer__Clear from DDraw surface structure....admin23:19, 23 July 2016