Index: ThirdParty.txt |
— | — | @@ -101,7 +101,7 @@ |
102 | 102 |
|
103 | 103 | Contains the MinHook library, subject to the following license:
|
104 | 104 | MinHook - The Minimalistic API Hooking Library for x64/x86
|
105 | | -Copyright (C) 2009-2014 Tsuda Kageyu.
|
| 105 | +Copyright (C) 2009-2016 Tsuda Kageyu.
|
106 | 106 | All rights reserved.
|
107 | 107 |
|
108 | 108 | Redistribution and use in source and binary forms, with or without
|
Index: ddraw/glDirectDraw.cpp |
— | — | @@ -353,7 +353,8 @@ |
354 | 354 | {
|
355 | 355 | if(!lpEnumModesCallback) return DDERR_INVALIDPARAMS;
|
356 | 356 | if (dwFlags & 0xFFFFFFFC) return DDERR_INVALIDPARAMS;
|
357 | | - bool match;
|
| 357 | + BOOL match;
|
| 358 | + BOOL scalemodes;
|
358 | 359 | DWORD modenum = 0;
|
359 | 360 | DWORD modemax = 128;
|
360 | 361 | DEVMODE mode;
|
— | — | @@ -367,8 +368,19 @@ |
368 | 369 | ddmode.dwSize = sizeof(DDSURFACEDESC);
|
369 | 370 | ddmode.dwFlags = DDSD_HEIGHT | DDSD_WIDTH | DDSD_PITCH | DDSD_PIXELFORMAT | DDSD_REFRESHRATE;
|
370 | 371 | ddmode.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT);
|
| 372 | + if (!_isnan(dxglcfg.firstscalex) && !_isnan(dxglcfg.firstscaley) &&
|
| 373 | + (dxglcfg.firstscalex > 0.25f) && (dxglcfg.firstscaley > 0.25f) &&
|
| 374 | + (dxglcfg.firstscalex != 1.0f) && (dxglcfg.firstscaley != 1.0f) &&
|
| 375 | + ((dxglcfg.scaler == 0) || ((dxglcfg.scaler >= 4) && (dxglcfg.scaler <= 6))))
|
| 376 | + scalemodes = TRUE;
|
| 377 | + else scalemodes = FALSE;
|
371 | 378 | while(EnumDisplaySettings(NULL,modenum++,&mode))
|
372 | 379 | {
|
| 380 | + if (scalemodes)
|
| 381 | + {
|
| 382 | + mode.dmPelsWidth /= dxglcfg.firstscalex;
|
| 383 | + mode.dmPelsHeight /= dxglcfg.firstscaley;
|
| 384 | + }
|
373 | 385 | modes[modenum-1] = mode;
|
374 | 386 | if(modenum >= modemax)
|
375 | 387 | {
|
— | — | @@ -404,7 +416,7 @@ |
405 | 417 | }
|
406 | 418 | for(DWORD i = 0; i < modenum; i++)
|
407 | 419 | {
|
408 | | - match = true;
|
| 420 | + match = TRUE;
|
409 | 421 | if(dwFlags & DDEDM_REFRESHRATES) ddmode.dwRefreshRate = modes[i].dmDisplayFrequency;
|
410 | 422 | else
|
411 | 423 | {
|
— | — | @@ -412,18 +424,18 @@ |
413 | 425 | for(DWORD x = 0; x < i; x++)
|
414 | 426 | if((modes[x].dmBitsPerPel == modes[i].dmBitsPerPel) &&
|
415 | 427 | (modes[x].dmPelsWidth == modes[i].dmPelsWidth) &&
|
416 | | - (modes[x].dmPelsHeight == modes[i].dmPelsHeight)) match = false;
|
| 428 | + (modes[x].dmPelsHeight == modes[i].dmPelsHeight)) match = FALSE;
|
417 | 429 | }
|
418 | 430 | if(lpDDSurfaceDesc)
|
419 | 431 | {
|
420 | 432 | if(lpDDSurfaceDesc->dwFlags & DDSD_WIDTH)
|
421 | | - if(lpDDSurfaceDesc->dwWidth != modes[i].dmPelsWidth) match = false;
|
| 433 | + if(lpDDSurfaceDesc->dwWidth != modes[i].dmPelsWidth) match = FALSE;
|
422 | 434 | if(lpDDSurfaceDesc->dwFlags & DDSD_HEIGHT)
|
423 | | - if(lpDDSurfaceDesc->dwHeight != modes[i].dmPelsHeight) match = false;
|
| 435 | + if(lpDDSurfaceDesc->dwHeight != modes[i].dmPelsHeight) match = FALSE;
|
424 | 436 | if(lpDDSurfaceDesc->dwFlags & DDSD_PIXELFORMAT)
|
425 | | - if(lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount != modes[i].dmBitsPerPel) match = false;
|
| 437 | + if(lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount != modes[i].dmBitsPerPel) match = FALSE;
|
426 | 438 | if(lpDDSurfaceDesc->dwFlags & DDSD_REFRESHRATE)
|
427 | | - if(lpDDSurfaceDesc->dwRefreshRate != modes[i].dmDisplayFrequency) match = false;
|
| 439 | + if(lpDDSurfaceDesc->dwRefreshRate != modes[i].dmDisplayFrequency) match = FALSE;
|
428 | 440 | }
|
429 | 441 | if(match)
|
430 | 442 | {
|
— | — | @@ -942,7 +954,7 @@ |
943 | 955 | HRESULT glDirectDraw7::CreateSurface2(LPDDSURFACEDESC2 lpDDSurfaceDesc2, LPDIRECTDRAWSURFACE7 FAR *lplpDDSurface, IUnknown FAR *pUnkOuter, BOOL RecordSurface, int version)
|
944 | 956 | {
|
945 | 957 | HRESULT error;
|
946 | | - int mipcount;
|
| 958 | + DWORD mipcount;
|
947 | 959 | TRACE_ENTER(5, 14, this, 14, lpDDSurfaceDesc2, 14, lplpDDSurface, 14, pUnkOuter, 22, RecordSurface);
|
948 | 960 | if (!this) TRACE_RET(HRESULT, 23, DDERR_INVALIDOBJECT);
|
949 | 961 | if (!lpDDSurfaceDesc2) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
— | — | @@ -1686,10 +1698,10 @@ |
1687 | 1699 | {
|
1688 | 1700 | case DISP_CHANGE_SUCCESSFUL:
|
1689 | 1701 | if (fullscreen) this->currmode = newmode;
|
1690 | | - primaryx = screenx = newmode.dmPelsWidth;
|
1691 | | - primaryy = screeny = newmode.dmPelsHeight;
|
1692 | | - internalx = newmode.dmPelsWidth * xscale;
|
1693 | | - internaly = newmode.dmPelsHeight * yscale;
|
| 1702 | + primaryx = screenx = newmode.dmPelsWidth / xscale;
|
| 1703 | + primaryy = screeny = newmode.dmPelsHeight / yscale;
|
| 1704 | + internalx = newmode.dmPelsWidth;
|
| 1705 | + internaly = newmode.dmPelsHeight;
|
1694 | 1706 | internalbpp = screenbpp = newmode.dmBitsPerPel;
|
1695 | 1707 | primarybpp = dwBPP;
|
1696 | 1708 | if (dwRefreshRate) internalrefresh = primaryrefresh = screenrefresh = dwRefreshRate;
|
Index: ddraw/glRenderer.cpp |
— | — | @@ -3342,13 +3342,6 @@ |
3343 | 3343 | if(This->ddInterface->GetFullscreen())
|
3344 | 3344 | {
|
3345 | 3345 | This->ddInterface->GetSizes(sizes);
|
3346 | | - viewport[0] = viewport[1] = 0;
|
3347 | | - viewport[2] = sizes[4];
|
3348 | | - viewport[3] = sizes[5];
|
3349 | | - view[0] = (GLfloat)-(sizes[4]-sizes[0])/2;
|
3350 | | - view[1] = (GLfloat)(sizes[4]-sizes[0])/2+sizes[0];
|
3351 | | - view[2] = (GLfloat)(sizes[5]-sizes[1])/2+sizes[1];
|
3352 | | - view[3] = (GLfloat)-(sizes[5]-sizes[1])/2;
|
3353 | 3346 | if (_isnan(dxglcfg.firstscalex) || _isnan(dxglcfg.firstscaley) ||
|
3354 | 3347 | (dxglcfg.firstscalex < 0.25f) || (dxglcfg.firstscaley < 0.25f))
|
3355 | 3348 | {
|
— | — | @@ -3362,6 +3355,13 @@ |
3363 | 3356 | This->firstscalex = dxglcfg.firstscalex;
|
3364 | 3357 | This->firstscaley = dxglcfg.firstscaley;
|
3365 | 3358 | }
|
| 3359 | + 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;
|
3366 | 3366 | }
|
3367 | 3367 | else
|
3368 | 3368 | {
|