mirror of
https://github.com/DxWnd/DxWnd.reloaded
synced 2024-12-30 09:25:35 +01:00
v2_02_19_src
Former-commit-id: 3808bbe5af8b015d87647397a1b618985d6bb309
This commit is contained in:
parent
061a3d0f34
commit
24d116b534
@ -79,6 +79,7 @@
|
|||||||
|
|
||||||
// third flags DWORD dxw.dwFlags3:
|
// third flags DWORD dxw.dwFlags3:
|
||||||
#define FORCEHOOKOPENGL 0x00000001 // loads OpenGL32.dll and hooks it
|
#define FORCEHOOKOPENGL 0x00000001 // loads OpenGL32.dll and hooks it
|
||||||
|
#define MARKBLIT 0x00000002 // higlights the blit to primary surface operation by surroundig the rect in color
|
||||||
|
|
||||||
// logging Tflags DWORD:
|
// logging Tflags DWORD:
|
||||||
#define OUTTRACE 0x00000001 // enables tracing to dxwnd.log in general
|
#define OUTTRACE 0x00000001 // enables tracing to dxwnd.log in general
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:4254ded87b12758c82865086e3af480673f216886af7b44d71477cc06be75705
|
oid sha256:2d27bd94b95b7ca824b05b37e72626d7250273d4c55512eac260ea59ed8cb2cb
|
||||||
size 311296
|
size 314880
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:c299cf7d537a05c2aefa8e169e5b25abe44450db15171d2bf9a0f66dbb976df0
|
oid sha256:c518035d2eea78a680be7ee136ab574ad087f8f346f923be2e43b1ba9fa5b3ee
|
||||||
size 501760
|
size 502272
|
||||||
|
4657
build/dxwnd.ini
4657
build/dxwnd.ini
File diff suppressed because it is too large
Load Diff
@ -97,3 +97,21 @@ D3D hooking: Added Wireframe option for D3D games
|
|||||||
Added hooking of CLSID_DxDiagProvider through CoCreateInstance
|
Added hooking of CLSID_DxDiagProvider through CoCreateInstance
|
||||||
Fixed (further simplified) clipping handling of primary/backbuffer surfaces
|
Fixed (further simplified) clipping handling of primary/backbuffer surfaces
|
||||||
ChangeDisplaySettings hook: fixed x,y coordinate inversion in log message
|
ChangeDisplaySettings hook: fixed x,y coordinate inversion in log message
|
||||||
|
|
||||||
|
v2.02.19
|
||||||
|
Saves GUI coordinates
|
||||||
|
Fixed "Remap client rect" option for Diablo's windows and Premier Manager 98 mouse movements
|
||||||
|
Added "Highlight blit to primary" option to draw a yellow bounding box around blits to primary surface
|
||||||
|
Fixed some exception conditions when closing the programs
|
||||||
|
Fixed CreateSurface handling to allow Premier Manager 98 start in emulated mode
|
||||||
|
Fixed ONEPIXELFIX handling
|
||||||
|
Fixed BIG WIN handling for Diablo's windows
|
||||||
|
Fixed FillRect hook to prevent filling outside virtual desktop
|
||||||
|
Disabled hooking of system libraries
|
||||||
|
Fixed a nasty bug that caused your desktop to freeze until shutdown !!!
|
||||||
|
Fixed GetWindowRect handling for windows not created by the task: Diablo queries the explorer window size! Now the retrieved RECT can't be larger than the virtual desktop
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,6 +21,8 @@ extern int Set_dwSize_From_Surface(LPDIRECTDRAWSURFACE);
|
|||||||
#define SwitchdwSize(s) s.dwSize=(s.dwSize==sizeof(DDSURFACEDESC))?sizeof(DDSURFACEDESC2):sizeof(DDSURFACEDESC)
|
#define SwitchdwSize(s) s.dwSize=(s.dwSize==sizeof(DDSURFACEDESC))?sizeof(DDSURFACEDESC2):sizeof(DDSURFACEDESC)
|
||||||
|
|
||||||
#define DXWNDDIRECTBLITTING 1
|
#define DXWNDDIRECTBLITTING 1
|
||||||
|
#define MARKBLITCOLOR32 0x00FFFF00
|
||||||
|
#define MARKBLITCOLOR16 0x0FF0
|
||||||
extern Blt_Type pBlt;
|
extern Blt_Type pBlt;
|
||||||
EmuBlt_Type pEmuBlt;
|
EmuBlt_Type pEmuBlt;
|
||||||
RevBlt_Type pRevBlt;
|
RevBlt_Type pRevBlt;
|
||||||
@ -29,12 +31,44 @@ RevBlt_Type pRevBlt;
|
|||||||
// Emulated blitting procedures: fills a 32BPP surface from the content of 8BPP or 16BPP ones.
|
// Emulated blitting procedures: fills a 32BPP surface from the content of 8BPP or 16BPP ones.
|
||||||
//--------------------------------------------------------------------------------------------//
|
//--------------------------------------------------------------------------------------------//
|
||||||
|
|
||||||
|
static void MarkRect32(DWORD *dest, int w, int h, int destpitch)
|
||||||
|
{
|
||||||
|
int x, y;
|
||||||
|
|
||||||
|
for(x = 0; x < w; x ++) *(dest ++) = MARKBLITCOLOR32;
|
||||||
|
dest += destpitch;
|
||||||
|
for(y = 0; y < h-2; y ++){
|
||||||
|
*dest = MARKBLITCOLOR32;
|
||||||
|
dest += w-1;
|
||||||
|
*dest = MARKBLITCOLOR32;
|
||||||
|
dest += destpitch + 1;
|
||||||
|
}
|
||||||
|
for(x = 0; x < w; x ++) *(dest ++) = MARKBLITCOLOR32;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void MarkRect16(SHORT *dest, int w, int h, int destpitch)
|
||||||
|
{
|
||||||
|
int x, y;
|
||||||
|
|
||||||
|
for(x = 0; x < w; x ++) *(dest ++) = MARKBLITCOLOR16;
|
||||||
|
dest += destpitch;
|
||||||
|
for(y = 0; y < h-2; y ++){
|
||||||
|
*dest = MARKBLITCOLOR16;
|
||||||
|
dest += w-1;
|
||||||
|
*dest = MARKBLITCOLOR16;
|
||||||
|
dest += destpitch + 1;
|
||||||
|
}
|
||||||
|
for(x = 0; x < w; x ++) *(dest ++) = MARKBLITCOLOR16;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI EmuBlt_8_to_32(LPDIRECTDRAWSURFACE lpddsdst, LPRECT lpdestrect,
|
static HRESULT WINAPI EmuBlt_8_to_32(LPDIRECTDRAWSURFACE lpddsdst, LPRECT lpdestrect,
|
||||||
LPDIRECTDRAWSURFACE lpddssrc, LPRECT lpsrcrect, DWORD dwflags, LPVOID lpsurface)
|
LPDIRECTDRAWSURFACE lpddssrc, LPRECT lpsrcrect, DWORD dwflags, LPVOID lpsurface)
|
||||||
{
|
{
|
||||||
HRESULT res;
|
HRESULT res;
|
||||||
BYTE *src8;
|
BYTE *src8;
|
||||||
DWORD *dest;
|
DWORD *dest, *dest0;
|
||||||
DDSURFACEDESC2 ddsd_src, ddsd_dst;
|
DDSURFACEDESC2 ddsd_src, ddsd_dst;
|
||||||
long srcpitch, destpitch;
|
long srcpitch, destpitch;
|
||||||
DWORD x, y, w, h;
|
DWORD x, y, w, h;
|
||||||
@ -75,6 +109,7 @@ static HRESULT WINAPI EmuBlt_8_to_32(LPDIRECTDRAWSURFACE lpddsdst, LPRECT lpdest
|
|||||||
dest += lpdestrect->top*ddsd_dst.lPitch;
|
dest += lpdestrect->top*ddsd_dst.lPitch;
|
||||||
dest += lpdestrect->left;
|
dest += lpdestrect->left;
|
||||||
destpitch = ddsd_dst.lPitch - w;
|
destpitch = ddsd_dst.lPitch - w;
|
||||||
|
dest0 = dest;
|
||||||
|
|
||||||
src8 = (BYTE *)lpsurface;
|
src8 = (BYTE *)lpsurface;
|
||||||
src8 += lpsrcrect->top*ddsd_src.lPitch;
|
src8 += lpsrcrect->top*ddsd_src.lPitch;
|
||||||
@ -90,6 +125,8 @@ static HRESULT WINAPI EmuBlt_8_to_32(LPDIRECTDRAWSURFACE lpddsdst, LPRECT lpdest
|
|||||||
src8 += srcpitch;
|
src8 += srcpitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(dxw.dwFlags3 & MARKBLIT) MarkRect32(dest0, w, h, destpitch);
|
||||||
|
|
||||||
res=(*pUnlockMethod(lpddsdst))(lpddsdst, lpdestrect);
|
res=(*pUnlockMethod(lpddsdst))(lpddsdst, lpdestrect);
|
||||||
if (res) OutTraceE("EmuBlt8_32: Unlock ERROR dds=%x res=%x(%s) at %d\n", lpddsdst, res, ExplainDDError(res), __LINE__);
|
if (res) OutTraceE("EmuBlt8_32: Unlock ERROR dds=%x res=%x(%s) at %d\n", lpddsdst, res, ExplainDDError(res), __LINE__);
|
||||||
res=(*pUnlockMethod(lpddssrc))(lpddssrc, lpsrcrect);
|
res=(*pUnlockMethod(lpddssrc))(lpddssrc, lpsrcrect);
|
||||||
@ -103,7 +140,7 @@ static HRESULT WINAPI EmuBlt_16_to_32(LPDIRECTDRAWSURFACE lpddsdst, LPRECT lpdes
|
|||||||
{
|
{
|
||||||
HRESULT res;
|
HRESULT res;
|
||||||
WORD *src16;
|
WORD *src16;
|
||||||
DWORD *dest;
|
DWORD *dest, *dest0;
|
||||||
DDSURFACEDESC2 ddsd_src, ddsd_dst;
|
DDSURFACEDESC2 ddsd_src, ddsd_dst;
|
||||||
long srcpitch, destpitch;
|
long srcpitch, destpitch;
|
||||||
DWORD x, y, w, h;
|
DWORD x, y, w, h;
|
||||||
@ -144,6 +181,7 @@ static HRESULT WINAPI EmuBlt_16_to_32(LPDIRECTDRAWSURFACE lpddsdst, LPRECT lpdes
|
|||||||
dest += lpdestrect->top*ddsd_dst.lPitch;
|
dest += lpdestrect->top*ddsd_dst.lPitch;
|
||||||
dest += lpdestrect->left;
|
dest += lpdestrect->left;
|
||||||
destpitch = ddsd_dst.lPitch - w;
|
destpitch = ddsd_dst.lPitch - w;
|
||||||
|
dest0 = dest;
|
||||||
|
|
||||||
ddsd_src.lPitch >>= 1;
|
ddsd_src.lPitch >>= 1;
|
||||||
src16 = (WORD *)(lpsurface ? lpsurface:ddsd_src.lpSurface);
|
src16 = (WORD *)(lpsurface ? lpsurface:ddsd_src.lpSurface);
|
||||||
@ -187,6 +225,8 @@ static HRESULT WINAPI EmuBlt_16_to_32(LPDIRECTDRAWSURFACE lpddsdst, LPRECT lpdes
|
|||||||
src16 += srcpitch;
|
src16 += srcpitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(dxw.dwFlags3 & MARKBLIT) MarkRect32(dest0, w, h, destpitch);
|
||||||
|
|
||||||
res=(*pUnlockMethod(lpddsdst))(lpddsdst, lpdestrect);
|
res=(*pUnlockMethod(lpddsdst))(lpddsdst, lpdestrect);
|
||||||
if (res) OutTraceE("EmuBlt16_32: Unlock ERROR dds=%x res=%x(%s) at %d\n", lpddsdst, res, ExplainDDError(res), __LINE__);
|
if (res) OutTraceE("EmuBlt16_32: Unlock ERROR dds=%x res=%x(%s) at %d\n", lpddsdst, res, ExplainDDError(res), __LINE__);
|
||||||
res=(*pUnlockMethod(lpddssrc))(lpddssrc, lpsrcrect);
|
res=(*pUnlockMethod(lpddssrc))(lpddssrc, lpsrcrect);
|
||||||
@ -199,7 +239,7 @@ static HRESULT WINAPI EmuBlt_24_to_32(LPDIRECTDRAWSURFACE lpddsdst, LPRECT lpdes
|
|||||||
{
|
{
|
||||||
HRESULT res;
|
HRESULT res;
|
||||||
BYTE *src24;
|
BYTE *src24;
|
||||||
DWORD *dest;
|
DWORD *dest, *dest0;
|
||||||
DDSURFACEDESC2 ddsd_src, ddsd_dst;
|
DDSURFACEDESC2 ddsd_src, ddsd_dst;
|
||||||
long srcpitch, destpitch;
|
long srcpitch, destpitch;
|
||||||
DWORD x, y, w, h;
|
DWORD x, y, w, h;
|
||||||
@ -240,6 +280,7 @@ static HRESULT WINAPI EmuBlt_24_to_32(LPDIRECTDRAWSURFACE lpddsdst, LPRECT lpdes
|
|||||||
dest += lpdestrect->top*ddsd_dst.lPitch;
|
dest += lpdestrect->top*ddsd_dst.lPitch;
|
||||||
dest += lpdestrect->left;
|
dest += lpdestrect->left;
|
||||||
destpitch = ddsd_dst.lPitch - w;
|
destpitch = ddsd_dst.lPitch - w;
|
||||||
|
dest0 = dest;
|
||||||
|
|
||||||
src24 = (BYTE *)lpsurface;
|
src24 = (BYTE *)lpsurface;
|
||||||
src24 += lpsrcrect->top*ddsd_src.lPitch;
|
src24 += lpsrcrect->top*ddsd_src.lPitch;
|
||||||
@ -258,6 +299,8 @@ static HRESULT WINAPI EmuBlt_24_to_32(LPDIRECTDRAWSURFACE lpddsdst, LPRECT lpdes
|
|||||||
src24 += srcpitch;
|
src24 += srcpitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(dxw.dwFlags3 & MARKBLIT) MarkRect32(dest0, w, h, destpitch);
|
||||||
|
|
||||||
res=(*pUnlockMethod(lpddsdst))(lpddsdst, lpdestrect);
|
res=(*pUnlockMethod(lpddsdst))(lpddsdst, lpdestrect);
|
||||||
if (res) OutTraceE("EmuBlt24_32: Unlock ERROR dds=%x res=%x(%s) at %d\n", lpddsdst, res, ExplainDDError(res), __LINE__);
|
if (res) OutTraceE("EmuBlt24_32: Unlock ERROR dds=%x res=%x(%s) at %d\n", lpddsdst, res, ExplainDDError(res), __LINE__);
|
||||||
res=(*pUnlockMethod(lpddssrc))(lpddssrc, lpsrcrect);
|
res=(*pUnlockMethod(lpddssrc))(lpddssrc, lpsrcrect);
|
||||||
@ -276,7 +319,7 @@ static HRESULT WINAPI EmuBlt_32_to_32(LPDIRECTDRAWSURFACE lpddsdst, LPRECT lpdes
|
|||||||
long srcpitch, destpitch;
|
long srcpitch, destpitch;
|
||||||
HRESULT res;
|
HRESULT res;
|
||||||
DWORD *src32;
|
DWORD *src32;
|
||||||
DWORD *dest;
|
DWORD *dest, dest0;
|
||||||
DDSURFACEDESC2 ddsd_src, ddsd_dst;
|
DDSURFACEDESC2 ddsd_src, ddsd_dst;
|
||||||
|
|
||||||
w = lpdestrect->right - lpdestrect->left;
|
w = lpdestrect->right - lpdestrect->left;
|
||||||
@ -315,6 +358,7 @@ static HRESULT WINAPI EmuBlt_32_to_32(LPDIRECTDRAWSURFACE lpddsdst, LPRECT lpdes
|
|||||||
dest += lpdestrect->top*ddsd_dst.lPitch;
|
dest += lpdestrect->top*ddsd_dst.lPitch;
|
||||||
dest += lpdestrect->left;
|
dest += lpdestrect->left;
|
||||||
destpitch = ddsd_dst.lPitch - w;
|
destpitch = ddsd_dst.lPitch - w;
|
||||||
|
dest0 = dest;
|
||||||
|
|
||||||
ddsd_src.lPitch >>= 2;
|
ddsd_src.lPitch >>= 2;
|
||||||
src32 = (DWORD *)(lpsurface ? lpsurface:ddsd_src.lpSurface);
|
src32 = (DWORD *)(lpsurface ? lpsurface:ddsd_src.lpSurface);
|
||||||
@ -330,6 +374,8 @@ static HRESULT WINAPI EmuBlt_32_to_32(LPDIRECTDRAWSURFACE lpddsdst, LPRECT lpdes
|
|||||||
src32 += srcpitch;
|
src32 += srcpitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(dxw.dwFlags3 & MARKBLIT) MarkRect32(dest0, w, h, destpitch);
|
||||||
|
|
||||||
res=(*pUnlockMethod(lpddsdst))(lpddsdst,lpdestrect);
|
res=(*pUnlockMethod(lpddsdst))(lpddsdst,lpdestrect);
|
||||||
if (res) OutTraceE("EmuBlt32_32: Unlock ERROR dds=%x res=%x(%s) at %d\n", lpddsdst, res, ExplainDDError(res), __LINE__);
|
if (res) OutTraceE("EmuBlt32_32: Unlock ERROR dds=%x res=%x(%s) at %d\n", lpddsdst, res, ExplainDDError(res), __LINE__);
|
||||||
res=(*pUnlockMethod(lpddssrc))(lpddssrc, lpsrcrect);
|
res=(*pUnlockMethod(lpddssrc))(lpddssrc, lpsrcrect);
|
||||||
@ -343,7 +389,7 @@ static HRESULT WINAPI EmuBlt_8_to_16(LPDIRECTDRAWSURFACE lpddsdst, LPRECT lpdest
|
|||||||
{
|
{
|
||||||
HRESULT res;
|
HRESULT res;
|
||||||
BYTE *src8;
|
BYTE *src8;
|
||||||
SHORT *dest;
|
SHORT *dest, *dest0;
|
||||||
DDSURFACEDESC2 ddsd_src, ddsd_dst;
|
DDSURFACEDESC2 ddsd_src, ddsd_dst;
|
||||||
long srcpitch, destpitch;
|
long srcpitch, destpitch;
|
||||||
DWORD x, y, w, h;
|
DWORD x, y, w, h;
|
||||||
@ -384,6 +430,7 @@ static HRESULT WINAPI EmuBlt_8_to_16(LPDIRECTDRAWSURFACE lpddsdst, LPRECT lpdest
|
|||||||
dest += lpdestrect->top*ddsd_dst.lPitch;
|
dest += lpdestrect->top*ddsd_dst.lPitch;
|
||||||
dest += lpdestrect->left;
|
dest += lpdestrect->left;
|
||||||
destpitch = ddsd_dst.lPitch - w;
|
destpitch = ddsd_dst.lPitch - w;
|
||||||
|
dest0 = dest;
|
||||||
|
|
||||||
src8 = (BYTE *)lpsurface;
|
src8 = (BYTE *)lpsurface;
|
||||||
src8 += lpsrcrect->top*ddsd_src.lPitch;
|
src8 += lpsrcrect->top*ddsd_src.lPitch;
|
||||||
@ -393,15 +440,14 @@ static HRESULT WINAPI EmuBlt_8_to_16(LPDIRECTDRAWSURFACE lpddsdst, LPRECT lpdest
|
|||||||
// OutTraceD("DEBUG: h=%d w=%d src=%x dst=%x spitch=%d dpitch=%d\n",h,w,src8,dest,srcpitch,destpitch);
|
// OutTraceD("DEBUG: h=%d w=%d src=%x dst=%x spitch=%d dpitch=%d\n",h,w,src8,dest,srcpitch,destpitch);
|
||||||
for(y = 0; y < h; y ++){
|
for(y = 0; y < h; y ++){
|
||||||
for(x = 0; x < w; x ++){
|
for(x = 0; x < w; x ++){
|
||||||
//DWORD pixel;
|
|
||||||
//pixel = PaletteEntries[*(src8 ++)];
|
|
||||||
//*(dest ++) = ((pixel&0x0000FF)>>3) | ((pixel&0x00FF00)>>7) | ((pixel&0xFF0000)>>19);
|
|
||||||
*(dest ++) = (SHORT)PaletteEntries[*(src8 ++)];
|
*(dest ++) = (SHORT)PaletteEntries[*(src8 ++)];
|
||||||
}
|
}
|
||||||
dest += destpitch;
|
dest += destpitch;
|
||||||
src8 += srcpitch;
|
src8 += srcpitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(dxw.dwFlags3 & MARKBLIT) MarkRect16(dest0, w, h, destpitch);
|
||||||
|
|
||||||
res=(*pUnlockMethod(lpddsdst))(lpddsdst, lpdestrect);
|
res=(*pUnlockMethod(lpddsdst))(lpddsdst, lpdestrect);
|
||||||
if (res) OutTraceE("EmuBlt8_16: Unlock ERROR dds=%x res=%x(%s) at %d\n", lpddsdst, res, ExplainDDError(res), __LINE__);
|
if (res) OutTraceE("EmuBlt8_16: Unlock ERROR dds=%x res=%x(%s) at %d\n", lpddsdst, res, ExplainDDError(res), __LINE__);
|
||||||
res=(*pUnlockMethod(lpddssrc))(lpddssrc, lpsrcrect);
|
res=(*pUnlockMethod(lpddssrc))(lpddssrc, lpsrcrect);
|
||||||
@ -426,7 +472,7 @@ static HRESULT WINAPI EmuBlt_24_to_16(LPDIRECTDRAWSURFACE lpddsdst, LPRECT lpdes
|
|||||||
{
|
{
|
||||||
HRESULT res;
|
HRESULT res;
|
||||||
BYTE *src24;
|
BYTE *src24;
|
||||||
SHORT *dest;
|
SHORT *dest, *dest0;
|
||||||
DDSURFACEDESC2 ddsd_src, ddsd_dst;
|
DDSURFACEDESC2 ddsd_src, ddsd_dst;
|
||||||
long srcpitch, destpitch;
|
long srcpitch, destpitch;
|
||||||
DWORD x, y, w, h;
|
DWORD x, y, w, h;
|
||||||
@ -467,6 +513,7 @@ static HRESULT WINAPI EmuBlt_24_to_16(LPDIRECTDRAWSURFACE lpddsdst, LPRECT lpdes
|
|||||||
dest += lpdestrect->top*ddsd_dst.lPitch;
|
dest += lpdestrect->top*ddsd_dst.lPitch;
|
||||||
dest += lpdestrect->left;
|
dest += lpdestrect->left;
|
||||||
destpitch = ddsd_dst.lPitch - w;
|
destpitch = ddsd_dst.lPitch - w;
|
||||||
|
dest0 = dest;
|
||||||
|
|
||||||
src24 = (BYTE *)lpsurface;
|
src24 = (BYTE *)lpsurface;
|
||||||
src24 += lpsrcrect->top*ddsd_src.lPitch;
|
src24 += lpsrcrect->top*ddsd_src.lPitch;
|
||||||
@ -482,6 +529,8 @@ static HRESULT WINAPI EmuBlt_24_to_16(LPDIRECTDRAWSURFACE lpddsdst, LPRECT lpdes
|
|||||||
src24 += srcpitch;
|
src24 += srcpitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(dxw.dwFlags3 & MARKBLIT) MarkRect16(dest0, w, h, destpitch);
|
||||||
|
|
||||||
res=(*pUnlockMethod(lpddsdst))(lpddsdst, lpdestrect);
|
res=(*pUnlockMethod(lpddsdst))(lpddsdst, lpdestrect);
|
||||||
if (res) OutTraceE("EmuBlt24_16: Unlock ERROR dds=%x res=%x(%s) at %d\n", lpddsdst, res, ExplainDDError(res), __LINE__);
|
if (res) OutTraceE("EmuBlt24_16: Unlock ERROR dds=%x res=%x(%s) at %d\n", lpddsdst, res, ExplainDDError(res), __LINE__);
|
||||||
res=(*pUnlockMethod(lpddssrc))(lpddssrc, lpsrcrect);
|
res=(*pUnlockMethod(lpddssrc))(lpddssrc, lpsrcrect);
|
||||||
|
@ -727,8 +727,8 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
|
|||||||
lparam = MAKELPARAM(curr.x, curr.y);
|
lparam = MAKELPARAM(curr.x, curr.y);
|
||||||
OutTraceC("WindowProc: hwnd=%x pos XY=(%d,%d)->(%d,%d)\n", hwnd, prev.x, prev.y, curr.x, curr.y);
|
OutTraceC("WindowProc: hwnd=%x pos XY=(%d,%d)->(%d,%d)\n", hwnd, prev.x, prev.y, curr.x, curr.y);
|
||||||
}
|
}
|
||||||
GetHookInfo()->CursorX=(short)curr.x;
|
GetHookInfo()->CursorX=LOWORD(lparam);
|
||||||
GetHookInfo()->CursorY=(short)curr.y;
|
GetHookInfo()->CursorY=HIWORD(lparam);
|
||||||
break;
|
break;
|
||||||
// fall through cases:
|
// fall through cases:
|
||||||
case WM_MOUSEWHEEL:
|
case WM_MOUSEWHEEL:
|
||||||
@ -750,8 +750,8 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
|
|||||||
lparam = MAKELPARAM(curr.x, curr.y);
|
lparam = MAKELPARAM(curr.x, curr.y);
|
||||||
OutTraceC("WindowProc: hwnd=%x pos XY=(%d,%d)->(%d,%d)\n", hwnd, prev.x, prev.y, curr.x, curr.y);
|
OutTraceC("WindowProc: hwnd=%x pos XY=(%d,%d)->(%d,%d)\n", hwnd, prev.x, prev.y, curr.x, curr.y);
|
||||||
}
|
}
|
||||||
GetHookInfo()->CursorX=(short)curr.x;
|
GetHookInfo()->CursorX=LOWORD(lparam);
|
||||||
GetHookInfo()->CursorY=(short)curr.y;
|
GetHookInfo()->CursorY=HIWORD(lparam);
|
||||||
break;
|
break;
|
||||||
case WM_SETFOCUS:
|
case WM_SETFOCUS:
|
||||||
if (dxw.dwFlags1 & ENABLECLIPPING) extClipCursor(lpClipRegion);
|
if (dxw.dwFlags1 & ENABLECLIPPING) extClipCursor(lpClipRegion);
|
||||||
@ -1279,6 +1279,7 @@ int HookInit(TARGETMAP *target, HWND hwnd)
|
|||||||
WINDOWPOS wp;
|
WINDOWPOS wp;
|
||||||
HMODULE base;
|
HMODULE base;
|
||||||
char *sModule;
|
char *sModule;
|
||||||
|
char sModuleBuf[60+1];
|
||||||
static char *dxversions[14]={
|
static char *dxversions[14]={
|
||||||
"Automatic", "DirectX1~6", "", "", "", "", "",
|
"Automatic", "DirectX1~6", "", "", "", "", "",
|
||||||
"DirectX7", "DirectX8", "DirectX9", "DirectX10", "DirectX11", "None", ""
|
"DirectX7", "DirectX8", "DirectX9", "DirectX10", "DirectX11", "None", ""
|
||||||
@ -1291,8 +1292,8 @@ int HookInit(TARGETMAP *target, HWND hwnd)
|
|||||||
dxw.hParentWnd=GetParent(hwnd);
|
dxw.hParentWnd=GetParent(hwnd);
|
||||||
dxw.hChildWnd=hwnd;
|
dxw.hChildWnd=hwnd;
|
||||||
|
|
||||||
OutTraceD("HookInit: path=\"%s\" module=\"%s\" dxversion=%s hWnd=%x dxw.hParentWnd=%x\n",
|
OutTraceD("HookInit: path=\"%s\" module=\"%s\" dxversion=%s hWnd=%x dxw.hParentWnd=%x desktop=%x\n",
|
||||||
target->path, target->module, dxversions[dxw.dwTargetDDVersion], hwnd, dxw.hParentWnd);
|
target->path, target->module, dxversions[dxw.dwTargetDDVersion], hwnd, dxw.hParentWnd, GetDesktopWindow());
|
||||||
if (IsDebug){
|
if (IsDebug){
|
||||||
DWORD dwStyle, dwExStyle;
|
DWORD dwStyle, dwExStyle;
|
||||||
dwStyle=GetWindowLong(dxw.GethWnd(), GWL_STYLE);
|
dwStyle=GetWindowLong(dxw.GethWnd(), GWL_STYLE);
|
||||||
@ -1327,17 +1328,19 @@ int HookInit(TARGETMAP *target, HWND hwnd)
|
|||||||
// extern BOOL ListProcessModules(BOOL);
|
// extern BOOL ListProcessModules(BOOL);
|
||||||
// ListProcessModules(true);
|
// ListProcessModules(true);
|
||||||
//}
|
//}
|
||||||
sModule=strtok(dxw.gsModules," ");
|
strncpy(sModuleBuf, dxw.gsModules, 60);
|
||||||
|
sModule=strtok(sModuleBuf," ;");
|
||||||
while (sModule) {
|
while (sModule) {
|
||||||
base=(*pLoadLibraryA)(sModule);
|
base=(*pLoadLibraryA)(sModule);
|
||||||
if(!base){
|
if(!base){
|
||||||
OutTraceE("HookInit: LoadLibrary ERROR module=%s err=%d\n", sModule, GetLastError());
|
OutTraceE("HookInit: LoadLibrary ERROR module=%s err=%d\n", sModule, GetLastError());
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
OutTraceD("HookInit: hooking additional module=%s base=%x\n", sModule, base);
|
else {
|
||||||
if (dxw.dwTFlags & OUTIMPORTTABLE) DumpImportTable(base);
|
OutTraceD("HookInit: hooking additional module=%s base=%x\n", sModule, base);
|
||||||
HookModule(base, dxw.dwTargetDDVersion);
|
if (dxw.dwTFlags & OUTIMPORTTABLE) DumpImportTable(base);
|
||||||
sModule=strtok(NULL," ");
|
HookModule(base, dxw.dwTargetDDVersion);
|
||||||
|
}
|
||||||
|
sModule=strtok(NULL," ;");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
147
dll/dxwcore.cpp
147
dll/dxwcore.cpp
@ -141,6 +141,17 @@ RECT dxwCore::GetScreenRect()
|
|||||||
return Screen;
|
return Screen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL dxwCore::IsDesktop(HWND hwnd)
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
(hwnd == 0)
|
||||||
|
||
|
||||||
|
(hwnd == (*pGetDesktopWindow)())
|
||||||
|
||
|
||||||
|
(hwnd == hWnd)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// v2.1.93: FixCursorPos completely revised to introduce a clipping tolerance in
|
// v2.1.93: FixCursorPos completely revised to introduce a clipping tolerance in
|
||||||
// clipping regions as well as in normal operations
|
// clipping regions as well as in normal operations
|
||||||
|
|
||||||
@ -264,14 +275,6 @@ void dxwCore::EraseClipCursor()
|
|||||||
(*pClipCursor)(NULL);
|
(*pClipCursor)(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// MapWindow Rect: returns a rectangle in the real coordinate system from the virtual coordinates
|
|
||||||
// of an emulated fullscreen window. NULL or void returns the rectangle of the whole client area.
|
|
||||||
|
|
||||||
RECT dxwCore::MapWindowRect(void)
|
|
||||||
{
|
|
||||||
return MapWindowRect(NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
RECT dxwCore::MapWindowRect(LPRECT lpRect)
|
RECT dxwCore::MapWindowRect(LPRECT lpRect)
|
||||||
{
|
{
|
||||||
POINT UpLeft={0,0};
|
POINT UpLeft={0,0};
|
||||||
@ -298,7 +301,17 @@ RECT dxwCore::MapWindowRect(LPRECT lpRect)
|
|||||||
return RetRect;
|
return RetRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dxwCore::MapRect(int *nXDest, int *nYDest, int *nWDest, int *nHDest)
|
void dxwCore::MapClient(LPRECT rect)
|
||||||
|
{
|
||||||
|
RECT client;
|
||||||
|
(*pGetClientRect)(hWnd, &client);
|
||||||
|
rect->left= rect->left * client.right / dwScreenWidth;
|
||||||
|
rect->top= rect->top * client.bottom / dwScreenHeight;
|
||||||
|
rect->right= rect->right * client.right / dwScreenWidth;
|
||||||
|
rect->bottom= rect->bottom * client.bottom / dwScreenHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
void dxwCore::MapClient(int *nXDest, int *nYDest, int *nWDest, int *nHDest)
|
||||||
{
|
{
|
||||||
RECT client;
|
RECT client;
|
||||||
(*pGetClientRect)(hWnd, &client);
|
(*pGetClientRect)(hWnd, &client);
|
||||||
@ -308,7 +321,7 @@ void dxwCore::MapRect(int *nXDest, int *nYDest, int *nWDest, int *nHDest)
|
|||||||
*nHDest= *nHDest * client.bottom / dwScreenHeight;
|
*nHDest= *nHDest * client.bottom / dwScreenHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dxwCore::MapPoint(LPPOINT lppoint)
|
void dxwCore::MapClient(LPPOINT lppoint)
|
||||||
{
|
{
|
||||||
RECT client;
|
RECT client;
|
||||||
(*pGetClientRect)(hWnd, &client);
|
(*pGetClientRect)(hWnd, &client);
|
||||||
@ -316,12 +329,109 @@ void dxwCore::MapPoint(LPPOINT lppoint)
|
|||||||
lppoint->y = (lppoint->y * client.bottom) / dwScreenHeight;
|
lppoint->y = (lppoint->y * client.bottom) / dwScreenHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dxwCore::UnmapPoint(LPPOINT lppoint)
|
void dxwCore::MapWindow(LPRECT rect)
|
||||||
{
|
{
|
||||||
RECT client;
|
RECT client;
|
||||||
|
POINT upleft = {0,0};
|
||||||
(*pGetClientRect)(hWnd, &client);
|
(*pGetClientRect)(hWnd, &client);
|
||||||
if (client.right) lppoint->x = (lppoint->x * dwScreenWidth) / client.right;
|
(*pClientToScreen)(hWnd, &upleft);
|
||||||
if (client.bottom) lppoint->y = (lppoint->y * dwScreenHeight) / client.bottom;
|
rect->left= upleft.x + ((rect->left * client.right) / dwScreenWidth);
|
||||||
|
rect->top= upleft.y + ((rect->top * client.bottom) / dwScreenHeight);
|
||||||
|
rect->right= upleft.x + ((rect->right * client.right) / dwScreenWidth);
|
||||||
|
rect->bottom= upleft.y + ((rect->bottom * client.bottom) / dwScreenHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
void dxwCore::MapWindow(int *nXDest, int *nYDest, int *nWDest, int *nHDest)
|
||||||
|
{
|
||||||
|
RECT client;
|
||||||
|
POINT upleft = {0,0};
|
||||||
|
(*pGetClientRect)(hWnd, &client);
|
||||||
|
(*pClientToScreen)(hWnd, &upleft);
|
||||||
|
*nXDest= upleft.x + ((*nXDest * client.right) / dwScreenWidth);
|
||||||
|
*nYDest= upleft.y + ((*nYDest * client.bottom) / dwScreenHeight);
|
||||||
|
*nWDest= (*nWDest * client.right) / dwScreenWidth;
|
||||||
|
*nHDest= (*nHDest * client.bottom) / dwScreenHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
void dxwCore::MapWindow(LPPOINT lppoint)
|
||||||
|
{
|
||||||
|
RECT client;
|
||||||
|
POINT upleft = {0,0};
|
||||||
|
(*pGetClientRect)(hWnd, &client);
|
||||||
|
(*pClientToScreen)(hWnd, &upleft);
|
||||||
|
lppoint->x = upleft.x + ((lppoint->x * client.right) / dwScreenWidth);
|
||||||
|
lppoint->y = upleft.y + ((lppoint->y * client.bottom) / dwScreenHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
POINT dxwCore::ClientOffset(HWND hwnd)
|
||||||
|
{
|
||||||
|
RECT desktop;
|
||||||
|
POINT upleft, win0, desk0, ret;
|
||||||
|
ret.x = ret.y = 0;
|
||||||
|
|
||||||
|
(*pGetClientRect)(hWnd,&desktop);
|
||||||
|
if(!desktop.right || !desktop.bottom) return ret;
|
||||||
|
|
||||||
|
upleft.x = upleft.y = 0;
|
||||||
|
(*pClientToScreen)(hwnd, &upleft);
|
||||||
|
win0 = upleft;
|
||||||
|
upleft.x = upleft.y = 0;
|
||||||
|
(*pClientToScreen)(hWnd, &upleft);
|
||||||
|
desk0 = upleft;
|
||||||
|
if (desktop.right) ret.x = ((win0.x - desk0.x) * (LONG)dwScreenWidth) / desktop.right;
|
||||||
|
if (desktop.bottom) ret.y = ((win0.y - desk0.y) * (LONG)dwScreenHeight) / desktop.bottom;
|
||||||
|
OutTraceB("ClientOffset: hwnd=%x offset=(%d,%d)\n", hwnd, ret.x, ret.y);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
RECT dxwCore::GetWindowRect(RECT win)
|
||||||
|
{
|
||||||
|
RECT desktop;
|
||||||
|
POINT desk0;
|
||||||
|
desk0.x = desk0.y = 0;
|
||||||
|
|
||||||
|
(*pGetClientRect)(hWnd, &desktop);
|
||||||
|
(*pClientToScreen)(hWnd,&desk0);
|
||||||
|
|
||||||
|
if(!desktop.right || !desktop.bottom) return win;
|
||||||
|
|
||||||
|
win.left = ((win.left - desk0.x) * (LONG)dwScreenWidth) / desktop.right;
|
||||||
|
win.top = ((win.top - desk0.y) * (LONG)dwScreenHeight) / desktop.bottom;
|
||||||
|
win.right = ((win.right - desk0.x) * (LONG)dwScreenWidth) / desktop.right;
|
||||||
|
win.bottom = ((win.bottom - desk0.y) * (LONG)dwScreenWidth) / desktop.right;
|
||||||
|
|
||||||
|
return win;
|
||||||
|
}
|
||||||
|
|
||||||
|
RECT dxwCore::GetClientRect(RECT win)
|
||||||
|
{
|
||||||
|
RECT desktop;
|
||||||
|
(*pGetClientRect)(hWnd, &desktop);
|
||||||
|
|
||||||
|
if(!desktop.right || !desktop.bottom) return win;
|
||||||
|
|
||||||
|
win.left = (win.left * dwScreenWidth) / desktop.right;
|
||||||
|
win.top = (win.top * dwScreenHeight) / desktop.bottom;
|
||||||
|
win.right = (win.right * dwScreenWidth) / desktop.right;
|
||||||
|
win.bottom = (win.bottom * dwScreenHeight) / desktop.bottom;
|
||||||
|
|
||||||
|
return win;
|
||||||
|
}
|
||||||
|
|
||||||
|
POINT dxwCore::AddCoordinates(POINT p1, POINT p2)
|
||||||
|
{
|
||||||
|
POINT ps;
|
||||||
|
ps.x = p1.x + p2.x;
|
||||||
|
ps.y = p1.y + p2.y;
|
||||||
|
return ps;
|
||||||
|
}
|
||||||
|
|
||||||
|
POINT dxwCore::SubCoordinates(POINT p1, POINT p2)
|
||||||
|
{
|
||||||
|
POINT ps;
|
||||||
|
ps.x = p1.x - p2.x;
|
||||||
|
ps.y = p1.y - p2.y;
|
||||||
|
return ps;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dxwCore::ScreenRefresh(void)
|
void dxwCore::ScreenRefresh(void)
|
||||||
@ -331,7 +441,6 @@ void dxwCore::ScreenRefresh(void)
|
|||||||
#define DXWREFRESHINTERVAL 20
|
#define DXWREFRESHINTERVAL 20
|
||||||
|
|
||||||
LPDIRECTDRAWSURFACE lpDDSPrim;
|
LPDIRECTDRAWSURFACE lpDDSPrim;
|
||||||
// extern LPDIRECTDRAWSURFACE GetPrimarySurface();
|
|
||||||
extern HRESULT WINAPI extBlt(LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect, LPDIRECTDRAWSURFACE lpddssrc, LPRECT lpsrcrect, DWORD dwflags, LPDDBLTFX lpddbltfx);
|
extern HRESULT WINAPI extBlt(LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect, LPDIRECTDRAWSURFACE lpddssrc, LPRECT lpsrcrect, DWORD dwflags, LPDDBLTFX lpddbltfx);
|
||||||
|
|
||||||
static int t = -1;
|
static int t = -1;
|
||||||
@ -376,7 +485,7 @@ static void CountFPS(HWND hwnd)
|
|||||||
DWORD tmp;
|
DWORD tmp;
|
||||||
tmp = (*pGetTickCount)();
|
tmp = (*pGetTickCount)();
|
||||||
if((tmp - time) > 1000) {
|
if((tmp - time) > 1000) {
|
||||||
char sBuf[80+12+1]; // title + fps string + terminator
|
char sBuf[80+15+1]; // title + fps string + terminator
|
||||||
char *fpss;
|
char *fpss;
|
||||||
// log fps count
|
// log fps count
|
||||||
OutTrace("FPS: Delta=%x FPSCount=%d\n", (tmp-time), FPSCount);
|
OutTrace("FPS: Delta=%x FPSCount=%d\n", (tmp-time), FPSCount);
|
||||||
@ -387,7 +496,7 @@ static void CountFPS(HWND hwnd)
|
|||||||
GetWindowText(hwnd, sBuf, 80);
|
GetWindowText(hwnd, sBuf, 80);
|
||||||
fpss=strstr(sBuf," ~ (");
|
fpss=strstr(sBuf," ~ (");
|
||||||
if(fpss==NULL) fpss=&sBuf[strlen(sBuf)];
|
if(fpss==NULL) fpss=&sBuf[strlen(sBuf)];
|
||||||
sprintf(fpss, " ~ (%d FPS)", FPSCount);
|
sprintf_s(fpss, 15, " ~ (%d FPS)", FPSCount);
|
||||||
SetWindowText(hwnd, sBuf);
|
SetWindowText(hwnd, sBuf);
|
||||||
}
|
}
|
||||||
// reset
|
// reset
|
||||||
@ -396,7 +505,7 @@ static void CountFPS(HWND hwnd)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
FPSCount++;
|
FPSCount++;
|
||||||
OutTrace("FPS: Delta=%x FPSCount++=%d\n", (tmp-time), FPSCount);
|
OutTraceB("FPS: Delta=%x FPSCount++=%d\n", (tmp-time), FPSCount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -573,7 +682,7 @@ void dxwCore::ShowFPS(HDC xdc)
|
|||||||
SetTextColor(xdc,color);
|
SetTextColor(xdc,color);
|
||||||
//SetBkMode(xdc, TRANSPARENT);
|
//SetBkMode(xdc, TRANSPARENT);
|
||||||
SetBkMode(xdc, OPAQUE);
|
SetBkMode(xdc, OPAQUE);
|
||||||
sprintf(sBuf, "FPS: %d", GetHookInfo()->FPSCount);
|
sprintf_s(sBuf, 80, "FPS: %d", GetHookInfo()->FPSCount);
|
||||||
TextOut(xdc, x, y, sBuf, strlen(sBuf));
|
TextOut(xdc, x, y, sBuf, strlen(sBuf));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -602,7 +711,7 @@ void dxwCore::ShowFPS(LPDIRECTDRAWSURFACE lpdds)
|
|||||||
SetTextColor(xdc,color);
|
SetTextColor(xdc,color);
|
||||||
//SetBkMode(xdc, TRANSPARENT);
|
//SetBkMode(xdc, TRANSPARENT);
|
||||||
SetBkMode(xdc, OPAQUE);
|
SetBkMode(xdc, OPAQUE);
|
||||||
sprintf(sBuf, "FPS: %d", GetHookInfo()->FPSCount);
|
sprintf_s(sBuf, 80, "FPS: %d", GetHookInfo()->FPSCount);
|
||||||
TextOut(xdc, x, y, sBuf, strlen(sBuf));
|
TextOut(xdc, x, y, sBuf, strlen(sBuf));
|
||||||
lpdds->ReleaseDC(xdc);
|
lpdds->ReleaseDC(xdc);
|
||||||
}
|
}
|
||||||
|
@ -20,10 +20,9 @@ public: // methods
|
|||||||
void SetScreenSize(int x, int y) {if(x)dwScreenWidth=x; if(y)dwScreenHeight=y;}
|
void SetScreenSize(int x, int y) {if(x)dwScreenWidth=x; if(y)dwScreenHeight=y;}
|
||||||
DWORD GetScreenWidth(void) {return dwScreenWidth;}
|
DWORD GetScreenWidth(void) {return dwScreenWidth;}
|
||||||
DWORD GetScreenHeight(void) {return dwScreenHeight;}
|
DWORD GetScreenHeight(void) {return dwScreenHeight;}
|
||||||
RECT GetScreenRect(void);
|
|
||||||
void MapRect(int *, int *, int *, int *);
|
|
||||||
void SetFullScreen(BOOL fs) {FullScreen=fs;}
|
void SetFullScreen(BOOL fs) {FullScreen=fs;}
|
||||||
BOOL IsFullScreen() {return FullScreen;}
|
BOOL IsFullScreen() {return FullScreen;}
|
||||||
|
BOOL IsDesktop(HWND);
|
||||||
POINT FixCursorPos(POINT);
|
POINT FixCursorPos(POINT);
|
||||||
POINT FixCursorPos(HWND, POINT);
|
POINT FixCursorPos(HWND, POINT);
|
||||||
void FixNCHITCursorPos(LPPOINT);
|
void FixNCHITCursorPos(LPPOINT);
|
||||||
@ -31,8 +30,18 @@ public: // methods
|
|||||||
void EraseClipCursor(void);
|
void EraseClipCursor(void);
|
||||||
RECT MapWindowRect(LPRECT lpRect);
|
RECT MapWindowRect(LPRECT lpRect);
|
||||||
RECT MapWindowRect(void);
|
RECT MapWindowRect(void);
|
||||||
void MapPoint(LPPOINT);
|
void MapClient(LPPOINT);
|
||||||
void UnmapPoint(LPPOINT);
|
void MapClient(LPRECT);
|
||||||
|
void MapClient(int *, int *, int *, int *);
|
||||||
|
void MapWindow(LPPOINT);
|
||||||
|
void MapWindow(LPRECT);
|
||||||
|
void MapWindow(int *, int *, int *, int *);
|
||||||
|
RECT GetScreenRect(void);
|
||||||
|
RECT GetWindowRect(RECT);
|
||||||
|
RECT GetClientRect(RECT);
|
||||||
|
POINT AddCoordinates(POINT, POINT);
|
||||||
|
POINT SubCoordinates(POINT, POINT);
|
||||||
|
POINT ClientOffset(HWND);
|
||||||
void ScreenRefresh(void);
|
void ScreenRefresh(void);
|
||||||
BOOL HandleFPS(void);
|
BOOL HandleFPS(void);
|
||||||
DWORD GetTickCount(void);
|
DWORD GetTickCount(void);
|
||||||
|
@ -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.18"
|
#define VERSION "2.02.19"
|
||||||
|
|
||||||
LRESULT CALLBACK HookProc(int ncode, WPARAM wparam, LPARAM lparam);
|
LRESULT CALLBACK HookProc(int ncode, WPARAM wparam, LPARAM lparam);
|
||||||
|
|
||||||
|
Binary file not shown.
65
dll/dxwnd.vs2008.vcproj.User-PC.User.user
Normal file
65
dll/dxwnd.vs2008.vcproj.User-PC.User.user
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioUserFile
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="9,00"
|
||||||
|
ShowAllFiles="false"
|
||||||
|
>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
>
|
||||||
|
<DebugSettings
|
||||||
|
Command=""
|
||||||
|
WorkingDirectory=""
|
||||||
|
CommandArguments=""
|
||||||
|
Attach="false"
|
||||||
|
DebuggerType="3"
|
||||||
|
Remote="1"
|
||||||
|
RemoteMachine="USER-PC"
|
||||||
|
RemoteCommand=""
|
||||||
|
HttpUrl=""
|
||||||
|
PDBPath=""
|
||||||
|
SQLDebugging=""
|
||||||
|
Environment=""
|
||||||
|
EnvironmentMerge="true"
|
||||||
|
DebuggerFlavor=""
|
||||||
|
MPIRunCommand=""
|
||||||
|
MPIRunArguments=""
|
||||||
|
MPIRunWorkingDirectory=""
|
||||||
|
ApplicationCommand=""
|
||||||
|
ApplicationArguments=""
|
||||||
|
ShimCommand=""
|
||||||
|
MPIAcceptMode=""
|
||||||
|
MPIAcceptFilter=""
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="Release|Win32"
|
||||||
|
>
|
||||||
|
<DebugSettings
|
||||||
|
Command=""
|
||||||
|
WorkingDirectory=""
|
||||||
|
CommandArguments=""
|
||||||
|
Attach="false"
|
||||||
|
DebuggerType="3"
|
||||||
|
Remote="1"
|
||||||
|
RemoteMachine="USER-PC"
|
||||||
|
RemoteCommand=""
|
||||||
|
HttpUrl=""
|
||||||
|
PDBPath=""
|
||||||
|
SQLDebugging=""
|
||||||
|
Environment=""
|
||||||
|
EnvironmentMerge="true"
|
||||||
|
DebuggerFlavor=""
|
||||||
|
MPIRunCommand=""
|
||||||
|
MPIRunArguments=""
|
||||||
|
MPIRunWorkingDirectory=""
|
||||||
|
ApplicationCommand=""
|
||||||
|
ApplicationArguments=""
|
||||||
|
ShimCommand=""
|
||||||
|
MPIAcceptMode=""
|
||||||
|
MPIAcceptFilter=""
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
</Configurations>
|
||||||
|
</VisualStudioUserFile>
|
@ -361,6 +361,10 @@ HRESULT WINAPI extCreateDevice(void *lpd3d, UINT adapter, D3DDEVTYPE devicetype,
|
|||||||
param[2] = mode.Format;
|
param[2] = mode.Format;
|
||||||
OutTraceD(" Current Format = 0x%x\n", mode.Format);
|
OutTraceD(" Current Format = 0x%x\n", mode.Format);
|
||||||
|
|
||||||
|
// useless ...
|
||||||
|
//param[0] = 0; //defaulting to window width
|
||||||
|
//param[1] = 0; //defaulting to window height
|
||||||
|
//param[2] = D3DFMT_UNKNOWN; // try
|
||||||
|
|
||||||
if(dwD3DVersion == 9){
|
if(dwD3DVersion == 9){
|
||||||
param[7] = 0; //hDeviceWindow
|
param[7] = 0; //hDeviceWindow
|
||||||
|
124
dll/hddraw.cpp
124
dll/hddraw.cpp
@ -671,7 +671,12 @@ int lpddsHookedVersion(LPDIRECTDRAWSURFACE lpdds)
|
|||||||
char sMsg[81];
|
char sMsg[81];
|
||||||
void * extGetCaps;
|
void * extGetCaps;
|
||||||
|
|
||||||
|
__try{
|
||||||
extGetCaps=(void *)*(DWORD *)(*(DWORD *)lpdds + 56);
|
extGetCaps=(void *)*(DWORD *)(*(DWORD *)lpdds + 56);
|
||||||
|
}
|
||||||
|
__except (EXCEPTION_EXECUTE_HANDLER){
|
||||||
|
extGetCaps=NULL;
|
||||||
|
};
|
||||||
if(extGetCaps==(void *)extGetCaps1S) return 1;
|
if(extGetCaps==(void *)extGetCaps1S) return 1;
|
||||||
if(extGetCaps==(void *)extGetCaps2S) return 2;
|
if(extGetCaps==(void *)extGetCaps2S) return 2;
|
||||||
if(extGetCaps==(void *)extGetCaps3S) return 3;
|
if(extGetCaps==(void *)extGetCaps3S) return 3;
|
||||||
@ -688,7 +693,12 @@ int lpddHookedVersion(LPDIRECTDRAW lpdd)
|
|||||||
char sMsg[81];
|
char sMsg[81];
|
||||||
void * extCreateSurface;
|
void * extCreateSurface;
|
||||||
|
|
||||||
|
__try{
|
||||||
extCreateSurface=(void *)*(DWORD *)(*(DWORD *)lpdd + 24);
|
extCreateSurface=(void *)*(DWORD *)(*(DWORD *)lpdd + 24);
|
||||||
|
}
|
||||||
|
__except (EXCEPTION_EXECUTE_HANDLER){
|
||||||
|
extCreateSurface=NULL;
|
||||||
|
};
|
||||||
if(extCreateSurface==(void *)extCreateSurface1) return 1;
|
if(extCreateSurface==(void *)extCreateSurface1) return 1;
|
||||||
if(extCreateSurface==(void *)extCreateSurface2) return 2;
|
if(extCreateSurface==(void *)extCreateSurface2) return 2;
|
||||||
if(extCreateSurface==(void *)extCreateSurface4) return 4;
|
if(extCreateSurface==(void *)extCreateSurface4) return 4;
|
||||||
@ -1788,7 +1798,7 @@ HRESULT WINAPI extCreateSurfaceEmu(int dxversion, CreateSurface_Type pCreateSurf
|
|||||||
// some games (Monopoly 3D) may depend on this setting - i.e. they could close
|
// some games (Monopoly 3D) may depend on this setting - i.e. they could close
|
||||||
// the exceeding references - so this is better be replicated adding an initial
|
// the exceeding references - so this is better be replicated adding an initial
|
||||||
// reference to the zero count.
|
// reference to the zero count.
|
||||||
lpDDSBack->AddRef(); // should it be repeated BBCount times????
|
if (lpDDSBack) lpDDSBack->AddRef(); // should it be repeated BBCount times????
|
||||||
|
|
||||||
// rebuild emulated primary surface
|
// rebuild emulated primary surface
|
||||||
|
|
||||||
@ -1847,28 +1857,19 @@ HRESULT WINAPI extCreateSurfaceEmu(int dxversion, CreateSurface_Type pCreateSurf
|
|||||||
OutTraceD("CreateSurface: created DDSEmu_Prim=%x DDSEmu_Back=%x DDSPrim=%x DDSBack=%x\n",
|
OutTraceD("CreateSurface: created DDSEmu_Prim=%x DDSEmu_Back=%x DDSPrim=%x DDSBack=%x\n",
|
||||||
lpDDSEmu_Prim, lpDDSEmu_Back, lpDDSPrim, lpDDSBack);
|
lpDDSEmu_Prim, lpDDSEmu_Back, lpDDSPrim, lpDDSBack);
|
||||||
|
|
||||||
// creation of lpDDSHDC service surfae moved to GetDC method
|
// creation of lpDDSHDC service surface moved to GetDC method
|
||||||
|
|
||||||
if(dxw.dwFlags1 & CLIPCURSOR) dxw.SetClipCursor();
|
if(dxw.dwFlags1 & CLIPCURSOR) dxw.SetClipCursor();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// not primary emulated surface ....
|
|
||||||
// try begin
|
|
||||||
//if((ddsd.dwFlags && DDSD_CAPS) && (ddsd.ddsCaps.dwCaps && DDSCAPS_ZBUFFER)){
|
|
||||||
// pfmt="untouched";
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
//end try
|
|
||||||
if(((ddsd.dwFlags & DDSD_WIDTH) && !(ddsd.dwFlags & DDSD_HEIGHT)) ||
|
if(((ddsd.dwFlags & DDSD_WIDTH) && !(ddsd.dwFlags & DDSD_HEIGHT)) ||
|
||||||
(ddsd.dwFlags & DDSD_ZBUFFERBITDEPTH) ||
|
(ddsd.dwFlags & DDSD_ZBUFFERBITDEPTH) ||
|
||||||
//(ddsd.dwFlags & DDSD_PIXELFORMAT) ||
|
((ddsd.dwFlags & DDSD_PIXELFORMAT) && !(ddsd.dwFlags & DDSD_PITCH) && !(ddsd.ddsCaps.dwCaps & DDSCAPS_3DDEVICE)) || // fix good for "Wargames"
|
||||||
((ddsd.dwFlags & DDSD_PIXELFORMAT) && !(ddsd.dwFlags & DDSD_PITCH)) || // fix good for "Wargames"
|
((ddsd.dwFlags & DDSD_CAPS) && (ddsd.ddsCaps.dwCaps & DDSCAPS_3DDEVICE) && !(ddsd.dwFlags & DDSD_PIXELFORMAT)) // fix good for Premier Manager 98
|
||||||
//((ddsd.dwFlags & DDSD_CAPS) && (ddsd.ddsCaps.dwCaps & DDSCAPS_TEXTURE)) ||
|
){
|
||||||
((ddsd.dwFlags & DDSD_CAPS) && (ddsd.ddsCaps.dwCaps & DDSCAPS_3DDEVICE))){
|
|
||||||
// don't alter pixel format
|
// don't alter pixel format
|
||||||
//ddsd.dwFlags &= ~DDSD_PIXELFORMAT; // Warhammer Dark Omen
|
ddsd.dwFlags &= ~DDSD_PIXELFORMAT; // Wargames, Warhammer Dark Omen
|
||||||
ddsd.dwFlags &= ~DDSD_PIXELFORMAT; // Wargames ???
|
|
||||||
pfmt="(none)";
|
pfmt="(none)";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -2261,6 +2262,21 @@ static void BlitError(HRESULT res, LPRECT lps, LPRECT lpd, int line)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void BlitTrace(char *label, LPRECT lps, LPRECT lpd, int line)
|
||||||
|
{
|
||||||
|
OutTrace("Blt: %s", label);
|
||||||
|
if (lps)
|
||||||
|
OutTrace(" src=(%d,%d)-(%d,%d)",lps->left, lps->top, lps->right, lps->bottom);
|
||||||
|
else
|
||||||
|
OutTrace(" src=(NULL)");
|
||||||
|
if (lpd)
|
||||||
|
OutTrace(" dest=(%d,%d)-(%d,%d)",lpd->left, lpd->top, lpd->right, lpd->bottom);
|
||||||
|
else
|
||||||
|
OutTrace(" dest=(NULL)");
|
||||||
|
OutTrace(" at %d\n", __LINE__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
|
HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
|
||||||
LPDIRECTDRAWSURFACE lpddssrc, LPRECT lpsrcrect, DWORD dwflags, LPDDBLTFX lpddbltfx, BOOL isFlipping)
|
LPDIRECTDRAWSURFACE lpddssrc, LPRECT lpsrcrect, DWORD dwflags, LPDDBLTFX lpddbltfx, BOOL isFlipping)
|
||||||
{
|
{
|
||||||
@ -2299,22 +2315,24 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
|
|||||||
OutTrace("\n");
|
OutTrace("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#define ONEPIXELFIXFlag 1
|
#ifdef ONEPIXELFIX
|
||||||
|
if (lpdestrect){
|
||||||
|
if ((lpdestrect->top == 0) && (lpdestrect->bottom == dxw.GetScreenHeight() -1)) lpdestrect->bottom = dxw.GetScreenHeight();
|
||||||
|
if ((lpdestrect->left == 0) && (lpdestrect->right == dxw.GetScreenWidth() -1)) lpdestrect->right = dxw.GetScreenWidth();
|
||||||
|
}
|
||||||
|
if (lpsrcrect){
|
||||||
|
if ((lpsrcrect->top == 0) && (lpsrcrect->bottom == dxw.GetScreenHeight() -1)) lpsrcrect->bottom = dxw.GetScreenHeight();
|
||||||
|
if ((lpsrcrect->left == 0) && (lpsrcrect->right == dxw.GetScreenWidth() -1)) lpsrcrect->right = dxw.GetScreenWidth();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#define FIXBIGGERRECT 1
|
#define FIXBIGGERRECT 1
|
||||||
|
#ifdef FIXBIGGERRECT
|
||||||
if (ONEPIXELFIXFlag){
|
if(ToPrim && lpdestrect){
|
||||||
if (lpdestrect){
|
if((DWORD)lpdestrect->bottom > dxw.GetScreenHeight()) lpdestrect->bottom = dxw.GetScreenHeight();
|
||||||
if (lpdestrect->bottom == dxw.GetScreenHeight() -1) lpdestrect->bottom = dxw.GetScreenHeight();
|
if((DWORD)lpdestrect->right > dxw.GetScreenWidth()) lpdestrect->right = dxw.GetScreenWidth();
|
||||||
if (lpdestrect->right == dxw.GetScreenWidth() -1) lpdestrect->right = dxw.GetScreenWidth();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(FIXBIGGERRECT){
|
|
||||||
if(ToPrim && lpdestrect){
|
|
||||||
if((DWORD)lpdestrect->bottom > dxw.GetScreenHeight()) lpdestrect->bottom = dxw.GetScreenHeight();
|
|
||||||
if((DWORD)lpdestrect->right > dxw.GetScreenWidth()) lpdestrect->right = dxw.GetScreenWidth();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if((dxw.dwFlags1 & EMULATESURFACE) && (dwflags==DDBLT_COLORFILL)){
|
if((dxw.dwFlags1 & EMULATESURFACE) && (dwflags==DDBLT_COLORFILL)){
|
||||||
OutTraceD("Debug: dwFillDepth=%d, EmuBPP=%d, dwFillColor=%x\n",
|
OutTraceD("Debug: dwFillDepth=%d, EmuBPP=%d, dwFillColor=%x\n",
|
||||||
@ -2370,18 +2388,22 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
|
|||||||
srcrect=dxw.MapWindowRect(lpsrcrect);
|
srcrect=dxw.MapWindowRect(lpsrcrect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IsDebug) BlitTrace("NOPRIM", lpsrcrect, lpdestrect, __LINE__);
|
||||||
res= (*pBlt)(lpdds, lpdestrect, lpddssrc, lpsrcrect ? &srcrect : NULL, dwflags, lpddbltfx);
|
res= (*pBlt)(lpdds, lpdestrect, lpddssrc, lpsrcrect ? &srcrect : NULL, dwflags, lpddbltfx);
|
||||||
// Blitting compressed data may work to screen surfaces only. In this case, it may be worth
|
// Blitting compressed data may work to screen surfaces only. In this case, it may be worth
|
||||||
// trying blitting directly to lpDDSEmu_Prim: it makes DK2 intro movies working.
|
// trying blitting directly to lpDDSEmu_Prim: it makes DK2 intro movies working.
|
||||||
switch(res){
|
switch(res){
|
||||||
case DDERR_UNSUPPORTED:
|
case DDERR_UNSUPPORTED:
|
||||||
if (dxw.dwFlags1 & EMULATESURFACE){
|
if (dxw.dwFlags1 & EMULATESURFACE){
|
||||||
|
if (IsDebug) BlitTrace("UNSUPP", lpsrcrect ? &srcrect : NULL, lpdestrect, __LINE__);
|
||||||
res=(*pBlt)(lpDDSEmu_Prim, lpdestrect, lpddssrc, lpsrcrect ? &srcrect : NULL, dwflags, lpddbltfx);
|
res=(*pBlt)(lpDDSEmu_Prim, lpdestrect, lpddssrc, lpsrcrect ? &srcrect : NULL, dwflags, lpddbltfx);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DDERR_SURFACEBUSY:
|
case DDERR_SURFACEBUSY:
|
||||||
(*pUnlockMethod(lpdds))(lpdds, NULL);
|
(*pUnlockMethod(lpdds))(lpdds, NULL);
|
||||||
if (lpddssrc) (*pUnlockMethod(lpddssrc))(lpddssrc, NULL);
|
if (lpddssrc) (*pUnlockMethod(lpddssrc))(lpddssrc, NULL);
|
||||||
|
if (IsDebug) BlitTrace("BUSY", lpsrcrect ? &srcrect : NULL, lpdestrect, __LINE__);
|
||||||
res=(*pBlt)(lpdds, lpdestrect, lpddssrc, lpsrcrect ? &srcrect : NULL, dwflags|DDBLT_WAIT, lpddbltfx);
|
res=(*pBlt)(lpdds, lpdestrect, lpddssrc, lpsrcrect ? &srcrect : NULL, dwflags|DDBLT_WAIT, lpddbltfx);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -2402,8 +2424,7 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
|
|||||||
res=0;
|
res=0;
|
||||||
// blit only when source and dest surface are different. Should make ScreenRefresh faster.
|
// blit only when source and dest surface are different. Should make ScreenRefresh faster.
|
||||||
if (lpdds != lpddssrc) {
|
if (lpdds != lpddssrc) {
|
||||||
//OutTrace("DEBUG: lpdds=%x lpddssrc=%x destrect=(%d,%d)-(%d,%d) lpsrcrect=%x flags=%x lpddbltfx=%x\n",
|
if (IsDebug) BlitTrace("PRIM-NOEMU", lpsrcrect, &destrect, __LINE__);
|
||||||
// lpdds, lpddssrc, destrect.left, destrect.top, destrect.right, destrect.bottom, lpsrcrect, dwflags, lpddbltfx);
|
|
||||||
res= (*pBlt)(lpdds, &destrect, lpddssrc, lpsrcrect, dwflags, lpddbltfx);
|
res= (*pBlt)(lpdds, &destrect, lpddssrc, lpsrcrect, dwflags, lpddbltfx);
|
||||||
}
|
}
|
||||||
if(res){
|
if(res){
|
||||||
@ -2411,6 +2432,7 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
|
|||||||
// Try to handle HDC lock concurrency....
|
// Try to handle HDC lock concurrency....
|
||||||
if(res==DDERR_SURFACEBUSY){
|
if(res==DDERR_SURFACEBUSY){
|
||||||
(*pUnlockMethod(lpdds))(lpdds, NULL);
|
(*pUnlockMethod(lpdds))(lpdds, NULL);
|
||||||
|
if (IsDebug) BlitTrace("BUSY", lpsrcrect, &destrect, __LINE__);
|
||||||
res= (*pBlt)(lpdds, &destrect, lpddssrc, lpsrcrect, dwflags, lpddbltfx);
|
res= (*pBlt)(lpdds, &destrect, lpddssrc, lpsrcrect, dwflags, lpddbltfx);
|
||||||
if (res) BlitError(res, lpsrcrect, &destrect, __LINE__);
|
if (res) BlitError(res, lpsrcrect, &destrect, __LINE__);
|
||||||
}
|
}
|
||||||
@ -2445,8 +2467,10 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
|
|||||||
|
|
||||||
res=0;
|
res=0;
|
||||||
// blit only when source and dest surface are different. Should make ScreenRefresh faster.
|
// blit only when source and dest surface are different. Should make ScreenRefresh faster.
|
||||||
if (lpdds != lpddssrc)
|
if (lpdds != lpddssrc){
|
||||||
|
if (IsDebug) BlitTrace("SRC2EMU", &emurect, &destrect, __LINE__);
|
||||||
res=(*pBlt)(lpdds, &emurect, lpddssrc, lpsrcrect, dwflags, lpddbltfx);
|
res=(*pBlt)(lpdds, &emurect, lpddssrc, lpsrcrect, dwflags, lpddbltfx);
|
||||||
|
}
|
||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
BlitError(res, lpsrcrect, &emurect, __LINE__);
|
BlitError(res, lpsrcrect, &emurect, __LINE__);
|
||||||
@ -2458,6 +2482,7 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
|
|||||||
*/
|
*/
|
||||||
if(res==DDERR_UNSUPPORTED){
|
if(res==DDERR_UNSUPPORTED){
|
||||||
if (dxw.dwFlags2 & SHOWFPSOVERLAY) dxw.ShowFPS(lpddssrc);
|
if (dxw.dwFlags2 & SHOWFPSOVERLAY) dxw.ShowFPS(lpddssrc);
|
||||||
|
if (IsDebug) BlitTrace("UNSUPP", &emurect, &destrect, __LINE__);
|
||||||
res=(*pBlt)(lpDDSEmu_Prim, &destrect, lpddssrc, lpsrcrect, dwflags, lpddbltfx);
|
res=(*pBlt)(lpDDSEmu_Prim, &destrect, lpddssrc, lpsrcrect, dwflags, lpddbltfx);
|
||||||
if (res) BlitError(res, lpsrcrect, &destrect, __LINE__);
|
if (res) BlitError(res, lpsrcrect, &destrect, __LINE__);
|
||||||
}
|
}
|
||||||
@ -2466,6 +2491,7 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
|
|||||||
if(res==DDERR_SURFACEBUSY){
|
if(res==DDERR_SURFACEBUSY){
|
||||||
res=(*pUnlockMethod(lpddssrc))(lpddssrc, NULL);
|
res=(*pUnlockMethod(lpddssrc))(lpddssrc, NULL);
|
||||||
if(res) OutTraceE("Unlock ERROR: err=%x(%s)\n", res, ExplainDDError(res));
|
if(res) OutTraceE("Unlock ERROR: err=%x(%s)\n", res, ExplainDDError(res));
|
||||||
|
if (IsDebug) BlitTrace("BUSY", &emurect, &destrect, __LINE__);
|
||||||
res=(*pBlt)(lpdds, &emurect, lpddssrc, lpsrcrect, dwflags, lpddbltfx);
|
res=(*pBlt)(lpdds, &emurect, lpddssrc, lpsrcrect, dwflags, lpddbltfx);
|
||||||
if (res) BlitError(res, lpsrcrect, &destrect, __LINE__);
|
if (res) BlitError(res, lpsrcrect, &destrect, __LINE__);
|
||||||
}
|
}
|
||||||
@ -2494,14 +2520,17 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (dxw.dwFlags2 & SHOWFPSOVERLAY) dxw.ShowFPS(lpDDSSource);
|
if (dxw.dwFlags2 & SHOWFPSOVERLAY) dxw.ShowFPS(lpDDSSource);
|
||||||
|
if (IsDebug) BlitTrace("BACK2PRIM", &emurect, &destrect, __LINE__);
|
||||||
res=(*pBlt)(lpDDSEmu_Prim, &destrect, lpDDSSource, &emurect, DDBLT_WAIT, 0);
|
res=(*pBlt)(lpDDSEmu_Prim, &destrect, lpDDSSource, &emurect, DDBLT_WAIT, 0);
|
||||||
if (res==DDERR_NOCLIPLIST){
|
if (res==DDERR_NOCLIPLIST){
|
||||||
RenewClipper(lpDD, lpDDSEmu_Prim);
|
RenewClipper(lpDD, lpDDSEmu_Prim);
|
||||||
|
if (IsDebug) BlitTrace("NOCLIP", &emurect, &destrect, __LINE__);
|
||||||
res=(*pBlt)(lpDDSEmu_Prim, &destrect, lpDDSSource, &emurect, DDBLT_WAIT, 0);
|
res=(*pBlt)(lpDDSEmu_Prim, &destrect, lpDDSSource, &emurect, DDBLT_WAIT, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res) BlitError(res, &emurect, &destrect, __LINE__);
|
if (res) BlitError(res, &emurect, &destrect, __LINE__);
|
||||||
if(dxw.dwFlags1 & SUPPRESSDXERRORS) res=0;
|
if(dxw.dwFlags1 & SUPPRESSDXERRORS) res=0;
|
||||||
|
if (IsDebug) OutTrace("%s: done ret=%x at %d\n", api, res, __LINE__);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2739,35 +2768,10 @@ HRESULT WINAPI extSetPalette(LPDIRECTDRAWSURFACE lpdds, LPDIRECTDRAWPALETTE lpdd
|
|||||||
isPrim=dxw.IsAPrimarySurface(lpdds);
|
isPrim=dxw.IsAPrimarySurface(lpdds);
|
||||||
OutTraceD("SetPalette: lpdds=%x%s lpddp=%x\n", lpdds, isPrim?"(PRIM)":"", lpddp);
|
OutTraceD("SetPalette: lpdds=%x%s lpddp=%x\n", lpdds, isPrim?"(PRIM)":"", lpddp);
|
||||||
|
|
||||||
#if 0
|
|
||||||
if(!(dxw.dwFlags1 & EMULATESURFACE) || !isPrim) {
|
|
||||||
res=(*pSetPalette)(lpdds, lpddp);
|
|
||||||
if(res)OutTraceE("SetPalette: ERROR res=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
OutTraceD("SetPalette: DEBUG emulating palette\n");
|
|
||||||
lpDDP = lpddp;
|
|
||||||
//if (lpDDSBack) { GHOGHO
|
|
||||||
// res=(*pSetPalette)(lpDDSBack, lpddp);
|
|
||||||
// if(res) OutTraceE("SetPalette: ERROR res=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__);
|
|
||||||
//}
|
|
||||||
// add a reference to simulate what would happen in reality....
|
|
||||||
lpdds->AddRef();
|
|
||||||
|
|
||||||
if(lpddp){
|
|
||||||
lpentries = (LPPALETTEENTRY)PaletteEntries;
|
|
||||||
res=lpddp->GetEntries(0, 0, 256, lpentries);
|
|
||||||
if(res) OutTraceE("SetPalette: GetEntries ERROR res=%x(%s)\n", res, ExplainDDError(res));
|
|
||||||
mySetPalette(0, 256, lpentries);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
#else
|
|
||||||
res=(*pSetPalette)(lpdds, lpddp);
|
res=(*pSetPalette)(lpdds, lpddp);
|
||||||
if(res)OutTraceE("SetPalette: ERROR res=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__);
|
if(res)OutTraceE("SetPalette: ERROR res=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__);
|
||||||
|
|
||||||
if((dxw.dwFlags1 & EMULATESURFACE) && (res==DD_OK)){
|
if(dxw.dwFlags1 & EMULATESURFACE){
|
||||||
OutTraceD("SetPalette: DEBUG emulating palette\n");
|
OutTraceD("SetPalette: DEBUG emulating palette\n");
|
||||||
lpDDP = lpddp;
|
lpDDP = lpddp;
|
||||||
|
|
||||||
@ -2778,10 +2782,10 @@ HRESULT WINAPI extSetPalette(LPDIRECTDRAWSURFACE lpdds, LPDIRECTDRAWPALETTE lpdd
|
|||||||
if(res2) OutTraceE("SetPalette: GetEntries ERROR res=%x(%s)\n", res2, ExplainDDError(res2));
|
if(res2) OutTraceE("SetPalette: GetEntries ERROR res=%x(%s)\n", res2, ExplainDDError(res2));
|
||||||
mySetPalette(0, 256, lpentries);
|
mySetPalette(0, 256, lpentries);
|
||||||
}
|
}
|
||||||
|
res=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI extSetEntries(LPDIRECTDRAWPALETTE lpddp, DWORD dwflags, DWORD dwstart, DWORD dwcount, LPPALETTEENTRY lpentries)
|
HRESULT WINAPI extSetEntries(LPDIRECTDRAWPALETTE lpddp, DWORD dwflags, DWORD dwstart, DWORD dwcount, LPPALETTEENTRY lpentries)
|
||||||
|
175
dll/syslibs.cpp
175
dll/syslibs.cpp
@ -192,6 +192,10 @@ HWND WINAPI extCreateWindowExA(
|
|||||||
)
|
)
|
||||||
&&
|
&&
|
||||||
(((DWORD)nWidth>=dxw.GetScreenWidth())&&((DWORD)nHeight>=dxw.GetScreenHeight()))
|
(((DWORD)nWidth>=dxw.GetScreenWidth())&&((DWORD)nHeight>=dxw.GetScreenHeight()))
|
||||||
|
&&
|
||||||
|
!(dwExStyle & WS_EX_CONTROLPARENT) // Diablo fix
|
||||||
|
&&
|
||||||
|
!(dwStyle & WS_CHILD) // Diablo fix
|
||||||
){
|
){
|
||||||
RECT screen;
|
RECT screen;
|
||||||
POINT upleft = {0,0};
|
POINT upleft = {0,0};
|
||||||
@ -240,32 +244,19 @@ HWND WINAPI extCreateWindowExA(
|
|||||||
// tested on Gangsters: coordinates must be window-relative!!!
|
// tested on Gangsters: coordinates must be window-relative!!!
|
||||||
// Age of Empires....
|
// Age of Empires....
|
||||||
if (dwStyle & WS_CHILD){
|
if (dwStyle & WS_CHILD){
|
||||||
RECT screen;
|
dxw.MapClient(&x, &y, &nWidth, &nHeight);
|
||||||
(*pGetClientRect)(dxw.GethWnd(),&screen);
|
|
||||||
x=x*screen.right/dxw.GetScreenWidth();
|
|
||||||
y=y*screen.bottom/dxw.GetScreenHeight();
|
|
||||||
nWidth=nWidth*screen.right/dxw.GetScreenWidth();
|
|
||||||
nHeight=nHeight*screen.bottom/dxw.GetScreenHeight();
|
|
||||||
OutTraceD("CreateWindowEx: fixed WS_CHILD pos=(%d,%d) size=(%d,%d)\n",
|
OutTraceD("CreateWindowEx: fixed WS_CHILD pos=(%d,%d) size=(%d,%d)\n",
|
||||||
x, y, nWidth, nHeight);
|
x, y, nWidth, nHeight);
|
||||||
}
|
}
|
||||||
// needed for Diablo, that creates a new control parent window that must be
|
// needed for Diablo, that creates a new control parent window that must be
|
||||||
// overlapped to the directdraw surface.
|
// overlapped to the directdraw surface.
|
||||||
else if (dwExStyle & WS_EX_CONTROLPARENT){
|
else if (dwExStyle & WS_EX_CONTROLPARENT){
|
||||||
RECT screen;
|
dxw.MapWindow(&x, &y, &nWidth, &nHeight);
|
||||||
POINT upleft = {0,0};
|
OutTraceD("CreateWindowEx: fixed WS_EX_CONTROLPARENT pos=(%d,%d) size=(%d,%d)\n",
|
||||||
(*pGetClientRect)(dxw.GethWnd(),&screen);
|
x, y, nWidth, nHeight);
|
||||||
(*pClientToScreen)(dxw.GethWnd(),&upleft);
|
|
||||||
x=upleft.x;
|
|
||||||
y=upleft.y;
|
|
||||||
nWidth=screen.right;
|
|
||||||
nHeight=screen.bottom;
|
|
||||||
OutTraceD("CreateWindowEx: fixed WS_EX_CONTROLPARENT win=(%d,%d)-(%d,%d)\n",
|
|
||||||
x, y, x+nWidth, y+nHeight);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(IsDebug)
|
OutTraceB("CreateWindowEx: fixed pos=(%d,%d) size=(%d,%d) Style=%x(%s) ExStyle=%x(%s)\n",
|
||||||
OutTrace("CreateWindowEx: fixed pos=(%d,%d) size=(%d,%d) Style=%x(%s) ExStyle=%x(%s)\n",
|
|
||||||
x, y, nWidth, nHeight, dwStyle, ExplainStyle(dwStyle), dwExStyle, ExplainExStyle(dwExStyle));
|
x, y, nWidth, nHeight, dwStyle, ExplainStyle(dwStyle), dwExStyle, ExplainExStyle(dwExStyle));
|
||||||
|
|
||||||
wndh= (*pCreateWindowExA)(dwExStyle, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight,
|
wndh= (*pCreateWindowExA)(dwExStyle, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight,
|
||||||
@ -281,7 +272,6 @@ HWND WINAPI extCreateWindowExA(
|
|||||||
extern void AdjustWindowPos(HWND, DWORD, DWORD);
|
extern void AdjustWindowPos(HWND, DWORD, DWORD);
|
||||||
(*pSetWindowLong)(wndh, GWL_STYLE, (dxw.dwFlags2 & MODALSTYLE) ? 0 : WS_OVERLAPPEDWINDOW);
|
(*pSetWindowLong)(wndh, GWL_STYLE, (dxw.dwFlags2 & MODALSTYLE) ? 0 : WS_OVERLAPPEDWINDOW);
|
||||||
(*pSetWindowLong)(wndh, GWL_EXSTYLE, 0);
|
(*pSetWindowLong)(wndh, GWL_EXSTYLE, 0);
|
||||||
//(*pShowWindow)(wndh, SW_SHOWNORMAL);
|
|
||||||
OutTraceD("CreateWindow: hwnd=%x, set style=WS_OVERLAPPEDWINDOW extstyle=0\n", wndh);
|
OutTraceD("CreateWindow: hwnd=%x, set style=WS_OVERLAPPEDWINDOW extstyle=0\n", wndh);
|
||||||
AdjustWindowPos(wndh, nWidth, nHeight);
|
AdjustWindowPos(wndh, nWidth, nHeight);
|
||||||
(*pShowWindow)(wndh, SW_SHOWNORMAL);
|
(*pShowWindow)(wndh, SW_SHOWNORMAL);
|
||||||
@ -536,10 +526,26 @@ BOOL WINAPI extRectangle(HDC hdc, int nLeftRect, int nTopRect, int nRightRect, i
|
|||||||
|
|
||||||
int WINAPI extFillRect(HDC hdc, const RECT *lprc, HBRUSH hbr)
|
int WINAPI extFillRect(HDC hdc, const RECT *lprc, HBRUSH hbr)
|
||||||
{
|
{
|
||||||
RECT rc;
|
RECT rc, trim;
|
||||||
|
HWND hWnd;
|
||||||
OutTraceD("FillRect: hdc=%x xy=(%d,%d)-(%d,%d)\n", hdc, lprc->left, lprc->top, lprc->right, lprc->bottom);
|
OutTraceD("FillRect: hdc=%x xy=(%d,%d)-(%d,%d)\n", hdc, lprc->left, lprc->top, lprc->right, lprc->bottom);
|
||||||
memcpy(&rc, lprc, sizeof(rc));
|
memcpy(&rc, lprc, sizeof(rc));
|
||||||
|
hWnd = WindowFromDC(hdc);
|
||||||
|
if((hWnd == dxw.GethWnd()) ||
|
||||||
|
(hWnd == 0) ||
|
||||||
|
(hWnd == GetDesktopWindow())){
|
||||||
|
// trim: some games (Player Manager 98) clear the screen by filling an exagerated rect
|
||||||
|
(*pGetClientRect)(dxw.GethWnd(), &trim);
|
||||||
|
hdc=GetDC(dxw.GethWnd());
|
||||||
|
dxw.MapWindowRect(&rc);
|
||||||
|
if(rc.left < trim.left) rc.left = trim.left;
|
||||||
|
if(rc.top < trim.top) rc.top = trim.top;
|
||||||
|
if(rc.right > trim.right) rc.right = trim.right;
|
||||||
|
if(rc.bottom > trim.bottom) rc.bottom = trim.bottom;
|
||||||
|
OutTraceD("FillRect: hwnd=%x hdc=%x fixed xy=(%d,%d)-(%d,%d)\n", hWnd, hdc, rc.left, rc.top, rc.right, rc.bottom);
|
||||||
|
}
|
||||||
if (dxw.dwFlags1 & FIXTEXTOUT) {
|
if (dxw.dwFlags1 & FIXTEXTOUT) {
|
||||||
|
// to be verified: why shifting and not scaling?
|
||||||
POINT anchor;
|
POINT anchor;
|
||||||
anchor.x=rc.left;
|
anchor.x=rc.left;
|
||||||
anchor.y=rc.top;
|
anchor.y=rc.top;
|
||||||
@ -1274,10 +1280,11 @@ BOOL WINAPI extClientToScreen(HWND hwnd, LPPOINT lppoint)
|
|||||||
{
|
{
|
||||||
// v2.02.10: fully revised to handle scaled windows
|
// v2.02.10: fully revised to handle scaled windows
|
||||||
BOOL res;
|
BOOL res;
|
||||||
|
|
||||||
OutTraceB("ClientToScreen: hwnd=%x hWnd=%x FullScreen=%x point=(%d,%d)\n",
|
OutTraceB("ClientToScreen: hwnd=%x hWnd=%x FullScreen=%x point=(%d,%d)\n",
|
||||||
hwnd, dxw.GethWnd(), dxw.IsFullScreen(), lppoint->x, lppoint->y);
|
hwnd, dxw.GethWnd(), dxw.IsFullScreen(), lppoint->x, lppoint->y);
|
||||||
if (lppoint && dxw.IsFullScreen()){
|
if (lppoint && dxw.IsFullScreen()){
|
||||||
dxw.MapPoint(lppoint);
|
*lppoint = dxw.AddCoordinates(*lppoint, dxw.ClientOffset(hwnd));
|
||||||
OutTraceB("ClientToScreen: FIXED point=(%d,%d)\n", lppoint->x, lppoint->y);
|
OutTraceB("ClientToScreen: FIXED point=(%d,%d)\n", lppoint->x, lppoint->y);
|
||||||
res=TRUE;
|
res=TRUE;
|
||||||
}
|
}
|
||||||
@ -1293,8 +1300,11 @@ BOOL WINAPI extScreenToClient(HWND hwnd, LPPOINT lppoint)
|
|||||||
BOOL res;
|
BOOL res;
|
||||||
OutTraceB("ScreenToClient: hwnd=%x hWnd=%x FullScreen=%x point=(%d,%d)\n",
|
OutTraceB("ScreenToClient: hwnd=%x hWnd=%x FullScreen=%x point=(%d,%d)\n",
|
||||||
hwnd, dxw.GethWnd(), dxw.IsFullScreen(), lppoint->x, lppoint->y);
|
hwnd, dxw.GethWnd(), dxw.IsFullScreen(), lppoint->x, lppoint->y);
|
||||||
|
|
||||||
|
if (lppoint && (lppoint->x == -32000) && (lppoint->y == -32000)) return 1;
|
||||||
|
|
||||||
if (lppoint && dxw.IsFullScreen()){
|
if (lppoint && dxw.IsFullScreen()){
|
||||||
dxw.UnmapPoint(lppoint);
|
*lppoint = dxw.SubCoordinates(*lppoint, dxw.ClientOffset(hwnd));
|
||||||
OutTraceB("ScreenToClient: FIXED point=(%d,%d)\n", lppoint->x, lppoint->y);
|
OutTraceB("ScreenToClient: FIXED point=(%d,%d)\n", lppoint->x, lppoint->y);
|
||||||
res=TRUE;
|
res=TRUE;
|
||||||
}
|
}
|
||||||
@ -1307,72 +1317,62 @@ BOOL WINAPI extScreenToClient(HWND hwnd, LPPOINT lppoint)
|
|||||||
BOOL WINAPI extGetClientRect(HWND hwnd, LPRECT lpRect)
|
BOOL WINAPI extGetClientRect(HWND hwnd, LPRECT lpRect)
|
||||||
{
|
{
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
OutTraceD("GetClientRect: whnd=%x FullScreen=%x\n", hwnd, dxw.IsFullScreen());
|
OutTraceB("GetClientRect: whnd=%x FullScreen=%x\n", hwnd, dxw.IsFullScreen());
|
||||||
if (lpRect && dxw.IsFullScreen() && (hwnd == dxw.GethWnd())){
|
|
||||||
lpRect->left=0;
|
if(!lpRect) return 0;
|
||||||
lpRect->top=0;
|
|
||||||
lpRect->right=dxw.GetScreenWidth();
|
|
||||||
lpRect->bottom=dxw.GetScreenHeight();
|
|
||||||
OutTraceD("GetClientRect: fixed rect=(%d,%d)-(%d,%d)\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// v2.1.75: in PREVENTMAXIMIZE mode, prevent the application to know the actual size of the desktop
|
|
||||||
// by calling GetClientRect on it!! Used to windowize "AfterLife".
|
|
||||||
// should I do the same with hwnd==0 ??
|
|
||||||
if ((hwnd==(*pGetDesktopWindow)()) || (hwnd==0)){
|
|
||||||
lpRect->left=0;
|
|
||||||
lpRect->top=0;
|
|
||||||
lpRect->right=dxw.GetScreenWidth();
|
|
||||||
lpRect->bottom=dxw.GetScreenHeight();
|
|
||||||
OutTraceD("GetClientRect: fixed rect=(%d,%d)-(%d,%d)\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// proxed call
|
// proxed call
|
||||||
ret=(*pGetClientRect)(hwnd, lpRect);
|
ret=(*pGetClientRect)(hwnd, lpRect);
|
||||||
OutTraceB("GetClientRect: rect=(%d,%d)-(%d,%d) ret=%d\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom, ret);
|
if(!ret) {
|
||||||
return ret;
|
OutTraceE("GetClientRect: ERROR hwnd=%x err=%d at %d\n", hwnd, GetLastError(), __LINE__);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
OutTraceB("GetClientRect: actual rect=(%d,%d)-(%d,%d)\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
|
||||||
|
|
||||||
|
if (dxw.IsDesktop(hwnd)){
|
||||||
|
*lpRect = dxw.GetScreenRect();
|
||||||
|
OutTraceB("GetClientRect: desktop rect=(%d,%d)-(%d,%d)\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (dxw.IsFullScreen()){
|
||||||
|
*lpRect=dxw.GetClientRect(*lpRect);
|
||||||
|
OutTraceB("GetClientRect: fixed rect=(%d,%d)-(%d,%d)\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
BOOL WINAPI extGetWindowRect(HWND hwnd, LPRECT lpRect)
|
BOOL WINAPI extGetWindowRect(HWND hwnd, LPRECT lpRect)
|
||||||
{
|
{
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
|
OutTraceB("GetWindowRect: hwnd=%x hWnd=%x FullScreen=%x\n", hwnd, dxw.GethWnd(), dxw.IsFullScreen());
|
||||||
OutTraceD("GetWindowRect: hwnd=%x hWnd=%x FullScreen=%x\n", hwnd, dxw.GethWnd(), dxw.IsFullScreen());
|
ret=(*pGetWindowRect)(hwnd, lpRect);
|
||||||
if (lpRect && dxw.IsFullScreen() && (hwnd == dxw.GethWnd())){
|
if(!ret) {
|
||||||
// a fullscreen window should have NO BORDERS!
|
OutTraceE("GetWindowRect: GetWindowRect hwnd=%x error %d at %d\n", hwnd, GetLastError(), __LINE__);
|
||||||
lpRect->left = 0;
|
|
||||||
lpRect->top = 0;
|
|
||||||
lpRect->right = dxw.GetScreenWidth();
|
|
||||||
lpRect->bottom = dxw.GetScreenHeight();
|
|
||||||
OutTraceD("GetWindowRect: fixed rect=(%d,%d)-(%d,%d)\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dxw.IsFullScreen() && ((*pGetWindowLong)(hwnd, GWL_STYLE) & WS_CHILD)){
|
|
||||||
// a child win should return the original supposed size
|
|
||||||
// so you basically revert here the coordinates compensation.
|
|
||||||
// Used by "Road Rash" to blit graphic on top of child windows
|
|
||||||
POINT upleft={0,0};
|
|
||||||
RECT client;
|
|
||||||
(*pClientToScreen)(dxw.GethWnd(),&upleft);
|
|
||||||
(*pGetClientRect)(dxw.GethWnd(),&client);
|
|
||||||
|
|
||||||
// using GetWindowRect and compensate for displacement.....
|
|
||||||
ret=(*pGetWindowRect)(hwnd, lpRect);
|
|
||||||
if (client.right && client.bottom){ // avoid divide by 0
|
|
||||||
lpRect->left = ((lpRect->left - upleft.x) * dxw.GetScreenWidth()) / client.right;
|
|
||||||
lpRect->top = ((lpRect->top - upleft.y) * dxw.GetScreenHeight()) / client.bottom;
|
|
||||||
lpRect->right = ((lpRect->right - upleft.x) * dxw.GetScreenWidth()) / client.right;
|
|
||||||
lpRect->bottom = ((lpRect->bottom - upleft.y) * dxw.GetScreenHeight()) / client.bottom;
|
|
||||||
OutTraceD("GetWindowRect: fixed CHILD rect=(%d,%d)-(%d,%d)\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
|
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
OutTraceB("GetWindowRect: rect=(%d,%d)-(%d,%d)\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
|
||||||
|
|
||||||
|
// minimized windows behaviour
|
||||||
|
if((lpRect->left == -32000)||(lpRect->top == -32000)) return ret;
|
||||||
|
|
||||||
|
if (dxw.IsDesktop(hwnd)){
|
||||||
|
// to avoid keeping track of window frame
|
||||||
|
*lpRect = dxw.GetScreenRect();
|
||||||
|
OutTraceB("GetWindowRect: desktop rect=(%d,%d)-(%d,%d)\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (dxw.IsFullScreen()){
|
||||||
|
*lpRect=dxw.GetWindowRect(*lpRect);
|
||||||
|
|
||||||
|
// Diablo fix: it retrieves coordinates for the explorer window, that are as big as the real desktop!!!
|
||||||
|
if(lpRect->left < 0) lpRect->left=0;
|
||||||
|
if(lpRect->right > (LONG)dxw.GetScreenWidth()) lpRect->right=dxw.GetScreenWidth();
|
||||||
|
if(lpRect->top < 0) lpRect->top=0;
|
||||||
|
if(lpRect->bottom > (LONG)dxw.GetScreenHeight()) lpRect->bottom=dxw.GetScreenHeight();
|
||||||
|
|
||||||
|
OutTraceB("GetWindowRect: fixed rect=(%d,%d)-(%d,%d)\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
|
||||||
|
}
|
||||||
|
|
||||||
ret=(*pGetWindowRect)(hwnd, lpRect);
|
|
||||||
OutTraceD("GetWindowRect: rect=(%d,%d)-(%d,%d)\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1429,6 +1429,8 @@ BOOL WINAPI extPeekMessage(LPMSG lpMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsg
|
|||||||
if((MsgCopy.message <= WM_MOUSELAST) && (MsgCopy.message >= WM_MOUSEFIRST)) MsgCopy.lParam = MAKELPARAM(MsgCopy.pt.x, MsgCopy.pt.y);
|
if((MsgCopy.message <= WM_MOUSELAST) && (MsgCopy.message >= WM_MOUSEFIRST)) MsgCopy.lParam = MAKELPARAM(MsgCopy.pt.x, MsgCopy.pt.y);
|
||||||
OutTraceC("PeekMessage: fixed lparam/pt=(%d,%d)\n", MsgCopy.pt.x, MsgCopy.pt.y);
|
OutTraceC("PeekMessage: fixed lparam/pt=(%d,%d)\n", MsgCopy.pt.x, MsgCopy.pt.y);
|
||||||
lpMsg=&MsgCopy;
|
lpMsg=&MsgCopy;
|
||||||
|
GetHookInfo()->CursorX=(short)MsgCopy.pt.x;
|
||||||
|
GetHookInfo()->CursorY=(short)MsgCopy.pt.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
@ -1455,6 +1457,8 @@ BOOL WINAPI extGetMessage(LPMSG lpMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsgF
|
|||||||
lpMsg->pt=FixMessagePt(FixedHwnd, lpMsg->pt);
|
lpMsg->pt=FixMessagePt(FixedHwnd, lpMsg->pt);
|
||||||
lpMsg->lParam = MAKELPARAM(lpMsg->pt.x, lpMsg->pt.y);
|
lpMsg->lParam = MAKELPARAM(lpMsg->pt.x, lpMsg->pt.y);
|
||||||
OutTraceC("PeekMessage: fixed lparam/pt=(%d,%d)\n", lpMsg->pt.x, lpMsg->pt.y);
|
OutTraceC("PeekMessage: fixed lparam/pt=(%d,%d)\n", lpMsg->pt.x, lpMsg->pt.y);
|
||||||
|
GetHookInfo()->CursorX=(short)lpMsg->pt.x;
|
||||||
|
GetHookInfo()->CursorY=(short)lpMsg->pt.y;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -1469,6 +1473,7 @@ BOOL WINAPI extGetMessage(LPMSG lpMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsgF
|
|||||||
#define SYSLIBIDX_DIRECTDRAW 4
|
#define SYSLIBIDX_DIRECTDRAW 4
|
||||||
#define SYSLIBIDX_OPENGL 5
|
#define SYSLIBIDX_OPENGL 5
|
||||||
#define SYSLIBIDX_MSVFW 6
|
#define SYSLIBIDX_MSVFW 6
|
||||||
|
//#define SYSLIBIDX_SMACK 7
|
||||||
#define SYSLIBIDX_MAX 7 // array size
|
#define SYSLIBIDX_MAX 7 // array size
|
||||||
HMODULE SysLibs[SYSLIBIDX_MAX];
|
HMODULE SysLibs[SYSLIBIDX_MAX];
|
||||||
char *SysNames[SYSLIBIDX_MAX]={
|
char *SysNames[SYSLIBIDX_MAX]={
|
||||||
@ -1478,7 +1483,8 @@ char *SysNames[SYSLIBIDX_MAX]={
|
|||||||
"ole32.dll",
|
"ole32.dll",
|
||||||
"ddraw.dll",
|
"ddraw.dll",
|
||||||
"opengl32.dll",
|
"opengl32.dll",
|
||||||
"msvfw32.dll"
|
//"msvfw32.dll",
|
||||||
|
"smackw32.dll"
|
||||||
};
|
};
|
||||||
char *SysNames2[SYSLIBIDX_MAX]={
|
char *SysNames2[SYSLIBIDX_MAX]={
|
||||||
"kernel32",
|
"kernel32",
|
||||||
@ -1487,7 +1493,8 @@ char *SysNames2[SYSLIBIDX_MAX]={
|
|||||||
"ole32",
|
"ole32",
|
||||||
"ddraw",
|
"ddraw",
|
||||||
"opengl32",
|
"opengl32",
|
||||||
"msvfw32"
|
//"msvfw32",
|
||||||
|
"smackw32"
|
||||||
};
|
};
|
||||||
extern void HookModule(HMODULE, int);
|
extern void HookModule(HMODULE, int);
|
||||||
extern void HookSysLibs(HMODULE);
|
extern void HookSysLibs(HMODULE);
|
||||||
@ -1525,7 +1532,7 @@ HMODULE WINAPI LoadLibraryExWrapper(LPCTSTR lpFileName, HANDLE hFile, DWORD dwFl
|
|||||||
idx=SYSLIBIDX_OPENGL;
|
idx=SYSLIBIDX_OPENGL;
|
||||||
SysLibs[idx]=libhandle;
|
SysLibs[idx]=libhandle;
|
||||||
}
|
}
|
||||||
HookModule(libhandle, 0);
|
if (idx == SYSLIBIDX_MAX) HookModule(libhandle, 0);
|
||||||
return libhandle;
|
return libhandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1537,7 +1544,7 @@ HMODULE WINAPI extLoadLibraryA(LPCTSTR lpFileName)
|
|||||||
HMODULE WINAPI extLoadLibraryW(LPCWSTR lpFileName)
|
HMODULE WINAPI extLoadLibraryW(LPCWSTR lpFileName)
|
||||||
{
|
{
|
||||||
char sFileName[256+1];
|
char sFileName[256+1];
|
||||||
wcstombs(sFileName, lpFileName, 80);
|
wcstombs_s(NULL, sFileName, lpFileName, 80);
|
||||||
return LoadLibraryExWrapper(sFileName, NULL, 0, "LoadLibraryW");;
|
return LoadLibraryExWrapper(sFileName, NULL, 0, "LoadLibraryW");;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1549,7 +1556,7 @@ HMODULE WINAPI extLoadLibraryExA(LPCTSTR lpFileName, HANDLE hFile, DWORD dwFlags
|
|||||||
HMODULE WINAPI extLoadLibraryExW(LPCWSTR lpFileName, HANDLE hFile, DWORD dwFlags)
|
HMODULE WINAPI extLoadLibraryExW(LPCWSTR lpFileName, HANDLE hFile, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
char sFileName[256+1];
|
char sFileName[256+1];
|
||||||
wcstombs(sFileName, lpFileName, 80);
|
wcstombs_s(NULL, sFileName, lpFileName, 80);
|
||||||
return LoadLibraryExWrapper(sFileName, hFile, dwFlags, "LoadLibraryExW");;
|
return LoadLibraryExWrapper(sFileName, hFile, dwFlags, "LoadLibraryExW");;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1829,7 +1836,7 @@ BOOL WINAPI extGDIBitBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nH
|
|||||||
int nWDest, nHDest;
|
int nWDest, nHDest;
|
||||||
nWDest= nWidth;
|
nWDest= nWidth;
|
||||||
nHDest= nHeight;
|
nHDest= nHeight;
|
||||||
dxw.MapRect(&nXDest, &nYDest, &nWDest, &nHDest);
|
dxw.MapClient(&nXDest, &nYDest, &nWDest, &nHDest);
|
||||||
if (dxw.dwFlags2 & SHOWFPSOVERLAY) dxw.ShowFPS(hdcDest);
|
if (dxw.dwFlags2 & SHOWFPSOVERLAY) dxw.ShowFPS(hdcDest);
|
||||||
res=(*pGDIStretchBlt)(hdcDest, nXDest, nYDest, nWDest, nHDest, hdcSrc, nXSrc, nYSrc, nWidth, nHeight, dwRop);
|
res=(*pGDIStretchBlt)(hdcDest, nXDest, nYDest, nWDest, nHDest, hdcSrc, nXSrc, nYSrc, nWidth, nHeight, dwRop);
|
||||||
}
|
}
|
||||||
@ -1852,7 +1859,7 @@ BOOL WINAPI extGDIPatBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nH
|
|||||||
|
|
||||||
if (dxw.IsFullScreen() && (OBJ_DC == GetObjectType(hdcDest))){
|
if (dxw.IsFullScreen() && (OBJ_DC == GetObjectType(hdcDest))){
|
||||||
int nWDest, nHDest;
|
int nWDest, nHDest;
|
||||||
dxw.MapRect(&nXDest, &nYDest, &nWDest, &nHDest);
|
dxw.MapClient(&nXDest, &nYDest, &nWDest, &nHDest);
|
||||||
if (dxw.dwFlags2 & SHOWFPSOVERLAY) dxw.ShowFPS(hdcDest);
|
if (dxw.dwFlags2 & SHOWFPSOVERLAY) dxw.ShowFPS(hdcDest);
|
||||||
res=(*pGDIPatBlt)(hdcDest, nXDest, nYDest, nWDest, nHDest, dwRop);
|
res=(*pGDIPatBlt)(hdcDest, nXDest, nYDest, nWDest, nHDest, dwRop);
|
||||||
}
|
}
|
||||||
|
@ -82,6 +82,8 @@
|
|||||||
#define IDC_USERGB565 1033
|
#define IDC_USERGB565 1033
|
||||||
#define IDC_SUPPRESSDXERRORS 1034
|
#define IDC_SUPPRESSDXERRORS 1034
|
||||||
#define IDC_PREVENTMAXIMIZE 1035
|
#define IDC_PREVENTMAXIMIZE 1035
|
||||||
|
#define IDC_SUPPRESSDXERRORS2 1035
|
||||||
|
#define IDC_MARKBLIT 1035
|
||||||
#define IDC_OUTWINMESSAGES 1036
|
#define IDC_OUTWINMESSAGES 1036
|
||||||
#define IDC_OUTDXTRACE 1037
|
#define IDC_OUTDXTRACE 1037
|
||||||
#define IDC_MODEXEMULATION 1038
|
#define IDC_MODEXEMULATION 1038
|
||||||
|
@ -38,6 +38,7 @@ void CTabDirectX::DoDataExchange(CDataExchange* pDX)
|
|||||||
DDX_Check(pDX, IDC_VIDEOTOSYSTEMMEM, cTarget->m_VideoToSystemMem);
|
DDX_Check(pDX, IDC_VIDEOTOSYSTEMMEM, cTarget->m_VideoToSystemMem);
|
||||||
DDX_Check(pDX, IDC_USERGB565, cTarget->m_UseRGB565);
|
DDX_Check(pDX, IDC_USERGB565, cTarget->m_UseRGB565);
|
||||||
DDX_Check(pDX, IDC_SUPPRESSDXERRORS, cTarget->m_SuppressDXErrors);
|
DDX_Check(pDX, IDC_SUPPRESSDXERRORS, cTarget->m_SuppressDXErrors);
|
||||||
|
DDX_Check(pDX, IDC_MARKBLIT, cTarget->m_MarkBlit);
|
||||||
DDX_Check(pDX, IDC_MAPGDITOPRIMARY, cTarget->m_MapGDIToPrimary);
|
DDX_Check(pDX, IDC_MAPGDITOPRIMARY, cTarget->m_MapGDIToPrimary);
|
||||||
DDX_Check(pDX, IDC_BACKBUFATTACH, cTarget->m_BackBufAttach);
|
DDX_Check(pDX, IDC_BACKBUFATTACH, cTarget->m_BackBufAttach);
|
||||||
DDX_Check(pDX, IDC_FULLRECTBLT, cTarget->m_FullRectBlt);
|
DDX_Check(pDX, IDC_FULLRECTBLT, cTarget->m_FullRectBlt);
|
||||||
|
@ -60,6 +60,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
|
|||||||
m_KeepCursorFixed = FALSE;
|
m_KeepCursorFixed = FALSE;
|
||||||
m_UseRGB565 = FALSE;
|
m_UseRGB565 = FALSE;
|
||||||
m_SuppressDXErrors = FALSE;
|
m_SuppressDXErrors = FALSE;
|
||||||
|
m_MarkBlit = FALSE;
|
||||||
m_PreventMaximize = FALSE;
|
m_PreventMaximize = FALSE;
|
||||||
m_ClientRemapping = FALSE;
|
m_ClientRemapping = FALSE;
|
||||||
m_MapGDIToPrimary = FALSE;
|
m_MapGDIToPrimary = FALSE;
|
||||||
|
@ -64,6 +64,7 @@ public:
|
|||||||
BOOL m_KeepCursorFixed;
|
BOOL m_KeepCursorFixed;
|
||||||
BOOL m_UseRGB565;
|
BOOL m_UseRGB565;
|
||||||
BOOL m_SuppressDXErrors;
|
BOOL m_SuppressDXErrors;
|
||||||
|
BOOL m_MarkBlit;
|
||||||
BOOL m_PreventMaximize;
|
BOOL m_PreventMaximize;
|
||||||
BOOL m_ClientRemapping;
|
BOOL m_ClientRemapping;
|
||||||
BOOL m_MapGDIToPrimary;
|
BOOL m_MapGDIToPrimary;
|
||||||
|
Binary file not shown.
@ -326,6 +326,7 @@ BEGIN
|
|||||||
CONTROL "DirectInput Hooking",IDC_HOOKDI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,182,97,12
|
CONTROL "DirectInput Hooking",IDC_HOOKDI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,182,97,12
|
||||||
GROUPBOX "DirectInput",IDC_STATIC,7,172,286,61
|
GROUPBOX "DirectInput",IDC_STATIC,7,172,286,61
|
||||||
CONTROL "Set AERO compatible mode",IDC_SETCOMPATIBILITY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,153,109,12
|
CONTROL "Set AERO compatible mode",IDC_SETCOMPATIBILITY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,153,109,12
|
||||||
|
CONTROL "Highlight blit to primary",IDC_MARKBLIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,84,127,10
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_TAB_MOUSE DIALOGEX 0, 0, 300, 240
|
IDD_TAB_MOUSE DIALOGEX 0, 0, 300, 240
|
||||||
|
Binary file not shown.
@ -98,6 +98,25 @@ CDxwndhostView::CDxwndhostView()
|
|||||||
EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &this->InitDevMode);
|
EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &this->InitDevMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CDxwndhostView::SaveWinPos()
|
||||||
|
{
|
||||||
|
char val[32];
|
||||||
|
RECT rect;
|
||||||
|
|
||||||
|
// save window rect
|
||||||
|
//::GetWindowRect(::GetActiveWindow(), &rect);
|
||||||
|
this->GetActiveWindow()->GetWindowRect(&rect);
|
||||||
|
if((rect.top < 0) || (rect.bottom < 0) || (rect.left < 0) || (rect.right < 0)) return;
|
||||||
|
sprintf_s(val, sizeof(val), "%i", rect.left);
|
||||||
|
WritePrivateProfileString("window", "posx", val, InitPath);
|
||||||
|
sprintf_s(val, sizeof(val), "%i", rect.top);
|
||||||
|
WritePrivateProfileString("window", "posy", val, InitPath);
|
||||||
|
sprintf_s(val, sizeof(val), "%i", rect.right-rect.left);
|
||||||
|
WritePrivateProfileString("window", "sizx", val, InitPath);
|
||||||
|
sprintf_s(val, sizeof(val), "%i", rect.bottom-rect.top);
|
||||||
|
WritePrivateProfileString("window", "sizy", val, InitPath);
|
||||||
|
}
|
||||||
|
|
||||||
void CDxwndhostView::SaveConfigFile()
|
void CDxwndhostView::SaveConfigFile()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -234,6 +253,7 @@ CDxwndhostView::~CDxwndhostView()
|
|||||||
void CDxwndhostView::OnExit()
|
void CDxwndhostView::OnExit()
|
||||||
{
|
{
|
||||||
// check for running apps ....
|
// check for running apps ....
|
||||||
|
this->SaveWinPos();
|
||||||
if (GetHookStatus(NULL)==DXW_RUNNING){
|
if (GetHookStatus(NULL)==DXW_RUNNING){
|
||||||
if (MessageBoxEx(0,
|
if (MessageBoxEx(0,
|
||||||
"A hooked task is still running.\n"
|
"A hooked task is still running.\n"
|
||||||
@ -267,6 +287,7 @@ void CDxwndhostView::OnInitialUpdate()
|
|||||||
LV_ITEM listitem;
|
LV_ITEM listitem;
|
||||||
int i;
|
int i;
|
||||||
char key[32];
|
char key[32];
|
||||||
|
RECT rect;
|
||||||
|
|
||||||
listcol.mask = LVCF_WIDTH;
|
listcol.mask = LVCF_WIDTH;
|
||||||
listcol.cx = 100;
|
listcol.cx = 100;
|
||||||
@ -275,6 +296,17 @@ void CDxwndhostView::OnInitialUpdate()
|
|||||||
GetCurrentDirectory(MAX_PATH, InitPath);
|
GetCurrentDirectory(MAX_PATH, InitPath);
|
||||||
strcat_s(InitPath, sizeof(InitPath), "\\");
|
strcat_s(InitPath, sizeof(InitPath), "\\");
|
||||||
strcat_s(InitPath, sizeof(InitPath), m_ConfigFileName);
|
strcat_s(InitPath, sizeof(InitPath), m_ConfigFileName);
|
||||||
|
|
||||||
|
// restore last window pos
|
||||||
|
AfxGetApp()->m_pMainWnd->GetWindowRect(&rect);
|
||||||
|
rect.left = GetPrivateProfileInt("window", "posx", 50, InitPath);
|
||||||
|
rect.top = GetPrivateProfileInt("window", "posy", 50, InitPath);
|
||||||
|
rect.right = rect.left + GetPrivateProfileInt("window", "sizx", 320, InitPath);
|
||||||
|
rect.bottom = rect.top + GetPrivateProfileInt("window", "sizy", 200, InitPath);
|
||||||
|
AfxGetApp()->m_pMainWnd->MoveWindow(&rect, TRUE);
|
||||||
|
AfxGetApp()->m_pMainWnd->ShowWindow(SW_SHOW);
|
||||||
|
AfxGetApp()->m_pMainWnd->UpdateWindow();
|
||||||
|
|
||||||
for(i = 0; i < MAXTARGETS; i ++){
|
for(i = 0; i < MAXTARGETS; i ++){
|
||||||
sprintf_s(key, sizeof(key), "path%i", i);
|
sprintf_s(key, sizeof(key), "path%i", i);
|
||||||
GetPrivateProfileString("target", key, "", TargetMaps[i].path, MAX_PATH, InitPath);
|
GetPrivateProfileString("target", key, "", TargetMaps[i].path, MAX_PATH, InitPath);
|
||||||
@ -427,6 +459,7 @@ void CDxwndhostView::OnModify()
|
|||||||
dlg.m_KeepCursorFixed = TargetMaps[i].flags2 & KEEPCURSORFIXED ? 1 : 0;
|
dlg.m_KeepCursorFixed = TargetMaps[i].flags2 & KEEPCURSORFIXED ? 1 : 0;
|
||||||
dlg.m_UseRGB565 = TargetMaps[i].flags & USERGB565 ? 1 : 0;
|
dlg.m_UseRGB565 = TargetMaps[i].flags & USERGB565 ? 1 : 0;
|
||||||
dlg.m_SuppressDXErrors = TargetMaps[i].flags & SUPPRESSDXERRORS ? 1 : 0;
|
dlg.m_SuppressDXErrors = TargetMaps[i].flags & SUPPRESSDXERRORS ? 1 : 0;
|
||||||
|
dlg.m_MarkBlit = TargetMaps[i].flags3 & MARKBLIT ? 1 : 0;
|
||||||
dlg.m_PreventMaximize = TargetMaps[i].flags & PREVENTMAXIMIZE ? 1 : 0;
|
dlg.m_PreventMaximize = TargetMaps[i].flags & PREVENTMAXIMIZE ? 1 : 0;
|
||||||
dlg.m_ClientRemapping = TargetMaps[i].flags & CLIENTREMAPPING ? 1 : 0;
|
dlg.m_ClientRemapping = TargetMaps[i].flags & CLIENTREMAPPING ? 1 : 0;
|
||||||
dlg.m_MapGDIToPrimary = TargetMaps[i].flags & MAPGDITOPRIMARY ? 1 : 0;
|
dlg.m_MapGDIToPrimary = TargetMaps[i].flags & MAPGDITOPRIMARY ? 1 : 0;
|
||||||
@ -538,6 +571,7 @@ void CDxwndhostView::OnModify()
|
|||||||
if(dlg.m_KeepCursorFixed) TargetMaps[i].flags2 |= KEEPCURSORFIXED;
|
if(dlg.m_KeepCursorFixed) TargetMaps[i].flags2 |= KEEPCURSORFIXED;
|
||||||
if(dlg.m_UseRGB565) TargetMaps[i].flags |= USERGB565;
|
if(dlg.m_UseRGB565) TargetMaps[i].flags |= USERGB565;
|
||||||
if(dlg.m_SuppressDXErrors) TargetMaps[i].flags |= SUPPRESSDXERRORS;
|
if(dlg.m_SuppressDXErrors) TargetMaps[i].flags |= SUPPRESSDXERRORS;
|
||||||
|
if(dlg.m_MarkBlit) TargetMaps[i].flags3 |= MARKBLIT;
|
||||||
if(dlg.m_PreventMaximize) TargetMaps[i].flags |= PREVENTMAXIMIZE;
|
if(dlg.m_PreventMaximize) TargetMaps[i].flags |= PREVENTMAXIMIZE;
|
||||||
if(dlg.m_ClientRemapping) TargetMaps[i].flags |= CLIENTREMAPPING;
|
if(dlg.m_ClientRemapping) TargetMaps[i].flags |= CLIENTREMAPPING;
|
||||||
if(dlg.m_MapGDIToPrimary) TargetMaps[i].flags |= MAPGDITOPRIMARY;
|
if(dlg.m_MapGDIToPrimary) TargetMaps[i].flags |= MAPGDITOPRIMARY;
|
||||||
@ -840,6 +874,7 @@ void CDxwndhostView::OnAdd()
|
|||||||
if(dlg.m_KeepCursorFixed) TargetMaps[i].flags2 |= KEEPCURSORFIXED;
|
if(dlg.m_KeepCursorFixed) TargetMaps[i].flags2 |= KEEPCURSORFIXED;
|
||||||
if(dlg.m_UseRGB565) TargetMaps[i].flags |= USERGB565;
|
if(dlg.m_UseRGB565) TargetMaps[i].flags |= USERGB565;
|
||||||
if(dlg.m_SuppressDXErrors) TargetMaps[i].flags |= SUPPRESSDXERRORS;
|
if(dlg.m_SuppressDXErrors) TargetMaps[i].flags |= SUPPRESSDXERRORS;
|
||||||
|
if(dlg.m_MarkBlit) TargetMaps[i].flags3 |= MARKBLIT;
|
||||||
if(dlg.m_PreventMaximize) TargetMaps[i].flags |= PREVENTMAXIMIZE;
|
if(dlg.m_PreventMaximize) TargetMaps[i].flags |= PREVENTMAXIMIZE;
|
||||||
if(dlg.m_ClientRemapping) TargetMaps[i].flags |= CLIENTREMAPPING;
|
if(dlg.m_ClientRemapping) TargetMaps[i].flags |= CLIENTREMAPPING;
|
||||||
if(dlg.m_MapGDIToPrimary) TargetMaps[i].flags |= MAPGDITOPRIMARY;
|
if(dlg.m_MapGDIToPrimary) TargetMaps[i].flags |= MAPGDITOPRIMARY;
|
||||||
@ -1093,6 +1128,7 @@ void CDxwndhostView::OnGoToTrayIcon()
|
|||||||
|
|
||||||
void CDxwndhostView::OnSaveFile()
|
void CDxwndhostView::OnSaveFile()
|
||||||
{
|
{
|
||||||
|
this->SaveWinPos();
|
||||||
if (this->isUpdated)
|
if (this->isUpdated)
|
||||||
if (MessageBoxEx(0,
|
if (MessageBoxEx(0,
|
||||||
"Task list has changed.\n"
|
"Task list has changed.\n"
|
||||||
|
@ -20,6 +20,7 @@ protected: // Create from serialization only features.
|
|||||||
private:
|
private:
|
||||||
void Resize(void);
|
void Resize(void);
|
||||||
void SaveConfigFile();
|
void SaveConfigFile();
|
||||||
|
void SaveWinPos();
|
||||||
TARGETMAP TargetMaps[MAXTARGETS];
|
TARGETMAP TargetMaps[MAXTARGETS];
|
||||||
PRIVATEMAP TitleMaps[MAXTARGETS];
|
PRIVATEMAP TitleMaps[MAXTARGETS];
|
||||||
char InitPath[MAX_PATH];
|
char InitPath[MAX_PATH];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user