1
0
mirror of https://github.com/DxWnd/DxWnd.reloaded synced 2024-12-30 09:25:35 +01:00

v2_04_19_src

This commit is contained in:
gho tik 2017-03-25 09:58:54 -04:00 committed by Refael Ackermann
parent b70f0095c3
commit 6c06d0dac5
26 changed files with 547 additions and 3970 deletions

View File

@ -1,153 +0,0 @@
[target]
maxres147=0
swapeffect147=0
maxddinterface147=7
slowratio147=1
scanline147=1
initresw147=0
initresh147=0
title148=State of War Warmonger
path148=D:\Games\State of War Warmonger\State of War - Warmonger.exe
startfolder148=
launchpath148=
module148=
opengllib148=
notes148=
registry148=
ver148=0
monitorid148=0
coord148=0
flag148=134234210
flagg148=134217728
flagh148=532
flagi148=4
flagj148=0
flagk148=0
flagl148=0
flagm148=0
tflag148=0
dflag148=0
posx148=50
posy148=50
sizx148=800
sizy148=600
maxfps148=0
initts148=0
winver148=0
maxres148=-1
swapeffect148=0
maxddinterface148=7
slowratio148=1
scanline148=1
initresw148=0
initresh148=0
title149=STCC Swedish TouringCar Championship
path149=D:\Games\STCC\STCC.exe
startfolder149=
launchpath149=
module149=
opengllib149=
notes149=Still slow and choppy in emulation mode
registry149=
ver149=0
monitorid149=0
coord149=0
flag149=136314914
flagg149=1207959552
flagh149=20
flagi149=138412036
flagj149=4256
flagk149=0
flagl149=0
flagm149=0
tflag149=0
dflag149=0
posx149=50
posy149=50
sizx149=800
sizy149=600
maxfps149=0
initts149=0
winver149=0
maxres149=-1
swapeffect149=0
maxddinterface149=7
slowratio149=1
scanline149=1
initresw149=0
initresh149=0
title150=Steel Saviour demo (T-Zwei)
path150=D:\Games\T-Zwei\TZwei.exe
startfolder150=
launchpath150=
module150=
opengllib150=
notes150=
registry150=
ver150=8
monitorid150=0
coord150=0
flag150=136314914
flagg150=1744961536
flagh150=20
flagi150=138412036
flagj150=4224
flagk150=65536
flagl150=0
flagm150=0
tflag150=0
dflag150=0
posx150=50
posy150=50
sizx150=800
sizy150=600
maxfps150=0
initts150=0
winver150=0
maxres150=-1
swapeffect150=0
maxddinterface150=7
slowratio150=2
scanline150=1
initresw150=0
initresh150=0
title151=Steel Saviour
path151=D:\Games\Steel Saviour\SteelSaviour.exe
startfolder151=
launchpath151=
module151=
opengllib151=
notes151=
registry151=
ver151=8
monitorid151=0
coord151=0
flag151=136314922
flagg151=1744961536
flagh151=20
flagi151=138412036
flagj151=4224
flagk151=65536
flagl151=0
flagm151=0
tflag151=0
dflag151=0
posx151=50
posy151=50
sizx151=800
sizy151=600
maxfps151=0
initts151=0
winver151=0
maxres151=-1
swapeffect151=0
maxddinterface151=7
slowratio151=2
scanline151=1
initresw151=0
initresh151=0
[window]
posx=1045
posy=520
sizx=320
sizy=200

View File

@ -1,7 +0,0 @@
[HKEY_LOCAL_MACHINE\SOFTWARE\Metropolis]
[HKEY_LOCAL_MACHINE\SOFTWARE\Metropolis\RoboRumble]
"Directory"=".\\"

View File

@ -0,0 +1,36 @@
[target]
title0=Alien vs. Predator Gold
path0=F:\Games\Avp Gold\avp.exe
startfolder0=
launchpath0=
module0=
opengllib0=
notes0=
registry0=
ver0=0
monitorid0=-1
coord0=0
flag0=673185826
flagg0=1207959552
flagh0=20
flagi0=134217732
flagj0=4224
flagk0=65536
flagl0=0
flagm0=0
tflag0=0
dflag0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=0
swapeffect0=0
maxddinterface0=7
slowratio0=2
scanline0=0
initresw0=800
initresh0=600

View File

@ -0,0 +1,36 @@
[target]
title0=Dracula - The Resurrection (GOG)
path0=D:\Games\Dracula Trilogy\Dracula - The Resurrection\Dracula.exe
startfolder0=
launchpath0=
module0=
opengllib0=
notes0=Works only after replaced the GOG dhook.dll with a dummy ddraw proxy\nDxWnd ddraw.dll proxy is fine, apoart form an initial warning dialog box.
registry0=
ver0=0
monitorid0=-1
coord0=0
flag0=673185826
flagg0=1207959552
flagh0=20
flagi0=205520900
flagj0=4224
flagk0=65536
flagl0=0
flagm0=8192
tflag0=0
dflag0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=0
swapeffect0=0
maxddinterface0=7
slowratio0=2
scanline0=0
initresw0=800
initresh0=600

View File

@ -0,0 +1,36 @@
[target]
title0=GP 500 (win2k obfuscated)
path0=D:\Games\gp500\gp500_win2k.exe
startfolder0=
launchpath0=
module0=
opengllib0=
notes0=
registry0=
ver0=0
monitorid0=-1
coord0=0
flag0=673185826
flagg0=1207959552
flagh0=20
flagi0=205520900
flagj0=4224
flagk0=65536
flagl0=0
flagm0=0
tflag0=0
dflag0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=0
swapeffect0=0
maxddinterface0=7
slowratio0=2
scanline0=0
initresw0=800
initresh0=600

View File

