mirror of
https://github.com/DxWnd/DxWnd.reloaded
synced 2024-12-30 09:25:35 +01:00
v2_03_98_srcfx1
Former-commit-id: 2c10d5937f78732bbaeaf42fb789f9fe6c7b323f
This commit is contained in:
parent
0e0ef465dc
commit
221a7c720c
1
Debug/.gitattributes
vendored
1
Debug/.gitattributes
vendored
@ -1 +0,0 @@
|
||||
*.{dll,exe} filter=lfs diff=lfs merge=lfs -text
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:57380350f6215b3dadaf6f920ebbf18fd2ec95162c1722bafac6f8b949eb851b
|
||||
size 458240
|
BIN
Debug/ddraw.ilk
BIN
Debug/ddraw.ilk
Binary file not shown.
@ -14,6 +14,11 @@ You can try these two simple steps:
|
||||
1) Assign to DxWnd.exe administrator privileges (right-click on DxWnd.exe, Properties->Compatibility->check "run this program as administrator" or whatever is your locale translated interface). I always try to set this flag in the DxWnd distribution, but a simple file copy can clear the privilege.
|
||||
|
||||
2) Clear compatibility settings on the target program (again, "Properties"->"Compatibility"->uncheck all compatibility flags). Maybe you'd better use the dedicated DxWnd command ("Tools"->"Clear compatibility flags", apparently this one goes a little deeper and clears some possibly hidden flags). If you clear compatibility flags it is likely that the game will no longer run in fullscreen without DxWnd, so maybe you can perform the operation on a copy of the executable file.
|
||||
==============================================================================================
|
||||
Window size & position:
|
||||
|
||||
Old DxWnd releases had a different setting for locking the window size and position.
|
||||
If the game jumps in some unexpected position of the screen or changes its window size, head to the Video / Window size & position panel and try some option different from "Free".
|
||||
|
||||
==============================================================================================
|
||||
Flip emulation:
|
||||
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d7f4c6f63e720e5a4a2275522d0d414d00fba3b80e28751a6db8e1f0613483f0
|
||||
oid sha256:c17fbc2f441f7355d88a7b189dfbba0ab31f0295b6900c1343849006fcce9f68
|
||||
size 706560
|
||||
|
@ -1356,7 +1356,7 @@ fix: cleaned up and unified capability handling in DirectDrawSurface GetCaps and
|
||||
add: warning message and update when running a program with non updated virtual registry settings.fix: LoadLibrary wrappers failed to clear the recursion flag, stopping the hook of new modules after a recursion case.
|
||||
add: warning messages when closing DxWnd and possibility to cancel the operation
|
||||
|
||||
v2.03.98
|
||||
v2.03.98/fx1
|
||||
add: fine tuning for vsync options: three modes (default: game native, force on, force off) three algorythms (ddraw WaitForVerticalBlank, loop controlled by GetScanLine, loop controlled by time delay)
|
||||
add: fine tuning for WAIT options in ddraw Flip() and Blt() methods: three modes (default: game native, force on, force off)
|
||||
fix: better support for non windowed + no emulation mode, surfaces and blit operations are left (almost) in original state, surface capabilities are left inaltered
|
||||
@ -1369,4 +1369,5 @@ fix: fixed logic to hook WindowProc routines for main window, childs and dialogs
|
||||
fix: more frequent updates of window coordinates to avoid scaling errors
|
||||
fix: fixed CreateDialogIndirectParam and CreateDialogParam wrappers to make inner windows properly scaled (fixes red Alert 2)
|
||||
fix: recovered DEFAULTMESSAGES option
|
||||
fix: normalized output for ddraw GetScanLine() method
|
||||
fix: normalized output for ddraw GetScanLine() method
|
||||
fix: fixed the policy for redrecting the WindowProc routine. Fixes "Ultimate Spiderman" clipping problems, and possibly much more
|
||||
|
@ -661,13 +661,20 @@ void HookWindowProc(HWND hwnd)
|
||||
|
||||
// v2.03.22: don't remap WindowProc in case of special address 0xFFFFnnnn.
|
||||
// This makes "The Hulk demo" work avoiding WindowProc recursion and stack overflow
|
||||
if (((DWORD)pWindowProc & 0xFFFF0000) == 0xFFFF0000){
|
||||
OutTraceDW("GetWindowLong: hwnd=%x WindowProc HOOK %x not updated\n", hwnd, pWindowProc);
|
||||
return;
|
||||
}
|
||||
// v2.03.99.rc1: commented out, issue fixed by addition below!
|
||||
//if (((DWORD)pWindowProc & 0xFFFF0000) == 0xFFFF0000){
|
||||
// OutTraceDW("GetWindowLong: hwnd=%x WindowProc HOOK %x not updated\n", hwnd, pWindowProc);
|
||||
// return;
|
||||
//}
|
||||
|
||||
// v2.03.99.rc1: always remap WindowProc, but push to call stack the previous value
|
||||
// depending on whether the window was hooked already or not!
|
||||
long lres;
|
||||
dxwws.PutProc(hwnd, pWindowProc);
|
||||
if(lres=(long)dxwws.GetProc(hwnd))
|
||||
dxwws.PutProc(hwnd, (WNDPROC)lres);
|
||||
else
|
||||
dxwws.PutProc(hwnd, pWindowProc);
|
||||
|
||||
lres=(*pSetWindowLongA)(hwnd, GWL_WNDPROC, (LONG)extWindowProc);
|
||||
OutTraceDW("SetWindowLong: HOOK hwnd=%x WindowProc=%x->%x\n", hwnd, lres, (LONG)extWindowProc);
|
||||
}
|
||||
|
@ -48,6 +48,7 @@ extern FARPROC Remap_DInput_ProcAddress(LPCSTR, HMODULE);
|
||||
extern FARPROC Remap_DInput8_ProcAddress(LPCSTR, HMODULE);
|
||||
extern FARPROC Remap_ComCtl32_ProcAddress(LPCSTR, HMODULE);
|
||||
extern FARPROC Remap_ComDlg32_ProcAddress(LPCSTR, HMODULE);
|
||||
extern FARPROC Remap_DSound_ProcAddress(LPCSTR, HMODULE);
|
||||
|
||||
typedef enum {
|
||||
HOOK_IAT_CANDIDATE = 0,
|
||||
|
@ -27,7 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#include "TlHelp32.h"
|
||||
|
||||
#define VERSION "2.03.98"
|
||||
#define VERSION "2.03.98.fx1"
|
||||
|
||||
#define DDTHREADLOCK 1
|
||||
//#define LOCKTHREADS
|
||||
|
Binary file not shown.
@ -969,7 +969,7 @@ HDC WINAPI extGDICreateCompatibleDC(HDC hdc)
|
||||
BOOL bSwitchedToMainWin = FALSE;
|
||||
|
||||
OutTraceDW("GDI.CreateCompatibleDC: hdc=%x\n", hdc);
|
||||
if(hdc==0){
|
||||
if(hdc==0 || (WindowFromDC(hdc)==0)) { // v2.03.99: Star Trek Armada
|
||||
hdc=(*pGDIGetDC)(dxw.GethWnd()); // potential DC leakage
|
||||
bSwitchedToMainWin = TRUE;
|
||||
OutTraceDW("GDI.CreateCompatibleDC: duplicating win HDC hWnd=%x\n", dxw.GethWnd());
|
||||
@ -1810,7 +1810,7 @@ int WINAPI extSetDIBits(HDC hdc, HBITMAP hbmp, UINT uStartScan, UINT cScanLines,
|
||||
OrigXDest=XDest;
|
||||
OrigYDest=YDest;
|
||||
dxw.MapClient(&XDest, &YDest, (int *)&dwWidth, (int *)&dwHeight);
|
||||
OutTraceDW("SetDIBitsToDevice: fixed dest=(%d,%d)-(%dx%d)\n", XDest, YDest, dwWidth, dwHeight);
|
||||
OutTraceDW("SetDIBits: fixed dest=(%d,%d)-(%dx%d)\n", XDest, YDest, dwWidth, dwHeight);
|
||||
if(!(hTempDc=CreateCompatibleDC(hdc)))
|
||||
OutTraceE("CreateCompatibleDC: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
||||
// tricky part: CreateCompatibleBitmap is needed to set the dc size, but it has to be performed
|
||||
@ -1821,7 +1821,7 @@ int WINAPI extSetDIBits(HDC hdc, HBITMAP hbmp, UINT uStartScan, UINT cScanLines,
|
||||
if(!SelectObject(hTempDc, hbmPic))
|
||||
OutTraceE("SelectObject: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
||||
if(!(*pSetDIBits)(hTempDc, hbmp, uStartScan, cScanLines, lpvBits, lpbmi, fuColorUse))
|
||||
OutTraceE("SetDIBitsToDevice: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
||||
OutTraceE("SetDIBits: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
||||
// v2.02.94: set HALFTONE stretching. Fixes "Celtic Kings Rage of War"
|
||||
SetStretchBltMode(hdc,HALFTONE);
|
||||
if(!(ret=(*pGDIStretchBlt)(hdc, XDest, YDest, dwWidth, dwHeight, hTempDc, 0, 0, OrigWidth, OrigHeight, SRCCOPY)))
|
||||
@ -1839,10 +1839,10 @@ int WINAPI extSetDIBits(HDC hdc, HBITMAP hbmp, UINT uStartScan, UINT cScanLines,
|
||||
int X, Y;
|
||||
X=XDest+dxw.VirtualOffsetX;
|
||||
Y=YDest+dxw.VirtualOffsetY;
|
||||
OutTraceDW("SetDIBitsToDevice: virtual pos=(%d,%d)+(%d+%d)=(%d,%d)\n",
|
||||
OutTraceDW("SetDIBits: virtual pos=(%d,%d)+(%d+%d)=(%d,%d)\n",
|
||||
XDest, YDest, dxw.VirtualOffsetX, dxw.VirtualOffsetY, X, Y);
|
||||
ret=(*pSetDIBits)(sdc.GetHdc(), hbmp, uStartScan, cScanLines, lpvBits, lpbmi, fuColorUse);
|
||||
if(!ret || (ret==GDI_ERROR)) OutTraceE("SetDIBitsToDevice: ERROR ret=%x err=%d\n", ret, GetLastError());
|
||||
if(!ret || (ret==GDI_ERROR)) OutTraceE("SetDIBits: ERROR ret=%x err=%d\n", ret, GetLastError());
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
@ -715,6 +715,9 @@ FARPROC WINAPI extGetProcAddress(HMODULE hModule, LPCSTR proc)
|
||||
case SYSLIBIDX_COMDLG32:
|
||||
if (remap=Remap_ComDlg32_ProcAddress(proc, hModule)) return remap;
|
||||
break;
|
||||
case SYSLIBIDX_DSOUND:
|
||||
if (remap=Remap_DSound_ProcAddress(proc, hModule)) return remap;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ dxwSDC::dxwSDC()
|
||||
|
||||
dxwSDC::~dxwSDC()
|
||||
{
|
||||
OutTraceB("dxwSDC::~dxwSDC: Destroy\n");
|
||||
//OutTraceB("dxwSDC::~dxwSDC: Destroy\n");
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------------+
|
||||
@ -351,9 +351,9 @@ void dxwSDC::copyDcAttributes(HDC destDC, HDC origDc, POINT origin)
|
||||
SetTextCharacterExtra(destDC, GetTextCharacterExtra(origDc));
|
||||
SetTextColor(destDC, GetTextColor(origDc));
|
||||
|
||||
OutTraceB("copyDcAttributes: orig=(%d,%d)\n", origin.x, origin.y);
|
||||
OutTraceB("dxwSDC::copyDcAttributes: orig=(%d,%d)\n", origin.x, origin.y);
|
||||
if(!(*pSetWindowOrgEx)(destDC, -origin.x, -origin.y, NULL))
|
||||
OutTraceE("copyDcAttributes: SetWindowOrgEx ERROR orig=(%d,%d) err=%d\n", origin.x, origin.y, GetLastError());
|
||||
OutTraceE("dxwSDC::copyDcAttributes: SetWindowOrgEx ERROR orig=(%d,%d) err=%d\n", origin.x, origin.y, GetLastError());
|
||||
|
||||
POINT brushOrg = {};
|
||||
GetBrushOrgEx(origDc, &brushOrg);
|
||||
|
Loading…
x
Reference in New Issue
Block a user