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

v2_03_44_src

Former-commit-id: 78999489be6a5745474ed4d697cf755eb76db1a2
This commit is contained in:
gho tik 2015-07-11 12:42:23 -04:00 committed by Refael ACkermann
parent d9a1b51681
commit bf26e50bd9
19 changed files with 254 additions and 159 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:367c504db6f66d3f5c9e40e1a3e3aeb94f3c5a3df7b7bd9134a649379a40c8fa oid sha256:4fa45747fcb74b2f182ae1d40d3d2219eef7a9410a72a7db49157aba403d9fe4
size 612864 size 613888

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:4b44208fd7eef222ff0861d95418c3aabb46481b83198c1b40d769bc52f6a8b4 oid sha256:48137e513053f009fb46ef066a902428491fa3fbc00119db3d5a16cd287ce4fa
size 545792 size 545792

View File

@ -1,70 +0,0 @@
[window]
exportpath=D:\DxWnd\v2_03_43_src\build\exports\
exepath=D:\Games\Arx Fatalis demo\
posx=1946
posy=567
sizx=320
sizy=200
[target]
title0=Arx Fatalis demo
path0=D:\Games\Arx Fatalis demo\ARX.exe
launchpath0=
module0=Athena
opengllib0=
notes0=
registry0=
ver0=0
coord0=0
flag0=136314918
flagg0=1207959552
flagh0=65552
flagi0=138412036
flagj0=4224
flagk0=65536
tflag0=0
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=150
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1
swapeffect0=0
title1=TieFighter 95
path1=D:\Games\TIE95\TIE95.EXE
launchpath1=
module1=
opengllib1=
notes1=The game can be played also with no joystick using the DxWnd virtual one.\nIf you have a real joystick, the "Use DLL injection" flag is not necessary.\nUse "Unlock Z order" to avoid losing control of the window.
registry1=
ver1=1
coord1=0
flag1=681574514
flagg1=1744830464
flagh1=20
flagi1=138412036
flagj1=1073746048
flagk1=136642560
tflag1=0
initx1=0
inity1=0
minx1=0
miny1=0
maxx1=800
maxy1=600
posx1=50
posy1=50
sizx1=800
sizy1=600
maxfps1=0
initts1=0
winver1=0
maxres1=-1
swapeffect1=0

View File

@ -28,5 +28,5 @@ launchpath0=
notes0= notes0=
registry0= registry0=
flagj0=0 flagj0=0
flagk0=262144 flagk0=0
swapeffect0=0 swapeffect0=0

32
build/exports/Reah.dxw Normal file
View File

@ -0,0 +1,32 @@
[target]
title0=Reah
path0=D:\Games\Reah\Reah.exe
launchpath0=F:\Autorun.exe
module0=
opengllib0=
notes0=
registry0=
ver0=0
coord0=0
flag0=-1465778141
flagg0=1209010176
flagh0=20
flagi0=138412036
flagj0=1073746048
flagk0=98304
tflag0=0
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1
swapeffect0=0

View File

@ -0,0 +1,32 @@
[target]
title0=Super Real Mahjong P7
path0=D:\Games\Super Real Mahjong P7\P7\p7.exe
launchpath0=D:\Games\Super Real Mahjong P7\P7\p7.exe -f
module0=
opengllib0=
notes0=
registry0=
ver0=0
coord0=0
flag0=681574434
flagg0=1207959552
flagh0=20
flagi0=138412036
flagj0=5248
flagk0=67436544
tflag0=0
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1
swapeffect0=0

View File