@ -0,0 +1,36 @@
[target]
title0=GTA window
path0=D:\Games\gta1\gtawin\gtawin.exe
startfolder0=
launchpath0=
module0=
opengllib0=
notes0=
registry0=\n[HKEY_LOCAL_MACHINE\SOFTWARE\DMA Design]\n\n[HKEY_LOCAL_MACHINE\SOFTWARE\DMA Design\Grand Theft Auto]\n"Language"=dword:00000000\n"Path"="."\n"Installed"=dword:00000001\n\n[HKEY_LOCAL_MACHINE\SOFTWARE\DMA Design\Grand Theft Auto\1.00.000]\n\n[HKEY_LOCAL_MACHINE\SOFTWARE\DMA Design\Grand Theft Auto\Controls]\n"Control 0"=dword:000000cb\n"Control 1"=dword:000000cd\n"Control 2"=dword:000000c8\n"Control 3"=dword:000000d0\n"Control 4"=dword:00000039\n"Control 5"=dword:0000001c\n"Control 6"=dword:0000001d\n"Control 7"=dword:0000002d\n"Control 8"=dword:0000002c\n"Control 9"=dword:0000000f\n\n
ver0=0
monitorid0=-1
coord0=0
flag0=673185826
flagg0=1207959552
flagh0=9236
flagi0=1212153860
flagj0=4224
flagk0=65536
flagl0=32768
flagm0=5
tflag0=0
dflag0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=0
swapeffect0=0
maxddinterface0=7
slowratio0=2
scanline0=0
initresw0=800
initresh0=600

36
build/exports/GTA2.dxw Normal file
View File

@ -0,0 +1,36 @@
[target]
title0=GTA2
path0=D:\Games\gta2\gta2.exe
startfolder0=
launchpath0=
module0=
opengllib0=
notes0=
registry0=
ver0=0
monitorid0=-1
coord0=0
flag0=673194018
flagg0=1208221696
flagh0=20
flagi0=138412036
flagj0=4224
flagk0=65536
flagl0=0
flagm0=0
tflag0=0
dflag0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=0
swapeffect0=0
maxddinterface0=7
slowratio0=2
scanline0=0
initresw0=800
initresh0=600

View File

@ -1,6 +1,6 @@
[target]
title0=Nightmare Creatures demo
path0=D:\Games\nc_demo\nc.exe
path0=f:\Games\nightmare creatures demo\nc.exe
startfolder0=
launchpath0=
module0=
@ -10,8 +10,8 @@ registry0=
ver0=0
monitorid0=-1
coord0=0
flag0=673185826
flagg0=1207959552
flag0=673194018
flagg0=1207959616
flagh0=20
flagi0=138412036
flagj0=4224

View File

@ -0,0 +1,36 @@
[target]
title0=Star Wars Jedi Knight II (multiplayer)
path0=D:\Games\Star Wars Jedi Knight II\GameData\jk2mp.exe
startfolder0=
launchpath0=D:\Games\Star Wars Jedi Knight II\JediOutcast.exe
module0=
opengllib0=
notes0=
registry0=
ver0=0
monitorid0=-1
coord0=0
flag0=706740258
flagg0=1208091136
flagh0=20
flagi0=138412036
flagj0=4224
flagk0=65536
flagl0=268435456
flagm0=0
tflag0=0
dflag0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=0
swapeffect0=0
maxddinterface0=7
slowratio0=2
scanline0=0
initresw0=800
initresh0=600

View File

@ -0,0 +1,36 @@
[target]
title0=Star Wars Jedi Knight II (singleplayer)
path0=D:\Games\Star Wars Jedi Knight II\GameData\jk2sp.exe
startfolder0=
launchpath0=D:\Games\Star Wars Jedi Knight II\JediOutcast.exe
module0=
opengllib0=
notes0=
registry0=
ver0=0
monitorid0=-1
coord0=0
flag0=706740258
flagg0=1208091136
flagh0=20
flagi0=138412036
flagj0=4224
flagk0=65536
flagl0=268435456
flagm0=0
tflag0=0
dflag0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=0
swapeffect0=0
maxddinterface0=7
slowratio0=2
scanline0=0
initresw0=800
initresh0=600

View File

@ -0,0 +1,36 @@
[target]
title0=Star Wars Tie Fighter (virtual joystick)
path0=D:\Games\TIE95\TIE95.EXE
startfolder0=
launchpath0=
module0=
opengllib0=
notes0=
registry0=
ver0=0
monitorid0=0
coord0=0
flag0=134217846
flagg0=1207959568
flagh0=16
flagi0=4261892
flagj0=0
flagk0=402655232
flagl0=1081344
flagm0=0
tflag0=0
dflag0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=6
winver0=0
maxres0=-1
swapeffect0=0
maxddinterface0=7
slowratio0=1
scanline0=1
initresw0=0
initresh0=0

View File

@ -0,0 +1,36 @@
[target]
title0=Stronghold Crusader
path0=F:\Games\Stronghold Crusader\Stronghold Crusader.exe
startfolder0=
launchpath0=
module0=
opengllib0=
notes0=
registry0=
ver0=0
monitorid0=-1
coord0=0
flag0=673185830
flagg0=1207959552
flagh0=20
flagi0=138412036
flagj0=4224
flagk0=65536
flagl0=0
flagm0=0
tflag0=0
dflag0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=0
swapeffect0=0
maxddinterface0=7
slowratio0=2
scanline0=0
initresw0=800
initresh0=600

File diff suppressed because it is too large Load Diff

View File

@ -1575,4 +1575,12 @@ v2.04.18
add: "Fix AdjustWindowRect" flag (FIXADJUSTWINDOWRECT) to selectively turn the AdjustWindowRect coordinate patching. The flag must be checked for "Man TT Super Bike" and unckecked for "Imperialism II".
add: "Hook child WindowProc" and "Hook dialog WindowProc" flags for better control over these risky operations.
fix: bad GetParent hook: caused crash when checking "Hook child WindowProc" flag.
fix: improvements in "Hybrid" emulation mode
fix: improvements in "Hybrid" emulation mode
v2.04.19/fx1
fix: major code reorganization: caps database & surface stack merged into a single object class, including ZBUFFER surfaces
fix: eliminated arbitrary surface properties settings
fix: joystick api promoted to hot patching to get a more powerful hooking
add: hooking of WM_STYLECHANGING/STYLECHANGED messages to allow D3D rendering within the window borders instead of over the whole window area - fixes "Nightmare Creatures" and others.
fix: fixed "Need fos Speed 5" peculiarity: QueryInterface of an object on top of itself.

View File

