DXGL r528 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r527‎ | r528 | r529 >
Date:22:28, 9 September 2014
Author:admin
Status:new
Tags:
Comment:
Support 3D rendering to scaled primary surface.
Modified paths:
  • /ddraw/glDirectDrawSurface.cpp (modified) (history)
  • /ddraw/glDirectDrawSurface.h (modified) (history)
  • /ddraw/glRenderer.cpp (modified) (history)

Diff [purge]

Index: ddraw/glDirectDrawSurface.cpp
@@ -346,6 +346,8 @@
347347 refcount1 = 0;
348348 refcountgamma = 0;
349349 refcountcolor = 0;
 350+ mulx = (float)fakex / (float)ddsd.dwWidth;
 351+ muly = (float)fakey / (float)ddsd.dwHeight;
350352 *error = DD_OK;
351353 backbuffer = NULL;
352354 if(ddsd.ddsCaps.dwCaps & DDSCAPS_COMPLEX)
Index: ddraw/glDirectDrawSurface.h
@@ -131,6 +131,7 @@
132132 glDirect3DTexture1 *d3dt1;
133133 DWORD flipcount;
134134 DWORD fakex,fakey;
 135+ float mulx, muly;
135136 DWORD dirty;
136137 // dirty bits:
137138 // 1 - Surface was locked
Index: ddraw/glRenderer.cpp
@@ -2024,7 +2024,10 @@
20252025 device->glDDS7->fbo.fbcolor = NULL;
20262026 device->glDDS7->fbo.fbz = NULL;
20272027 } while (1);
2028 - This->util->SetViewport(device->viewport.dwX, device->viewport.dwY, device->viewport.dwWidth, device->viewport.dwHeight);
 2028+ This->util->SetViewport((int)((float)device->viewport.dwX*device->glDDS7->mulx),
 2029+ (int)((float)device->viewport.dwY*device->glDDS7->muly),
 2030+ (int)((float)device->viewport.dwWidth*device->glDDS7->mulx),
 2031+ (int)((float)device->viewport.dwHeight*device->glDDS7->muly));
20292032 This->util->SetDepthRange(device->viewport.dvMinZ,device->viewport.dvMaxZ);
20302033 if(device->renderstate[D3DRENDERSTATE_ALPHABLENDENABLE]) This->util->BlendEnable(true);
20312034 else This->util->BlendEnable(false);