@ -951,4 +951,13 @@ fix: deleted emulation of ZBUFFER attach. Needed for "Arx Fatalis"
fix: added emulation of PixelFormat in getPixelFormat hooker. Needed for "Arx Fatalis" fix: added emulation of PixelFormat in getPixelFormat hooker. Needed for "Arx Fatalis"
add: added virtual joystick feature. Required to play "Tie Fighter 95" with no real joystick add: added virtual joystick feature. Required to play "Tie Fighter 95" with no real joystick
v2.03.43.fix1 v2.03.43.fix1
fix: recovered virtual joystick buttons fix: recovered virtual joystick buttons
v2.03.44
fix: GetSystemPaletteUse error message
fix: transparent virtual joystick icons
fix: RealizePalette hooker crash in "Super Real Mahjong P7"
fix: complete recoding of GDI BitBlt, StretchBlt and PatBlt hookers: it fixes "Reah" problems
fix: changes in USER32 BeginPaint hooker to support DC sharing with ddraw
fix: increased configuration panels heigth do avoid clipping when desktop font size is set to 125%

View File

@ -1421,7 +1421,7 @@ char *ExplainGetDCExFlags(DWORD c)
char *ExplainPaletteUse(UINT uUsage) char *ExplainPaletteUse(UINT uUsage)
{ {
char *eb = SYSPAL_ERROR; char *eb = "SYSPAL_ERROR";
switch(uUsage){ switch(uUsage){
case SYSPAL_STATIC: eb="SYSPAL_STATIC"; break; case SYSPAL_STATIC: eb="SYSPAL_STATIC"; break;
case SYSPAL_NOSTATIC: eb="SYSPAL_NOSTATIC"; break; case SYSPAL_NOSTATIC: eb="SYSPAL_NOSTATIC"; break;

View File

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

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -9,6 +9,10 @@
#include "stdio.h" #include "stdio.h"
#define GDIMODE_STRETCHED 0
#define GDIMODE_EMULATED 1
extern int GDIEmulationMode;
static void Stopper(char *s, int line) static void Stopper(char *s, int line)
{ {
char sMsg[81]; char sMsg[81];
@ -616,7 +620,7 @@ UINT WINAPI extRealizePalette(HDC hdc)
HRESULT res; HRESULT res;
extern LPDIRECTDRAWPALETTE lpDDP; extern LPDIRECTDRAWPALETTE lpDDP;
extern SetEntries_Type pSetEntries; extern SetEntries_Type pSetEntries;
res=(*pSetEntries)(lpDDP, 0, 0, 256, PalEntries); if(lpDDP && pSetEntries) res=(*pSetEntries)(lpDDP, 0, 0, 256, PalEntries);
} }
else else
ret=(*pGDIRealizePalette)(hdc); ret=(*pGDIRealizePalette)(hdc);
@ -758,6 +762,7 @@ HDC WINAPI extGDICreateCompatibleDC(HDC hdc)
BOOL WINAPI extGDIBitBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HDC hdcSrc, int nXSrc, int nYSrc, DWORD dwRop) BOOL WINAPI extGDIBitBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HDC hdcSrc, int nXSrc, int nYSrc, DWORD dwRop)
{ {
BOOL res; BOOL res;
BOOL IsToScreen;
OutTraceDW("GDI.BitBlt: HDC=%x nXDest=%d nYDest=%d nWidth=%d nHeight=%d hdcSrc=%x nXSrc=%d nYSrc=%d dwRop=%x(%s)\n", OutTraceDW("GDI.BitBlt: HDC=%x nXDest=%d nYDest=%d nWidth=%d nHeight=%d hdcSrc=%x nXSrc=%d nYSrc=%d dwRop=%x(%s)\n",
hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop, ExplainROP(dwRop)); hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop, ExplainROP(dwRop));
@ -771,44 +776,40 @@ BOOL WINAPI extGDIBitBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nH
if(dxw.dwFlags3 & GDIEMULATEDC){ if(dxw.dwFlags3 & GDIEMULATEDC){
if (hdcDest==dxw.RealHDC) hdcDest=dxw.VirtualHDC; if (hdcDest==dxw.RealHDC) hdcDest=dxw.VirtualHDC;
//return (*pGDIBitBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop); OutTraceB("GDI.BitBlt: DEBUG emulated hdc dest=%x->%x\n", dxw.RealHDC, hdcDest);
} }
SetStretchBltMode(hdcDest, HALFTONE); if(hdcDest == NULL){
if (OBJ_DC == GetObjectType(hdcDest)){ // happens in Reah, hdc is NULL despite the fact that BeginPaint returns a valid DC. Too bad, we recover here ...
//if(dxw.IsRealDesktop(WindowFromDC(hdcDest))) hdcDest=GetDC(dxw.GethWnd()); // ?????? hdcDest = (*pGDIGetDC)(dxw.GethWnd());
if (dxw.HandleFPS()) return TRUE; OutTraceB("GDI.BitBlt: DEBUG hdc dest=NULL->%x\n", hdcDest);
if (dxw.dwFlags3 & NOGDIBLT) return TRUE; }
if(dxw.IsFullScreen()){
int nWDest, nHDest; IsToScreen=(OBJ_DC == GetObjectType(hdcDest));
nWDest= nWidth; if (IsToScreen && (dxw.dwFlags3 & NOGDIBLT)) return TRUE;
nHDest= nHeight; if(dxw.IsFullScreen()) {
dxw.MapClient(&nXDest, &nYDest, &nWDest, &nHDest); switch(GDIEmulationMode){
res=(*pGDIStretchBlt)(hdcDest, nXDest, nYDest, nWDest, nHDest, hdcSrc, nXSrc, nYSrc, nWidth, nHeight, dwRop); case GDIMODE_STRETCHED: {
dxw.ShowOverlay(hdcDest);
OutTrace("Debug: DC dest=(%d,%d) size=(%d,%d)\n", nXDest, nYDest, nWDest, nHDest);
}
else if(WindowFromDC(hdcDest)==NULL){
// V2.02.31: See StretchBlt.
int nWDest, nHDest; int nWDest, nHDest;
nWDest= nWidth; nWDest= nWidth;
nHDest= nHeight; nHDest= nHeight;
dxw.MapWindow(&nXDest, &nYDest, &nWDest, &nHDest); dxw.MapClient(&nXDest, &nYDest, &nWDest, &nHDest);
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);
dxw.ShowOverlay(hdcDest); OutTraceB("GDI.BitBlt: DEBUG DC dest=(%d,%d) size=(%d,%d)\n", nXDest, nYDest, nWDest, nHDest);
OutTrace("Debug: NULL dest=(%d,%d) size=(%d,%d)\n", nXDest, nYDest, nWDest, nHDest); }
} break;
else{ case GDIMODE_EMULATED:
default:
res=(*pGDIBitBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop); res=(*pGDIBitBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop);
OutTrace("Debug: PROXY dest=(%d,%d) size=(%d,%d)\n", nXDest, nYDest, nWidth, nHeight); break;
}
} }
}
else { else {
res=(*pGDIBitBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop); res=(*pGDIBitBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop);
} }
if(res && IsToScreen) dxw.ShowOverlay(hdcDest);
if(!res) OutTraceE("GDI.BitBlt: ERROR err=%d at %d\n", GetLastError(), __LINE__); if(!res) OutTraceE("GDI.BitBlt: ERROR err=%d at %d\n", GetLastError(), __LINE__);
return res; return res;
} }
@ -823,29 +824,42 @@ BOOL WINAPI extGDIPatBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nH
OutTraceB("GDI.PatBlt: DEBUG FullScreen=%x target hdctype=%x(%s) hwnd=%x\n", OutTraceB("GDI.PatBlt: DEBUG FullScreen=%x target hdctype=%x(%s) hwnd=%x\n",
dxw.IsFullScreen(), GetObjectType(hdcDest), ExplainDCType(GetObjectType(hdcDest)), WindowFromDC(hdcDest)); dxw.IsFullScreen(), GetObjectType(hdcDest), ExplainDCType(GetObjectType(hdcDest)), WindowFromDC(hdcDest));
IsToScreen=FALSE; if(dxw.dwFlags3 & GDIEMULATEDC){
res=0; if (hdcDest==dxw.RealHDC) hdcDest=dxw.VirtualHDC;
if (OBJ_DC == GetObjectType(hdcDest)){ OutTraceB("GDI.PatBlt: DEBUG emulated hdc dest=%x->%x\n", dxw.RealHDC, hdcDest);
IsToScreen=TRUE; }
if (dxw.HandleFPS()) return TRUE;
if (dxw.dwFlags3 & NOGDIBLT) return TRUE; if(hdcDest == NULL){
if (dxw.IsFullScreen()){ // happens in Reah, hdc is NULL despite the fact that BeginPaint returns a valid DC. Too bad, we recover here ...
dxw.MapClient(&nXDest, &nYDest, &nWidth, &nHeight); hdcDest = (*pGDIGetDC)(dxw.GethWnd());
dxw.ShowOverlay(hdcDest); OutTraceB("GDI.PatBlt: DEBUG hdc dest=NULL->%x\n", hdcDest);
res=(*pGDIPatBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, dwRop); }
}
else if(WindowFromDC(hdcDest)==NULL){ IsToScreen=(OBJ_DC == GetObjectType(hdcDest));
// V2.02.31: See StretchBlt. if (IsToScreen && (dxw.dwFlags3 & NOGDIBLT)) return TRUE;
dxw.MapWindow(&nXDest, &nYDest, &nWidth, &nHeight); if(dxw.IsFullScreen()) {
res=(*pGDIPatBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, dwRop); switch(GDIEmulationMode){
case GDIMODE_STRETCHED: {
int nWDest, nHDest;
nWDest= nWidth;
nHDest= nHeight;
dxw.MapClient(&nXDest, &nYDest, &nWDest, &nHDest);
res=(*pGDIPatBlt)(hdcDest, nXDest, nYDest, nWDest, nHDest, dwRop);
OutTraceB("GDI.PatBlt: DEBUG DC dest=(%d,%d) size=(%d,%d)\n", nXDest, nYDest, nWDest, nHDest);
}
break;
case GDIMODE_EMULATED:
default:
res=(*pGDIPatBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, dwRop);
break;
} }
} }
else { else {
res=(*pGDIPatBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, dwRop); res=(*pGDIPatBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, dwRop);
} }
if (IsToScreen) dxw.ShowOverlay(hdcDest);
if(!res) OutTraceE("GDI.PatBlt: ERROR err=%d at %d\n", GetLastError(), __LINE__);
if(res && IsToScreen) dxw.ShowOverlay(hdcDest);
if(!res) OutTraceE("GDI.PatBlt: ERROR err=%d at %d\n", GetLastError(), __LINE__);
return res; return res;
} }
@ -861,24 +875,41 @@ BOOL WINAPI extGDIStretchBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, in
OutTraceB("GDI.StretchBlt: DEBUG FullScreen=%x target hdctype=%x(%s) hwnd=%x\n", OutTraceB("GDI.StretchBlt: DEBUG FullScreen=%x target hdctype=%x(%s) hwnd=%x\n",
dxw.IsFullScreen(), GetObjectType(hdcDest), ExplainDCType(GetObjectType(hdcDest)), WindowFromDC(hdcDest)); dxw.IsFullScreen(), GetObjectType(hdcDest), ExplainDCType(GetObjectType(hdcDest)), WindowFromDC(hdcDest));
IsToScreen=FALSE; if(dxw.dwFlags3 & GDIEMULATEDC){
if (OBJ_DC == GetObjectType(hdcDest)){ if (hdcDest==dxw.RealHDC) hdcDest=dxw.VirtualHDC;
if (dxw.HandleFPS()) return TRUE; OutTraceB("GDI.StretchBlt: DEBUG emulated hdc dest=%x->%x\n", dxw.RealHDC, hdcDest);
if (dxw.dwFlags3 & NOGDIBLT) return TRUE;
IsToScreen=TRUE;
if(dxw.IsFullScreen()){
dxw.MapClient(&nXDest, &nYDest, &nWidth, &nHeight);
}
else if(WindowFromDC(hdcDest)==NULL){
// V2.02.31: In "Silent Hunter II" intro movie, QuickTime 5 renders the video on the PrimarySurface->GetDC device context,
// that is a memory device type associated to NULL (desktop) window, through GDI StretchBlt api. So, you shoud compensate
// by scaling and offsetting to main window.
dxw.MapWindow(&nXDest, &nYDest, &nWidth, &nHeight);
}
} }
res=(*pGDIStretchBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, nWSrc, nHSrc, dwRop); if(hdcDest == NULL){
if (IsToScreen) dxw.ShowOverlay(hdcDest); // happens in Reah, hdc is NULL despite the fact that BeginPaint returns a valid DC. Too bad, we recover here ...
hdcDest = (*pGDIGetDC)(dxw.GethWnd());
OutTraceB("GDI.StretchBlt: DEBUG hdc dest=NULL->%x\n", hdcDest);
}
IsToScreen=(OBJ_DC == GetObjectType(hdcDest));
if (IsToScreen && (dxw.dwFlags3 & NOGDIBLT)) return TRUE;
if(dxw.IsFullScreen()) {
switch(GDIEmulationMode){
case GDIMODE_STRETCHED: {
int nWDest, nHDest;
nWDest= nWidth;
nHDest= nHeight;
dxw.MapClient(&nXDest, &nYDest, &nWDest, &nHDest);
res=(*pGDIStretchBlt)(hdcDest, nXDest, nYDest, nWDest, nHDest, hdcSrc, nXSrc, nYSrc, nWidth, nHeight, dwRop);
OutTraceB("GDI.StretchBlt: DEBUG DC dest=(%d,%d) size=(%d,%d)\n", nXDest, nYDest, nWDest, nHDest);
}
break;
case GDIMODE_EMULATED:
default:
res=(*pGDIStretchBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, nWidth, nHeight, dwRop);
break;
}
}
else {
res=(*pGDIStretchBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, nWidth, nHeight, dwRop);
}
if(res && IsToScreen) dxw.ShowOverlay(hdcDest);
if(!res) OutTraceE("GDI.StretchBlt: ERROR err=%d at %d\n", GetLastError(), __LINE__); if(!res) OutTraceE("GDI.StretchBlt: ERROR err=%d at %d\n", GetLastError(), __LINE__);
return res; return res;
} }