@ -985,8 +985,7 @@ HRESULT WINAPI extCreateSurface(int dxversion, CreateSurface_Type pCreateSurface
res=BuildPrimary(lpdd, pCreateSurface, lpddsd, dxversion, lplpdds, NULL);
if(res) return res;
lpDDSPrim = *lplpdds;
dxwss.PushPrimarySurface(lpDDSPrim, dxversion);
dxwcdb.PushCaps(*lplpdds, lpddsd->ddsCaps.dwCaps);
dxwss.PushPrimarySurface(lpDDSPrim, dxversion, lpddsd->ddsCaps.dwCaps);
RegisterPixelFormat(dxversion, lpDDSPrim);
if (BBCount){
@ -994,12 +993,11 @@ HRESULT WINAPI extCreateSurface(int dxversion, CreateSurface_Type pCreateSurface
// build emulated backbuffer surface
res=AttachBackBuffer(lpdd, pCreateSurface, lpddsd, dxversion, &lpDDSBack, NULL);
if(res) return res;
dxwss.PushBackBufferSurface(lpDDSBack, dxversion);
// here we try to guess what sort of capabilities would expose a built-in backbuffer surface
dwCaps = lpddsd->ddsCaps.dwCaps;
dwCaps &= ~DDSCAPS_PRIMARYSURFACE;
dwCaps |= (DDSCAPS_BACKBUFFER|DDSCAPS_VIDEOMEMORY);
dxwcdb.PushCaps(lpDDSBack, dwCaps);
dxwss.PushBackBufferSurface(lpDDSBack, dxversion, dwCaps);
}
if(IsTraceDDRAW){
@ -1036,14 +1034,12 @@ HRESULT WINAPI extCreateSurface(int dxversion, CreateSurface_Type pCreateSurface
}
res=BuildBackBuffer(lpdd, pCreateSurface, lpddsd, dxversion, lplpdds, NULL);
if(res == DD_OK) {
dxwss.PushBackBufferSurface(*lplpdds, dxversion);
dxwcdb.PushCaps(*lplpdds, lpddsd->ddsCaps.dwCaps);
}
if(res == DD_OK) dxwss.PushBackBufferSurface(*lplpdds, dxversion, lpddsd->ddsCaps.dwCaps);
return res;
}
// if nothing else, it's a generic/zbuffer surface
// Note: should DxWnd trace a memory 3D surface that will be used as reference surface for D3D CreateDevice?
res=BuildGeneric(lpdd, pCreateSurface, lpddsd, dxversion, lplpdds, pu);
if(!res) {
@ -1055,7 +1051,7 @@ HRESULT WINAPI extCreateSurface(int dxversion, CreateSurface_Type pCreateSurface
// save surface size expressed in bytes
extern int ZBufferSize;
ZBufferSize = lpddsd->dwWidth * lpddsd->dwHeight * (lpddsd->ddpfPixelFormat.dwZBufferBitDepth >> 3);
dxwcdb.PushCaps(*lplpdds, lpddsd->ddsCaps.dwCaps);
dxwss.PushZBufferSurface(*lplpdds, dxversion, lpddsd->ddsCaps.dwCaps);
OutTraceDW("CreateSurface: ZBufferSize=%d\n", ZBufferSize);
}
}

View File

@ -567,7 +567,7 @@ static DWORD SetZBufferCaps(DWORD dwCaps)
if(dwCaps & ~DDSCAPS_ZBUFFER) return dwCaps;
// ... else try to cope with primary surface caps
dwCaps = dxwcdb.GetCaps(dxwss.GetPrimarySurface());
dwCaps = dxwss.GetCaps(dxwss.GetPrimarySurface());
dwCaps &= ~(DDSCAPS_PRIMARYSURFACE|DDSCAPS_FLIP|DDSCAPS_BACKBUFFER|DDSCAPS_3DDEVICE|DDSCAPS_COMPLEX);
dwCaps |= DDSCAPS_ZBUFFER;
return dwCaps;
@ -2588,17 +2588,17 @@ HRESULT WINAPI extGetAttachedSurface(int dxversion, GetAttachedSurface_Type pGet
// compatible with those of the original surface!
DWORD dwCaps;
lpDDZBuffer = *lplpddas;
dwCaps = dxwcdb.GetCaps(*lplpddas);
dwCaps = dxwss.GetCaps(*lplpddas);
// v2.04.17 - beware: the caps db is not properly cleaned on surface destruction, so it may happen
// that you get a fake-known case where the caps are referred to some other surface type.
// Happened in "Star Treck: Armada" where the ZBUFFER collects an old PRIMARY caps entry.
if(!dwCaps || !(dwCaps & DDSCAPS_ZBUFFER)){
dwCaps = dxwcdb.GetCaps(lpdds);
dwCaps = dxwss.GetCaps(lpdds);
if(dwCaps){
dwCaps &= ~(DDSCAPS_PRIMARYSURFACE|DDSCAPS_FLIP|DDSCAPS_BACKBUFFER|DDSCAPS_3DDEVICE|DDSCAPS_COMPLEX);
dwCaps |= DDSCAPS_ZBUFFER;
//if(dwCaps & DDSCAPS_VIDEOMEMORY) dwCaps|=DDSCAPS_LOCALVIDMEM;
dxwcdb.PushCaps(*lplpddas, dwCaps);
dxwss.PushZBufferSurface(*lplpddas, dxversion, dwCaps);
sMode = "derived";
}
else sMode = "unknown";
@ -3303,6 +3303,7 @@ static HRESULT WINAPI extBltFast(int dxversion, Blt_Type pBlt, BltFast_Type pBlt
}
// consistency check ....
// situation found for instance in "Warlords Battlecry II demo".
if (lpsrcrect)
if((lpsrcrect->left >= lpsrcrect->right) || (lpsrcrect->top >= lpsrcrect->bottom)) {
OutTraceDW("BltFast: ASSERT bad rect at %d\n", __LINE__);
@ -3859,7 +3860,7 @@ static HRESULT WINAPI extUnlock(int dxversion, Unlock4_Type pUnlock, LPDIRECTDRA
OutTrace("Unlock(%d): lpdds=%x%s %s\n", dxversion, lpdds, (IsPrim ? "(PRIM)": (IsBack ? "(BACK)" : "")), sRect);
}
if ((dxw.dwFlags8 & ZBUFFERHARDCLEAN) && (dxwcdb.GetCaps(lpdds) & DDSCAPS_ZBUFFER)){
if ((dxw.dwFlags8 & ZBUFFERHARDCLEAN) && dxwss.IsAZBufferSurface(lpdds)){
DWORD dwSize = (dxversion<4)?sizeof(DDSURFACEDESC):sizeof(DDSURFACEDESC2);
DDSURFACEDESC2 ddsd;
memset(&ddsd, 0, dwSize);
@ -3989,7 +3990,7 @@ static HRESULT WINAPI extUnlockDir(int dxversion, Unlock4_Type pUnlock, LPDIRECT
OutTrace("Unlock(%d): lpdds=%x%s %s\n", dxversion, lpdds, (IsPrim ? "(PRIM)": (IsBack ? "(BACK)" : "")), sRect);
}
if ((dxw.dwFlags8 & ZBUFFERHARDCLEAN) && (dxwcdb.GetCaps(lpdds) & DDSCAPS_ZBUFFER)){
if ((dxw.dwFlags8 & ZBUFFERHARDCLEAN) && dxwss.IsAZBufferSurface(lpdds)){
DWORD dwSize = (dxversion<4)?sizeof(DDSURFACEDESC):sizeof(DDSURFACEDESC2);
DDSURFACEDESC2 ddsd;
memset(&ddsd, 0, dwSize);
@ -4720,6 +4721,13 @@ static HRESULT WINAPI extAddAttachedSurface(AddAttachedSurface_Type pAddAttached
// just remember this for further handling in the Flip operation.
// But beware: this holds to BACKBUFFER surfaces only, and NOT for attached ZBUFFERS or similar!
// If the surface was created with DDSCAPS_BACKBUFFER/ZBUFFER capabilities, it should be in the
// surface stack already, so better avoid setting unknown version and capabilities here...
// Note: should DxWnd trace the difference between a potential BACK/ZBUFFER surface and an active one?
// The program can create a surface with backbuffer/zbuffer capabilities, but assign the effective
// role afterwards, here while performing the attach to the master surface.
IsPrim=dxwss.IsAPrimarySurface(lpdds);
IsBack=dxwss.IsABackBufferSurface(lpdds);
OutTraceDDRAW("AddAttachedSurface: lpdds=%x%s lpddsadd=%x%s\n", lpdds, IsPrim?"(PRIM)":(IsBack?"(BACK)":""), lpddsadd, (lpddsadd==lpDDZBuffer)?"(ZBUF)":"");
@ -4742,7 +4750,6 @@ static HRESULT WINAPI extAddAttachedSurface(AddAttachedSurface_Type pAddAttached
if ((dxw.dwFlags1 & EMULATESURFACE) && (res==DDERR_CANNOTATTACHSURFACE) ||
(res==DDERR_NOEXCLUSIVEMODE))
OutTraceDW("AddAttachedSurface: emulating BACKBUFFER attach on PRIMARY\n");
dxwss.PushBackBufferSurface(lpddsadd, 1);
res=DD_OK;
}
//else if (IsBack) {
@ -4757,43 +4764,7 @@ static HRESULT WINAPI extAddAttachedSurface(AddAttachedSurface_Type pAddAttached
}
}
}
else {
// AddAttachedSurface successful, manage CAPS propagation
if ((dxw.dwFlags1 & EMULATESURFACE) && (IsPrim || IsBack)){
}
HRESULT sdres;
DDSURFACEDESC2 sd;
sd.dwSize=Set_dwSize_From_Surface();
sdres=lpddsadd->GetSurfaceDesc((DDSURFACEDESC *)&sd);
if (sdres)
OutTraceE("AddAttachedSurface: GetSurfaceDesc ERROR res=%x at %d\n", sdres, __LINE__);
else
OutTraceDW("AddAttachedSurface: GetSurfaceDesc dwCaps=%x(%s)\n",
sd.ddsCaps.dwCaps, ExplainDDSCaps(sd.ddsCaps.dwCaps));
if (IsPrim){
if (sd.ddsCaps.dwCaps & DDSCAPS_BACKBUFFER)
OutTraceDW("AddAttachedSurface: registering BACKBUFFER attach on PRIMARY\n");
dxwss.PushBackBufferSurface(lpddsadd, 1);
}
//else if (IsBack) or plain surface for ZBUFFER {
else {
// v2.02.13: emulate ZBUFFER attach to backbuffer/plain surface
if ((sd.ddsCaps.dwCaps & DDSCAPS_ZBUFFER) && (dxw.dwFlags1 & EMULATESURFACE)){
DWORD dwCaps;
dwCaps = dxwcdb.GetCaps(lpddsadd);
if(!dwCaps){
OutTraceDW("AddAttachedSurface: registering ZBUFFER attach on %s surface\n", IsBack ? "BACKBUFFER" : "PLAIN");
dwCaps = dxwcdb.GetCaps(lpdds);
if(dwCaps){
dwCaps &= ~(DDSCAPS_PRIMARYSURFACE|DDSCAPS_FLIP|DDSCAPS_BACKBUFFER|DDSCAPS_3DDEVICE|DDSCAPS_COMPLEX);
dwCaps |= DDSCAPS_ZBUFFER;
//if(dwCaps & DDSCAPS_VIDEOMEMORY) dwCaps|=DDSCAPS_LOCALVIDMEM;
dxwcdb.PushCaps(lpddsadd, dwCaps);
}
}
}
}
}
if (res) OutTraceE("AddAttachedSurface: ERROR %x(%s)\n", res, ExplainDDError(res));
return res;
}
@ -4887,7 +4858,7 @@ static HRESULT WINAPI extGetCapsS(int dxInterface, GetCapsS_Type pGetCapsS, LPDI
}
if (IsZBuf) {
IsFixed=TRUE;
caps->dwCaps = SetZBufferCaps(dxwcdb.GetCaps(lpdds));
caps->dwCaps = SetZBufferCaps(dxwss.GetCaps(lpdds));
break;
}
break; // inconditional break;
@ -4969,7 +4940,7 @@ static HRESULT WINAPI extGetSurfaceDesc(int dxversion, GetSurfaceDesc_Type pGetS
}
if (IsZBuf) {
IsFixed=TRUE;
lpddsd->ddsCaps.dwCaps = SetZBufferCaps(dxwcdb.GetCaps(lpdds));
lpddsd->ddsCaps.dwCaps = SetZBufferCaps(dxwss.GetCaps(lpdds));
break;
}
break; // inconditional break

View File

@ -29,7 +29,6 @@
dxwCore dxw;
dxwSStack dxwss;
dxwWStack dxwws;
dxwCapsDB dxwcdb;
dxwSDC sdc;
dxwFStack fontdb;
GetWindowLong_Type pGetWindowLong;

View File

@ -29,6 +29,7 @@ typedef struct {
USHORT uRef;
USHORT uRole;
USHORT uVersion;
DWORD dwCaps;
} SurfaceDB_Type;
typedef struct {
@ -37,8 +38,9 @@ typedef struct {
} CapsDB_Type;
typedef enum {
SURFACE_ROLE_PRIMARY = 1,
SURFACE_ROLE_BACKBUFFER
SURFACE_ROLE_PRIMARY = 0,
SURFACE_ROLE_BACKBUFFER,
SURFACE_ROLE_ZBUFFER
} Enum_Surface_Role_Type;
typedef struct {
@ -248,41 +250,31 @@ public:
public:
char *ExplainSurfaceRole(LPDIRECTDRAWSURFACE);
void ClearSurfaceList();
void PushPrimarySurface(LPDIRECTDRAWSURFACE, int);
void PushPrimarySurface(LPDIRECTDRAWSURFACE, int, DWORD);
BOOL IsAPrimarySurface(LPDIRECTDRAWSURFACE);
void UnrefSurface(LPDIRECTDRAWSURFACE);
LPDIRECTDRAWSURFACE GetPrimarySurface(void);
void PushBackBufferSurface(LPDIRECTDRAWSURFACE, int);
void PushBackBufferSurface(LPDIRECTDRAWSURFACE, int, DWORD);
BOOL IsABackBufferSurface(LPDIRECTDRAWSURFACE);
LPDIRECTDRAWSURFACE GetBackBufferSurface(void);
void PopSurface(LPDIRECTDRAWSURFACE);
LPDIRECTDRAWSURFACE GetZBufferSurface(void);
void PushZBufferSurface(LPDIRECTDRAWSURFACE, int, DWORD);
BOOL IsAZBufferSurface(LPDIRECTDRAWSURFACE);
LPDIRECTDRAWSURFACE GetBackBufferSurface(void); void PopSurface(LPDIRECTDRAWSURFACE);
void DuplicateSurface(LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE, int);
DWORD GetCaps(LPDIRECTDRAWSURFACE);
protected:
SurfaceDB_Type SurfaceDB[DDSQLEN+1];
LPDIRECTDRAWSURFACE lpDDSPrimary;
LPDIRECTDRAWSURFACE lpDDSBackBuffer;
LPDIRECTDRAWSURFACE lpDDSZBuffer;
private:
void PushSurface(LPDIRECTDRAWSURFACE, USHORT, USHORT);
void PushSurface(LPDIRECTDRAWSURFACE, USHORT, USHORT, DWORD);
LPDIRECTDRAWSURFACE GetSurfaceByRole(USHORT);
void SetSurfaceEntry(LPDIRECTDRAWSURFACE, USHORT, USHORT);
};
class dxwCapsDB
{
public:
dxwCapsDB();
virtual ~dxwCapsDB();
public:
// void ClearCapsDB();
void PushCaps(LPDIRECTDRAWSURFACE, DWORD);
DWORD GetCaps(LPDIRECTDRAWSURFACE);
protected:
CapsDB_Type CapsDB[DDSQLEN+1];
};
typedef struct {
HWND hwnd;
WNDPROC wndproc;
@ -327,7 +319,6 @@ protected:
extern dxwCore dxw;
extern dxwSStack dxwss;
extern dxwWStack dxwws;
extern dxwCapsDB dxwcdb;
extern dxwFStack fontdb;
typedef enum {

View File

@ -27,7 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "TlHelp32.h"
#define VERSION "2.04.18"
#define VERSION "2.04.19.fx1"
#define DDTHREADLOCK 1

Binary file not shown.

View File

@ -361,10 +361,6 @@
RelativePath=".\dxmapping.cpp"
>
</File>
<File
RelativePath=".\dxwcapsdb.cpp"
>
</File>
<File
RelativePath=".\dxwcore.cpp"
>

View File

@ -13,8 +13,10 @@
dxwSStack::dxwSStack()
{
// three variables used as cache ...
lpDDSPrimary = NULL;
lpDDSBackBuffer = NULL;
lpDDSZBuffer = NULL;
memset(SurfaceDB, 0, sizeof(SurfaceDB));
}
@ -26,15 +28,16 @@ static char *sRole(USHORT role)
{
char *s;
switch (role){
case 0: s="(NULL)"; break; // should never happen ...
case SURFACE_ROLE_PRIMARY: s="(PRIM)"; break;
case SURFACE_ROLE_BACKBUFFER: s="(BACK)"; break;
case SURFACE_ROLE_ZBUFFER: s="(ZBUF)"; break;
default: s="??"; break; // should never happen ...
}
return s;
}
#ifdef DXW_SURFACE_STACK_TRACING
extern char*ExplainDDSCaps(DWORD);
static void CheckSurfaceList(SurfaceDB_Type *SurfaceDB)
{
char sMsg[81];
@ -59,8 +62,9 @@ static void DumpSurfaceList(SurfaceDB_Type *SurfaceDB)
{
for (int i=0;i<DDSQLEN;i++) {
if (SurfaceDB[i].lpdds == NULL) break;
OutTrace("--- SURFACELIST DUMP: i=%d lpssd=%x%s ref=%d vers=%d\n", i,
SurfaceDB[i].lpdds, sRole(SurfaceDB[i].uRole), SurfaceDB[i].uRef, SurfaceDB[i].uVersion);
OutTrace("--- SURFACELIST DUMP: i=%d lpssd=%x%s ref=%d vers=%d caps=%x(%s)\n", i,
SurfaceDB[i].lpdds, sRole(SurfaceDB[i].uRole), SurfaceDB[i].uRef, SurfaceDB[i].uVersion,
SurfaceDB[i].dwCaps, ExplainDDSCaps(SurfaceDB[i].dwCaps));
}
}
#endif
@ -85,26 +89,54 @@ void dxwSStack::ClearSurfaceList()
#ifdef DXW_SURFACE_STACK_TRACING
OutTrace(">>> SURFACELIST CLEAR ALL\n");
#endif
for (int i=0;i<DDSQLEN;i++) {
// v2.03.91.fx5: emptying the list entirely is no good for "Warhammer 40K Rites of War"
// better leave the last used primary and backbuffer surfaces.
int i;
SurfaceDB_Type LastEntries[3];
LastEntries[0].lpdds = 0;
LastEntries[1].lpdds = 0;
LastEntries[2].lpdds = 0;
lpDDSPrimary = NULL;
lpDDSBackBuffer = NULL;
lpDDSZBuffer = NULL;
// search for last (more recent) entries and copy to safe place
for (i=0;i<DDSQLEN;i++) {
if(SurfaceDB[i].lpdds == NULL) break;
LastEntries[SurfaceDB[i].uRole]=SurfaceDB[i];
}
// clear all
for (i=0;i<DDSQLEN;i++) {
SurfaceDB[i].lpdds = NULL;
SurfaceDB[i].uRef = FALSE;
SurfaceDB[i].uRole = 0;
SurfaceDB[i].uVersion = 0;
}
// v2.03.91.fx5: emptying the list entirely is no good for "Warhammer 40K Rites of War"
// better leave the last used primary and backbuffer surfaces.
if(lpDDSPrimary){
SurfaceDB[0].lpdds = lpDDSPrimary;
SurfaceDB[0].uRef = TRUE;
SurfaceDB[0].uRole = SURFACE_ROLE_PRIMARY;
SurfaceDB[0].uVersion = 0;
// bring back the valid entries to db
i = 0;
if(LastEntries[0].lpdds) {
SurfaceDB[i++]=LastEntries[0];
lpDDSPrimary = LastEntries[0].lpdds;
#ifdef DXW_SURFACE_STACK_TRACING
OutTrace(">>> SAVED lpDDSPrimary=%x\n", lpDDSPrimary);
#endif
}
if(lpDDSBackBuffer){
SurfaceDB[1].lpdds = lpDDSBackBuffer;
SurfaceDB[1].uRef = TRUE;
SurfaceDB[1].uRole = SURFACE_ROLE_BACKBUFFER;
SurfaceDB[1].uVersion = 0;
if(LastEntries[1].lpdds) {
SurfaceDB[i++]=LastEntries[1];
lpDDSBackBuffer = LastEntries[1].lpdds;
#ifdef DXW_SURFACE_STACK_TRACING
OutTrace(">>> SAVED lpDDSBackBuffer=%x\n", lpDDSBackBuffer);
#endif
}
if(LastEntries[2].lpdds) {
SurfaceDB[i++]=LastEntries[2];
lpDDSZBuffer = LastEntries[2].lpdds;
#ifdef DXW_SURFACE_STACK_TRACING
OutTrace(">>> SAVED lpDDSZBuffer=%x\n", lpDDSZBuffer);
#endif
}
#ifdef DXW_SURFACE_STACK_TRACING
DumpSurfaceList(SurfaceDB);
#endif
}
void dxwSStack::UnrefSurface(LPDIRECTDRAWSURFACE ps)
@ -115,19 +147,17 @@ void dxwSStack::UnrefSurface(LPDIRECTDRAWSURFACE ps)
if ((SurfaceDB[i].lpdds==ps) || SurfaceDB[i].lpdds==0) break;
// if found, delete it by left-copying each entry until end of array
if (SurfaceDB[i].lpdds == ps) {
SurfaceDB[i].uRef = FALSE;
#ifdef DXW_SURFACE_STACK_TRACING
OutTraceSDB(">>> SURFACELIST UNREF: lpdds=%x%s ref=%x vers=%d\n", ps, sRole(SurfaceDB[i].uRole), SurfaceDB[i].uRef, SurfaceDB[i].uVersion);
#endif
SurfaceDB[i].uRef = FALSE;
if(ps == lpDDSPrimary) lpDDSPrimary = GetSurfaceByRole(SURFACE_ROLE_PRIMARY);
if(ps == lpDDSBackBuffer) lpDDSBackBuffer = GetSurfaceByRole(SURFACE_ROLE_BACKBUFFER);
}
#ifdef DXW_SURFACE_STACK_TRACING
DumpSurfaceList(SurfaceDB);
#endif
}
void dxwSStack::PushSurface(LPDIRECTDRAWSURFACE ps, USHORT role, USHORT version)
void dxwSStack::PushSurface(LPDIRECTDRAWSURFACE ps, USHORT role, USHORT version, DWORD dwCaps)
{
int i;
SurfaceDB_Type *e;
@ -148,21 +178,56 @@ void dxwSStack::PushSurface(LPDIRECTDRAWSURFACE ps, USHORT role, USHORT version)
e->uRole = role;
e->uRef = TRUE;
e->uVersion = version;
e->dwCaps = dwCaps;
switch(e->uRole){
case SURFACE_ROLE_PRIMARY: lpDDSPrimary = e->lpdds; break;
case SURFACE_ROLE_BACKBUFFER: lpDDSBackBuffer = e->lpdds; break;
case SURFACE_ROLE_ZBUFFER: lpDDSZBuffer = e->lpdds; break;
}
#ifdef DXW_SURFACE_STACK_TRACING
DumpSurfaceList(SurfaceDB);
#endif
}
void dxwSStack::PushPrimarySurface(LPDIRECTDRAWSURFACE ps, int version)
void dxwSStack::PushPrimarySurface(LPDIRECTDRAWSURFACE ps, int version, DWORD dwCaps)
{
PushSurface(ps, SURFACE_ROLE_PRIMARY, (USHORT)version);
lpDDSPrimary = ps;
PushSurface(ps, SURFACE_ROLE_PRIMARY, (USHORT)version, dwCaps);
}
void dxwSStack::PushBackBufferSurface(LPDIRECTDRAWSURFACE ps, int version)
void dxwSStack::PushBackBufferSurface(LPDIRECTDRAWSURFACE ps, int version, DWORD dwCaps)
{
PushSurface(ps, SURFACE_ROLE_BACKBUFFER, (USHORT)version);
lpDDSBackBuffer = ps;
PushSurface(ps, SURFACE_ROLE_BACKBUFFER, (USHORT)version, dwCaps);
}
void dxwSStack::PushZBufferSurface(LPDIRECTDRAWSURFACE ps, int version, DWORD dwCaps)
{
PushSurface(ps, SURFACE_ROLE_ZBUFFER, (USHORT)version, dwCaps);
}
void dxwSStack::DuplicateSurface(LPDIRECTDRAWSURFACE psfrom, LPDIRECTDRAWSURFACE psto, int version)
{
int i, j;
SurfaceDB_Type *e;
#ifdef DXW_SURFACE_STACK_TRACING
OutTraceSDB(">>> SURFACELIST DUPL: from=%x to=%x vers=%d\n", psfrom, psto, version);
#endif
for (i=0;i<DDSQLEN;i++) {
e=&SurfaceDB[i];
if ((e->lpdds==psfrom) || (e->lpdds==(DWORD)0)) break; // got matching entry or end of the list
}
// if not found, return
if (!e->lpdds) return;
// search for an empty slot
j = i;
for (j=0;j<DDSQLEN;j++) if (!SurfaceDB[j].lpdds) break;
// duplicate the entry with the new lpdds and version but old role / capabilities
SurfaceDB[j] = SurfaceDB[i];
SurfaceDB[j].lpdds = psto;
SurfaceDB[j].uVersion = version;
#ifdef DXW_SURFACE_STACK_TRACING
DumpSurfaceList(SurfaceDB);
#endif
}
void dxwSStack::PopSurface(LPDIRECTDRAWSURFACE ps)
@ -187,8 +252,7 @@ void dxwSStack::PopSurface(LPDIRECTDRAWSURFACE ps)
SurfaceDB[DDSQLEN].uRole=0;
SurfaceDB[DDSQLEN].uRef=0;
SurfaceDB[DDSQLEN].uVersion=0;
if (ps == lpDDSPrimary) lpDDSPrimary = GetSurfaceByRole(SURFACE_ROLE_PRIMARY);
if (ps == lpDDSBackBuffer) lpDDSBackBuffer = GetSurfaceByRole(SURFACE_ROLE_BACKBUFFER);
SurfaceDB[DDSQLEN].dwCaps=0;
}
#ifdef DXW_SURFACE_STACK_TRACING
DumpSurfaceList(&SurfaceDB[0]);
@ -226,6 +290,18 @@ BOOL dxwSStack::IsABackBufferSurface(LPDIRECTDRAWSURFACE ps)
return FALSE;
}
BOOL dxwSStack::IsAZBufferSurface(LPDIRECTDRAWSURFACE ps)
{
int i;
// treat NULL surface ptr as a non primary
if(!ps) return FALSE;
for (i=0;i<DDSQLEN;i++) {
if (SurfaceDB[i].lpdds==0) return FALSE;
if (SurfaceDB[i].lpdds==ps) return (SurfaceDB[i].uRole == SURFACE_ROLE_ZBUFFER);
}
return FALSE;
}
LPDIRECTDRAWSURFACE dxwSStack::GetSurfaceByRole(USHORT role)
{
// Get a surface marked for the desired role (either PRIMARY or BACKBUFFER) and
@ -255,3 +331,23 @@ LPDIRECTDRAWSURFACE dxwSStack::GetBackBufferSurface(void)
//return GetSurfaceByRole(SURFACE_ROLE_BACKBUFFER);
return lpDDSBackBuffer;
}
LPDIRECTDRAWSURFACE dxwSStack::GetZBufferSurface(void)
{
//return GetSurfaceByRole(SURFACE_ROLE_BACKBUFFER);
return lpDDSZBuffer;
}
DWORD dxwSStack::GetCaps(LPDIRECTDRAWSURFACE ps)
{
for (int i=0;i<DDSQLEN;i++) {
if (SurfaceDB[i].lpdds==0) return 0;
if (SurfaceDB[i].lpdds==ps) {
#ifdef DXW_SURFACE_STACK_TRACING
OutTraceSDB(">>> GETCAPS: lpdds=%x caps=%x(%s)\n", ps, SurfaceDB[i].dwCaps, ExplainDDSCaps(SurfaceDB[i].dwCaps));
#endif
return SurfaceDB[i].dwCaps;
}
}
return 0;
}

View File

@ -43,7 +43,6 @@ HRESULT WINAPI extQueryInterfaceDX(int dxversion, QueryInterface_Type pQueryInte
BOOL IsBack;
int iObjectType;
int iObjectVersion;
DWORD dwCaps;
extern LPDIRECTDRAWSURFACE lpDDSEmu_Prim;
IsPrim=dxwss.IsAPrimarySurface((LPDIRECTDRAWSURFACE)lpdds);
@ -197,58 +196,31 @@ HRESULT WINAPI extQueryInterfaceDX(int dxversion, QueryInterface_Type pQueryInte
OutTraceDW("QueryInterface: lpdds=%x REFIID=%x obp=%x obj=%s version=%d ret=0\n",
lpdds, riid.Data1, *obp, sLabel, iObjectVersion);
// v2.04.19.fx1: Beware! "Need for Speed 5" performs QueryInterface of one sorface on top of itself!
// This is allowed, but in this case calling dxwss.PopSurface before dxwss.DuplicateSurface would
// clear the capabilities to be copied over to the (not) new surface.
// fixed by inserting an "if" statement before PopSurface
switch(iObjectType){
case TYPE_OBJECT_UNKNOWN:
dwCaps = dxwcdb.GetCaps((LPDIRECTDRAWSURFACE)lpdds);
if (dwCaps) {
OutTraceDW("QueryInterface(S): PASS lpdds=%x->%x caps=%x(%s)\n", lpdds, *obp, dwCaps, ExplainDDSCaps(dwCaps));
dxwcdb.PushCaps(*(LPDIRECTDRAWSURFACE *)obp, dwCaps);
}
else {
OutTraceDW("QueryInterface(S): NO CAPS\n");
}
if(*obp != lpdds) dxwss.PopSurface((LPDIRECTDRAWSURFACE)*obp); // clear any past attribution
dxwss.DuplicateSurface((LPDIRECTDRAWSURFACE)lpdds, (LPDIRECTDRAWSURFACE)*obp, iObjectVersion);
break;
#ifdef YEARDEAD
case TYPE_OBJECT_UNKNOWN:
// triky: some games (actually, only one: "Year Dead") perform a QueryInterface with IID_UNKNOWN
// to duplicate the object. In this case, the CAPS should be passed, but maybe the new object
// also needs hooking?
dwCaps = dxwcdb.GetCaps((LPDIRECTDRAWSURFACE)lpdds);
if (dwCaps) {
OutTraceDW("QueryInterface(S): PASS lpdds=%x->%x caps=%x(%s)\n", lpdds, *obp, dwCaps, ExplainDDSCaps(dwCaps));
dxwcdb.PushCaps(*(LPDIRECTDRAWSURFACE *)obp, dwCaps);
if(dwCaps & DDSCAPS_PRIMARYSURFACE) {
HookDDSurface((LPDIRECTDRAWSURFACE *)obp, 1, TRUE);
dxwss.PushPrimarySurface((LPDIRECTDRAWSURFACE)*obp, dxversion);
}
else HookDDSurface((LPDIRECTDRAWSURFACE *)obp, 1, FALSE);
}
break;
#endif
case TYPE_OBJECT_DIRECTDRAW:
HookDDSession((LPDIRECTDRAW *)obp, iObjectVersion);
break;
case TYPE_OBJECT_DDRAWSURFACE:
dxw.dwDDVersion=iObjectVersion;
if(*obp != lpdds) dxwss.PopSurface((LPDIRECTDRAWSURFACE)*obp); // clear any past attribution
dxwss.DuplicateSurface((LPDIRECTDRAWSURFACE)lpdds, (LPDIRECTDRAWSURFACE)*obp, iObjectVersion);
if(IsPrim){
OutTraceDW("QueryInterface(S): primary=%x new=%x\n", lpdds, *obp);
dxwss.PushPrimarySurface((LPDIRECTDRAWSURFACE)*obp, iObjectVersion);
HookDDSurface((LPDIRECTDRAWSURFACE *)obp, dxw.dwDDVersion, TRUE);
}
else{
if(IsBack) dxwss.PushBackBufferSurface((LPDIRECTDRAWSURFACE)*obp, iObjectVersion);
else dxwss.PopSurface((LPDIRECTDRAWSURFACE)*obp); // no primary, no backbuffer, then pop.
// v2.02.13: seems that hooking inconditionally gives troubles. What is the proper safe hook condition?
HookDDSurface((LPDIRECTDRAWSURFACE *)obp, dxw.dwDDVersion, FALSE);
}
dwCaps = dxwcdb.GetCaps((LPDIRECTDRAWSURFACE)lpdds);
if (dwCaps) {
OutTraceDW("QueryInterface(S): PASS lpdds=%x->%x caps=%x(%s)\n", lpdds, *obp, dwCaps, ExplainDDSCaps(dwCaps));
dxwcdb.PushCaps(*(LPDIRECTDRAWSURFACE *)obp, dwCaps);
}
else {
OutTraceDW("QueryInterface(S): NO CAPS\n");
}
break;
case TYPE_OBJECT_CLIPPER:
HookDDClipper((LPDIRECTDRAWCLIPPER *)obp); // there is a single Clipper intrface!

View File

@ -89,10 +89,10 @@ static HookEntryEx_Type RemapHooks[]={
};
static HookEntryEx_Type JoyHooks[]={
{HOOK_IAT_CANDIDATE, 0, "joyGetNumDevs", NULL, (FARPROC *)&pjoyGetNumDevs, (FARPROC)extjoyGetNumDevs},
{HOOK_IAT_CANDIDATE, 0, "joyGetDevCapsA", NULL, (FARPROC *)&pjoyGetDevCapsA, (FARPROC)extjoyGetDevCapsA},
{HOOK_IAT_CANDIDATE, 0, "joyGetPosEx", NULL, (FARPROC *)&pjoyGetPosEx, (FARPROC)extjoyGetPosEx},
{HOOK_IAT_CANDIDATE, 0, "joyGetPos", NULL, (FARPROC *)&pjoyGetPos, (FARPROC)extjoyGetPos},
{HOOK_HOT_CANDIDATE, 0, "joyGetNumDevs", NULL, (FARPROC *)&pjoyGetNumDevs, (FARPROC)extjoyGetNumDevs},
{HOOK_HOT_CANDIDATE, 0, "joyGetDevCapsA", NULL, (FARPROC *)&pjoyGetDevCapsA, (FARPROC)extjoyGetDevCapsA},
{HOOK_HOT_CANDIDATE, 0, "joyGetPosEx", NULL, (FARPROC *)&pjoyGetPosEx, (FARPROC)extjoyGetPosEx},
{HOOK_HOT_CANDIDATE, 0, "joyGetPos", NULL, (FARPROC *)&pjoyGetPos, (FARPROC)extjoyGetPos},
{HOOK_IAT_CANDIDATE, 0, 0, NULL, 0, 0} // terminator
};

View File

@ -206,22 +206,31 @@ void SetIdlePriority(BOOL idle)
void ExplainMsg(char *ApiName, HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
char sPos[161];
sPos[160]=0;
char sPos[321];
sPos[320]=0;
sPos[0]=0;
switch(Msg){
case WM_WINDOWPOSCHANGING:
case WM_WINDOWPOSCHANGED:
LPWINDOWPOS wp;
wp = (LPWINDOWPOS)lParam;
sprintf_s(sPos, 160, " pos=(%d,%d) size=(%dx%d) flags=%x(%s)", wp->x, wp->y, wp->cx, wp->cy, wp->flags, ExplainWPFlags(wp->flags));
sprintf_s(sPos, 320, " pos=(%d,%d) size=(%dx%d) flags=%x(%s)", wp->x, wp->y, wp->cx, wp->cy, wp->flags, ExplainWPFlags(wp->flags));
break;
case WM_MOVE:
sprintf_s(sPos, 160, " pos=(%d,%d)", HIWORD(lParam), LOWORD(lParam));
sprintf_s(sPos, 320, " pos=(%d,%d)", HIWORD(lParam), LOWORD(lParam));
break;
case WM_STYLECHANGING:
case WM_STYLECHANGED:
LPSTYLESTRUCT style;
style = (LPSTYLESTRUCT)lParam;
if(wParam == GWL_STYLE) sprintf_s(sPos, 320, "style=%x(%s)->%x(%s)",
style->styleOld, ExplainStyle(style->styleOld), style->styleNew, ExplainStyle(style->styleNew));
if(wParam == GWL_EXSTYLE) sprintf_s(sPos, 320, "exstyle=%x(%s)->%x(%s)",
style->styleOld, ExplainExStyle(style->styleOld), style->styleNew, ExplainExStyle(style->styleNew));
break;
case WM_SIZE:
static char *modes[5]={"RESTORED", "MINIMIZED", "MAXIMIZED", "MAXSHOW", "MAXHIDE"};
sprintf_s(sPos, 160, " mode=SIZE_%s size=(%dx%d)", modes[wParam % 5], HIWORD(lParam), LOWORD(lParam));
sprintf_s(sPos, 320, " mode=SIZE_%s size=(%dx%d)", modes[wParam % 5], HIWORD(lParam), LOWORD(lParam));
break;
}
OutTrace("%s[%x]: WinMsg=[0x%x]%s(%x,%x) %s\n", ApiName, hwnd, Msg, ExplainWinMessage(Msg), wParam, lParam, sPos);
@ -385,6 +394,13 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
//return 0;
}
break;
case WM_STYLECHANGING:
case WM_STYLECHANGED:
if(dxw.dwFlags1 & LOCKWINSTYLE) {
OutTraceDW("WindowProc: %s - suppressed\n", message==WM_STYLECHANGING ? "WM_STYLECHANGING" : "WM_STYLECHANGED");
return 1;
}
break;
case WM_WINDOWPOSCHANGING:
case WM_WINDOWPOSCHANGED:
if(dxw.Windowize && dxw.IsFullScreen()){

Binary file not shown.