Index: ddraw/glDirectDrawSurface.cpp |
— | — | @@ -72,6 +72,7 @@ |
73 | 73 | ddsd = *lpDDSurfaceDesc2;
|
74 | 74 | miptexture = NULL;
|
75 | 75 | LONG sizes[6];
|
| 76 | + float xscale, yscale;
|
76 | 77 | ddInterface->GetSizes(sizes);
|
77 | 78 | if(ddsd.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
|
78 | 79 | {
|
— | — | @@ -89,10 +90,23 @@ |
90 | 91 | {
|
91 | 92 | ddsd.dwWidth = sizes[2];
|
92 | 93 | ddsd.dwHeight = sizes[3];
|
93 | | - if(dxglcfg.primaryscale) // FIXME: Support new scaling modes
|
| 94 | + if(dxglcfg.primaryscale)
|
94 | 95 | {
|
95 | | - fakex = sizes[0];
|
96 | | - fakey = sizes[1];
|
| 96 | + if (_isnan(dxglcfg.firstscalex) || _isnan(dxglcfg.firstscaley) ||
|
| 97 | + (dxglcfg.firstscalex < 0.25f) || (dxglcfg.firstscaley < 0.25f))
|
| 98 | + {
|
| 99 | + if (ddsd.dwWidth <= 400) xscale = 2.0f;
|
| 100 | + else xscale = 1.0f;
|
| 101 | + if (ddsd.dwHeight <= 300) yscale = 2.0f;
|
| 102 | + else yscale = 1.0f;
|
| 103 | + }
|
| 104 | + else
|
| 105 | + {
|
| 106 | + xscale = dxglcfg.firstscalex;
|
| 107 | + yscale = dxglcfg.firstscaley;
|
| 108 | + }
|
| 109 | + fakex = (DWORD)((float)sizes[0] / xscale);
|
| 110 | + fakey = (DWORD)((float)sizes[1] / yscale);
|
97 | 111 | }
|
98 | 112 | else
|
99 | 113 | {
|
— | — | @@ -1208,6 +1222,7 @@ |
1209 | 1223 | {
|
1210 | 1224 | TRACE_ENTER(1,14,this);
|
1211 | 1225 | /*LONG sizes[6];
|
| 1226 | + float xscale, yscale;
|
1212 | 1227 | if(hRC != ddInterface->renderer->hRC)
|
1213 | 1228 | {
|
1214 | 1229 | ddInterface->GetSizes(sizes);
|
— | — | @@ -1215,10 +1230,23 @@ |
1216 | 1231 | {
|
1217 | 1232 | ddsd.dwWidth = sizes[2];
|
1218 | 1233 | ddsd.dwHeight = sizes[3];
|
1219 | | - if(dxglcfg.primaryscale) // FIXME: Support new scaling modes
|
| 1234 | + if(dxglcfg.primaryscale)
|
1220 | 1235 | {
|
1221 | | - fakex = sizes[0];
|
1222 | | - fakey = sizes[1];
|
| 1236 | + if (_isnan(dxglcfg.firstscalex) || _isnan(dxglcfg.firstscaley) ||
|
| 1237 | + (dxglcfg.firstscalex < 0.25f) || (dxglcfg.firstscaley < 0.25f))
|
| 1238 | + {
|
| 1239 | + if (ddsd.dwWidth <= 400) xscale = 2.0f;
|
| 1240 | + else xscale = 1.0f;
|
| 1241 | + if (ddsd.dwHeight <= 300) yscale = 2.0f;
|
| 1242 | + else yscale = 1.0f;
|
| 1243 | + }
|
| 1244 | + else
|
| 1245 | + {
|
| 1246 | + xscale = dxglcfg.firstscalex;
|
| 1247 | + yscale = dxglcfg.firstscaley;
|
| 1248 | + }
|
| 1249 | + fakex = (DWORD)((float)sizes[0] / xscale);
|
| 1250 | + fakey = (DWORD)((float)sizes[1] / yscale);
|
1223 | 1251 | }
|
1224 | 1252 | else
|
1225 | 1253 | {
|
— | — | @@ -1245,6 +1273,7 @@ |
1246 | 1274 | TRACE_ENTER(1,14,this);
|
1247 | 1275 | if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
1248 | 1276 | LONG sizes[6];
|
| 1277 | + //float xscale, yscale;
|
1249 | 1278 | if(!ddInterface->renderer) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
1250 | 1279 | /*if(hRC != ddInterface->renderer->hRC)
|
1251 | 1280 | {
|
— | — | @@ -1255,10 +1284,23 @@ |
1256 | 1285 | {
|
1257 | 1286 | ddsd.dwWidth = sizes[2];
|
1258 | 1287 | ddsd.dwHeight = sizes[3];
|
1259 | | - if(dxglcfg.primaryscale) // FIXME: Support new scaling modes
|
| 1288 | + if(dxglcfg.primaryscale)
|
1260 | 1289 | {
|
1261 | | - fakex = sizes[0];
|
1262 | | - fakey = sizes[1];
|
| 1290 | + if (_isnan(dxglcfg.firstscalex) || _isnan(dxglcfg.firstscaley) ||
|
| 1291 | + (dxglcfg.firstscalex < 0.25f) || (dxglcfg.firstscaley < 0.25f))
|
| 1292 | + {
|
| 1293 | + if (ddsd.dwWidth <= 400) xscale = 2.0f;
|
| 1294 | + else xscale = 1.0f;
|
| 1295 | + if (ddsd.dwHeight <= 300) yscale = 2.0f;
|
| 1296 | + else yscale = 1.0f;
|
| 1297 | + }
|
| 1298 | + else
|
| 1299 | + {
|
| 1300 | + xscale = dxglcfg.firstscalex;
|
| 1301 | + yscale = dxglcfg.firstscaley;
|
| 1302 | + }
|
| 1303 | + fakex = (DWORD)((float)sizes[0] / xscale);
|
| 1304 | + fakey = (DWORD)((float)sizes[1] / yscale);
|
1263 | 1305 | }
|
1264 | 1306 | else
|
1265 | 1307 | {
|