View File

@ -16,6 +16,18 @@ DWORD WINAPI extICDrawBegin(HIC, DWORD, HPALETTE, HWND, HDC, int, int, int, int
typedef BOOL (WINAPI *DrawDibDraw_Type)(HDRAWDIB, HDC, int, int, int, int, LPBITMAPINFOHEADER, LPVOID, int, int, int, int, UINT); typedef BOOL (WINAPI *DrawDibDraw_Type)(HDRAWDIB, HDC, int, int, int, int, LPBITMAPINFOHEADER, LPVOID, int, int, int, int, UINT);
DrawDibDraw_Type pDrawDibDraw = NULL; DrawDibDraw_Type pDrawDibDraw = NULL;
BOOL WINAPI extDrawDibDraw(HDRAWDIB, HDC, int, int, int, int, LPBITMAPINFOHEADER, LPVOID, int, int, int, int, UINT); BOOL WINAPI extDrawDibDraw(HDRAWDIB, HDC, int, int, int, int, LPBITMAPINFOHEADER, LPVOID, int, int, int, int, UINT);
typedef BOOL (WINAPI *DrawDibBegin_Type)(HDRAWDIB, HDC, int, int, LPBITMAPINFOHEADER, int, int, UINT);
DrawDibBegin_Type pDrawDibBegin = NULL;
BOOL WINAPI extDrawDibBegin(HDRAWDIB, HDC, int, int, LPBITMAPINFOHEADER, int, int, UINT);
typedef BOOL (WINAPI *DrawDibStart_Type)(HDRAWDIB, LONG);
DrawDibStart_Type pDrawDibStart = NULL;
BOOL WINAPI extDrawDibStart(HDRAWDIB, LONG);
typedef BOOL (WINAPI *DrawDibStop_Type)(HDRAWDIB);
DrawDibStop_Type pDrawDibStop = NULL;
BOOL WINAPI extDrawDibStop(HDRAWDIB);
typedef BOOL (WINAPI *DrawDibEnd_Type)(HDRAWDIB);
DrawDibEnd_Type pDrawDibEnd = NULL;
BOOL WINAPI extDrawDibEnd(HDRAWDIB);
static HookEntry_Type Hooks[]={ static HookEntry_Type Hooks[]={
//{HOOK_HOT_CANDIDATE, "ICSendMessage", (FARPROC)NULL, (FARPROC *)&pICSendMessage, (FARPROC)extICSendMessage}, //{HOOK_HOT_CANDIDATE, "ICSendMessage", (FARPROC)NULL, (FARPROC *)&pICSendMessage, (FARPROC)extICSendMessage},
@ -24,6 +36,10 @@ static HookEntry_Type Hooks[]={
{HOOK_HOT_CANDIDATE, "ICGetDisplayFormat", (FARPROC)NULL, (FARPROC *)&pICGetDisplayFormat, (FARPROC)extICGetDisplayFormat}, // "Man in Black" - beware: this is NOT STDCALL!!! {HOOK_HOT_CANDIDATE, "ICGetDisplayFormat", (FARPROC)NULL, (FARPROC *)&pICGetDisplayFormat, (FARPROC)extICGetDisplayFormat}, // "Man in Black" - beware: this is NOT STDCALL!!!
{HOOK_HOT_CANDIDATE, "ICDrawBegin", (FARPROC)NULL, (FARPROC *)&pICDrawBegin, (FARPROC)extICDrawBegin}, {HOOK_HOT_CANDIDATE, "ICDrawBegin", (FARPROC)NULL, (FARPROC *)&pICDrawBegin, (FARPROC)extICDrawBegin},
{HOOK_HOT_CANDIDATE, "DrawDibDraw", (FARPROC)NULL, (FARPROC *)&pDrawDibDraw, (FARPROC)extDrawDibDraw}, {HOOK_HOT_CANDIDATE, "DrawDibDraw", (FARPROC)NULL, (FARPROC *)&pDrawDibDraw, (FARPROC)extDrawDibDraw},
{HOOK_HOT_CANDIDATE, "DrawDibBegin", (FARPROC)NULL, (FARPROC *)&pDrawDibBegin, (FARPROC)extDrawDibBegin},
{HOOK_HOT_CANDIDATE, "DrawDibStart", (FARPROC)NULL, (FARPROC *)&pDrawDibStart, (FARPROC)extDrawDibStart},
{HOOK_HOT_CANDIDATE, "DrawDibStop", (FARPROC)NULL, (FARPROC *)&pDrawDibStop, (FARPROC)extDrawDibStop},
{HOOK_HOT_CANDIDATE, "DrawDibEnd", (FARPROC)NULL, (FARPROC *)&pDrawDibEnd, (FARPROC)extDrawDibEnd},
{HOOK_IAT_CANDIDATE, 0, NULL, 0, 0} // terminator {HOOK_IAT_CANDIDATE, 0, NULL, 0, 0} // terminator
}; };
@ -236,4 +252,43 @@ BOOL WINAPI extDrawDibDraw(HDRAWDIB hdd, HDC hdc, int xDst, int yDst, int dxDst,
hdd, hdc, xDst, yDst, dxDst, dyDst, xSrc, ySrc, dxSrc, dySrc, wFlags); hdd, hdc, xDst, yDst, dxDst, dyDst, xSrc, ySrc, dxSrc, dySrc, wFlags);
ret = (*pDrawDibDraw)(hdd, hdc, xDst, yDst, dxDst, dyDst, lpbi, lpBits, xSrc, ySrc, dxSrc, dySrc, wFlags); ret = (*pDrawDibDraw)(hdd, hdc, xDst, yDst, dxDst, dyDst, lpbi, lpBits, xSrc, ySrc, dxSrc, dySrc, wFlags);
return ret; return ret;
} }
BOOL WINAPI extDrawDibBegin(HDRAWDIB hdd, HDC hdc, int dxDest, int dyDest, LPBITMAPINFOHEADER lpbi, int dxSrc, int dySrc, UINT wFlags)
{
// Reah game transitions
BOOL ret;
OutTrace("DrawDibBegin: hdd=%x hdc=%x DEST size=(%d,%d) SRC size=(%d,%d) flags=%x\n",
hdd, hdc, dxDest, dyDest, dxSrc, dySrc, wFlags);
ret = (*pDrawDibBegin)(hdd, hdc, dxDest, dyDest, lpbi, dxSrc, dySrc, wFlags);
return ret;
}
BOOL WINAPI extDrawDibStart(HDRAWDIB hdd, LONG rate)
{
// Reah game transitions
BOOL ret;
OutTrace("DrawDibStart: hdd=%x rate=%x\n", hdd, rate);
ret = (*pDrawDibStart)(hdd, rate);
return ret;
}
BOOL WINAPI extDrawDibStop(HDRAWDIB hdd)
{
// Reah game transitions
BOOL ret;
OutTrace("DrawDibStop: hdd=%x\n", hdd);
ret = (*pDrawDibStop)(hdd);
return ret;
}
BOOL WINAPI extDrawDibEnd(HDRAWDIB hdd)
{
// Reah game transitions
BOOL ret;
OutTrace("DrawDibEnd: hdd=%x\n", hdd);
ret = (*pDrawDibEnd)(hdd);
return ret;
}

