DXGL r706 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r705‎ | r706 | r707 >
Date:19:10, 29 May 2017
Author:admin
Status:new
Tags:
Comment:
Fix First scale in stretch and aspect modes.
Modified paths:
  • /ddraw/glDirectDraw.cpp (modified) (history)
  • /ddraw/glRenderer.cpp (modified) (history)

Diff [purge]

Index: ddraw/glDirectDraw.cpp
@@ -1698,8 +1698,10 @@
16991699 {
17001700 case DISP_CHANGE_SUCCESSFUL:
17011701 if (fullscreen) this->currmode = newmode;
1702 - primaryx = screenx = newmode.dmPelsWidth / xscale;
1703 - primaryy = screeny = newmode.dmPelsHeight / yscale;
 1702+ primaryx = newmode.dmPelsWidth / xscale;
 1703+ screenx = newmode.dmPelsWidth;
 1704+ primaryy = newmode.dmPelsHeight / yscale;
 1705+ screeny = newmode.dmPelsHeight;
17041706 internalx = newmode.dmPelsWidth;
17051707 internaly = newmode.dmPelsHeight;
17061708 internalbpp = screenbpp = newmode.dmBitsPerPel;
Index: ddraw/glRenderer.cpp
@@ -3356,12 +3356,12 @@
33573357 This->firstscaley = dxglcfg.firstscaley;
33583358 }
33593359 viewport[0] = viewport[1] = 0;
3360 - viewport[2] = sizes[4]*This->firstscalex;
3361 - viewport[3] = sizes[5]*This->firstscaley;
3362 - view[0] = (GLfloat)-((sizes[4]*This->firstscalex)-sizes[0])/2;
3363 - view[1] = (GLfloat)((sizes[4]*This->firstscalex)-sizes[0])/2+sizes[0];
3364 - view[2] = (GLfloat)((sizes[5]*This->firstscaley)-sizes[1])/2+sizes[1];
3365 - view[3] = (GLfloat)-((sizes[5]*This->firstscaley)-sizes[1])/2;
 3360+ viewport[2] = sizes[4];
 3361+ viewport[3] = sizes[5];
 3362+ view[0] = (GLfloat)-(sizes[4]-sizes[0])/2;
 3363+ view[1] = (GLfloat)(sizes[4]-sizes[0])/2+sizes[0];
 3364+ view[2] = (GLfloat)(sizes[5]-sizes[1])/2+sizes[1];
 3365+ view[3] = (GLfloat)-(sizes[5]-sizes[1])/2;
33663366 }
33673367 else
33683368 {