DXGL r780 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r779
|
r780
|
r781
>
Date:
02:43, 17 December 2017
Author:
admin
Status:
new
Tags:
Comment:
Add fixed and custom primary scaling.
Modified paths:
/ddraw/glDirectDrawSurface.cpp
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/glDirectDrawSurface.cpp
—
—
@@ -72,6 +72,7 @@
73
73
ddsd = *lpDDSurfaceDesc2;
74
74
miptexture = NULL;
75
75
LONG sizes[6];
76
+ int i;
76
77
float xscale, yscale;
77
78
ddInterface->GetSizes(sizes);
78
79
if(ddsd.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
—
—
@@ -105,8 +106,72 @@
106
107
xscale = dxglcfg.postsizex;
107
108
yscale = dxglcfg.postsizey;
108
109
}
109
- fakex = (DWORD)((float)sizes[0] / xscale);
110
- fakey = (DWORD)((float)sizes[1] / yscale);
110
+ switch (dxglcfg.primaryscale)
111
+ {
112
+ case 1: // Scale to window size
113
+ default:
114
+ fakex = (DWORD)((float)sizes[0] / xscale);
115
+ fakey = (DWORD)((float)sizes[1] / yscale);
116
+ break;
117
+ case 2: // Scale to integer auto
118
+ for (i = 1; i < 100; i++)
119
+ {
120
+ if ((ddsd.dwWidth * i) >(DWORD)((float)sizes[0] / xscale))
121
+ {
122
+ fakex = ddsd.dwWidth * i;
123
+ break;
124
+ }
125
+ }
126
+ for (i = 1; i < 100; i++)
127
+ {
128
+ if ((ddsd.dwHeight * i) >(DWORD)((float)sizes[1] / yscale))
129
+ {
130
+ fakey = ddsd.dwHeight * i;
131
+ break;
132
+ }
133
+ }
134
+ break;
135
+ case 3: // 1.5x scale
136
+ fakex = (DWORD)((float)ddsd.dwWidth * 1.5f);
137
+ fakey = (DWORD)((float)ddsd.dwHeight * 1.5f);
138
+ break;
139
+ case 4: // 2x scale
140
+ fakex = ddsd.dwWidth * 2;
141
+ fakey = ddsd.dwHeight * 2;
142
+ break;
143
+ case 5: // 2.5x scale
144
+ fakex = (DWORD)((float)ddsd.dwWidth * 2.5f);
145
+ fakey = (DWORD)((float)ddsd.dwHeight * 2.5f);
146
+ break;
147
+ case 6: // 3x scale
148
+ fakex = ddsd.dwWidth * 3;
149
+ fakey = ddsd.dwHeight * 3;
150
+ break;
151
+ case 7: // 4x scale
152
+ fakex = ddsd.dwWidth * 4;
153
+ fakey = ddsd.dwHeight * 4;
154
+ break;
155
+ case 8: // 5x scale
156
+ fakex = ddsd.dwWidth * 5;
157
+ fakey = ddsd.dwHeight * 5;
158
+ break;
159
+ case 9: // 6x scale
160
+ fakex = ddsd.dwWidth * 6;
161
+ fakey = ddsd.dwHeight * 6;
162
+ break;
163
+ case 10: // 7x scale
164
+ fakex = ddsd.dwWidth * 7;
165
+ fakey = ddsd.dwHeight * 7;
166
+ break;
167
+ case 11: // 8x scale
168
+ fakex = ddsd.dwWidth * 8;
169
+ fakey = ddsd.dwHeight * 8;
170
+ break;
171
+ case 12: // Custom scale
172
+ fakex = (DWORD)((float)ddsd.dwWidth * dxglcfg.primaryscalex);
173
+ fakey = (DWORD)((float)ddsd.dwHeight * dxglcfg.primaryscaley);
174
+ break;
175
+ }
111
176
}
112
177
else
113
178
{
—
—
@@ -1245,7 +1310,7 @@
1246
1311
void glDirectDrawSurface7::Restore2()
1247
1312
{
1248
1313
TRACE_ENTER(1,14,this);
1249
- /*LONG sizes[6];
1314
+# /*LONG sizes[6];
1250
1315
float xscale, yscale;
1251
1316
if(hRC != ddInterface->renderer->hRC)
1252
1317
{
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