mirror of
https://github.com/DxWnd/DxWnd.reloaded
synced 2024-12-30 09:25:35 +01:00
v2_02_43_src
Former-commit-id: b685fc66929a3860d4911cbbe3f4c832f2c29d20
This commit is contained in:
parent
9af2065e0f
commit
75164868ec
24
build/Empire Earth (16BPP).dxw
Normal file
24
build/Empire Earth (16BPP).dxw
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
[target]
|
||||||
|
title0=Empire Earth
|
||||||
|
path0=D:\Games\Empire Earth\Empire Earth.exe
|
||||||
|
module0=
|
||||||
|
opengllib0=
|
||||||
|
ver0=0
|
||||||
|
coord0=0
|
||||||
|
flag0=671105057
|
||||||
|
flagg0=134217744
|
||||||
|
flagh0=84
|
||||||
|
flagi0=0
|
||||||
|
tflag0=3
|
||||||
|
initx0=0
|
||||||
|
inity0=0
|
||||||
|
minx0=0
|
||||||
|
miny0=0
|
||||||
|
maxx0=0
|
||||||
|
maxy0=0
|
||||||
|
posx0=50
|
||||||
|
posy0=50
|
||||||
|
sizx0=800
|
||||||
|
sizy0=600
|
||||||
|
maxfps0=0
|
||||||
|
initts0=0
|
24
build/Empire Earth.dxw
Normal file
24
build/Empire Earth.dxw
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
[target]
|
||||||
|
title0=Empire Earth
|
||||||
|
path0=D:\Games\Empire Earth\Empire Earth.exe
|
||||||
|
module0=
|
||||||
|
opengllib0=
|
||||||
|
ver0=0
|
||||||
|
coord0=0
|
||||||
|
flag0=1744847009
|
||||||
|
flagg0=201326608
|
||||||
|
flagh0=65620
|
||||||
|
flagi0=0
|
||||||
|
tflag0=23
|
||||||
|
initx0=0
|
||||||
|
inity0=0
|
||||||
|
minx0=0
|
||||||
|
miny0=0
|
||||||
|
maxx0=0
|
||||||
|
maxy0=0
|
||||||
|
posx0=50
|
||||||
|
posy0=50
|
||||||
|
sizx0=800
|
||||||
|
sizy0=600
|
||||||
|
maxfps0=0
|
||||||
|
initts0=0
|
@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:9937414e8ef05dd175c44b487760617042c0a74574f8cab9f1e7486302cee68a
|
oid sha256:5c0d2dcaecf0148f5d3ef79ca65a40148ad4b38921a6705d6dcd736f66a71c74
|
||||||
size 424960
|
size 425984
|
||||||
|
BIN
build/dxwnd.dll.release
Normal file
BIN
build/dxwnd.dll.release
Normal file
Binary file not shown.
@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:e400384f655d2a3050893125cf7be2026964cb1800b9cebf94af7c1fb98c4d26
|
oid sha256:bfed2b8cff2d31bff7391b371e2913378ac855e390fe9dbd2c1c6384eef71963
|
||||||
size 532480
|
size 532480
|
||||||
|
2626
build/dxwnd.ini
2626
build/dxwnd.ini
File diff suppressed because it is too large
Load Diff
1
build/issues.txt
Normal file
1
build/issues.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Ancient Evil: working both in emulated / direct mode, but in emulated mode the cursor is not visible.
|
@ -287,3 +287,10 @@ added hook to kernel32.dll QueryPerformanceCounter API to enable time stretching
|
|||||||
handled GetAttachedSurface emulation for FLIP capability on primary surface - that makes the intro movies of Empire Earth visible.
|
handled GetAttachedSurface emulation for FLIP capability on primary surface - that makes the intro movies of Empire Earth visible.
|
||||||
Some code cleaning
|
Some code cleaning
|
||||||
Cleared invisible debug flags ...
|
Cleared invisible debug flags ...
|
||||||
|
|
||||||
|
v2.02.43
|
||||||
|
Several changes for Empire Earth:
|
||||||
|
fix: restore 16BPP color mode after directdraw session termination
|
||||||
|
fix: recovered window destruction
|
||||||
|
fix: proper handling of MIPMAP and LOCALVIDMEM surfaces
|
||||||
|
fix: revised color management, now when the program terminates the desktop is restored to the previous color depth
|
||||||
|
Binary file not shown.
@ -373,28 +373,30 @@ static char *DumpPixelFormat(LPDDSURFACEDESC2 lpddsd)
|
|||||||
|
|
||||||
static void LogSurfaceAttributes(LPDDSURFACEDESC lpddsd, char *label, int line)
|
static void LogSurfaceAttributes(LPDDSURFACEDESC lpddsd, char *label, int line)
|
||||||
{
|
{
|
||||||
OutTraceD("SurfaceDesc: %s Flags=%x(%s)",
|
if(!IsTraceD) return;
|
||||||
|
OutTrace("SurfaceDesc: %s Flags=%x(%s)",
|
||||||
label,
|
label,
|
||||||
lpddsd->dwFlags, ExplainFlags(lpddsd->dwFlags));
|
lpddsd->dwFlags, ExplainFlags(lpddsd->dwFlags));
|
||||||
if (lpddsd->dwFlags & DDSD_BACKBUFFERCOUNT) OutTraceD(" BackBufferCount=%d", lpddsd->dwBackBufferCount);
|
if (lpddsd->dwFlags & DDSD_BACKBUFFERCOUNT) OutTrace(" BackBufferCount=%d", lpddsd->dwBackBufferCount);
|
||||||
if (lpddsd->dwFlags & DDSD_WIDTH) OutTraceD(" Width=%d", lpddsd->dwWidth);
|
if (lpddsd->dwFlags & DDSD_WIDTH) OutTrace(" Width=%d", lpddsd->dwWidth);
|
||||||
if (lpddsd->dwFlags & DDSD_HEIGHT) OutTraceD(" Height=%d", lpddsd->dwHeight);
|
if (lpddsd->dwFlags & DDSD_HEIGHT) OutTrace(" Height=%d", lpddsd->dwHeight);
|
||||||
if (lpddsd->dwFlags & DDSD_PITCH) OutTraceD(" Pitch=%d", lpddsd->lPitch);
|
if (lpddsd->dwFlags & DDSD_PITCH) OutTrace(" Pitch=%d", lpddsd->lPitch);
|
||||||
|
if (lpddsd->dwFlags & DDSD_MIPMAPCOUNT) OutTrace(" MipMapCount=%d", lpddsd->dwMipMapCount);
|
||||||
if (lpddsd->dwFlags & DDSD_CAPS) {
|
if (lpddsd->dwFlags & DDSD_CAPS) {
|
||||||
OutTraceD(" Caps=%x(%s)", lpddsd->ddsCaps.dwCaps, ExplainDDSCaps(lpddsd->ddsCaps.dwCaps));
|
OutTrace(" Caps=%x(%s)", lpddsd->ddsCaps.dwCaps, ExplainDDSCaps(lpddsd->ddsCaps.dwCaps));
|
||||||
if(lpddsd->dwSize==sizeof(DDSURFACEDESC2)){
|
if(lpddsd->dwSize==sizeof(DDSURFACEDESC2)){
|
||||||
LPDDSURFACEDESC2 lpddsd2=(LPDDSURFACEDESC2)lpddsd;
|
LPDDSURFACEDESC2 lpddsd2=(LPDDSURFACEDESC2)lpddsd;
|
||||||
OutTraceD(" Caps2=%x(%s)", lpddsd2->ddsCaps.dwCaps2, ExplainDDSCaps2(lpddsd2->ddsCaps.dwCaps2));
|
OutTrace(" Caps2=%x(%s)", lpddsd2->ddsCaps.dwCaps2, ExplainDDSCaps2(lpddsd2->ddsCaps.dwCaps2));
|
||||||
OutTraceD(" Caps3=%x(%s)", lpddsd2->ddsCaps.dwCaps3, ExplainDDSCaps3(lpddsd2->ddsCaps.dwCaps3));
|
OutTrace(" Caps3=%x(%s)", lpddsd2->ddsCaps.dwCaps3, ExplainDDSCaps3(lpddsd2->ddsCaps.dwCaps3));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (lpddsd->dwFlags & DDSD_CKDESTBLT ) OutTraceD(" CKDestBlt=(%x,%x)", lpddsd->ddckCKDestBlt.dwColorSpaceLowValue, lpddsd->ddckCKDestBlt.dwColorSpaceHighValue);
|
if (lpddsd->dwFlags & DDSD_CKDESTBLT ) OutTrace(" CKDestBlt=(%x,%x)", lpddsd->ddckCKDestBlt.dwColorSpaceLowValue, lpddsd->ddckCKDestBlt.dwColorSpaceHighValue);
|
||||||
if (lpddsd->dwFlags & DDSD_CKDESTOVERLAY ) OutTraceD(" CKDestOverlay=(%x,%x)", lpddsd->ddckCKDestOverlay.dwColorSpaceLowValue, lpddsd->ddckCKDestOverlay.dwColorSpaceHighValue);
|
if (lpddsd->dwFlags & DDSD_CKDESTOVERLAY ) OutTrace(" CKDestOverlay=(%x,%x)", lpddsd->ddckCKDestOverlay.dwColorSpaceLowValue, lpddsd->ddckCKDestOverlay.dwColorSpaceHighValue);
|
||||||
if (lpddsd->dwFlags & DDSD_CKSRCBLT ) OutTraceD(" CKSrcBlt=(%x,%x)", lpddsd->ddckCKSrcBlt.dwColorSpaceLowValue, lpddsd->ddckCKSrcBlt.dwColorSpaceHighValue);
|
if (lpddsd->dwFlags & DDSD_CKSRCBLT ) OutTrace(" CKSrcBlt=(%x,%x)", lpddsd->ddckCKSrcBlt.dwColorSpaceLowValue, lpddsd->ddckCKSrcBlt.dwColorSpaceHighValue);
|
||||||
if (lpddsd->dwFlags & DDSD_CKSRCOVERLAY ) OutTraceD(" CKSrcOverlay=(%x,%x)", lpddsd->ddckCKSrcOverlay.dwColorSpaceLowValue, lpddsd->ddckCKSrcOverlay.dwColorSpaceHighValue);
|
if (lpddsd->dwFlags & DDSD_CKSRCOVERLAY ) OutTrace(" CKSrcOverlay=(%x,%x)", lpddsd->ddckCKSrcOverlay.dwColorSpaceLowValue, lpddsd->ddckCKSrcOverlay.dwColorSpaceHighValue);
|
||||||
if (lpddsd->dwFlags & DDSD_PIXELFORMAT ) OutTraceD("%s", DumpPixelFormat((LPDDSURFACEDESC2)lpddsd));
|
if (lpddsd->dwFlags & DDSD_PIXELFORMAT ) OutTrace("%s", DumpPixelFormat((LPDDSURFACEDESC2)lpddsd));
|
||||||
if (lpddsd->dwFlags & DDSD_LPSURFACE) OutTraceD(" Surface=%x", lpddsd->lpSurface);
|
if (lpddsd->dwFlags & DDSD_LPSURFACE) OutTrace(" Surface=%x", lpddsd->lpSurface);
|
||||||
OutTraceD("\n");
|
OutTrace("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void DumpPixFmt(LPDDSURFACEDESC2 lpdds)
|
static void DumpPixFmt(LPDDSURFACEDESC2 lpdds)
|
||||||
@ -2114,6 +2116,15 @@ void FixSurfaceCapsAnalytic(LPDDSURFACEDESC2 lpddsd, int dxversion)
|
|||||||
lpddsd->ddsCaps.dwCaps = (DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN);
|
lpddsd->ddsCaps.dwCaps = (DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN);
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
|
case DDSCAPS_OFFSCREENPLAIN|DDSCAPS_VIDEOMEMORY|DDSCAPS_LOCALVIDMEM:
|
||||||
|
// Empire Earth
|
||||||
|
lpddsd->ddsCaps.dwCaps = (DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN);
|
||||||
|
return;
|
||||||
|
break;
|
||||||
|
case DDSCAPS_COMPLEX|DDSCAPS_TEXTURE|DDSCAPS_MIPMAP:
|
||||||
|
// Empire Earth: flags = DDSD_CAPS|DDSD_WIDTH|DDSD_HEIGHT|DDSD_PIXELFORMAT|DDSD_MIPMAPCOUNT
|
||||||
|
return;
|
||||||
|
break;
|
||||||
case DDSCAPS_SYSTEMMEMORY|DDSCAPS_ZBUFFER:
|
case DDSCAPS_SYSTEMMEMORY|DDSCAPS_ZBUFFER:
|
||||||
// the Sims
|
// the Sims
|
||||||
return;
|
return;
|
||||||
@ -2194,7 +2205,7 @@ static void FixSurfaceCaps(LPDDSURFACEDESC2 lpddsd, int dxversion)
|
|||||||
// To do: fix Dungeon Keeper II
|
// To do: fix Dungeon Keeper II
|
||||||
|
|
||||||
// rules of thumb:
|
// rules of thumb:
|
||||||
// 1) always get rid of DDSCAPS_VIDEOMEMORY caps
|
// 1) always get rid of DDSCAPS_VIDEOMEMORY & DDSCAPS_LOCALVIDMEM caps
|
||||||
// 2) always add DDSCAPS_SYSTEMMEMORY caps
|
// 2) always add DDSCAPS_SYSTEMMEMORY caps
|
||||||
// 3) DDSCAPS_SYSTEMMEMORY is supported from dxversion 4
|
// 3) DDSCAPS_SYSTEMMEMORY is supported from dxversion 4
|
||||||
// 4) if DDSD_CAPS is not set, ignore caps
|
// 4) if DDSD_CAPS is not set, ignore caps
|
||||||
@ -2253,6 +2264,14 @@ static void FixSurfaceCaps(LPDDSURFACEDESC2 lpddsd, int dxversion)
|
|||||||
// v2.02.41: don't alter FOURCC pixel formats
|
// v2.02.41: don't alter FOURCC pixel formats
|
||||||
if((lpddsd->dwFlags & DDSD_PIXELFORMAT) && (lpddsd->ddpfPixelFormat.dwFlags & DDPF_FOURCC)) return;
|
if((lpddsd->dwFlags & DDSD_PIXELFORMAT) && (lpddsd->ddpfPixelFormat.dwFlags & DDPF_FOURCC)) return;
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
// v2.02.43: don't alter MIPMAP surfaces
|
||||||
|
if((lpddsd->dwFlags & DDSD_MIPMAPCOUNT) && (lpddsd->ddsCaps.dwCaps & DDSCAPS_MIPMAP)) {
|
||||||
|
//GetPixFmt(lpddsd);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// HoM&M3/4 fix....
|
// HoM&M3/4 fix....
|
||||||
if(((lpddsd->dwFlags & (DDSD_CAPS|DDSD_WIDTH|DDSD_HEIGHT)) == (DDSD_CAPS|DDSD_HEIGHT|DDSD_WIDTH)) &&
|
if(((lpddsd->dwFlags & (DDSD_CAPS|DDSD_WIDTH|DDSD_HEIGHT)) == (DDSD_CAPS|DDSD_HEIGHT|DDSD_WIDTH)) &&
|
||||||
@ -2267,7 +2286,7 @@ static void FixSurfaceCaps(LPDDSURFACEDESC2 lpddsd, int dxversion)
|
|||||||
// default case: adjust pixel format
|
// default case: adjust pixel format
|
||||||
OutTraceB("FixSurfaceCaps: suppress DDSCAPS_VIDEOMEMORY case\n");
|
OutTraceB("FixSurfaceCaps: suppress DDSCAPS_VIDEOMEMORY case\n");
|
||||||
lpddsd->dwFlags |= (DDSD_CAPS|DDSD_PIXELFORMAT);
|
lpddsd->dwFlags |= (DDSD_CAPS|DDSD_PIXELFORMAT);
|
||||||
lpddsd->ddsCaps.dwCaps &= ~DDSCAPS_VIDEOMEMORY;
|
lpddsd->ddsCaps.dwCaps &= ~(DDSCAPS_VIDEOMEMORY|DDSCAPS_LOCALVIDMEM); // v2.02.43
|
||||||
lpddsd->ddsCaps.dwCaps |= (DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN);
|
lpddsd->ddsCaps.dwCaps |= (DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN);
|
||||||
if(!(dxw.dwFlags3 & NOPIXELFORMAT)) GetPixFmt(lpddsd);
|
if(!(dxw.dwFlags3 & NOPIXELFORMAT)) GetPixFmt(lpddsd);
|
||||||
return;
|
return;
|
||||||
@ -3479,7 +3498,7 @@ LPDIRECTDRAWSURFACE2 lpDDSBuffer = NULL;
|
|||||||
|
|
||||||
HRESULT WINAPI extLockDir(LPDIRECTDRAWSURFACE lpdds, LPRECT lprect, LPDIRECTDRAWSURFACE lpdds2, DWORD flags, HANDLE hEvent)
|
HRESULT WINAPI extLockDir(LPDIRECTDRAWSURFACE lpdds, LPRECT lprect, LPDIRECTDRAWSURFACE lpdds2, DWORD flags, HANDLE hEvent)
|
||||||
{
|
{
|
||||||
HRESULT res;
|
HRESULT res, res2;
|
||||||
static RECT client;
|
static RECT client;
|
||||||
POINT upleft={0,0};
|
POINT upleft={0,0};
|
||||||
LPDIRECTDRAWSURFACE lpDDSPrim;
|
LPDIRECTDRAWSURFACE lpDDSPrim;
|
||||||
@ -3497,7 +3516,13 @@ HRESULT WINAPI extLockDir(LPDIRECTDRAWSURFACE lpdds, LPRECT lprect, LPDIRECTDRAW
|
|||||||
OutTrace(" rect=(NULL)\n");
|
OutTrace(" rect=(NULL)\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
(*pGetGDISurface)(lpPrimaryDD, &lpDDSPrim);
|
// V2.02.43: Empire Earth does some test Lock operations apparently before the primary surface is created
|
||||||
|
if(lpPrimaryDD){
|
||||||
|
lpDDSPrim=0;
|
||||||
|
res2=(*pGetGDISurface)(lpPrimaryDD, &lpDDSPrim);
|
||||||
|
if(res2)
|
||||||
|
OutTraceE("Lock: GetGDISurface ERROR res=%x(%s) at %d\n", res2, ExplainDDError(res2), __LINE__);
|
||||||
|
else
|
||||||
(*pReleaseS)(lpDDSPrim);
|
(*pReleaseS)(lpDDSPrim);
|
||||||
if(lpdds==lpDDSPrim){
|
if(lpdds==lpDDSPrim){
|
||||||
if(dxw.dwFlags1 & LOCKEDSURFACE){
|
if(dxw.dwFlags1 & LOCKEDSURFACE){
|
||||||
@ -3538,6 +3563,7 @@ HRESULT WINAPI extLockDir(LPDIRECTDRAWSURFACE lpdds, LPRECT lprect, LPDIRECTDRAW
|
|||||||
lprect->left, lprect->top, lprect->right, lprect->bottom);
|
lprect->left, lprect->top, lprect->right, lprect->bottom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
res=(*pLock)(lpdds, lprect, lpdds2, flags, hEvent);
|
res=(*pLock)(lpdds, lprect, lpdds2, flags, hEvent);
|
||||||
|
|
||||||
@ -3922,13 +3948,36 @@ HRESULT WINAPI extGetPixelFormat(LPDIRECTDRAWSURFACE lpdds, LPDDPIXELFORMAT p)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
static HRESULT WINAPI RestoreAll(LPDIRECTDRAWSURFACE7 lpDDSurface, LPDDSURFACEDESC2 lpDDSurfaceDesc, LPVOID lpContext)
|
||||||
|
{
|
||||||
|
HRESULT res;
|
||||||
|
//res=lpDDSurface->Restore();
|
||||||
|
res=(*pRestore)((LPDIRECTDRAWSURFACE)lpDDSurface);
|
||||||
|
OutTraceB("TestCooperativeLevel: Restore lpdds=%x res=%x(%s)\n", lpDDSurface, res, ExplainDDError(res));
|
||||||
|
(*pReleaseS)((LPDIRECTDRAWSURFACE)lpDDSurface);
|
||||||
|
if(res) return DDENUMRET_CANCEL;
|
||||||
|
return DDENUMRET_OK;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
HRESULT WINAPI extTestCooperativeLevel(LPDIRECTDRAW lpdd)
|
HRESULT WINAPI extTestCooperativeLevel(LPDIRECTDRAW lpdd)
|
||||||
{
|
{
|
||||||
HRESULT res;
|
HRESULT res;
|
||||||
res=(*pTestCooperativeLevel)(lpdd);
|
res=(*pTestCooperativeLevel)(lpdd);
|
||||||
if(IsDebug)
|
OutTraceB("TestCooperativeLevel: lpdd=%x res=%x(%s)\n", lpdd, res, ExplainDDError(res));
|
||||||
OutTrace("TestCooperativeLevel: lpdd=%x res=%x(%s)\n", lpdd, res, ExplainDDError(res));
|
if(res==DDERR_WRONGMODE) {
|
||||||
return DD_OK;
|
#if 0
|
||||||
|
(*pEnumSurfaces4)(lpdd, DDENUMSURFACES_DOESEXIST|DDENUMSURFACES_ALL, NULL, NULL, (LPDDENUMSURFACESCALLBACK2)RestoreAll);
|
||||||
|
//lpDDSEmu_Prim->Restore();
|
||||||
|
//res=(*pEnumSurfaces4)(lpdd, dwflags, lpddsd, lpContext, cb);
|
||||||
|
#else
|
||||||
|
res=((LPDIRECTDRAW7)lpdd)->RestoreAllSurfaces();
|
||||||
|
if(res) OutTraceE("TestCooperativeLevel: RestoreAllSurfaces ERROR res=%x(%s)\n", res, ExplainDDError(res));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
if(dxw.dwFlags1 & SUPPRESSDXERRORS) return DD_OK;
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI extReleaseS(LPDIRECTDRAWSURFACE lpdds)
|
HRESULT WINAPI extReleaseS(LPDIRECTDRAWSURFACE lpdds)
|
||||||
@ -4223,6 +4272,11 @@ ULONG WINAPI extReleaseD(LPDIRECTDRAW lpdd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// when lpdd session is closed (ref==0) the system restores the default color depth
|
||||||
|
// so if FORCE16BPP is set, dxwnd must restore the 16BPP value
|
||||||
|
//extern void SwitchTo16BPP();
|
||||||
|
//if((ActualRef==0) && (dxw.dwFlags3 & FORCE16BPP)) SwitchTo16BPP();
|
||||||
|
|
||||||
OutTraceD("Release(D): lpdd=%x ref=%x\n", lpdd, VirtualRef);
|
OutTraceD("Release(D): lpdd=%x ref=%x\n", lpdd, VirtualRef);
|
||||||
return (ULONG)VirtualRef;
|
return (ULONG)VirtualRef;
|
||||||
}
|
}
|
||||||
|
@ -980,7 +980,7 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WM_ERASEBKGND:
|
case WM_ERASEBKGND:
|
||||||
if(dxw.IsRealDesktop(hwnd)){
|
if(dxw.IsDesktop(hwnd)){
|
||||||
OutTraceD("WindowProc: WM_ERASEBKGND(%x,%x) - suppressed\n", wparam, lparam);
|
OutTraceD("WindowProc: WM_ERASEBKGND(%x,%x) - suppressed\n", wparam, lparam);
|
||||||
return 1; // 1 == OK, erased
|
return 1; // 1 == OK, erased
|
||||||
}
|
}
|
||||||
@ -989,7 +989,11 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
|
|||||||
if ((dxw.dwFlags1 & LOCKWINPOS) && dxw.IsFullScreen()){
|
if ((dxw.dwFlags1 & LOCKWINPOS) && dxw.IsFullScreen()){
|
||||||
OutTraceD("WindowProc: prevent WM_DISPLAYCHANGE depth=%d size=(%d,%d)\n",
|
OutTraceD("WindowProc: prevent WM_DISPLAYCHANGE depth=%d size=(%d,%d)\n",
|
||||||
wparam, HIWORD(lparam), LOWORD(lparam));
|
wparam, HIWORD(lparam), LOWORD(lparam));
|
||||||
return 0;
|
// v2.02.43: unless EMULATESURFACE is set, lock the screen resolution only, but not the color depth!
|
||||||
|
if(dxw.dwFlags1 & EMULATESURFACE) return 0;
|
||||||
|
// let rparam (color depth) change, but override lparam (screen width & height.)
|
||||||
|
lparam = MAKELPARAM((LONG)dxw.GetScreenHeight(), (LONG)dxw.GetScreenWidth());
|
||||||
|
//return 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WM_WINDOWPOSCHANGING:
|
case WM_WINDOWPOSCHANGING:
|
||||||
@ -1197,31 +1201,41 @@ void HookSysLibsInit()
|
|||||||
HookGDI32Init();
|
HookGDI32Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEVMODE InitDevMode;
|
||||||
|
|
||||||
|
static void SaveScreenMode()
|
||||||
|
{
|
||||||
|
static BOOL DoOnce=FALSE;
|
||||||
|
if(DoOnce) return;
|
||||||
|
DoOnce=TRUE;
|
||||||
|
EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &InitDevMode);
|
||||||
|
OutTraceD("DXWND: Initial display mode WxH=(%dx%d) BitsPerPel=%d\n",
|
||||||
|
InitDevMode.dmPelsWidth, InitDevMode.dmPelsHeight, InitDevMode.dmBitsPerPel);
|
||||||
|
}
|
||||||
|
|
||||||
static void RecoverScreenMode()
|
static void RecoverScreenMode()
|
||||||
{
|
{
|
||||||
DEVMODE InitDevMode, CurrentDevMode;
|
DEVMODE CurrentDevMode;
|
||||||
BOOL res;
|
BOOL res;
|
||||||
EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &CurrentDevMode);
|
EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &CurrentDevMode);
|
||||||
EnumDisplaySettings(NULL, ENUM_REGISTRY_SETTINGS, &InitDevMode);
|
|
||||||
OutTraceD("ChangeDisplaySettings: recover CURRENT WxH=(%dx%d) BitsPerPel=%d TARGET WxH=(%dx%d) BitsPerPel=%d\n",
|
OutTraceD("ChangeDisplaySettings: recover CURRENT WxH=(%dx%d) BitsPerPel=%d TARGET WxH=(%dx%d) BitsPerPel=%d\n",
|
||||||
CurrentDevMode.dmPelsWidth, CurrentDevMode.dmPelsHeight, CurrentDevMode.dmBitsPerPel,
|
CurrentDevMode.dmPelsWidth, CurrentDevMode.dmPelsHeight, CurrentDevMode.dmBitsPerPel,
|
||||||
InitDevMode.dmPelsWidth, InitDevMode.dmPelsHeight, InitDevMode.dmBitsPerPel);
|
InitDevMode.dmPelsWidth, InitDevMode.dmPelsHeight, InitDevMode.dmBitsPerPel);
|
||||||
//InitDevMode.dmFields |= (DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT);
|
|
||||||
InitDevMode.dmFields = (DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT);
|
InitDevMode.dmFields = (DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT);
|
||||||
res=(*pChangeDisplaySettings)(&InitDevMode, 0);
|
res=(*pChangeDisplaySettings)(&InitDevMode, 0);
|
||||||
if(res) OutTraceE("ChangeDisplaySettings: ERROR err=%d at %d\n", GetLastError(), __LINE__);
|
if(res) OutTraceE("ChangeDisplaySettings: ERROR err=%d at %d\n", GetLastError(), __LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SwitchTo16BPP()
|
void SwitchTo16BPP()
|
||||||
{
|
{
|
||||||
DEVMODE InitDevMode;
|
DEVMODE CurrentDevMode;
|
||||||
BOOL res;
|
BOOL res;
|
||||||
EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &InitDevMode);
|
EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &CurrentDevMode);
|
||||||
OutTraceD("ChangeDisplaySettings: CURRENT wxh=(%dx%d) BitsPerPel=%d -> 16\n",
|
OutTraceD("ChangeDisplaySettings: CURRENT wxh=(%dx%d) BitsPerPel=%d -> 16\n",
|
||||||
InitDevMode.dmPelsWidth, InitDevMode.dmPelsHeight, InitDevMode.dmBitsPerPel);
|
CurrentDevMode.dmPelsWidth, CurrentDevMode.dmPelsHeight, CurrentDevMode.dmBitsPerPel);
|
||||||
InitDevMode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
|
CurrentDevMode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
|
||||||
InitDevMode.dmBitsPerPel = 16;
|
CurrentDevMode.dmBitsPerPel = 16;
|
||||||
res=(*pChangeDisplaySettings)(&InitDevMode, 0);
|
res=(*pChangeDisplaySettings)(&CurrentDevMode, CDS_UPDATEREGISTRY);
|
||||||
if(res) OutTraceE("ChangeDisplaySettings: ERROR err=%d at %d\n", GetLastError(), __LINE__);
|
if(res) OutTraceE("ChangeDisplaySettings: ERROR err=%d at %d\n", GetLastError(), __LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1229,7 +1243,6 @@ static void LockScreenMode(DWORD dmPelsWidth, DWORD dmPelsHeight, DWORD dmBitsPe
|
|||||||
{
|
{
|
||||||
DEVMODE InitDevMode;
|
DEVMODE InitDevMode;
|
||||||
BOOL res;
|
BOOL res;
|
||||||
EnumDisplaySettings(NULL, ENUM_REGISTRY_SETTINGS, &InitDevMode);
|
|
||||||
OutTraceD("ChangeDisplaySettings: LOCK wxh=(%dx%d) BitsPerPel=%d -> wxh=(%dx%d) BitsPerPel=%d\n",
|
OutTraceD("ChangeDisplaySettings: LOCK wxh=(%dx%d) BitsPerPel=%d -> wxh=(%dx%d) BitsPerPel=%d\n",
|
||||||
InitDevMode.dmPelsWidth, InitDevMode.dmPelsHeight, InitDevMode.dmBitsPerPel,
|
InitDevMode.dmPelsWidth, InitDevMode.dmPelsHeight, InitDevMode.dmBitsPerPel,
|
||||||
dmPelsWidth, dmPelsHeight, dmBitsPerPel);
|
dmPelsWidth, dmPelsHeight, dmBitsPerPel);
|
||||||
@ -1241,7 +1254,6 @@ static void LockScreenMode(DWORD dmPelsWidth, DWORD dmPelsHeight, DWORD dmBitsPe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// to do: find a logic in the exception codes (0xc0000095 impies a bitmask ?)
|
// to do: find a logic in the exception codes (0xc0000095 impies a bitmask ?)
|
||||||
// idem for ExceptionFlags
|
// idem for ExceptionFlags
|
||||||
// generalize, find OPCODE length and set number of NOPs accordingly!
|
// generalize, find OPCODE length and set number of NOPs accordingly!
|
||||||
@ -1484,6 +1496,7 @@ void HookInit(TARGETMAP *target, HWND hwnd)
|
|||||||
sModule=strtok(NULL," ;");
|
sModule=strtok(NULL," ;");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SaveScreenMode();
|
||||||
if(dxw.dwFlags2 & RECOVERSCREENMODE) RecoverScreenMode();
|
if(dxw.dwFlags2 & RECOVERSCREENMODE) RecoverScreenMode();
|
||||||
if(dxw.dwFlags3 & FORCE16BPP) SwitchTo16BPP();
|
if(dxw.dwFlags3 & FORCE16BPP) SwitchTo16BPP();
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#include "dxwnd.h"
|
#include "dxwnd.h"
|
||||||
#include "dxwcore.hpp"
|
#include "dxwcore.hpp"
|
||||||
|
|
||||||
#define VERSION "2.02.42"
|
#define VERSION "2.02.43"
|
||||||
|
|
||||||
#define DDTHREADLOCK 1
|
#define DDTHREADLOCK 1
|
||||||
|
|
||||||
|
Binary file not shown.
@ -210,7 +210,7 @@ FARPROC Remap_GDI32_ProcAddress(LPCSTR proc, HMODULE hModule)
|
|||||||
if(dxw.dwFlags2 & DISABLEGAMMARAMP)
|
if(dxw.dwFlags2 & DISABLEGAMMARAMP)
|
||||||
if(addr=RemapLibrary(proc, hModule, GammaHooks)) return addr;
|
if(addr=RemapLibrary(proc, hModule, GammaHooks)) return addr;
|
||||||
|
|
||||||
if(1) // v2.02.33 - for "Stratego" compatibility option
|
if(dxw.dwFlags3 & FONTBYPASS) // v2.02.33 - for "Stratego" compatibility option
|
||||||
if(addr=RemapLibrary(proc, hModule, FontHooks)) return addr;
|
if(addr=RemapLibrary(proc, hModule, FontHooks)) return addr;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -1692,9 +1692,10 @@ BOOL WINAPI extCreateScalableFontResourceA(DWORD fdwHidden, LPCTSTR lpszFontRes,
|
|||||||
BOOL res;
|
BOOL res;
|
||||||
OutTraceD("CreateScalableFontResource: hidden=%d FontRes=\"%s\" FontFile=\"%s\" CurrentPath=\"%s\"\n",
|
OutTraceD("CreateScalableFontResource: hidden=%d FontRes=\"%s\" FontFile=\"%s\" CurrentPath=\"%s\"\n",
|
||||||
fdwHidden, lpszFontRes, lpszFontFile, lpszCurrentPath);
|
fdwHidden, lpszFontRes, lpszFontFile, lpszCurrentPath);
|
||||||
if (1) return TRUE;
|
if(dxw.dwFlags3 & FONTBYPASS) return TRUE;
|
||||||
res=(*pCreateScalableFontResourceA)(fdwHidden, lpszFontRes, lpszFontFile, lpszCurrentPath);
|
res=(*pCreateScalableFontResourceA)(fdwHidden, lpszFontRes, lpszFontFile, lpszCurrentPath);
|
||||||
if(!res) OutTraceE("CreateScalableFontResource: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
if(!res) OutTraceE("CreateScalableFontResource: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL WINAPI extCreateScalableFontResourceW(DWORD fdwHidden, LPCWSTR lpszFontRes, LPCWSTR lpszFontFile, LPCWSTR lpszCurrentPath)
|
BOOL WINAPI extCreateScalableFontResourceW(DWORD fdwHidden, LPCWSTR lpszFontRes, LPCWSTR lpszFontFile, LPCWSTR lpszCurrentPath)
|
||||||
@ -1702,27 +1703,36 @@ BOOL WINAPI extCreateScalableFontResourceW(DWORD fdwHidden, LPCWSTR lpszFontRes,
|
|||||||
BOOL res;
|
BOOL res;
|
||||||
OutTraceD("CreateScalableFontResource: hidden=%d FontRes=\"%ls\" FontFile=\"%ls\" CurrentPath=\"%ls\"\n",
|
OutTraceD("CreateScalableFontResource: hidden=%d FontRes=\"%ls\" FontFile=\"%ls\" CurrentPath=\"%ls\"\n",
|
||||||
fdwHidden, lpszFontRes, lpszFontFile, lpszCurrentPath);
|
fdwHidden, lpszFontRes, lpszFontFile, lpszCurrentPath);
|
||||||
if (1) return TRUE;
|
if(dxw.dwFlags3 & FONTBYPASS) return TRUE;
|
||||||
res=(*pCreateScalableFontResourceW)(fdwHidden, lpszFontRes, lpszFontFile, lpszCurrentPath);
|
res=(*pCreateScalableFontResourceW)(fdwHidden, lpszFontRes, lpszFontFile, lpszCurrentPath);
|
||||||
if(!res) OutTraceE("CreateScalableFontResource: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
if(!res) OutTraceE("CreateScalableFontResource: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
int WINAPI extAddFontResourceA(LPCTSTR lpszFontFile)
|
int WINAPI extAddFontResourceA(LPCTSTR lpszFontFile)
|
||||||
{
|
{
|
||||||
BOOL res;
|
BOOL res;
|
||||||
OutTraceD("AddFontResource: FontFile=\"%s\"\n", lpszFontFile);
|
OutTraceD("AddFontResource: FontFile=\"%s\"\n", lpszFontFile);
|
||||||
if(1) return TRUE;
|
if(dxw.dwFlags3 & FONTBYPASS) {
|
||||||
|
OutTraceD("AddFontResource: SUPPRESSED FontFile=\"%s\"\n", lpszFontFile);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
res=(*pAddFontResourceA)(lpszFontFile);
|
res=(*pAddFontResourceA)(lpszFontFile);
|
||||||
if(!res) OutTraceE("AddFontResource: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
if(!res) OutTraceE("AddFontResource: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
int WINAPI extAddFontResourceW(LPCWSTR lpszFontFile)
|
int WINAPI extAddFontResourceW(LPCWSTR lpszFontFile)
|
||||||
{
|
{
|
||||||
BOOL res;
|
BOOL res;
|
||||||
OutTraceD("AddFontResource: FontFile=\"%ls\"\n", lpszFontFile);
|
OutTraceD("AddFontResource: FontFile=\"%ls\"\n", lpszFontFile);
|
||||||
if(1) return TRUE;
|
if(dxw.dwFlags3 & FONTBYPASS) {
|
||||||
|
OutTraceD("AddFontResource: SUPPRESSED FontFile=\"%ls\"\n", lpszFontFile);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
res=(*pAddFontResourceW)(lpszFontFile);
|
res=(*pAddFontResourceW)(lpszFontFile);
|
||||||
if(!res) OutTraceE("AddFontResource: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
if(!res) OutTraceE("AddFontResource: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT WINAPI extSetSystemPaletteUse(HDC hdc, UINT uUsage)
|
UINT WINAPI extSetSystemPaletteUse(HDC hdc, UINT uUsage)
|
||||||
|
@ -54,11 +54,6 @@ static HookEntry_Type SuppressChildHooks[]={
|
|||||||
{0, NULL, 0, 0} // terminator
|
{0, NULL, 0, 0} // terminator
|
||||||
};
|
};
|
||||||
|
|
||||||
//static HookEntry_Type SuppressPerfCountersHooks[]={
|
|
||||||
// //{"QueryPerformanceFrequency", (FARPROC)NULL, (FARPROC *)NULL, (FARPROC)QueryPerformanceFrequency},
|
|
||||||
// {0, NULL, 0, 0} // terminator
|
|
||||||
//};
|
|
||||||
|
|
||||||
static char *libname = "kernel32.dll";
|
static char *libname = "kernel32.dll";
|
||||||
|
|
||||||
void HookKernel32(HMODULE module)
|
void HookKernel32(HMODULE module)
|
||||||
@ -69,7 +64,6 @@ void HookKernel32(HMODULE module)
|
|||||||
if(dxw.dwFlags2 & TIMESTRETCH) HookLibrary(module, TimeHooks, libname);
|
if(dxw.dwFlags2 & TIMESTRETCH) HookLibrary(module, TimeHooks, libname);
|
||||||
if(dxw.dwFlags2 & FAKEVERSION) HookLibrary(module, VersionHooks, libname);
|
if(dxw.dwFlags2 & FAKEVERSION) HookLibrary(module, VersionHooks, libname);
|
||||||
if(dxw.dwFlags4 & SUPPRESSCHILD) HookLibrary(module, SuppressChildHooks, libname);
|
if(dxw.dwFlags4 & SUPPRESSCHILD) HookLibrary(module, SuppressChildHooks, libname);
|
||||||
//if (1) HookLibrary(module, SuppressPerfCountersHooks, libname);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HookKernel32Init()
|
void HookKernel32Init()
|
||||||
|
@ -1762,11 +1762,11 @@ LONG WINAPI extTabbedTextOutA(HDC hdc, int X, int Y, LPCTSTR lpString, int nCoun
|
|||||||
|
|
||||||
BOOL WINAPI extDestroyWindow(HWND hWnd)
|
BOOL WINAPI extDestroyWindow(HWND hWnd)
|
||||||
{
|
{
|
||||||
|
// v2.02.43: Empire Earth builds test surfaces that must be destroyed!
|
||||||
BOOL res;
|
BOOL res;
|
||||||
OutTraceB("DestroyWindow: hwnd=%x\n", hWnd);
|
OutTraceB("DestroyWindow: hwnd=%x\n", hWnd);
|
||||||
if (hWnd == dxw.GethWnd()) {
|
if (hWnd == dxw.GethWnd()) {
|
||||||
OutTraceD("DestroyWindow: destroy main hwnd=%x\n", hWnd);
|
OutTraceD("DestroyWindow: destroy main hwnd=%x\n", hWnd);
|
||||||
if(1) return 0;
|
|
||||||
dxw.SethWnd(NULL);
|
dxw.SethWnd(NULL);
|
||||||
}
|
}
|
||||||
res=(*pDestroyWindow)(hWnd);
|
res=(*pDestroyWindow)(hWnd);
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user