View File

@ -620,7 +620,6 @@ BOOL WINAPI extInvalidateRect(HWND hwnd, RECT *lpRect, BOOL bErase)
OutTraceDW("InvalidateRect: hwnd=%x rect=NULL erase=%x\n", OutTraceDW("InvalidateRect: hwnd=%x rect=NULL erase=%x\n",
hwnd, bErase); hwnd, bErase);
if(dxw.IsFullScreen()) { if(dxw.IsFullScreen()) {
switch(GDIEmulationMode){ switch(GDIEmulationMode){
case GDIMODE_STRETCHED: case GDIMODE_STRETCHED:
@ -2086,20 +2085,26 @@ HDC WINAPI extBeginPaint(HWND hwnd, LPPAINTSTRUCT lpPaint)
// if not in fullscreen mode, that's all! // if not in fullscreen mode, that's all!
if(!dxw.IsFullScreen()) return hdc; if(!dxw.IsFullScreen()) return hdc;
// on CLIENTREMAPPING, resize the paint area to virtual screen size
//if(dxw.dwFlags1 & CLIENTREMAPPING) lpPaint->rcPaint=dxw.GetScreenRect();
if(dxw.dwFlags1 & CLIENTREMAPPING) dxw.UnmapClient(&(lpPaint->rcPaint));
switch(GDIEmulationMode){ if(bFlippedDC) {
case GDIMODE_STRETCHED: hdc = dxw.AcquireSharedDC(hwnd);
break;
case GDIMODE_EMULATED:
HDC EmuHDC;
EmuHDC = dxw.AcquireEmulatedDC(hwnd);
lpPaint->hdc=EmuHDC;
hdc = EmuHDC;
break;
} }
else {
switch(GDIEmulationMode){
case GDIMODE_STRETCHED:
// on CLIENTREMAPPING, resize the paint area to virtual screen size
//if(dxw.dwFlags1 & CLIENTREMAPPING) lpPaint->rcPaint=dxw.GetScreenRect();
if(dxw.dwFlags1 & CLIENTREMAPPING) dxw.UnmapClient(&(lpPaint->rcPaint));
break;
case GDIMODE_EMULATED:
HDC EmuHDC;
EmuHDC = dxw.AcquireEmulatedDC(hwnd);
lpPaint->hdc=EmuHDC;
hdc = EmuHDC;
break;
}
}
OutTraceDW("GDI.BeginPaint: hdc=%x rcPaint=(%d,%d)-(%d,%d)\n", OutTraceDW("GDI.BeginPaint: hdc=%x rcPaint=(%d,%d)-(%d,%d)\n",
hdc, lpPaint->rcPaint.left, lpPaint->rcPaint.top, lpPaint->rcPaint.right, lpPaint->rcPaint.bottom); hdc, lpPaint->rcPaint.left, lpPaint->rcPaint.top, lpPaint->rcPaint.right, lpPaint->rcPaint.bottom);

View File

@ -339,12 +339,18 @@ MMRESULT WINAPI extjoyGetPosEx(DWORD uJoyID, LPJOYINFOEX pji)
dwButtons = 0; dwButtons = 0;
if (GetKeyState(VK_LBUTTON) < 0) dwButtons |= JOY_BUTTON1; if (GetKeyState(VK_LBUTTON) < 0) dwButtons |= JOY_BUTTON1;
if (GetKeyState(VK_RBUTTON) < 0) dwButtons |= JOY_BUTTON2; if (GetKeyState(VK_RBUTTON) < 0) dwButtons |= JOY_BUTTON2;
if (GetKeyState(VK_MBUTTON) < 0) dwButtons |= JOY_BUTTON3;
POINT pt; POINT pt;
if(hwnd=dxw.GethWnd()){ if(hwnd=dxw.GethWnd()){
RECT client; RECT client;
POINT upleft = {0,0}; POINT upleft = {0,0};
(*pGetClientRect)(hwnd, &client); (*pGetClientRect)(hwnd, &client);
(*pClientToScreen)(hwnd, &upleft); (*pClientToScreen)(hwnd, &upleft);
if(dwButtons & JOY_BUTTON3){
// center joystick ...
dwButtons &= ~JOY_BUTTON3;
(*pSetCursorPos)(upleft.x + (client.right >> 1), upleft.y + (client.bottom >> 1));
}
(*pGetCursorPos)(&pt); (*pGetCursorPos)(&pt);
pt.x -= upleft.x; pt.x -= upleft.x;
pt.y -= upleft.y; pt.y -= upleft.y;
@ -391,7 +397,6 @@ static void ShowJoystick(LONG x, LONG y, DWORD dwButtons)
RECT client; RECT client;
RECT win; RECT win;
POINT PrevViewPort; POINT PrevViewPort;
int StretchMode;
// don't show when system cursor is visible // don't show when system cursor is visible
CURSORINFO ci; CURSORINFO ci;
@ -422,16 +427,12 @@ static void ShowJoystick(LONG x, LONG y, DWORD dwButtons)
(*pGetWindowRect)(dxw.GethWnd(), &win); (*pGetWindowRect)(dxw.GethWnd(), &win);
//if(!pSetViewportOrgEx) pSetViewportOrgEx=SetViewportOrgEx;
(*pSetViewportOrgEx)(hClientDC, 0, 0, &PrevViewPort); (*pSetViewportOrgEx)(hClientDC, 0, 0, &PrevViewPort);
StretchMode=GetStretchBltMode(hClientDC);
SetStretchBltMode(hClientDC, HALFTONE);
int w, h; int w, h;
w=36; w=bm.bmWidth;
h=36; h=bm.bmHeight;
(*pGDIStretchBlt)(hClientDC, x-(w>>1), y-(h>>1), w, h, hdcMem, 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY); (*pGDIBitBlt)(hClientDC, x-(w>>1), y-(h>>1), w, h, hdcMem, 0, 0, SRCPAINT);
SetStretchBltMode(hClientDC, StretchMode);
(*pSetViewportOrgEx)(hClientDC, PrevViewPort.x, PrevViewPort.y, NULL); (*pSetViewportOrgEx)(hClientDC, PrevViewPort.x, PrevViewPort.y, NULL);
SelectObject(hdcMem, hbmOld); SelectObject(hdcMem, hbmOld);
DeleteDC(hdcMem); DeleteDC(hdcMem);

Binary file not shown.

Binary file not shown.