DXGL r528 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
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 @@
347
347
refcount1 = 0;
348
348
refcountgamma = 0;
349
349
refcountcolor = 0;
350
+ mulx = (float)fakex / (float)ddsd.dwWidth;
351
+ muly = (float)fakey / (float)ddsd.dwHeight;
350
352
*error = DD_OK;
351
353
backbuffer = NULL;
352
354
if(ddsd.ddsCaps.dwCaps & DDSCAPS_COMPLEX)
Index: ddraw/glDirectDrawSurface.h
—
—
@@ -131,6 +131,7 @@
132
132
glDirect3DTexture1 *d3dt1;
133
133
DWORD flipcount;
134
134
DWORD fakex,fakey;
135
+ float mulx, muly;
135
136
DWORD dirty;
136
137
// dirty bits:
137
138
// 1 - Surface was locked
Index: ddraw/glRenderer.cpp
—
—
@@ -2024,7 +2024,10 @@
2025
2025
device->glDDS7->fbo.fbcolor = NULL;
2026
2026
device->glDDS7->fbo.fbz = NULL;
2027
2027
} 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));
2029
2032
This->util->SetDepthRange(device->viewport.dvMinZ,device->viewport.dvMaxZ);
2030
2033
if(device->renderstate[D3DRENDERSTATE_ALPHABLENDENABLE]) This->util->BlendEnable(true);
2031
2034
else This->util->BlendEnable(false);
Navigation menu
Personal tools
Log in
Namespaces
Special page
English
expanded
collapsed
Views
More
expanded
collapsed
Search
Navigation
Home
Main page
Recent changes
Random page
MediaWiki help
Introduction
Progress
Downloads
Source code
Build from source
AppDB
Bug reports
Forums
Tools
Special pages
Printable version