mirror of
https://github.com/DxWnd/DxWnd.reloaded
synced 2024-12-30 09:25:35 +01:00
v2_02_40_src
Former-commit-id: 53c980c6de887b9d936afba8a95c8060b400864f
This commit is contained in:
parent
0b3d188631
commit
e8b01bcd28
@ -110,6 +110,10 @@
|
||||
#define NODDRAWBLT 0x10000000 // Suppress ddraw Blt to primary
|
||||
#define NODDRAWFLIP 0x20000000 // Suppress ddraw Flip to primary
|
||||
#define NOGDIBLT 0x40000000 // Suppress GDI Blt to video device
|
||||
#define NOPIXELFORMAT 0x80000000 // Don't fix the pixel format for plain surfaces
|
||||
|
||||
// fourth flags DWORD dxw.dwFlags4:
|
||||
#define NOALPHACHANNEL 0x00000001 // By default, create surfaces with no DDPF_ALPHAPIXELS capability
|
||||
|
||||
// logging Tflags DWORD:
|
||||
#define OUTTRACE 0x00000001 // enables tracing to dxwnd.log in general
|
||||
|
5848
build/dxwnd.1.ini
5848
build/dxwnd.1.ini
File diff suppressed because it is too large
Load Diff
1133
build/dxwnd.2.ini
1133
build/dxwnd.2.ini
File diff suppressed because it is too large
Load Diff
@ -1,167 +0,0 @@
|
||||
[window]
|
||||
posx=1452
|
||||
posy=365
|
||||
sizx=320
|
||||
sizy=514
|
||||
[target]
|
||||
title0=Rayman 2 Demo
|
||||
path0=D:\Games\Rayman2Demo\Rayman2Demo.exe
|
||||
module0=
|
||||
opengllib0=
|
||||
ver0=1
|
||||
coord0=0
|
||||
flag0=402653217
|
||||
flagg0=1210056704
|
||||
flagh0=2097172
|
||||
flagi0=0
|
||||
tflag0=64
|
||||
initx0=0
|
||||
inity0=0
|
||||
minx0=0
|
||||
miny0=0
|
||||
maxx0=0
|
||||
maxy0=0
|
||||
posx0=50
|
||||
posy0=50
|
||||
sizx0=800
|
||||
sizy0=600
|
||||
maxfps0=0
|
||||
initts0=0
|
||||
title1=Mirror's Edge
|
||||
path1=D:\Games\Mirror's Edge\Binaries\MirrorsEdge.exe
|
||||
module1=
|
||||
opengllib1=
|
||||
ver1=0
|
||||
coord1=0
|
||||
flag1=-2013265882
|
||||
flagg1=1207959552
|
||||
flagh1=2097172
|
||||
flagi1=0
|
||||
tflag1=5
|
||||
initx1=0
|
||||
inity1=0
|
||||
minx1=0
|
||||
miny1=0
|
||||
maxx1=0
|
||||
maxy1=0
|
||||
posx1=50
|
||||
posy1=50
|
||||
sizx1=800
|
||||
sizy1=600
|
||||
maxfps1=0
|
||||
initts1=6
|
||||
title2=LastHalfWin.exe
|
||||
path2=D:\Games\Last Half Of Darkness\LastHalfWin.exe
|
||||
module2=
|
||||
opengllib2=
|
||||
ver2=1
|
||||
coord2=0
|
||||
flag2=134217760
|
||||
flagg2=1207959552
|
||||
flagh2=4
|
||||
flagi2=0
|
||||
tflag2=512
|
||||
initx2=0
|
||||
inity2=0
|
||||
minx2=0
|
||||
miny2=0
|
||||
maxx2=0
|
||||
maxy2=0
|
||||
posx2=50
|
||||
posy2=50
|
||||
sizx2=800
|
||||
sizy2=600
|
||||
maxfps2=0
|
||||
initts2=0
|
||||
title3=DOOM95.EXE
|
||||
path3=D:\Games\Doom95i\DOOM95.EXE
|
||||
module3=
|
||||
opengllib3=
|
||||
ver3=0
|
||||
coord3=0
|
||||
flag3=134217762
|
||||
flagg3=1207959552
|
||||
flagh3=20
|
||||
flagi3=0
|
||||
tflag3=512
|
||||
initx3=0
|
||||
inity3=0
|
||||
minx3=0
|
||||
miny3=0
|
||||
maxx3=0
|
||||
maxy3=0
|
||||
posx3=50
|
||||
posy3=50
|
||||
sizx3=800
|
||||
sizy3=600
|
||||
maxfps3=0
|
||||
initts3=0
|
||||
title4=CNC3.exe
|
||||
path4=D:\Games\Command & Conquer 3\CNC3.exe
|
||||
module4=
|
||||
opengllib4=
|
||||
ver4=9
|
||||
coord4=0
|
||||
flag4=134217762
|
||||
flagg4=1207959552
|
||||
flagh4=20
|
||||
flagi4=0
|
||||
tflag4=512
|
||||
initx4=0
|
||||
inity4=0
|
||||
minx4=0
|
||||
miny4=0
|
||||
maxx4=0
|
||||
maxy4=0
|
||||
posx4=50
|
||||
posy4=50
|
||||
sizx4=800
|
||||
sizy4=600
|
||||
maxfps4=0
|
||||
initts4=0
|
||||
title5=Div.exe
|
||||
path5=D:\Games\Beyond Divinity\Div.exe
|
||||
module5=
|
||||
opengllib5=
|
||||
ver5=0
|
||||
coord5=0
|
||||
flag5=134217762
|
||||
flagg5=1207959552
|
||||
flagh5=20
|
||||
flagi5=0
|
||||
tflag5=512
|
||||
initx5=0
|
||||
inity5=0
|
||||
minx5=0
|
||||
miny5=0
|
||||
maxx5=0
|
||||
maxy5=0
|
||||
posx5=50
|
||||
posy5=50
|
||||
sizx5=800
|
||||
sizy5=600
|
||||
maxfps5=0
|
||||
initts5=0
|
||||
title6=martian gothic.exe
|
||||
path6=D:\Games\Martian Gothic\martian gothic.exe
|
||||
module6=
|
||||
opengllib6=
|
||||
ver6=7
|
||||
coord6=0
|
||||
flag6=201326626
|
||||
flagg6=1208090624
|
||||
flagh6=276
|
||||
flagi6=0
|
||||
tflag6=263
|
||||
initx6=0
|
||||
inity6=0
|
||||
minx6=0
|
||||
miny6=0
|
||||
maxx6=0
|
||||
maxy6=0
|
||||
posx6=50
|
||||
posy6=50
|
||||
sizx6=800
|
||||
sizy6=600
|
||||
maxfps6=0
|
||||
initts6=0
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:af6a5009d304a3e8cd4b4303697b68a8a6e060a6815e60b70a75a622cf8e4870
|
||||
size 421376
|
||||
oid sha256:f72014ec45098420011258296358843eced6ce66d98dd791d8997884a624db18
|
||||
size 422400
|
||||
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:78e9db00462bdbd92c3b15f0f9e7aa7ae434573ccaa808af1226ba489104837f
|
||||
oid sha256:645d3eb20a6c06832fd937ba3847de75e82273c684ccfac31dbfface9881df50
|
||||
size 532480
|
||||
|
466
dll/ddraw.cpp
466
dll/ddraw.cpp
@ -251,31 +251,21 @@ DWORD *Palette16BPP = NULL;
|
||||
void *EmuScreenBuffer = NULL; // to implement pitch bug fix
|
||||
DWORD rPitch = 0;
|
||||
LPVOID rSurface = NULL;
|
||||
static char *SetPixFmt(LPDDSURFACEDESC2);
|
||||
static void SetPixFmt(LPDDSURFACEDESC2);
|
||||
static void GetPixFmt(LPDDSURFACEDESC2);
|
||||
|
||||
static HookEntry_Type ddHooks[]={
|
||||
{"DirectDrawCreate", (FARPROC)NULL, (FARPROC *)&pDirectDrawCreate, (FARPROC)extDirectDrawCreate},
|
||||
{"DirectDrawCreateEx", (FARPROC)NULL, (FARPROC *)&pDirectDrawCreateEx, (FARPROC)extDirectDrawCreateEx},
|
||||
{"DirectDrawCreate", (FARPROC)NULL, (FARPROC *)&pDirectDrawCreate, (FARPROC)extDirectDrawCreate},
|
||||
{"DirectDrawCreate", (FARPROC)NULL, (FARPROC *)&pDirectDrawCreate, (FARPROC)extDirectDrawCreate},
|
||||
{0, NULL, 0, 0} // terminator
|
||||
};
|
||||
|
||||
FARPROC Remap_ddraw_ProcAddress(LPCSTR proc, HMODULE hModule)
|
||||
{
|
||||
if (!strcmp(proc,"DirectDrawCreate")){
|
||||
pDirectDrawCreate=(DirectDrawCreate_Type)(*pGetProcAddress)(hModule, proc);
|
||||
OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), pDirectDrawCreate);
|
||||
return (FARPROC)extDirectDrawCreate;
|
||||
}
|
||||
if (!strcmp(proc,"DirectDrawCreateEx")){
|
||||
pDirectDrawCreateEx=(DirectDrawCreateEx_Type)(*pGetProcAddress)(hModule, proc);
|
||||
OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), pDirectDrawCreateEx);
|
||||
return (FARPROC)extDirectDrawCreateEx;
|
||||
}
|
||||
if (!strcmp(proc,"DirectDrawEnumerateA")){
|
||||
pDirectDrawEnumerate=(DirectDrawEnumerate_Type)(*pGetProcAddress)(hModule, proc);
|
||||
OutTraceP("GetProcAddress: hooking proc=%s at addr=%x\n", proc, pDirectDrawEnumerate);
|
||||
return (FARPROC)extDirectDrawEnumerateProxy;
|
||||
}
|
||||
if (!strcmp(proc,"DirectDrawEnumerateExA")){
|
||||
pDirectDrawEnumerateEx=(DirectDrawEnumerateEx_Type)(*pGetProcAddress)(hModule, proc);
|
||||
OutTraceP("GetProcAddress: hooking proc=%s at addr=%x\n", proc, pDirectDrawEnumerateEx);
|
||||
return (FARPROC)extDirectDrawEnumerateExProxy;
|
||||
}
|
||||
// NULL -> keep the original call address
|
||||
FARPROC addr;
|
||||
if (addr=RemapLibrary(proc, hModule, ddHooks)) return addr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -303,7 +293,7 @@ static void Stopper(char *s, int line)
|
||||
#define REFPROBE(obj, op)
|
||||
#endif
|
||||
|
||||
#define STOPPER_TEST // comment out to eliminate
|
||||
//#define STOPPER_TEST // comment out to eliminate
|
||||
#ifdef STOPPER_TEST
|
||||
#define STOPPER(s) Stopper(s, __LINE__)
|
||||
#else
|
||||
@ -333,11 +323,19 @@ static char *DumpPixelFormat(LPDDSURFACEDESC2 lpddsd)
|
||||
sprintf(sBuf, " PixelFormat size=%d flags=%x(%s) BPP=%d",
|
||||
lpddsd->dwSize, flags, ExplainPixelFormatFlags(flags), lpddsd->ddpfPixelFormat.dwRGBBitCount);
|
||||
if (flags & DDPF_RGB) {
|
||||
sprintf(sItem, " RGBA=(%x,%x,%x,%x)",
|
||||
lpddsd->ddpfPixelFormat.dwRBitMask,
|
||||
lpddsd->ddpfPixelFormat.dwGBitMask,
|
||||
lpddsd->ddpfPixelFormat.dwBBitMask,
|
||||
lpddsd->ddpfPixelFormat.dwRGBAlphaBitMask);
|
||||
if (flags & DDPF_ALPHAPIXELS) {
|
||||
sprintf(sItem, " RGBA=(%x,%x,%x,%x)",
|
||||
lpddsd->ddpfPixelFormat.dwRBitMask,
|
||||
lpddsd->ddpfPixelFormat.dwGBitMask,
|
||||
lpddsd->ddpfPixelFormat.dwBBitMask,
|
||||
lpddsd->ddpfPixelFormat.dwRGBAlphaBitMask);
|
||||
}
|
||||
else {
|
||||
sprintf(sItem, " RGB=(%x,%x,%x)",
|
||||
lpddsd->ddpfPixelFormat.dwRBitMask,
|
||||
lpddsd->ddpfPixelFormat.dwGBitMask,
|
||||
lpddsd->ddpfPixelFormat.dwBBitMask);
|
||||
}
|
||||
strcat(sBuf, sItem);
|
||||
}
|
||||
if (flags & DDPF_YUV) {
|
||||
@ -559,18 +557,10 @@ void InitDDScreenParameters(LPDIRECTDRAW lpdd)
|
||||
return;
|
||||
}
|
||||
|
||||
OutTraceD("InitDDScreenParameters: Flags=%x FourCC=%x RGBBitCount=%d RGBA BitMask=(%x,%x,%x,%x)\n",
|
||||
ddsd.ddpfPixelFormat.dwFlags,
|
||||
ddsd.ddpfPixelFormat.dwFourCC,
|
||||
ddsd.ddpfPixelFormat.dwRGBBitCount,
|
||||
ddsd.ddpfPixelFormat.dwRBitMask,
|
||||
ddsd.ddpfPixelFormat.dwGBitMask,
|
||||
ddsd.ddpfPixelFormat.dwBBitMask,
|
||||
ddsd.ddpfPixelFormat.dwRGBAlphaBitMask);
|
||||
|
||||
OutTraceD("InitDDScreenParameters: Actual %s\n", DumpPixelFormat((LPDDSURFACEDESC2)&ddsd));
|
||||
dxw.ActualPixelFormat=ddsd.ddpfPixelFormat;
|
||||
if(dxw.VirtualPixelFormat.dwRGBBitCount==0) dxw.VirtualPixelFormat=ddsd.ddpfPixelFormat;
|
||||
SetBltTransformations();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -578,24 +568,17 @@ void InitDSScreenParameters(LPDIRECTDRAWSURFACE lpdds)
|
||||
{
|
||||
HRESULT res;
|
||||
DDPIXELFORMAT p;
|
||||
DDSURFACEDESC2 ddsd;
|
||||
p.dwSize=sizeof(DDPIXELFORMAT);
|
||||
if(res=(*pGetPixelFormat)(lpdds, &p)){
|
||||
OutTraceE("GetPixelFormat: ERROR res=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__);
|
||||
return;
|
||||
}
|
||||
|
||||
OutTraceD("InitDSScreenParameters: Flags=%x FourCC=%x RGBBitCount=%d RGBA BitMask=(%x,%x,%x,%x)\n",
|
||||
p.dwFlags,
|
||||
p.dwFourCC,
|
||||
p.dwRGBBitCount,
|
||||
p.dwRBitMask,
|
||||
p.dwGBitMask,
|
||||
p.dwBBitMask,
|
||||
p.dwRGBAlphaBitMask);
|
||||
|
||||
ddsd.ddpfPixelFormat = p;
|
||||
OutTraceD("InitDSScreenParameters: Actual %s\n", DumpPixelFormat(&ddsd));
|
||||
dxw.ActualPixelFormat=p;
|
||||
SetBltTransformations();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -624,7 +607,6 @@ void InitScreenParameters()
|
||||
// initialize to default null values, but dwRGBBitCount
|
||||
dxw.ActualPixelFormat.dwRGBBitCount=CurrDevMode.dmBitsPerPel;
|
||||
dxw.VirtualPixelFormat.dwRGBBitCount=CurrDevMode.dmBitsPerPel; // until set differently
|
||||
//if(dxw.dwFlags2 & INIT8BPP) dxw.VirtualPixelFormat.dwRGBBitCount = 8;
|
||||
OutTraceD("InitScreenParameters: RGBBitCount=%d\n", CurrDevMode.dmBitsPerPel);
|
||||
SetBltTransformations();
|
||||
|
||||
@ -644,19 +626,20 @@ void FixPixelFormat(int ColorDepth, DDPIXELFORMAT *pf)
|
||||
pf->dwRGBAlphaBitMask = 0x0000;
|
||||
break;
|
||||
case 16:
|
||||
pf->dwFlags |= DDPF_ALPHAPIXELS; // v2.02.33
|
||||
pf->dwRGBBitCount = 16;
|
||||
if (dxw.dwFlags1 & USERGB565){
|
||||
pf->dwRBitMask = 0xf800;
|
||||
pf->dwGBitMask = 0x07e0;
|
||||
pf->dwBBitMask = 0x001f;
|
||||
pf->dwRGBAlphaBitMask = 0x0000;
|
||||
}
|
||||
else {
|
||||
if(!(dxw.dwFlags4 & NOALPHACHANNEL)) pf->dwFlags |= DDPF_ALPHAPIXELS; // v2.02.33,40
|
||||
pf->dwRBitMask = 0x7c00;
|
||||
pf->dwGBitMask = 0x03e0;
|
||||
pf->dwBBitMask = 0x001f;
|
||||
pf->dwRGBAlphaBitMask = 0x8000;
|
||||
}
|
||||
pf->dwRGBAlphaBitMask = 0x8000;
|
||||
break;
|
||||
case 24:
|
||||
pf->dwRGBBitCount = 24;
|
||||
@ -666,7 +649,7 @@ void FixPixelFormat(int ColorDepth, DDPIXELFORMAT *pf)
|
||||
pf->dwRGBAlphaBitMask = 0x00000000;
|
||||
break;
|
||||
case 32:
|
||||
pf->dwFlags |= DDPF_ALPHAPIXELS; // v2.02.33
|
||||
if(!(dxw.dwFlags4 & NOALPHACHANNEL)) pf->dwFlags |= DDPF_ALPHAPIXELS; // v2.02.33
|
||||
pf->dwRGBBitCount = 32;
|
||||
pf->dwRBitMask = 0x00FF0000;
|
||||
pf->dwGBitMask = 0x0000FF00;
|
||||
@ -863,59 +846,44 @@ int lpddHookedVersion(LPDIRECTDRAW lpdd)
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
static char *SetPixFmt(LPDDSURFACEDESC2 lpdd)
|
||||
// SetPixFmt: builds a pixel format descriptor when no one is specified, starting from the color depth, the current
|
||||
// desktop pixel format (when the color depth is the same) or the config flags
|
||||
|
||||
static void SetPixFmt(LPDDSURFACEDESC2 lpdd)
|
||||
{
|
||||
char *pfstr;
|
||||
OutTraceD("SetPixFmt: BPP=%d Use565=%d\n", dxw.VirtualPixelFormat.dwRGBBitCount, dxw.dwFlags1 & USERGB565 ? 1:0);
|
||||
OutTraceD("SetPixFmt: BPP=%d Use565=%d NoAlpha=%d\n",
|
||||
dxw.VirtualPixelFormat.dwRGBBitCount,
|
||||
dxw.dwFlags1 & USERGB565 ? 1:0,
|
||||
dxw.dwFlags4 & NOALPHACHANNEL ? 1:0);
|
||||
|
||||
memset(&lpdd->ddpfPixelFormat,0,sizeof(DDPIXELFORMAT));
|
||||
lpdd->ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT);
|
||||
lpdd->ddpfPixelFormat.dwRGBBitCount = dxw.ActualPixelFormat.dwRGBBitCount;
|
||||
if(dxw.ActualPixelFormat.dwRGBBitCount==dxw.VirtualPixelFormat.dwRGBBitCount && dxw.ActualPixelFormat.dwRBitMask){
|
||||
// if same color depth, choose current color masks
|
||||
pfstr="CURRENT";
|
||||
lpdd->ddpfPixelFormat=dxw.ActualPixelFormat;
|
||||
}
|
||||
else
|
||||
|
||||
switch (dxw.VirtualPixelFormat.dwRGBBitCount)
|
||||
{
|
||||
switch (dxw.VirtualPixelFormat.dwRGBBitCount)
|
||||
{
|
||||
case 8:
|
||||
pfstr="RGB8";
|
||||
FixPixelFormat(8, &lpdd->ddpfPixelFormat);
|
||||
break;
|
||||
case 16:
|
||||
pfstr=(dxw.dwFlags1 & USERGB565)?"RGB16-565":"RGB16-555";
|
||||
FixPixelFormat(16, &lpdd->ddpfPixelFormat);
|
||||
break;
|
||||
case 24:
|
||||
pfstr="RGB24";
|
||||
FixPixelFormat(24, &lpdd->ddpfPixelFormat);
|
||||
break;
|
||||
case 32:
|
||||
pfstr="RGB32";
|
||||
FixPixelFormat(32, &lpdd->ddpfPixelFormat);
|
||||
break;
|
||||
default:
|
||||
pfstr="unsupported";
|
||||
OutTraceE("CreateSurface ERROR: Unsupported resolution ColorBPP=%d\n", dxw.VirtualPixelFormat.dwRGBBitCount);
|
||||
break;
|
||||
}
|
||||
case 8:
|
||||
case 16:
|
||||
case 24:
|
||||
case 32:
|
||||
FixPixelFormat(dxw.VirtualPixelFormat.dwRGBBitCount, &lpdd->ddpfPixelFormat);
|
||||
break;
|
||||
default:
|
||||
OutTraceE("CreateSurface ERROR: Unsupported resolution ColorBPP=%d\n", dxw.VirtualPixelFormat.dwRGBBitCount);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// remember current virtual settings
|
||||
dxw.VirtualPixelFormat=lpdd->ddpfPixelFormat;
|
||||
OutTraceD("SetPixFmt: %s\n", DumpPixelFormat(lpdd));
|
||||
}
|
||||
|
||||
OutTraceD("SetPixFmt: RGBBitCount=%d Flags=%x FourCC=%x RGBA BitMask=(%x,%x,%x,%x)\n",
|
||||
lpdd->ddpfPixelFormat.dwRGBBitCount,
|
||||
lpdd->ddpfPixelFormat.dwFlags,
|
||||
lpdd->ddpfPixelFormat.dwFourCC,
|
||||
lpdd->ddpfPixelFormat.dwRBitMask,
|
||||
lpdd->ddpfPixelFormat.dwGBitMask,
|
||||
lpdd->ddpfPixelFormat.dwBBitMask,
|
||||
lpdd->ddpfPixelFormat.dwRGBAlphaBitMask);
|
||||
// retrieves the stored pixel format
|
||||
|
||||
return pfstr;
|
||||
static void GetPixFmt(LPDDSURFACEDESC2 lpdd)
|
||||
{
|
||||
lpdd->ddpfPixelFormat = dxw.VirtualPixelFormat;
|
||||
OutTraceD("GetPixFmt: %s\n", DumpPixelFormat(lpdd));
|
||||
}
|
||||
|
||||
static void RenewClipper(LPDIRECTDRAW lpdd, LPDIRECTDRAWSURFACE lpdds)
|
||||
@ -1433,15 +1401,17 @@ HRESULT WINAPI extGetCapsD(LPDIRECTDRAW lpdd, LPDDCAPS c1, LPDDCAPS c2)
|
||||
if(res)
|
||||
OutTraceE("GetCaps(D): ERROR res=%x(%s)\n", res, ExplainDDError(res));
|
||||
else {
|
||||
if (c1) OutTraceD("GetCaps(D-HW): caps=%x(%s) caps2=%x(%s) fxcaps=%x(%s) fxalphacaps=%x(%s) keycaps=%x(%s)\n",
|
||||
if (c1) OutTraceD("GetCaps(D-HW): caps=%x(%s) caps2=%x(%s) palcaps=%x(%s) fxcaps=%x(%s) fxalphacaps=%x(%s) keycaps=%x(%s)\n",
|
||||
c1->dwCaps, ExplainDDDCaps(c1->dwCaps),
|
||||
c1->dwCaps2, ExplainDDDCaps2(c1->dwCaps2),
|
||||
c1->dwPalCaps, ExplainDDPalCaps(c1->dwPalCaps),
|
||||
c1->dwFXCaps, ExplainDDFXCaps(c1->dwFXCaps),
|
||||
c1->dwFXAlphaCaps, ExplainDDFXALPHACaps(c1->dwFXAlphaCaps),
|
||||
c1->dwCKeyCaps, ExplainDDCKeyCaps(c1->dwCKeyCaps));
|
||||
if (c2) OutTraceD("GetCaps(D-SW): caps=%x(%s) caps2=%x(%s) fxcaps=%x(%s) fxalphacaps=%x(%s) keycaps=%x(%s)\n",
|
||||
if (c2) OutTraceD("GetCaps(D-SW): caps=%x(%s) caps2=%x(%s) palcaps=%x(%s) fxcaps=%x(%s) fxalphacaps=%x(%s) keycaps=%x(%s)\n",
|
||||
c2->dwCaps, ExplainDDDCaps(c2->dwCaps),
|
||||
c2->dwCaps2, ExplainDDDCaps2(c2->dwCaps2),
|
||||
c2->dwPalCaps, ExplainDDPalCaps(c2->dwPalCaps),
|
||||
c2->dwFXCaps, ExplainDDFXCaps(c2->dwFXCaps),
|
||||
c2->dwFXAlphaCaps, ExplainDDFXALPHACaps(c2->dwFXAlphaCaps),
|
||||
c2->dwCKeyCaps, ExplainDDCKeyCaps(c2->dwCKeyCaps));
|
||||
@ -1457,7 +1427,10 @@ HRESULT WINAPI extGetCapsD(LPDIRECTDRAW lpdd, LPDDCAPS c1, LPDDCAPS c2)
|
||||
c2=&swcaps;
|
||||
res=(*pGetCapsD)(lpdd, NULL, c2);
|
||||
}
|
||||
//DWORD AlphaCaps;
|
||||
//AlphaCaps=c1->dwFXAlphaCaps;
|
||||
memcpy((void *)c1, (void *)c2, size);
|
||||
//c1->dwFXAlphaCaps=AlphaCaps;
|
||||
}
|
||||
|
||||
if((dxw.dwFlags3 & CAPMASK) && c1 && c2) MaskCapsD(c1, c2);
|
||||
@ -1825,10 +1798,8 @@ HRESULT WINAPI extSetDisplayMode(int version, LPDIRECTDRAW lpdd,
|
||||
if(IsTraceD){
|
||||
OutTrace("SetDisplayMode: version=%d dwWidth=%i dwHeight=%i dwBPP=%i",
|
||||
version, dwwidth, dwheight, dwbpp);
|
||||
if (version==2)
|
||||
OutTrace(" dwRefresh=%i dwFlags=%x\n", dwrefreshrate, dwflags);
|
||||
else
|
||||
OutTrace("\n");
|
||||
if (version==2) OutTrace(" dwRefresh=%i dwFlags=%x\n", dwrefreshrate, dwflags);
|
||||
else OutTrace("\n");
|
||||
}
|
||||
|
||||
dxw.SetScreenSize(dwwidth, dwheight);
|
||||
@ -1837,16 +1808,17 @@ HRESULT WINAPI extSetDisplayMode(int version, LPDIRECTDRAW lpdd,
|
||||
AdjustWindowFrame(dxw.GethWnd(), dwwidth, dwheight);
|
||||
|
||||
if(dxw.dwFlags1 & EMULATESURFACE){
|
||||
// in EMULATESURFACE mode, let SetPixFmt decide upon the PixelFormat
|
||||
dxw.VirtualPixelFormat.dwRGBBitCount = dwbpp;
|
||||
dwbpp = dxw.ActualPixelFormat.dwRGBBitCount;
|
||||
SetPixFmt(&ddsd);
|
||||
SetBltTransformations();
|
||||
OutTraceD("SetDisplayMode: mode=EMULATESURFACE EmuBPP=%d ActBPP=%d\n", dxw.VirtualPixelFormat.dwRGBBitCount, dxw.ActualPixelFormat.dwRGBBitCount);
|
||||
}
|
||||
else {
|
||||
OutTraceD("SetDisplayMode: mode=STANDARD BPP=%d\n", dwbpp);
|
||||
dxw.ActualPixelFormat.dwRGBBitCount = dwbpp;
|
||||
OutTraceD("SetDisplayMode: mode=EMULATE %s ret=OK\n", DumpPixelFormat(&ddsd));
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
OutTraceD("SetDisplayMode: mode=STANDARD BPP=%d\n", dwbpp);
|
||||
dxw.ActualPixelFormat.dwRGBBitCount = dwbpp;
|
||||
|
||||
ZeroMemory(&ddsd, sizeof(ddsd));
|
||||
ddsd.dwSize = Set_dwSize_From_DDraw(lpdd);
|
||||
ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | DDSD_REFRESHRATE;
|
||||
@ -1854,14 +1826,13 @@ HRESULT WINAPI extSetDisplayMode(int version, LPDIRECTDRAW lpdd,
|
||||
ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB;
|
||||
|
||||
(*pGetDisplayMode)(lpdd, (LPDDSURFACEDESC)&ddsd);
|
||||
if(ddsd.ddpfPixelFormat.dwRGBBitCount != dwbpp){
|
||||
OutTraceD("SetDisplayMode: fixing colordepth current=%d required=%d size=(%dx%d)\n",
|
||||
if (version==1)
|
||||
res = (*pSetDisplayMode1)(lpdd, ddsd.dwWidth, ddsd.dwHeight, dwbpp);
|
||||
else
|
||||
res = (*pSetDisplayMode2)(lpdd, ddsd.dwWidth, ddsd.dwHeight, dwbpp, ddsd.dwRefreshRate, 0);
|
||||
|
||||
OutTraceD("SetDisplayMode: fixing colordepth current=%d required=%d size=(%dx%d)\n",
|
||||
ddsd.ddpfPixelFormat.dwRGBBitCount, dwbpp, ddsd.dwWidth, ddsd.dwHeight);
|
||||
if (version==1)
|
||||
res = (*pSetDisplayMode1)(lpdd, ddsd.dwWidth, ddsd.dwHeight, dwbpp);
|
||||
else
|
||||
res = (*pSetDisplayMode2)(lpdd, ddsd.dwWidth, ddsd.dwHeight, dwbpp, ddsd.dwRefreshRate, 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1883,7 +1854,10 @@ HRESULT WINAPI extGetDisplayMode(LPDIRECTDRAW lpdd, LPDDSURFACEDESC lpddsd)
|
||||
OutTraceD("GetDisplayMode\n");
|
||||
|
||||
(*pGetDisplayMode)(lpdd, lpddsd);
|
||||
if(dxw.dwFlags1 & EMULATESURFACE) SetPixFmt((LPDDSURFACEDESC2)lpddsd);
|
||||
if(dxw.dwFlags1 & EMULATESURFACE) {
|
||||
GetPixFmt((LPDDSURFACEDESC2)lpddsd);
|
||||
if(!lpddsd->ddpfPixelFormat.dwFlags) SetPixFmt((LPDDSURFACEDESC2)lpddsd);
|
||||
}
|
||||
lpddsd->dwWidth = dxw.GetScreenWidth();
|
||||
lpddsd->dwHeight = dxw.GetScreenHeight();
|
||||
|
||||
@ -1894,13 +1868,15 @@ HRESULT WINAPI extGetDisplayMode(LPDIRECTDRAW lpdd, LPDDSURFACEDESC lpddsd)
|
||||
OutTraceD("GetDisplayMode: fix RGBBitCount=%d\n", lpddsd->ddpfPixelFormat.dwRGBBitCount);
|
||||
}
|
||||
|
||||
OutTraceD("GetDisplayMode: returning WxH=(%dx%d) PixelFormat Flags=%x(%s) RGBBitCount=%d RGBAmask=(%x,%x,%x,%x) Caps=%x(%s)\n",
|
||||
lpddsd->dwWidth, lpddsd->dwHeight,
|
||||
lpddsd->ddpfPixelFormat.dwFlags, ExplainPixelFormatFlags(lpddsd->ddpfPixelFormat.dwFlags),
|
||||
lpddsd->ddpfPixelFormat.dwRGBBitCount,
|
||||
lpddsd->ddpfPixelFormat.dwRBitMask, lpddsd->ddpfPixelFormat.dwGBitMask, lpddsd->ddpfPixelFormat.dwBBitMask,
|
||||
lpddsd->ddpfPixelFormat.dwRGBAlphaBitMask,
|
||||
lpddsd->ddsCaps.dwCaps, ExplainDDSCaps(lpddsd->ddsCaps.dwCaps));
|
||||
//OutTraceD("GetDisplayMode: returning WxH=(%dx%d) PixelFormat Flags=%x(%s) RGBBitCount=%d RGBAmask=(%x,%x,%x,%x) Caps=%x(%s)\n",
|
||||
// lpddsd->dwWidth, lpddsd->dwHeight,
|
||||
// lpddsd->ddpfPixelFormat.dwFlags, ExplainPixelFormatFlags(lpddsd->ddpfPixelFormat.dwFlags),
|
||||
// lpddsd->ddpfPixelFormat.dwRGBBitCount,
|
||||
// lpddsd->ddpfPixelFormat.dwRBitMask, lpddsd->ddpfPixelFormat.dwGBitMask, lpddsd->ddpfPixelFormat.dwBBitMask,
|
||||
// lpddsd->ddpfPixelFormat.dwRGBAlphaBitMask,
|
||||
// lpddsd->ddsCaps.dwCaps, ExplainDDSCaps(lpddsd->ddsCaps.dwCaps));
|
||||
|
||||
OutTraceD("GetDisplayMode: returning size=(%dx%d) %s\n", lpddsd->dwWidth, lpddsd->dwHeight, DumpPixelFormat((LPDDSURFACEDESC2)lpddsd));
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -2006,7 +1982,7 @@ void FixSurfaceCapsAnalytic(LPDDSURFACEDESC2 lpddsd, int dxversion)
|
||||
// lpddsd->ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN|DDSCAPS_SYSTEMMEMORY;
|
||||
// lpddsd->dwHeight = dxw.GetScreenHeight();
|
||||
// lpddsd->dwWidth = dxw.GetScreenWidth();
|
||||
// SetPixFmt(lpddsd);
|
||||
// GetPixFmt(lpddsd);
|
||||
// return;
|
||||
// break;
|
||||
// }
|
||||
@ -2016,7 +1992,7 @@ void FixSurfaceCapsAnalytic(LPDDSURFACEDESC2 lpddsd, int dxversion)
|
||||
// dwFlags: DDSD_CAPS+HEIGHT+WIDTH+PIXELFORMAT+TEXTURESTAGE
|
||||
// dwCaps1: DDSCAPS_OFFSCREENPLAIN+SYSTEMMEMORY+TEXTURE
|
||||
// dwCaps2: DDSCAPS2_TEXTUREMANAGE
|
||||
SetPixFmt(lpddsd);
|
||||
GetPixFmt(lpddsd);
|
||||
return;
|
||||
break;
|
||||
case DDSD_CAPS|DDSD_WIDTH|DDSD_HEIGHT|DDSD_ZBUFFERBITDEPTH:
|
||||
@ -2067,54 +2043,54 @@ void FixSurfaceCapsAnalytic(LPDDSURFACEDESC2 lpddsd, int dxversion)
|
||||
break;
|
||||
case DDSCAPS_OFFSCREENPLAIN|DDSCAPS_VIDEOMEMORY:
|
||||
// Alien Nations, Heroes of Might & Magic IV --- troublesome!!!!
|
||||
//lpddsd->dwFlags = 0;
|
||||
//lpddsd->ddsCaps.dwCaps = (DDSCAPS_OFFSCREENPLAIN|DDSCAPS_SYSTEMMEMORY);
|
||||
lpddsd->ddsCaps.dwCaps = 0;
|
||||
lpddsd->dwFlags = (DDSD_CAPS|DDSD_HEIGHT|DDSD_WIDTH|DDSD_PIXELFORMAT);
|
||||
lpddsd->ddsCaps.dwCaps = (DDSCAPS_OFFSCREENPLAIN|DDSCAPS_SYSTEMMEMORY);
|
||||
GetPixFmt(lpddsd);
|
||||
return;
|
||||
break;
|
||||
case DDSCAPS_OFFSCREENPLAIN|DDSCAPS_SYSTEMMEMORY:
|
||||
// Cave Story, HoMM3
|
||||
lpddsd->dwFlags |= DDSD_PIXELFORMAT;
|
||||
SetPixFmt(lpddsd);
|
||||
GetPixFmt(lpddsd);
|
||||
return;
|
||||
break;
|
||||
case DDSCAPS_SYSTEMMEMORY:
|
||||
// Magic & Mayhem
|
||||
lpddsd->dwFlags |= DDSD_PIXELFORMAT;
|
||||
lpddsd->ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN;
|
||||
SetPixFmt(lpddsd);
|
||||
GetPixFmt(lpddsd);
|
||||
return;
|
||||
break;
|
||||
case DDSCAPS_OFFSCREENPLAIN:
|
||||
// Cave Story, Magic & Mayhem
|
||||
lpddsd->dwFlags |= DDSD_PIXELFORMAT;
|
||||
lpddsd->ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN;
|
||||
SetPixFmt(lpddsd);
|
||||
GetPixFmt(lpddsd);
|
||||
return;
|
||||
break;
|
||||
case DDSCAPS_OFFSCREENPLAIN|DDSCAPS_3DDEVICE:
|
||||
// Nightmare Ned
|
||||
lpddsd->dwFlags |= DDSD_PIXELFORMAT;
|
||||
SetPixFmt(lpddsd);
|
||||
GetPixFmt(lpddsd);
|
||||
return;
|
||||
break;
|
||||
case DDSCAPS_SYSTEMMEMORY|DDSCAPS_3DDEVICE:
|
||||
// Actua Soccer 3
|
||||
lpddsd->dwFlags |= DDSD_PIXELFORMAT;
|
||||
SetPixFmt(lpddsd);
|
||||
GetPixFmt(lpddsd);
|
||||
return;
|
||||
break;
|
||||
case DDSCAPS_VIDEOMEMORY|DDSCAPS_3DDEVICE:
|
||||
// Actua Soccer 3
|
||||
lpddsd->dwFlags |= DDSD_PIXELFORMAT;
|
||||
lpddsd->ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY|DDSCAPS_3DDEVICE;
|
||||
SetPixFmt(lpddsd);
|
||||
GetPixFmt(lpddsd);
|
||||
return;
|
||||
break;
|
||||
case DDSCAPS_OFFSCREENPLAIN|DDSCAPS_3DDEVICE|DDSCAPS_SYSTEMMEMORY:
|
||||
// Nightmare Ned, The Sims ???
|
||||
lpddsd->dwFlags |= DDSD_PIXELFORMAT;
|
||||
SetPixFmt(lpddsd);
|
||||
GetPixFmt(lpddsd);
|
||||
return;
|
||||
break;
|
||||
}
|
||||
@ -2139,14 +2115,26 @@ void FixSurfaceCapsAnalytic(LPDDSURFACEDESC2 lpddsd, int dxversion)
|
||||
lpddsd->ddsCaps.dwCaps = (DDSCAPS_OFFSCREENPLAIN|DDSCAPS_3DDEVICE|DDSCAPS_SYSTEMMEMORY);
|
||||
// eotry
|
||||
return;
|
||||
break; case DDSCAPS_OFFSCREENPLAIN:
|
||||
break;
|
||||
case DDSCAPS_OFFSCREENPLAIN:
|
||||
// Submarine titans (8BPP)
|
||||
lpddsd->ddsCaps.dwCaps = (DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN);
|
||||
SetPixFmt(lpddsd);
|
||||
GetPixFmt(lpddsd);
|
||||
return;
|
||||
break;
|
||||
case DDSCAPS_OFFSCREENPLAIN|DDSCAPS_SYSTEMMEMORY:
|
||||
// Duckman, HoM&M4
|
||||
// Duckman, HoM&M4, Beavis & Butthead do U.
|
||||
// unsetting the Pixel Format may cause the backbuffer to be created with DDPF_ALPHAPIXELS flag on
|
||||
// and some generic surface with DDPF_ALPHAPIXELS off, so that blitting is unsupported.
|
||||
// But it seems impossible to get HOMM4 to cope with Beavis & Butthead!!!
|
||||
if(!(dxw.dwFlags3 & NOPIXELFORMAT)) GetPixFmt(lpddsd);
|
||||
return;
|
||||
break;
|
||||
case DDSCAPS_OFFSCREENPLAIN|DDSCAPS_VIDEOMEMORY:
|
||||
// Dungeon Keeper II GOG release (intro screen): doesn't like calling GetPixFmt!!!
|
||||
// need not to be configurable until we get a different case.
|
||||
// it works both on VIDEOMEMORY or SYSTEMMEMORY. The latter should be more stable.
|
||||
lpddsd->ddsCaps.dwCaps = (DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN);
|
||||
return;
|
||||
break;
|
||||
case DDSCAPS_SYSTEMMEMORY|DDSCAPS_ZBUFFER:
|
||||
@ -2154,7 +2142,7 @@ void FixSurfaceCapsAnalytic(LPDDSURFACEDESC2 lpddsd, int dxversion)
|
||||
return;
|
||||
break;
|
||||
case DDSCAPS_SYSTEMMEMORY|DDSCAPS_TEXTURE:
|
||||
// Wargames Direct3D hw acceleration
|
||||
// Wargames Direct3D hw acceleration
|
||||
// Star Wars Shadows of the Empire in RGB HEL mode
|
||||
return;
|
||||
break;
|
||||
@ -2174,7 +2162,7 @@ void FixSurfaceCapsAnalytic(LPDDSURFACEDESC2 lpddsd, int dxversion)
|
||||
break;
|
||||
case DDSCAPS_OFFSCREENPLAIN|DDSCAPS_SYSTEMMEMORY|DDSCAPS_3DDEVICE:
|
||||
// Premier Manager 98
|
||||
SetPixFmt(lpddsd);
|
||||
GetPixFmt(lpddsd);
|
||||
return;
|
||||
break;
|
||||
case DDSCAPS_OVERLAY|DDSCAPS_VIDEOMEMORY: // NOT WORKING
|
||||
@ -2185,16 +2173,15 @@ void FixSurfaceCapsAnalytic(LPDDSURFACEDESC2 lpddsd, int dxversion)
|
||||
case DDSCAPS_SYSTEMMEMORY:
|
||||
// Star Force Deluxe
|
||||
lpddsd->ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN|DDSCAPS_SYSTEMMEMORY;
|
||||
// SetPixFmt(lpddsd);
|
||||
// GetPixFmt(lpddsd);
|
||||
return;
|
||||
break;
|
||||
case DDSCAPS_TEXTURE|DDSCAPS_VIDEOMEMORY|DDSCAPS_ALLOCONLOAD:
|
||||
// Star Wars Shadows of the Empire
|
||||
// seems to work both with/without SetPixFmt, but doesn't like DDSCAPS_SYSTEMMEMORY textures.
|
||||
// Setting SetPixFmt makes bad alpha transparencies!
|
||||
// seems to work both with/without GetPixFmt, but doesn't like DDSCAPS_SYSTEMMEMORY textures.
|
||||
// Setting GetPixFmt makes bad alpha transparencies!
|
||||
// DDSCAPS_VIDEOMEMORY doesn't work with HEL only! Better switch to DDSCAPS_SYSTEMMEMORY.
|
||||
if (dxw.dwFlags3 & FORCESHEL) lpddsd->ddsCaps.dwCaps = (DDSCAPS_TEXTURE|DDSCAPS_SYSTEMMEMORY|DDSCAPS_ALLOCONLOAD);
|
||||
//SetPixFmt(lpddsd);
|
||||
return;
|
||||
break;
|
||||
}
|
||||
@ -2204,7 +2191,7 @@ void FixSurfaceCapsAnalytic(LPDDSURFACEDESC2 lpddsd, int dxversion)
|
||||
case DDSCAPS_SYSTEMMEMORY:
|
||||
// Wargames
|
||||
lpddsd->ddsCaps.dwCaps = (DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN);
|
||||
SetPixFmt(lpddsd);
|
||||
GetPixFmt(lpddsd);
|
||||
//lpddsd->dwFlags = DDSD_CAPS|DDSD_WIDTH|DDSD_HEIGHT|DDSD_PITCH; // turn DDSD_PIXELFORMAT off
|
||||
return;
|
||||
break;
|
||||
@ -2237,6 +2224,8 @@ static void FixSurfaceCaps(LPDDSURFACEDESC2 lpddsd, int dxversion)
|
||||
// 5) ignore DDSD_CKSRCBLT, ....
|
||||
// 6) setting a different pixel format in memory requires DDSCAPS_OFFSCREENPLAIN capability
|
||||
// 7) DDSD_TEXTURESTAGE surfaces may need to adjust fixel format (....???)
|
||||
// 8) Generic surfaces are mapped to SYSTEMMEMORY and set to primary surface PixelFormat
|
||||
// 9) When pixelformat is unspecified, be sure to pick the right one (with or without alphapixels?)
|
||||
|
||||
if(!(lpddsd->dwFlags & DDSD_CAPS)) lpddsd->ddsCaps.dwCaps = 0;
|
||||
|
||||
@ -2251,7 +2240,7 @@ static void FixSurfaceCaps(LPDDSURFACEDESC2 lpddsd, int dxversion)
|
||||
}
|
||||
if((lpddsd->dwFlags & (DDSD_PIXELFORMAT|DDSD_TEXTURESTAGE)) == (DDSD_PIXELFORMAT|DDSD_TEXTURESTAGE)){
|
||||
// textures, set proper color depth and make no further changes
|
||||
SetPixFmt(lpddsd);
|
||||
GetPixFmt(lpddsd);
|
||||
return;
|
||||
}
|
||||
if((lpddsd->dwFlags & DDSD_CAPS) && (lpddsd->ddsCaps.dwCaps & DDSCAPS_ZBUFFER)) { // z-buffer surface - set to memory
|
||||
@ -2261,7 +2250,7 @@ static void FixSurfaceCaps(LPDDSURFACEDESC2 lpddsd, int dxversion)
|
||||
if((lpddsd->dwFlags & DDSD_CAPS) && (lpddsd->ddsCaps.dwCaps & DDSCAPS_3DDEVICE)) { // 3DDEVICE: enforce PIXELFORMAT on MEMORY
|
||||
lpddsd->dwFlags |= DDSD_PIXELFORMAT;
|
||||
lpddsd->ddsCaps.dwCaps = (DDSCAPS_OFFSCREENPLAIN|DDSCAPS_SYSTEMMEMORY|DDSCAPS_3DDEVICE);
|
||||
SetPixFmt(lpddsd);
|
||||
GetPixFmt(lpddsd);
|
||||
return;
|
||||
}
|
||||
//// DDSCAPS_ALLOCONLOAD on VIDEOMEMORY can't be done when HAL is disabled - it returns DDERR_NODIRECTDRAWHW error
|
||||
@ -2282,28 +2271,23 @@ static void FixSurfaceCaps(LPDDSURFACEDESC2 lpddsd, int dxversion)
|
||||
if(lpddsd->dwFlags & DDSD_ZBUFFERBITDEPTH){
|
||||
lpddsd->dwFlags &= ~DDSD_PIXELFORMAT;
|
||||
}
|
||||
#if 0
|
||||
// HoM&M3/4 fix....
|
||||
if(((lpddsd->dwFlags & (DDSD_CAPS|DDSD_WIDTH|DDSD_HEIGHT)) == (DDSD_CAPS|DDSD_HEIGHT|DDSD_WIDTH)) &&
|
||||
(lpddsd->ddsCaps.dwCaps == (DDSCAPS_OFFSCREENPLAIN|DDSCAPS_VIDEOMEMORY))){
|
||||
lpddsd->ddsCaps.dwCaps = 0;
|
||||
((lpddsd->ddsCaps.dwCaps & ~(DDSCAPS_SYSTEMMEMORY|DDSCAPS_VIDEOMEMORY) == DDSCAPS_OFFSCREENPLAIN)){
|
||||
//lpddsd->ddsCaps.dwCaps = 0;
|
||||
lpddsd->dwFlags = (DDSD_CAPS|DDSD_HEIGHT|DDSD_WIDTH|DDSD_PIXELFORMAT);
|
||||
lpddsd->ddsCaps.dwCaps = (DDSCAPS_OFFSCREENPLAIN|DDSCAPS_SYSTEMMEMORY);
|
||||
GetPixFmt(lpddsd);
|
||||
return;
|
||||
}
|
||||
// HoM&M3/4 fix.... don't alter pixel format set to OFFSCREENPLAIN+SYSTEMMEMORY surface
|
||||
if(((lpddsd->dwFlags & (DDSD_CAPS|DDSD_WIDTH|DDSD_HEIGHT|DDSD_PIXELFORMAT)) == (DDSD_CAPS|DDSD_WIDTH|DDSD_HEIGHT|DDSD_PIXELFORMAT)) &&
|
||||
(lpddsd->ddsCaps.dwCaps == (DDSCAPS_OFFSCREENPLAIN|DDSCAPS_SYSTEMMEMORY))){
|
||||
return;
|
||||
}
|
||||
if(((lpddsd->dwFlags & (DDSD_CAPS|DDSD_WIDTH|DDSD_HEIGHT|DDSD_PIXELFORMAT)) == (DDSD_CAPS|DDSD_WIDTH|DDSD_HEIGHT|DDSD_PIXELFORMAT)) &&
|
||||
(lpddsd->ddsCaps.dwCaps == (DDSCAPS_OFFSCREENPLAIN|DDSCAPS_SYSTEMMEMORY))){
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
// default case: adjust pixel format
|
||||
OutTraceB("FixSurfaceCaps: suppress DDSCAPS_VIDEOMEMORY case\n");
|
||||
lpddsd->dwFlags |= (DDSD_CAPS|DDSD_PIXELFORMAT);
|
||||
lpddsd->ddsCaps.dwCaps &= ~DDSCAPS_VIDEOMEMORY;
|
||||
lpddsd->ddsCaps.dwCaps |= (DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN);
|
||||
SetPixFmt(lpddsd);
|
||||
if(!(dxw.dwFlags3 & NOPIXELFORMAT)) GetPixFmt(lpddsd);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2322,6 +2306,14 @@ static HRESULT BuildPrimaryEmu(LPDIRECTDRAW lpdd, CreateSurface_Type pCreateSurf
|
||||
|
||||
// emulated primary surface
|
||||
memcpy((void *)&ddsd, lpddsd, lpddsd->dwSize);
|
||||
|
||||
// handle the surface attributes before the ddsd.dwFlags gets updated:
|
||||
// if a surface desc is NOT specified, build one
|
||||
if(!(ddsd.dwFlags & DDSD_PIXELFORMAT)) SetPixFmt((LPDDSURFACEDESC2)&ddsd);
|
||||
// then save it
|
||||
dxw.VirtualPixelFormat = ddsd.ddpfPixelFormat;
|
||||
|
||||
OutTraceD("DDSD_PIXELFORMAT: color=%d flags=%x\n", dxw.VirtualPixelFormat.dwRGBBitCount, dxw.VirtualPixelFormat.dwFlags);
|
||||
ddsd.dwFlags &= ~(DDSD_BACKBUFFERCOUNT|DDSD_REFRESHRATE);
|
||||
ddsd.dwFlags |= (DDSD_CAPS|DDSD_WIDTH|DDSD_HEIGHT|DDSD_PIXELFORMAT);
|
||||
ddsd.ddsCaps.dwCaps &= ~(DDSCAPS_PRIMARYSURFACE|DDSCAPS_FLIP|DDSCAPS_COMPLEX|DDSCAPS_VIDEOMEMORY|DDSCAPS_LOCALVIDMEM);
|
||||
@ -2329,7 +2321,6 @@ static HRESULT BuildPrimaryEmu(LPDIRECTDRAW lpdd, CreateSurface_Type pCreateSurf
|
||||
ddsd.ddsCaps.dwCaps |= (DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN);
|
||||
ddsd.dwWidth = dxw.GetScreenWidth();
|
||||
ddsd.dwHeight = dxw.GetScreenHeight();
|
||||
SetPixFmt((LPDDSURFACEDESC2)&ddsd);
|
||||
|
||||
// create Primary surface
|
||||
DumpSurfaceAttributes((LPDDSURFACEDESC)&ddsd, "[Primary]" , __LINE__);
|
||||
@ -2358,7 +2349,7 @@ static HRESULT BuildPrimaryEmu(LPDIRECTDRAW lpdd, CreateSurface_Type pCreateSurf
|
||||
ClearSurfaceDesc((void *)&ddsd, dxversion);
|
||||
ddsd.dwFlags = DDSD_CAPS;
|
||||
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
|
||||
SetPixFmt(&ddsd);
|
||||
GetPixFmt(&ddsd);
|
||||
DumpSurfaceAttributes((LPDDSURFACEDESC)&ddsd, "[EmuPrim]" , __LINE__);
|
||||
|
||||
res=(*pCreateSurface)(lpdd, &ddsd, &lpDDSEmu_Prim, 0);
|
||||
@ -2477,7 +2468,7 @@ static HRESULT BuildBackBufferEmu(LPDIRECTDRAW lpdd, CreateSurface_Type pCreateS
|
||||
ddsd.ddsCaps.dwCaps |= (DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN);
|
||||
ddsd.dwWidth = dxw.GetScreenWidth();
|
||||
ddsd.dwHeight = dxw.GetScreenHeight();
|
||||
SetPixFmt(&ddsd);
|
||||
GetPixFmt(&ddsd);
|
||||
|
||||
DumpSurfaceAttributes((LPDDSURFACEDESC)&ddsd, "[Backbuf]" , __LINE__);
|
||||
res=(*pCreateSurface)(lpdd, &ddsd, lplpdds, 0);
|
||||
@ -2977,11 +2968,13 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
|
||||
|
||||
// debug suppressions
|
||||
if(ToPrim){
|
||||
if(isFlipping)
|
||||
if(isFlipping){
|
||||
if(dxw.dwFlags3 & NODDRAWFLIP) return DD_OK;
|
||||
else
|
||||
}
|
||||
else {
|
||||
if(dxw.dwFlags3 & NODDRAWBLT) return DD_OK;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ONEPIXELFIX
|
||||
if (lpdestrect){
|
||||
@ -3033,6 +3026,8 @@ HRESULT WINAPI sBlt(char *api, LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect,
|
||||
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
|
||||
// trying blitting directly to lpDDSEmu_Prim: it makes DK2 intro movies working.
|
||||
// Wrong guess!!! The cause was not compression, but simply a pixelformat mismatch. Better
|
||||
// configure things properly and avoid this branch.
|
||||
switch(res){
|
||||
case DDERR_UNSUPPORTED:
|
||||
if (dxw.dwFlags1 & EMULATESURFACE){
|
||||
@ -3338,44 +3333,6 @@ HRESULT WINAPI extBltFast(LPDIRECTDRAWSURFACE lpdds, DWORD dwx, DWORD dwy,
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define DDPCAPS_INITIALIZE_LEGACY 0x00000008l
|
||||
|
||||
HRESULT WINAPI extCreatePalette(LPDIRECTDRAW lpdd, DWORD dwflags, LPPALETTEENTRY lpddpa,
|
||||
LPDIRECTDRAWPALETTE *lplpddp, IUnknown *pu)
|
||||
{
|
||||
HRESULT res;
|
||||
|
||||
OutTraceD("CreatePalette: dwFlags=%x(%s)\n", dwflags, ExplainCreatePaletteFlags(dwflags));
|
||||
|
||||
if(!(dxw.dwFlags1 & EMULATESURFACE)){
|
||||
res = (*pCreatePalette)(lpdd, dwflags, lpddpa, lplpddp, pu);
|
||||
if (res) {
|
||||
OutTraceD("CreatePalette: res=%x(%s)\n", res, ExplainDDError(res));
|
||||
return res;
|
||||
}
|
||||
HookDDPalette(lplpddp);
|
||||
OutTraceD("CreatePalette: GENUINE lpddp=%x\n", *lplpddp);
|
||||
return res;
|
||||
}
|
||||
|
||||
if (dwflags & ~(DDPCAPS_PRIMARYSURFACE|DDPCAPS_8BIT|DDPCAPS_ALLOW256|DDPCAPS_INITIALIZE_LEGACY)) STOPPER("Palette flags");
|
||||
|
||||
res = (*pCreatePalette)(lpdd, dwflags & ~DDPCAPS_PRIMARYSURFACE, lpddpa, lplpddp, pu);
|
||||
if(res) {
|
||||
if (res) OutTraceD("CreatePalette: res=%x(%s)\n", res, ExplainDDError(res));
|
||||
return res;
|
||||
}
|
||||
|
||||
HookDDPalette(lplpddp);
|
||||
|
||||
if((dwflags & (DDPCAPS_8BIT|DDPCAPS_PRIMARYSURFACE)) == (DDPCAPS_8BIT|DDPCAPS_PRIMARYSURFACE)){ // v2.02.39
|
||||
mySetPalette(0, 256, lpddpa);
|
||||
lpDDP = *lplpddp;
|
||||
}
|
||||
OutTraceD("CreatePalette: EMULATED lpddp=%x\n", *lplpddp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
HRESULT WINAPI extWaitForVerticalBlank(LPDIRECTDRAW lpdd, DWORD dwflags, HANDLE hevent)
|
||||
{
|
||||
static DWORD time = 0;
|
||||
@ -3391,7 +3348,37 @@ HRESULT WINAPI extWaitForVerticalBlank(LPDIRECTDRAW lpdd, DWORD dwflags, HANDLE
|
||||
return 0;
|
||||
}
|
||||
|
||||
// extGetPalette: To revise completely.
|
||||
#define DDPCAPS_INITIALIZE_LEGACY 0x00000008l
|
||||
|
||||
HRESULT WINAPI extCreatePalette(LPDIRECTDRAW lpdd, DWORD dwflags, LPPALETTEENTRY lpddpa,
|
||||
LPDIRECTDRAWPALETTE *lplpddp, IUnknown *pu)
|
||||
{
|
||||
HRESULT res;
|
||||
|
||||
OutTraceD("CreatePalette: dwFlags=%x(%s)\n", dwflags, ExplainCreatePaletteFlags(dwflags));
|
||||
if(IsDebug && (dwflags & DDPCAPS_8BIT)){
|
||||
int idx;
|
||||
OutTrace("CreatePalette: ");
|
||||
for(idx=0; idx<256; idx++) OutTrace("(%02x.%02x.%02x)",
|
||||
lpddpa[idx].peRed,
|
||||
lpddpa[idx].peGreen,
|
||||
lpddpa[idx].peBlue );
|
||||
OutTrace("\n");
|
||||
}
|
||||
|
||||
if (dwflags & ~(DDPCAPS_PRIMARYSURFACE|DDPCAPS_8BIT|DDPCAPS_ALLOW256|DDPCAPS_INITIALIZE_LEGACY)) STOPPER("Palette flags");
|
||||
|
||||
if(dxw.dwFlags1 & EMULATESURFACE) dwflags &= ~DDPCAPS_PRIMARYSURFACE;
|
||||
res = (*pCreatePalette)(lpdd, dwflags, lpddpa, lplpddp, pu);
|
||||
if (res) {
|
||||
OutTraceE("CreatePalette: ERROR res=%x(%s)\n", res, ExplainDDError(res));
|
||||
return res;
|
||||
}
|
||||
else OutTrace("CreatePalette: OK lpddp=%x\n", *lplpddp);
|
||||
|
||||
HookDDPalette(lplpddp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
HRESULT WINAPI extGetPalette(LPDIRECTDRAWSURFACE lpdds, LPDIRECTDRAWPALETTE *lplpddp)
|
||||
{
|
||||
@ -3399,24 +3386,10 @@ HRESULT WINAPI extGetPalette(LPDIRECTDRAWSURFACE lpdds, LPDIRECTDRAWPALETTE *lpl
|
||||
|
||||
OutTraceD("GetPalette: lpdds=%x\n", lpdds);
|
||||
|
||||
// if NO-EMU mode, just proxy the call
|
||||
if(!(dxw.dwFlags1 & EMULATESURFACE)){
|
||||
res=(*pGetPalette)(lpdds, lplpddp);
|
||||
if (res) OutTraceE("GetPalette: ERROR res=%x(%s)\n", res, ExplainDDError(res));
|
||||
return 0;
|
||||
return res;
|
||||
}
|
||||
|
||||
// in EMU mode, return the global palette ptr
|
||||
if (lpDDP){
|
||||
*lplpddp = lpDDP;
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
OutTraceD("GetPalette: ASSERT no lpDDP\n");
|
||||
*lplpddp = lpDDP;
|
||||
return DDERR_NOPALETTEATTACHED;
|
||||
}
|
||||
res=(*pGetPalette)(lpdds, lplpddp);
|
||||
if (res) OutTraceE("GetPalette: ERROR res=%x(%s)\n", res, ExplainDDError(res));
|
||||
else OutTrace("GetPalette: OK\n");
|
||||
return res;
|
||||
}
|
||||
|
||||
HRESULT WINAPI extSetPalette(LPDIRECTDRAWSURFACE lpdds, LPDIRECTDRAWPALETTE lpddp)
|
||||
@ -3425,17 +3398,17 @@ HRESULT WINAPI extSetPalette(LPDIRECTDRAWSURFACE lpdds, LPDIRECTDRAWPALETTE lpdd
|
||||
BOOL isPrim;
|
||||
HRESULT res;
|
||||
|
||||
dxw.IsGDIPalette=FALSE;
|
||||
isPrim=dxw.IsAPrimarySurface(lpdds);
|
||||
OutTraceD("SetPalette: lpdds=%x%s lpddp=%x\n", lpdds, isPrim?"(PRIM)":"", lpddp);
|
||||
|
||||
res=(*pSetPalette)(lpdds, lpddp);
|
||||
res=DD_OK;
|
||||
if(res)OutTraceE("SetPalette: ERROR res=%x(%s) at %d\n", res, ExplainDDError(res), __LINE__);
|
||||
else OutTrace("SetPalette: OK\n");
|
||||
|
||||
if(dxw.dwFlags1 & EMULATESURFACE){
|
||||
OutTraceD("SetPalette: DEBUG emulating palette\n");
|
||||
if((dxw.dwFlags1 & EMULATESURFACE) && isPrim){
|
||||
OutTraceD("SetPalette: register PRIMARY palette lpDDP=%x\n", lpddp);
|
||||
lpDDP = lpddp;
|
||||
|
||||
if(lpddp){
|
||||
HRESULT res2;
|
||||
lpentries = (LPPALETTEENTRY)PaletteEntries;
|
||||
@ -3453,31 +3426,30 @@ HRESULT WINAPI extSetEntries(LPDIRECTDRAWPALETTE lpddp, DWORD dwflags, DWORD dws
|
||||
{
|
||||
HRESULT res;
|
||||
|
||||
dxw.IsGDIPalette=FALSE;
|
||||
OutTraceD("SetEntries: lpddp=%x dwFlags=%x, start=%d, count=%d entries=%x\n", //GHO: added trace infos
|
||||
lpddp, dwflags, dwstart, dwcount, lpentries);
|
||||
|
||||
res = (*pSetEntries)(lpddp, dwflags, dwstart, dwcount, lpentries);
|
||||
if(res) OutTraceE("SetEntries: ERROR res=%x(%s)\n", res, ExplainDDError(res));
|
||||
else OutTrace("SetEntries: OK\n");
|
||||
|
||||
if(!(dxw.dwFlags1 & EMULATESURFACE) || lpDDP != lpddp){
|
||||
return res;
|
||||
if((dxw.dwFlags1 & EMULATESURFACE) && (lpDDP == lpddp)){
|
||||
OutTraceD("SetEntries: update PRIMARY palette lpDDP=%x\n", lpddp);
|
||||
if ((dwstart + dwcount > 256) || (dwstart<0)){
|
||||
dwcount=256;
|
||||
dwstart=0;
|
||||
OutTraceD("SetEntries: ASSERT start+count > 256\n");
|
||||
}
|
||||
|
||||
mySetPalette(dwstart, dwcount, lpentries);
|
||||
|
||||
// GHO: needed for fixed rect and variable palette animations,
|
||||
// e.g. dungeon keeper loading screen, Warcraft II splash, ...
|
||||
// GHO: but refreshing cause flickering when GDI was used without updating the primary surface
|
||||
// e.g. Tomb Raider 2 intro titles, Virtua Fighter PC, ...
|
||||
if ((dxw.dwFlags1 & EMULATESURFACE) && !(dxw.dwFlags2 & NOPALETTEUPDATE)) dxw.ScreenRefresh();
|
||||
}
|
||||
|
||||
if ((dwstart + dwcount > 256) || (dwstart<0)){
|
||||
dwcount=256;
|
||||
dwstart=0;
|
||||
OutTraceD("SetEntries: ASSERT start+count > 256\n");
|
||||
}
|
||||
|
||||
mySetPalette(dwstart, dwcount, lpentries);
|
||||
|
||||
// GHO: needed for fixed rect and variable palette animations,
|
||||
// e.g. dungeon keeper loading screen, Warcraft II splash, ...
|
||||
// GHO: but refreshing cause flickering when GDI was used without updating the primary surface
|
||||
// e.g. Tomb Raider 2 intro titles
|
||||
if ((dxw.dwFlags1 & EMULATESURFACE) && !(dxw.dwFlags2 & NOPALETTEUPDATE)) dxw.ScreenRefresh();
|
||||
return 0;
|
||||
return res;
|
||||
}
|
||||
|
||||
HRESULT WINAPI extSetClipper(LPDIRECTDRAWSURFACE lpdds, LPDIRECTDRAWCLIPPER lpddc)
|
||||
@ -3772,7 +3744,6 @@ HRESULT WINAPI extFlipToGDISurface(LPDIRECTDRAW lpdd)
|
||||
//HRESULT res;
|
||||
|
||||
OutTraceD("FlipToGDISurface: lpdd=%x\n", lpdd);
|
||||
STOPPER("FlipToGDISurface");
|
||||
// to revise: so far, it seems the best thing to do is NOTHING, just return 0.
|
||||
//res=(*pFlipToGDISurface)(lpdd);
|
||||
//if (res) OutTraceE("FlipToGDISurface: ERROR res=%x(%s), skipping\n", res, ExplainDDError(res));
|
||||
@ -3814,14 +3785,7 @@ HRESULT WINAPI EnumModesCallbackDumper(LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID l
|
||||
OutTrace("\tdwBackBufferCount=%d\n", lpDDSurfaceDesc->dwBackBufferCount);
|
||||
OutTrace("\tdwRefreshRate=%d\n", lpDDSurfaceDesc->dwRefreshRate);
|
||||
OutTrace("\tlpSurface=%x\n", lpDDSurfaceDesc->lpSurface);
|
||||
OutTrace("\tddpfPixelFormat.dwSize=%D\n", lpDDSurfaceDesc->ddpfPixelFormat.dwSize);
|
||||
OutTrace("\tddpfPixelFormat.dwFlags=%x\n", lpDDSurfaceDesc->ddpfPixelFormat.dwFlags);
|
||||
OutTrace("\tddpfPixelFormat.dwRGBBitCount=%d\n", lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount);
|
||||
OutTrace("\tddpfPixelFormat.dwARGBBitMask=(%x,%x,%x,%x)\n",
|
||||
lpDDSurfaceDesc->ddpfPixelFormat.dwRGBAlphaBitMask,
|
||||
lpDDSurfaceDesc->ddpfPixelFormat.dwRBitMask,
|
||||
lpDDSurfaceDesc->ddpfPixelFormat.dwGBitMask,
|
||||
lpDDSurfaceDesc->ddpfPixelFormat.dwBBitMask);
|
||||
OutTrace("\tddpfPixelFormat %s\n", DumpPixelFormat((LPDDSURFACEDESC2)lpDDSurfaceDesc));
|
||||
return DDENUMRET_OK;
|
||||
}
|
||||
|
||||
|
@ -298,30 +298,43 @@ char *ExplainDDFXCaps(DWORD c)
|
||||
return(eb);
|
||||
}
|
||||
|
||||
char *ExplainDDPalCaps(DWORD c)
|
||||
{
|
||||
static char eb[256];
|
||||
unsigned int l;
|
||||
strcpy(eb,"DDPCAPS_");
|
||||
if (c & DDPCAPS_ALPHA) strcat(eb, "ALPHA+");
|
||||
if (c & DDPCAPS_PRIMARYSURFACE) strcat(eb, "PRIMARYSURFACE+");
|
||||
l=strlen(eb);
|
||||
if (l>strlen("DDPCAPS_")) eb[l-1]=0; // delete last '+' if any
|
||||
else eb[0]=0;
|
||||
return(eb);
|
||||
}
|
||||
|
||||
char *ExplainDDCKeyCaps(DWORD c)
|
||||
{
|
||||
static char eb[512];
|
||||
unsigned int l;
|
||||
strcpy(eb,"DDCKEYCAPS_");
|
||||
if (c & DDCKEYCAPS_DESTBLT) strcat(eb, "DDCKEYCAPS_DESTBLT+");
|
||||
if (c & DDCKEYCAPS_DESTBLTCLRSPACE) strcat(eb, "DDCKEYCAPS_DESTBLTCLRSPACE+");
|
||||
if (c & DDCKEYCAPS_DESTBLTCLRSPACEYUV) strcat(eb, "DDCKEYCAPS_DESTBLTCLRSPACEYUV+");
|
||||
if (c & DDCKEYCAPS_DESTBLTYUV) strcat(eb, "DDCKEYCAPS_DESTBLTYUV+");
|
||||
if (c & DDCKEYCAPS_DESTOVERLAY) strcat(eb, "DDCKEYCAPS_DESTOVERLAY+");
|
||||
if (c & DDCKEYCAPS_DESTOVERLAYCLRSPACE) strcat(eb, "DDCKEYCAPS_DESTOVERLAYCLRSPACE+");
|
||||
if (c & DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV) strcat(eb, "DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV+");
|
||||
if (c & DDCKEYCAPS_DESTOVERLAYONEACTIVE) strcat(eb, "DDCKEYCAPS_DESTOVERLAYONEACTIVE+");
|
||||
if (c & DDCKEYCAPS_DESTOVERLAYYUV) strcat(eb, "DDCKEYCAPS_DESTOVERLAYYUV+");
|
||||
if (c & DDCKEYCAPS_SRCBLT) strcat(eb, "DDCKEYCAPS_SRCBLT+");
|
||||
if (c & DDCKEYCAPS_SRCBLTCLRSPACE) strcat(eb, "DDCKEYCAPS_SRCBLTCLRSPACE+");
|
||||
if (c & DDCKEYCAPS_SRCBLTCLRSPACEYUV) strcat(eb, "DDCKEYCAPS_SRCBLTCLRSPACEYUV+");
|
||||
if (c & DDCKEYCAPS_SRCBLTYUV) strcat(eb, "DDCKEYCAPS_SRCBLTYUV+");
|
||||
if (c & DDCKEYCAPS_SRCOVERLAY) strcat(eb, "DDCKEYCAPS_SRCOVERLAY+");
|
||||
if (c & DDCKEYCAPS_SRCOVERLAYCLRSPACE) strcat(eb, "DDCKEYCAPS_SRCOVERLAYCLRSPACE+");
|
||||
if (c & DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV) strcat(eb, "DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV+");
|
||||
if (c & DDCKEYCAPS_SRCOVERLAYONEACTIVE) strcat(eb, "DDCKEYCAPS_SRCOVERLAYONEACTIVE+");
|
||||
if (c & DDCKEYCAPS_SRCOVERLAYYUV) strcat(eb, "DDCKEYCAPS_SRCOVERLAYYUV+");
|
||||
if (c & DDCKEYCAPS_NOCOSTOVERLAY) strcat(eb, "DDCKEYCAPS_NOCOSTOVERLAY+");
|
||||
if (c & DDCKEYCAPS_DESTBLT) strcat(eb, "DESTBLT+");
|
||||
if (c & DDCKEYCAPS_DESTBLTCLRSPACE) strcat(eb, "DESTBLTCLRSPACE+");
|
||||
if (c & DDCKEYCAPS_DESTBLTCLRSPACEYUV) strcat(eb, "DESTBLTCLRSPACEYUV+");
|
||||
if (c & DDCKEYCAPS_DESTBLTYUV) strcat(eb, "DESTBLTYUV+");
|
||||
if (c & DDCKEYCAPS_DESTOVERLAY) strcat(eb, "DESTOVERLAY+");
|
||||
if (c & DDCKEYCAPS_DESTOVERLAYCLRSPACE) strcat(eb, "DESTOVERLAYCLRSPACE+");
|
||||
if (c & DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV) strcat(eb, "DESTOVERLAYCLRSPACEYUV+");
|
||||
if (c & DDCKEYCAPS_DESTOVERLAYONEACTIVE) strcat(eb, "DESTOVERLAYONEACTIVE+");
|
||||
if (c & DDCKEYCAPS_DESTOVERLAYYUV) strcat(eb, "DESTOVERLAYYUV+");
|
||||
if (c & DDCKEYCAPS_SRCBLT) strcat(eb, "SRCBLT+");
|
||||
if (c & DDCKEYCAPS_SRCBLTCLRSPACE) strcat(eb, "SRCBLTCLRSPACE+");
|
||||
if (c & DDCKEYCAPS_SRCBLTCLRSPACEYUV) strcat(eb, "SRCBLTCLRSPACEYUV+");
|
||||
if (c & DDCKEYCAPS_SRCBLTYUV) strcat(eb, "SRCBLTYUV+");
|
||||
if (c & DDCKEYCAPS_SRCOVERLAY) strcat(eb, "SRCOVERLAY+");
|
||||
if (c & DDCKEYCAPS_SRCOVERLAYCLRSPACE) strcat(eb, "SRCOVERLAYCLRSPACE+");
|
||||
if (c & DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV) strcat(eb, "SRCOVERLAYCLRSPACEYUV+");
|
||||
if (c & DDCKEYCAPS_SRCOVERLAYONEACTIVE) strcat(eb, "SRCOVERLAYONEACTIVE+");
|
||||
if (c & DDCKEYCAPS_SRCOVERLAYYUV) strcat(eb, "SRCOVERLAYYUV+");
|
||||
if (c & DDCKEYCAPS_NOCOSTOVERLAY) strcat(eb, "NOCOSTOVERLAY+");
|
||||
l=strlen(eb);
|
||||
if (l>strlen("DDCKEYCAPS_")) eb[l-1]=0; // delete last '+' if any
|
||||
else eb[0]=0;
|
||||
@ -1521,8 +1534,16 @@ char *ExplainGetDCExFlags(DWORD c)
|
||||
return(eb);
|
||||
}
|
||||
|
||||
|
||||
|
||||
char *ExplainPaletteUse(UINT uUsage)
|
||||
{
|
||||
char *eb = SYSPAL_ERROR;
|
||||
switch(uUsage){
|
||||
case SYSPAL_STATIC: eb="SYSPAL_STATIC"; break;
|
||||
case SYSPAL_NOSTATIC: eb="SYSPAL_NOSTATIC"; break;
|
||||
case SYSPAL_NOSTATIC256: eb="SYSPAL_NOSTATIC256"; break;
|
||||
}
|
||||
return eb;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -7,6 +7,7 @@ extern char *ExplainDDSCaps2(DWORD);
|
||||
extern char *ExplainDDSCaps3(DWORD);
|
||||
extern char *ExplainDDDCaps(DWORD);
|
||||
extern char *ExplainDDDCaps2(DWORD);
|
||||
extern char *ExplainDDPalCaps(DWORD);
|
||||
extern char *ExplainDDFXALPHACaps(DWORD);
|
||||
extern char *ExplainDDFXCaps(DWORD);
|
||||
extern char *ExplainDDCKeyCaps(DWORD);
|
||||
@ -43,3 +44,4 @@ extern char *ExplainRegType(DWORD);
|
||||
extern char *ExplainDCType(DWORD);
|
||||
extern char *ExplainPeekRemoveMsg(DWORD);
|
||||
extern char *ExplainGetDCExFlags(DWORD);
|
||||
extern char *ExplainPaletteUse(UINT);
|
||||
|
@ -59,9 +59,9 @@ static char *Flag3Names[32]={
|
||||
"SAVECAPS", "SINGLEPROCAFFINITY", "EMULATEREGISTRY", "CDROMDRIVETYPE",
|
||||
"NOWINDOWMOVE", "DISABLEHAL", "LOCKSYSCOLORS", "EMULATEDC",
|
||||
"FULLSCREENONLY", "FONTBYPASS", "YUV2RGB", "RGB2YUV",
|
||||
"BUFFEREDIOFIX", "FILTERMESSAGES", "Flags3:23", "Flags3:24",
|
||||
"Flags3:25", "Flags3:26", "Flags3:27", "Flags3:28",
|
||||
"Flags3:29", "Flags3:30", "Flags3:31", "Flags3:32",
|
||||
"BUFFEREDIOFIX", "FILTERMESSAGES", "PEEKALLMESSAGES", "SURFACEWARN",
|
||||
"ANALYTICMODE", "FORCESHEL", "CAPMASK", "COLORFIX",
|
||||
"NODDRAWBLT", "NODDRAWFLIP", "NOGDIBLT", "NOPIXELFORMAT",
|
||||
};
|
||||
|
||||
static char *Flag4Names[32]={
|
||||
@ -490,12 +490,12 @@ void *HookAPI(HMODULE module, char *dll, void *apiproc, const char *apiname, voi
|
||||
__try{
|
||||
pnth = PIMAGE_NT_HEADERS(PBYTE(base) + PIMAGE_DOS_HEADER(base)->e_lfanew);
|
||||
if(!pnth) {
|
||||
OutTraceE("HookAPI: ERROR no PNTH at %d\n", __LINE__);
|
||||
OutTraceH("HookAPI: ERROR no PNTH at %d\n", __LINE__);
|
||||
return 0;
|
||||
}
|
||||
rva = pnth->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress;
|
||||
if(!rva) {
|
||||
OutTraceE("HookAPI: ERROR no RVA at %d\n", __LINE__);
|
||||
OutTraceH("HookAPI: ERROR no RVA at %d\n", __LINE__);
|
||||
return 0;
|
||||
}
|
||||
pidesc = (PIMAGE_IMPORT_DESCRIPTOR)(base + rva);
|
||||
@ -778,6 +778,17 @@ LRESULT CALLBACK extChildWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPAR
|
||||
return DefWindowProc(hwnd, message, wparam, lparam);
|
||||
}
|
||||
|
||||
static void dx_UpdatePositionLock(HWND hwnd)
|
||||
{
|
||||
RECT rect;
|
||||
POINT p={0,0};
|
||||
(*pGetClientRect)(hwnd,&rect);
|
||||
(*pClientToScreen)(hwnd,&p);
|
||||
dxw.dwFlags1 |= LOCKWINPOS;
|
||||
OutTraceD("Toggle position lock ON\n");
|
||||
dxw.InitWindowPos(p.x, p.y, rect.right-rect.left, rect.bottom-rect.top);
|
||||
}
|
||||
|
||||
static void dx_TogglePositionLock(HWND hwnd)
|
||||
{
|
||||
// toggle position locking
|
||||
@ -787,15 +798,9 @@ static void dx_TogglePositionLock(HWND hwnd)
|
||||
dxw.dwFlags1 &= ~LOCKWINPOS;
|
||||
}
|
||||
else {
|
||||
// lock and update window position!!!
|
||||
// v2.1.80: fixed
|
||||
RECT rect;
|
||||
POINT p={0,0};
|
||||
(*pGetClientRect)(hwnd,&rect);
|
||||
(*pClientToScreen)(hwnd,&p);
|
||||
dxw.dwFlags1 |= LOCKWINPOS;
|
||||
OutTraceD("Toggle position lock ON\n");
|
||||
dxw.InitWindowPos(p.x, p.y, rect.right-rect.left, rect.bottom-rect.top);
|
||||
dxw.dwFlags1 |= LOCKWINPOS;
|
||||
dx_UpdatePositionLock(hwnd);
|
||||
}
|
||||
}
|
||||
|
||||
@ -834,6 +839,13 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
|
||||
WNDPROC pWindowProc;
|
||||
extern void dxwFixWindowPos(char *, HWND, LPARAM);
|
||||
extern LPRECT lpClipRegion;
|
||||
static BOOL DoOnce = TRUE;
|
||||
static BOOL IsToBeLocked;
|
||||
|
||||
if(DoOnce){
|
||||
DoOnce=FALSE;
|
||||
IsToBeLocked=(dxw.dwFlags1 & LOCKWINPOS);
|
||||
}
|
||||
|
||||
// v2.1.93: adjust clipping region
|
||||
|
||||
@ -974,11 +986,18 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
|
||||
OutTraceD("WindowProc: WM_WINDOWPOSCHANGING fixed size=(%d,%d)\n", wp->cx, wp->cy);
|
||||
break;
|
||||
case WM_ENTERSIZEMOVE:
|
||||
if(IsToBeLocked){
|
||||
dxw.dwFlags1 &= ~LOCKWINPOS;
|
||||
}
|
||||
while((*pShowCursor)(1) < 0);
|
||||
if(dxw.dwFlags1 & CLIPCURSOR) dxw.EraseClipCursor();
|
||||
if(dxw.dwFlags1 & ENABLECLIPPING) (*pClipCursor)(NULL);
|
||||
break;
|
||||
case WM_EXITSIZEMOVE:
|
||||
if(IsToBeLocked){
|
||||
dxw.dwFlags1 |= LOCKWINPOS;
|
||||
dx_UpdatePositionLock(hwnd);
|
||||
}
|
||||
if (dxw.dwFlags1 & HIDEHWCURSOR) while((*pShowCursor)(0) >= 0);
|
||||
if (dxw.dwFlags2 & SHOWHWCURSOR) while((*pShowCursor)(1) < 0);
|
||||
if(dxw.dwFlags1 & ENABLECLIPPING) extClipCursor(lpClipRegion);
|
||||
|
@ -25,7 +25,7 @@ dxwCore::dxwCore()
|
||||
TimeShift = 0;
|
||||
lpDDSPrimHDC = NULL;
|
||||
//IsWithinDDraw = FALSE;
|
||||
IsGDIPalette = FALSE;
|
||||
//IsGDIPalette = FALSE;
|
||||
memset(PrimSurfaces, 0, sizeof(PrimSurfaces));
|
||||
ResetEmulatedDC();
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ public: // simple data variables
|
||||
short iSizX;
|
||||
short iSizY;
|
||||
//BOOL IsWithinDDraw; // flag to avoid double intervention at ddraw & GDI level
|
||||
BOOL IsGDIPalette;
|
||||
//BOOL IsGDIPalette;
|
||||
char *CustomOpenGLLib;
|
||||
WORD palVersion;
|
||||
WORD palNumEntries;
|
||||
|
BIN
dll/dxwnd.aps
BIN
dll/dxwnd.aps
Binary file not shown.
@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "dxwnd.h"
|
||||
#include "dxwcore.hpp"
|
||||
|
||||
#define VERSION "2.02.39"
|
||||
#define VERSION "2.02.40"
|
||||
|
||||
#define DDTHREADLOCK 1
|
||||
|
||||
|
Binary file not shown.
1664
dll/gdi32.1.cpp
Normal file
1664
dll/gdi32.1.cpp
Normal file
File diff suppressed because it is too large
Load Diff
165
dll/gdi32.cpp
165
dll/gdi32.cpp
@ -5,6 +5,22 @@
|
||||
#include "dxhook.h"
|
||||
#include "dxhelper.h"
|
||||
|
||||
#include "stdio.h"
|
||||
|
||||
static void Stopper(char *s, int line)
|
||||
{
|
||||
char sMsg[81];
|
||||
sprintf(sMsg,"break: \"%s\"", s);
|
||||
MessageBox(0, sMsg, "break", MB_OK | MB_ICONEXCLAMATION);
|
||||
}
|
||||
|
||||
#define STOPPER_TEST // comment out to eliminate
|
||||
#ifdef STOPPER_TEST
|
||||
#define STOPPER(s) Stopper(s, __LINE__)
|
||||
#else
|
||||
#define STOPPER(s)
|
||||
#endif
|
||||
|
||||
/*
|
||||
dlg->m_DCEmulationMode = 0;
|
||||
if(t->flags2 & HOOKGDI) dlg->m_DCEmulationMode = 1;
|
||||
@ -17,15 +33,17 @@ static HookEntry_Type Hooks[]={
|
||||
{"ScaleWindowExtEx", (FARPROC)ScaleWindowExtEx, (FARPROC *)&pGDIScaleWindowExtEx, (FARPROC)extScaleWindowExtEx},
|
||||
{"SaveDC", (FARPROC)SaveDC, (FARPROC *)&pGDISaveDC, (FARPROC)extGDISaveDC},
|
||||
{"RestoreDC", (FARPROC)RestoreDC, (FARPROC *)&pGDIRestoreDC, (FARPROC)extGDIRestoreDC},
|
||||
{"AnimatePalette", (FARPROC)AnimatePalette, (FARPROC *)&pAnimatePalette, (FARPROC)extAnimatePalette},
|
||||
{"CreatePalette", (FARPROC)CreatePalette, (FARPROC *)&pGDICreatePalette, (FARPROC)extGDICreatePalette},
|
||||
{"SelectPalette", (FARPROC)SelectPalette, (FARPROC *)&pGDISelectPalette, (FARPROC)extSelectPalette},
|
||||
{"RealizePalette", (FARPROC)RealizePalette, (FARPROC *)&pGDIRealizePalette, (FARPROC)extRealizePalette},
|
||||
{"GetSystemPaletteEntries", (FARPROC)GetSystemPaletteEntries, (FARPROC *)&pGDIGetSystemPaletteEntries, (FARPROC)extGetSystemPaletteEntries},
|
||||
{"SetSystemPaletteUse", (FARPROC)SetSystemPaletteUse, (FARPROC *)&pSetSystemPaletteUse, (FARPROC)extSetSystemPaletteUse},
|
||||
{"StretchDIBits", (FARPROC)StretchDIBits, (FARPROC *)&pStretchDIBits, (FARPROC)extStretchDIBits},
|
||||
//{"SetDIBitsToDevice", (FARPROC)NULL, (FARPROC *)&pSetDIBitsToDevice, (FARPROC)extSetDIBitsToDevice},
|
||||
//{"CreateCompatibleBitmap", (FARPROC)NULL, (FARPROC *)&pCreateCompatibleBitmap, (FARPROC)extCreateCompatibleBitmap},
|
||||
{0, NULL, 0, 0} // terminator
|
||||
};
|
||||
};
|
||||
|
||||
static HookEntry_Type RemapHooks[]={
|
||||
{"SetViewportOrgEx", (FARPROC)SetViewportOrgEx, (FARPROC *)&pSetViewportOrgEx, (FARPROC)extSetViewportOrgEx}, // needed in ShowBanner
|
||||
@ -131,10 +149,11 @@ void HookGDI32(HMODULE module)
|
||||
if(dxw.dwFlags1 & CLIENTREMAPPING)
|
||||
HookLibrary(module, RemapHooks, libname);
|
||||
|
||||
if(dxw.dwFlags3 & EMULATEDC)
|
||||
if(dxw.dwFlags3 & EMULATEDC){
|
||||
HookLibrary(module, EmulateHooks, libname);
|
||||
HookLibrary(module, ScaledHooks, libname);
|
||||
HookLibrary(module, GDIHooks, libname);
|
||||
}
|
||||
|
||||
if(dxw.dwFlags2 & HOOKGDI){
|
||||
HookLibrary(module, EmulateHooks, libname);
|
||||
@ -441,7 +460,6 @@ int WINAPI extGDISaveDC(HDC hdc)
|
||||
|
||||
ret=(*pGDISaveDC)(hdc);
|
||||
OutTraceD("GDI.SaveDC: hdc=%x ret=%x\n", hdc, ret);
|
||||
//AutoRefreshThread=CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)AutoRefresh, (LPVOID)hdc, 0, &dwThrdId);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -451,7 +469,6 @@ BOOL WINAPI extGDIRestoreDC(HDC hdc, int nSavedDC)
|
||||
|
||||
ret=(*pGDIRestoreDC)(hdc, nSavedDC);
|
||||
OutTraceD("GDI.RestoreDC: hdc=%x nSavedDC=%x ret=%x\n", hdc, nSavedDC, ret);
|
||||
//TerminateThread(AutoRefreshThread, 0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -466,7 +483,6 @@ HPALETTE WINAPI extGDICreatePalette(CONST LOGPALETTE *plpal)
|
||||
HPALETTE ret;
|
||||
int idx;
|
||||
|
||||
dxw.IsGDIPalette=TRUE;
|
||||
OutTraceD("GDI.CreatePalette: plpal=%x version=%x NumEntries=%x\n", plpal, plpal->palVersion, plpal->palNumEntries);
|
||||
ret=(*pGDICreatePalette)(plpal);
|
||||
if(IsDebug){
|
||||
@ -474,76 +490,83 @@ HPALETTE WINAPI extGDICreatePalette(CONST LOGPALETTE *plpal)
|
||||
for(idx=0; idx<plpal->palNumEntries; idx++) OutTraceD("(%x)", plpal->palPalEntry[idx]);
|
||||
OutTraceD("\n");
|
||||
}
|
||||
dxw.palVersion=plpal->palVersion;
|
||||
dxw.palNumEntries=plpal->palNumEntries;
|
||||
if(dxw.palNumEntries>256) dxw.palNumEntries=256;
|
||||
for(idx=0; idx<dxw.palNumEntries; idx++) dxw.palPalEntry[idx]=plpal->palPalEntry[idx];
|
||||
OutTraceD("GDI.CreatePalette: hPalette=%x\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
HPALETTE hDesktopPalette=NULL;
|
||||
|
||||
HPALETTE WINAPI extSelectPalette(HDC hdc, HPALETTE hpal, BOOL bForceBackground)
|
||||
{
|
||||
HPALETTE ret;
|
||||
|
||||
ret=(*pGDISelectPalette)(hdc, hpal, bForceBackground);
|
||||
OutTraceD("GDI.SelectPalette: hdc=%x hpal=%x ForceBackground=%x ret=%x\n", hdc, hpal, bForceBackground, ret);
|
||||
if((OBJ_DC == GetObjectType(hdc)) && (dxw.dwFlags1 & EMULATESURFACE)){
|
||||
OutTraceD("GDI.SelectPalette: register desktop palette hpal=%x\n", hpal);
|
||||
hDesktopPalette=hpal;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
BOOL WINAPI extAnimatePalette(HPALETTE hpal, UINT iStartIndex, UINT cEntries, const PALETTEENTRY *ppe)
|
||||
{
|
||||
// Invoked by "Pharaoh's Ascent 1.4"
|
||||
//STOPPER("AnimatePalette");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
UINT WINAPI extRealizePalette(HDC hdc)
|
||||
{
|
||||
UINT ret;
|
||||
extern void mySetPalette(int, int, LPPALETTEENTRY);
|
||||
|
||||
ret=(*pGDIRealizePalette)(hdc);
|
||||
OutTraceD("GDI.RealizePalette: hdc=%x ret=%x\n", hdc, ret);
|
||||
|
||||
if(!dxw.IsGDIPalette) return ret;
|
||||
|
||||
// quick & dirty implementation through a nasty global:
|
||||
// if the SelectPalette didn't force to the background (arg bForceBackground==FALSE)
|
||||
// then don't override the current palette set by the DirectDrawPalette class.
|
||||
// should be cleaned up a little....
|
||||
// maybe not: now both Diablo & Dementia colors are working...
|
||||
if(dxw.dwFlags1 & EMULATESURFACE)
|
||||
mySetPalette(0, dxw.palNumEntries, dxw.palPalEntry);
|
||||
// DEBUGGING
|
||||
if(IsDebug){
|
||||
int idx;
|
||||
OutTraceD("PaletteEntries[%x]= ", dxw.palNumEntries);
|
||||
for(idx=0; idx<dxw.palNumEntries; idx++) OutTraceD("(%x)", PaletteEntries[idx]);
|
||||
OutTraceD("\n");
|
||||
OutTraceD("GDI.RealizePalette: hdc=%x\n", hdc);
|
||||
if((OBJ_DC == GetObjectType(hdc)) && (dxw.dwFlags1 & EMULATESURFACE)){
|
||||
PALETTEENTRY PalEntries[256];
|
||||
UINT nEntries;
|
||||
nEntries=GetPaletteEntries(hDesktopPalette, 0, 255, PalEntries);
|
||||
mySetPalette(0, nEntries, PalEntries);
|
||||
if(IsDebug){
|
||||
UINT idx;
|
||||
OutTraceD("PaletteEntries[%x]= ", nEntries);
|
||||
for(idx=0; idx<256; idx++) OutTraceD("(%02x.%02x.%02x)", PalEntries[idx].peRed, PalEntries[idx].peGreen, PalEntries[idx].peBlue);
|
||||
OutTraceD("\n");
|
||||
}
|
||||
ret=DD_OK;
|
||||
}
|
||||
else
|
||||
ret=(*pGDIRealizePalette)(hdc);
|
||||
OutTraceD("GDI.RealizePalette: hdc=%x ret=%x\n", hdc, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// In emulated mode (when color depyth is 8BPP ?) it may happen that the game
|
||||
// expects to get the requested system palette entries, while the 32BPP screen
|
||||
// returns 0. "Mission Frce Cyberstorm" is one of these. Returning the same
|
||||
// returns 0. "Mission Force Cyberstorm" is one of these. Returning the same
|
||||
// value as nEntries, even though lppe is untouched, fixes the problem.
|
||||
|
||||
UINT WINAPI extGetSystemPaletteEntries(HDC hdc, UINT iStartIndex, UINT nEntries, LPPALETTEENTRY lppe)
|
||||
{
|
||||
int ret;
|
||||
|
||||
OutTraceD("GetSystemPaletteEntries: hdc=%x start=%d num=%d\n", hdc, iStartIndex, nEntries);
|
||||
ret=(*pGDIGetSystemPaletteEntries)(hdc, iStartIndex, nEntries, lppe);
|
||||
OutTraceD("GetSystemPaletteEntries: ret=%d\n", ret);
|
||||
if((ret == 0) && (dxw.dwFlags1 & EMULATESURFACE)) {
|
||||
//OutTraceD("GetSystemPaletteEntries: fixing ret=%d\n", nEntries);
|
||||
//ret = nEntries;
|
||||
// this seems to build a more reasonable system palette ....
|
||||
HPALETTE hpal;
|
||||
hpal=CreateHalftonePalette(NULL);
|
||||
GetPaletteEntries(hpal, iStartIndex, nEntries, lppe);
|
||||
ret = nEntries;
|
||||
OutTraceD("GetSystemPaletteEntries: fixing ret=%d\n", ret);
|
||||
ret = GetPaletteEntries(hpal, iStartIndex, nEntries, lppe);
|
||||
//ret = nEntries;
|
||||
OutTraceD("GetSystemPaletteEntries: fixing with halftone ret=%d\n", ret);
|
||||
if(IsDebug){
|
||||
UINT idx;
|
||||
OutTraceD("PaletteEntries[%x]= ", nEntries);
|
||||
for(idx=0; idx<nEntries; idx++) OutTraceD("(%02x.%02x.%02x)", lppe[idx].peRed, lppe[idx].peGreen, lppe[idx].peBlue);
|
||||
OutTraceD("\n");
|
||||
}
|
||||
for(UINT idx=iStartIndex; idx<iStartIndex+nEntries; idx++) lppe[idx].peFlags=0; // not useful, but ....
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -591,6 +614,7 @@ BOOL WINAPI extDDDeleteDC(HDC hdc)
|
||||
return res;
|
||||
}
|
||||
|
||||
#if 1
|
||||
static HDC WINAPI winDDGetDC(HWND hwnd, char *api)
|
||||
{
|
||||
HDC hdc;
|
||||
@ -601,7 +625,6 @@ static HDC WINAPI winDDGetDC(HWND hwnd, char *api)
|
||||
|
||||
dxw.ResetPrimarySurface();
|
||||
dxw.SetPrimarySurface();
|
||||
|
||||
if(dxw.IsRealDesktop(hwnd)) hwnd=dxw.GethWnd();
|
||||
|
||||
if(dxw.lpDDSPrimHDC){
|
||||
@ -637,6 +660,42 @@ static HDC WINAPI winDDGetDC(HWND hwnd, char *api)
|
||||
OutTraceE("%s: ERROR err=%d at %d\n", api, GetLastError, __LINE__);
|
||||
return(hdc);
|
||||
}
|
||||
#else
|
||||
HDC hPrimaryDC=NULL;
|
||||
static HDC WINAPI winDDGetDC(HWND hwnd, char *api)
|
||||
{
|
||||
HDC hdc;
|
||||
//HRESULT res;
|
||||
//extern HRESULT WINAPI extGetDC(LPDIRECTDRAWSURFACE, HDC FAR *);
|
||||
|
||||
OutTraceD("%s: hwnd=%x\n", api, hwnd);
|
||||
|
||||
//dxw.ResetPrimarySurface();
|
||||
//dxw.SetPrimarySurface();
|
||||
if(dxw.IsRealDesktop(hwnd) && dxw.IsFullScreen()){
|
||||
LPDIRECTDRAWSURFACE lpPrim;
|
||||
HDC PrimDC;
|
||||
lpPrim=dxw.GetPrimarySurface();
|
||||
(*pGetDC)(lpPrim, &PrimDC);
|
||||
hdc=(*pGDICreateCompatibleDC)(PrimDC);
|
||||
(*pReleaseDC)(lpPrim, PrimDC);
|
||||
OutTraceD("%s: returning DDRAW DC handle hwnd=%x hdc=%x\n", api, hwnd, hdc);
|
||||
hPrimaryDC=hdc;
|
||||
return hdc;
|
||||
}
|
||||
else {
|
||||
hdc=(*pGDIGetDC)(hwnd ? hwnd : dxw.GethWnd());
|
||||
OutTraceD("%s: returning window DC handle hwnd=%x hdc=%x\n", api, hwnd, hdc);
|
||||
//PrimHDC=NULL;
|
||||
}
|
||||
|
||||
if(hdc)
|
||||
OutTraceD("%s: hwnd=%x hdc=%x\n", api, hwnd, hdc);
|
||||
else
|
||||
OutTraceE("%s: ERROR err=%d at %d\n", api, GetLastError, __LINE__);
|
||||
return(hdc);
|
||||
}
|
||||
#endif
|
||||
|
||||
HDC WINAPI extDDCreateDC(LPSTR Driver, LPSTR Device, LPSTR Output, CONST DEVMODE *InitData)
|
||||
{
|
||||
@ -677,6 +736,7 @@ HDC WINAPI extDDGetWindowDC(HWND hwnd)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if 1
|
||||
int WINAPI extDDReleaseDC(HWND hwnd, HDC hDC)
|
||||
{
|
||||
int res;
|
||||
@ -698,6 +758,27 @@ int WINAPI extDDReleaseDC(HWND hwnd, HDC hDC)
|
||||
}
|
||||
return(res);
|
||||
}
|
||||
#else
|
||||
int WINAPI extDDReleaseDC(HWND hwnd, HDC hDC)
|
||||
{
|
||||
int res;
|
||||
extern HRESULT WINAPI extReleaseDC(LPDIRECTDRAWSURFACE, HDC);
|
||||
|
||||
OutTraceD("GDI.ReleaseDC: hwnd=%x hdc=%x\n", hwnd, hDC);
|
||||
res=0;
|
||||
if (hDC == hPrimaryDC){
|
||||
OutTraceD("GDI.ReleaseDC: refreshing primary surface lpdds=%x\n",dxw.lpDDSPrimHDC);
|
||||
//extReleaseDC(dxw.lpDDSPrimHDC, hDC);
|
||||
hPrimaryDC=NULL;
|
||||
res=1; // 1 = OK
|
||||
}
|
||||
else {
|
||||
res=(*pGDIReleaseDC)(hwnd, hDC);
|
||||
if (!res) OutTraceE("GDI.ReleaseDC: ERROR err=%d at %d\n", GetLastError(), __LINE__);
|
||||
}
|
||||
return(res);
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOL WINAPI extDDBitBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HDC hdcSrc, int nXSrc, int nYSrc, DWORD dwRop)
|
||||
{
|
||||
@ -720,9 +801,7 @@ BOOL WINAPI extDDBitBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHe
|
||||
|
||||
res=(*pGDIBitBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop);
|
||||
if(!res) OutTraceE("GDI.BitBlt: ERROR err=%d at %d\n", GetLastError(), __LINE__);
|
||||
|
||||
res=(*pGDIBitBlt)(NULL, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop);
|
||||
|
||||
if(!res) ret=0;
|
||||
return ret;
|
||||
}
|
||||
@ -806,14 +885,13 @@ BOOL WINAPI extGDIBitBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nH
|
||||
OutTraceD("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));
|
||||
|
||||
OutTraceB("GDI.StretchBlt: DEBUG FullScreen=%x target hdctype=%x(%s) hwnd=%x\n",
|
||||
OutTraceB("GDI.BitBlt: DEBUG FullScreen=%x target hdctype=%x(%s) hwnd=%x\n",
|
||||
dxw.IsFullScreen(), GetObjectType(hdcDest), ExplainDCType(GetObjectType(hdcDest)), WindowFromDC(hdcDest));
|
||||
|
||||
// beware: HDC could refer to screen DC that are written directly on screen, or memory DC that will be scaled to
|
||||
// the screen surface later on, on ReleaseDC or ddraw Blit / Flip operation. Scaling of rect coordinates is
|
||||
// needed only in the first case, and must be avoided on the second, otherwise the image would be scaled twice!
|
||||
|
||||
res=0;
|
||||
if (OBJ_DC == GetObjectType(hdcDest)){
|
||||
if (dxw.HandleFPS()) return TRUE;
|
||||
if (dxw.dwFlags3 & NOGDIBLT) return TRUE;
|
||||
@ -836,6 +914,10 @@ BOOL WINAPI extGDIBitBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nH
|
||||
if (dxw.dwFlags2 & SHOWFPSOVERLAY) dxw.ShowFPS(hdcDest);
|
||||
OutTrace("Debug: NULL dest=(%d,%d) size=(%d,%d)\n", nXDest, nYDest, nWDest, nHDest);
|
||||
}
|
||||
else{
|
||||
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);
|
||||
}
|
||||
}
|
||||
else {
|
||||
res=(*pGDIBitBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop);
|
||||
@ -1643,6 +1725,13 @@ int WINAPI extAddFontResourceW(LPCWSTR lpszFontFile)
|
||||
if(!res) OutTraceE("AddFontResource: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
|
||||
}
|
||||
|
||||
UINT WINAPI extSetSystemPaletteUse(HDC hdc, UINT uUsage)
|
||||
{
|
||||
//BOOL res;
|
||||
OutTraceD("SetSystemPaletteUse: hdc=%x Usage=%x(%s)\n", hdc, uUsage, ExplainPaletteUse(uUsage));
|
||||
return SYSPAL_NOSTATIC256;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// to map:
|
||||
// GetCurrentPositionEx
|
||||
|
@ -693,6 +693,15 @@ HRESULT WINAPI extCreatePaletteProxy(LPDIRECTDRAW lpdd, DWORD dwflags, LPPALETTE
|
||||
HRESULT res;
|
||||
|
||||
OutTraceP("CreatePalette(D): PROXED lpdd=%x dwFlags=%x(%s)\n", lpdd, dwflags, ExplainCreatePaletteFlags(dwflags));
|
||||
if(IsDebug && (dwflags & DDPCAPS_8BIT)){
|
||||
int idx;
|
||||
OutTrace("CreatePalette: ");
|
||||
for(idx=0; idx<256; idx++) OutTrace("(%02x.%02x.%02x)",
|
||||
lpddpa[idx].peRed,
|
||||
lpddpa[idx].peGreen,
|
||||
lpddpa[idx].peBlue );
|
||||
OutTrace("\n");
|
||||
}
|
||||
res = (*pCreatePalette)(lpdd, dwflags, lpddpa, lplpddp, pu);
|
||||
if (res) {
|
||||
OutTraceP("CreatePalette(D): ERROR res=%x(%s)\n", res, ExplainDDError(res));
|
||||
@ -2042,6 +2051,12 @@ UINT WINAPI extGetSystemPaletteEntriesProxy(HDC hdc, UINT iStartIndex, UINT nEnt
|
||||
|
||||
ret=(*pGDIGetSystemPaletteEntries)(hdc, iStartIndex, nEntries, lppe);
|
||||
OutTrace("GDI.GetSystemPaletteEntries: PROXED hdc=%x start=%d num=%d ret=%d\n", hdc, iStartIndex, nEntries, ret);
|
||||
if(ret && IsDebug){
|
||||
UINT idx;
|
||||
OutTraceD("PaletteEntries[%x]= ", nEntries);
|
||||
for(idx=iStartIndex; idx<nEntries; idx++) OutTraceD("(%02x.%02x.%02x-F%02x)", lppe[idx].peRed, lppe[idx].peGreen, lppe[idx].peBlue, lppe[idx].peFlags);
|
||||
OutTraceD("\n");
|
||||
}
|
||||
if(!ret) OutTrace("GDI.GetSystemPaletteEntries: ERROR err=%d\n", GetLastError());
|
||||
return ret;
|
||||
}
|
||||
|
@ -317,8 +317,6 @@ HMODULE WINAPI LoadLibraryExWrapper(LPCTSTR lpFileName, HANDLE hFile, DWORD dwFl
|
||||
HMODULE libhandle;
|
||||
int idx;
|
||||
|
||||
//if(!strcmp(lpFileName, "d3d9.dll") && GetModuleHandle(lpFileName)) return GetModuleHandle(lpFileName); // attempt to avoid loading same dll twice....
|
||||
|
||||
libhandle=(*pLoadLibraryExA)(lpFileName, hFile, dwFlags);
|
||||
OutTraceD("%s: FileName=%s hFile=%x Flags=%x(%s) hmodule=%x\n", api, lpFileName, hFile, dwFlags, ExplainLoadLibFlags(dwFlags), libhandle);
|
||||
if(!libhandle){
|
||||
|
@ -88,6 +88,8 @@ typedef BOOL (WINAPI *GetViewportOrgEx_Type)(HDC, LPPOINT);
|
||||
typedef BOOL (WINAPI *GetWindowOrgEx_Type)(HDC, LPPOINT);
|
||||
typedef BOOL (WINAPI *SetWindowOrgEx_Type)(HDC, int, int, LPPOINT);
|
||||
typedef BOOL (WINAPI *GetCurrentPositionEx_Type)(HDC, LPPOINT);
|
||||
typedef BOOL (WINAPI *AnimatePalette_Type)(HPALETTE, UINT, UINT, const PALETTEENTRY *);
|
||||
typedef UINT (WINAPI *SetSystemPaletteUse_Type)(HDC, UINT);
|
||||
|
||||
// Kernel32.dll:
|
||||
typedef BOOL (WINAPI *GetDiskFreeSpaceA_Type)(LPCSTR, LPDWORD, LPDWORD, LPDWORD, LPDWORD);
|
||||
@ -271,6 +273,8 @@ DXWEXTERN CreateScalableFontResourceA_Type pCreateScalableFontResourceA DXWINITI
|
||||
DXWEXTERN AddFontResourceA_Type pAddFontResourceA DXWINITIALIZED;
|
||||
DXWEXTERN CreateScalableFontResourceW_Type pCreateScalableFontResourceW DXWINITIALIZED;
|
||||
DXWEXTERN AddFontResourceW_Type pAddFontResourceW DXWINITIALIZED;
|
||||
DXWEXTERN AnimatePalette_Type pAnimatePalette DXWINITIALIZED;
|
||||
DXWEXTERN SetSystemPaletteUse_Type pSetSystemPaletteUse DXWINITIALIZED;
|
||||
|
||||
// Kernel32.dll:
|
||||
DXWEXTERN GetDiskFreeSpaceA_Type pGetDiskFreeSpaceA DXWINITIALIZED;
|
||||
@ -443,6 +447,8 @@ extern BOOL WINAPI extCreateScalableFontResourceA(DWORD, LPCTSTR, LPCTSTR, LPCTS
|
||||
extern int WINAPI extAddFontResourceA(LPCTSTR);
|
||||
extern BOOL WINAPI extCreateScalableFontResourceW(DWORD, LPCWSTR, LPCWSTR, LPCWSTR);
|
||||
extern int WINAPI extAddFontResourceW(LPCWSTR);
|
||||
extern BOOL WINAPI extAnimatePalette(HPALETTE, UINT, UINT, const PALETTEENTRY *);
|
||||
extern UINT WINAPI extSetSystemPaletteUse(HDC, UINT);
|
||||
|
||||
// Kernel32.dll:
|
||||
extern BOOL WINAPI extGetDiskFreeSpaceA(LPCSTR, LPDWORD, LPDWORD, LPDWORD, LPDWORD);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -130,9 +130,13 @@ static char *libname = "user32.dll";
|
||||
void HookUser32(HMODULE hModule)
|
||||
{
|
||||
HookLibrary(hModule, Hooks, libname);
|
||||
if ((dxw.dwFlags3 & EMULATEDC) || (dxw.dwFlags2 & HOOKGDI) || (dxw.dwFlags1 & MAPGDITOPRIMARY))
|
||||
HookLibrary(hModule, EmulateHooks, libname);
|
||||
HookLibrary(hModule, (dxw.dwFlags1 & MAPGDITOPRIMARY) ? DDHooks : GDIHooks, libname);
|
||||
//if ((dxw.dwFlags3 & EMULATEDC) || (dxw.dwFlags2 & HOOKGDI) || (dxw.dwFlags1 & MAPGDITOPRIMARY))
|
||||
// HookLibrary(hModule, EmulateHooks, libname);
|
||||
//HookLibrary(hModule, (dxw.dwFlags1 & MAPGDITOPRIMARY) ? DDHooks : GDIHooks, libname);
|
||||
if (dxw.dwFlags3 & EMULATEDC) HookLibrary(hModule, EmulateHooks, libname);
|
||||
if (dxw.dwFlags2 & HOOKGDI) HookLibrary(hModule, GDIHooks, libname);
|
||||
if (dxw.dwFlags1 & MAPGDITOPRIMARY) HookLibrary(hModule, DDHooks, libname);
|
||||
|
||||
if (dxw.dwFlags1 & CLIENTREMAPPING) HookLibrary(hModule, RemapHooks, libname);
|
||||
if(dxw.dwFlags1 & MODIFYMOUSE)HookLibrary(hModule, MouseHooks, libname);
|
||||
if (dxw.dwFlags1 & (PREVENTMAXIMIZE|FIXWINFRAME|LOCKWINPOS|LOCKWINSTYLE))HookLibrary(hModule, WinHooks, libname);
|
||||
@ -1236,17 +1240,17 @@ int WINAPI extFillRect(HDC hdc, const RECT *lprc, HBRUSH hbr)
|
||||
OutTraceD("FillRect: hdc=%x hbrush=%x rect=(%d,%d)-(%d,%d)\n", hdc, hbr, lprc->left, lprc->top, lprc->right, lprc->bottom);
|
||||
|
||||
// when not in fullscreen mode, just proxy the call
|
||||
if(!dxw.IsFullScreen()) return (*pFillRect)(hdc, lprc, hbr);
|
||||
// better not: some games may use excessive coordinates: see "Premier Manager 98"
|
||||
// if(!dxw.IsFullScreen()) return (*pFillRect)(hdc, lprc, hbr);
|
||||
|
||||
memcpy(&rc, lprc, sizeof(rc));
|
||||
if(OBJ_DC == GetObjectType(hdc)){
|
||||
if(rc.left < 0) rc.left = 0;
|
||||
if(rc.top < 0) rc.top = 0;
|
||||
if((DWORD)rc.right > dxw.GetScreenWidth()) rc.right = dxw.GetScreenWidth();
|
||||
if((DWORD)rc.bottom > dxw.GetScreenHeight()) rc.bottom = dxw.GetScreenHeight();
|
||||
dxw.MapClient(&rc);
|
||||
OutTraceD("FillRect: fixed rect=(%d,%d)-(%d,%d)\n", rc.left, rc.top, rc.right, rc.bottom);
|
||||
}
|
||||
if(rc.left < 0) rc.left = 0;
|
||||
if(rc.top < 0) rc.top = 0;
|
||||
if((DWORD)rc.right > dxw.GetScreenWidth()) rc.right = dxw.GetScreenWidth();
|
||||
if((DWORD)rc.bottom > dxw.GetScreenHeight()) rc.bottom = dxw.GetScreenHeight();
|
||||
if(OBJ_DC == GetObjectType(hdc)) dxw.MapWindow(&rc);
|
||||
//else dxw.MapClient(&rc);
|
||||
OutTraceD("FillRect: fixed rect=(%d,%d)-(%d,%d)\n", rc.left, rc.top, rc.right, rc.bottom);
|
||||
|
||||
res=(*pFillRect)(hdc, &rc, hbr);
|
||||
return res;
|
||||
|
@ -33,6 +33,9 @@ END_MESSAGE_MAP()
|
||||
|
||||
// CPaletteDialog message handlers
|
||||
|
||||
CDib dib;
|
||||
CWnd *myWin;
|
||||
|
||||
void CPaletteDialog::OnTimer(UINT_PTR nIDEvent)
|
||||
{
|
||||
DXWNDSTATUS DxWndStatus;
|
||||
@ -41,14 +44,14 @@ void CPaletteDialog::OnTimer(UINT_PTR nIDEvent)
|
||||
extern TARGETMAP *pTargets;
|
||||
RECT Rect;
|
||||
int h, w;
|
||||
static BOOL PaletteUpdated = FALSE;
|
||||
|
||||
DxStatus=GetHookStatus(&DxWndStatus);
|
||||
this->GetDC()->GetWindow()->GetClientRect(&Rect);
|
||||
myWin->GetClientRect(&Rect);
|
||||
h=Rect.bottom - Rect.top;
|
||||
w=Rect.right - Rect.left;
|
||||
if((h==0) || (w==0)) return;
|
||||
|
||||
CDib dib;
|
||||
dib.ReadFromResource(IDB_PALETTE);
|
||||
if(DxStatus==DXW_RUNNING){
|
||||
for(int row=0; row<16; row++){
|
||||
for(int col=0; col<16; col++){
|
||||
@ -61,13 +64,26 @@ void CPaletteDialog::OnTimer(UINT_PTR nIDEvent)
|
||||
dib.SetPixel(col, row, rgbq);
|
||||
}
|
||||
}
|
||||
PaletteUpdated = TRUE;
|
||||
}
|
||||
dib.Draw(this->GetDC(), CRect(0, 0, w, h), CRect(0, 0, 16, 16));
|
||||
else{
|
||||
if (PaletteUpdated) dib.ReadFromResource(IDB_PALETTE);
|
||||
PaletteUpdated = FALSE;
|
||||
}
|
||||
|
||||
CDC *dc;
|
||||
dc=this->GetDC();
|
||||
if(dc) dib.Draw(dc, CRect(0, 0, w, h), CRect(0, 0, 16, 16));
|
||||
this->ReleaseDC(dc);
|
||||
}
|
||||
|
||||
BOOL CPaletteDialog::OnInitDialog()
|
||||
{
|
||||
CDC *myDC;
|
||||
CDialog::OnInitDialog();
|
||||
if((myDC=this->GetDC())==NULL) return FALSE;
|
||||
if((myWin=myDC->GetWindow())==NULL) return FALSE;
|
||||
dib.ReadFromResource(IDB_PALETTE);
|
||||
SetTimer(IDPaletteTIMER, 200, NULL);
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
@ -76,7 +92,8 @@ BOOL CPaletteDialog::OnInitDialog()
|
||||
void CPaletteDialog::OnOK()
|
||||
{
|
||||
// TODO: Add your specialized code here and/or call the base class
|
||||
KillTimer(IDPaletteTIMER);
|
||||
// stop timer
|
||||
KillTimer(IDPaletteTIMER);
|
||||
// delete(dib);
|
||||
CDialog::OnOK();
|
||||
}
|
||||
|
@ -183,10 +183,11 @@
|
||||
#define IDC_CAPMASK 1136
|
||||
#define IDC_FORCESHEL 1137
|
||||
#define IDC_COLORFIX 1138
|
||||
#define IDC_NODDRAWBLIT 1139
|
||||
#define IDC_NODDRAWBLT 1139
|
||||
#define IDC_NODDRAWFLIP 1140
|
||||
#define IDC_NOGDIBLT 1141
|
||||
#define IDC_NOPIXELFORMAT 1142
|
||||
#define IDC_NOALPHACHANNEL 1143
|
||||
#define ID_MODIFY 32771
|
||||
#define ID_DELETE 32772
|
||||
#define ID_ADD 32773
|
||||
|
@ -40,6 +40,8 @@ void CTabDirectX::DoDataExchange(CDataExchange* pDX)
|
||||
DDX_Check(pDX, IDC_DISABLEHAL, cTarget->m_DisableHAL);
|
||||
DDX_Check(pDX, IDC_FORCESHEL, cTarget->m_ForcesHEL);
|
||||
DDX_Check(pDX, IDC_COLORFIX, cTarget->m_ColorFix);
|
||||
DDX_Check(pDX, IDC_NOPIXELFORMAT, cTarget->m_NoPixelFormat);
|
||||
DDX_Check(pDX, IDC_NOALPHACHANNEL, cTarget->m_NoAlphaChannel);
|
||||
//DDX_Check(pDX, IDC_SAVECAPS, cTarget->m_SaveCaps);
|
||||
// DirectInput
|
||||
DDX_Check(pDX, IDC_HOOKDI, cTarget->m_HookDI);
|
||||
|
@ -40,6 +40,8 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
|
||||
m_DisableHAL = FALSE;
|
||||
m_ForcesHEL = FALSE;
|
||||
m_ColorFix = FALSE;
|
||||
m_NoPixelFormat = FALSE;
|
||||
m_NoAlphaChannel = FALSE;
|
||||
m_LockSysColors = FALSE;
|
||||
m_ForceYUVtoRGB = FALSE;
|
||||
m_ForceRGBtoYUV = FALSE;
|
||||
|
@ -120,6 +120,8 @@ public:
|
||||
BOOL m_DisableHAL;
|
||||
BOOL m_ForcesHEL;
|
||||
BOOL m_ColorFix;
|
||||
BOOL m_NoPixelFormat;
|
||||
BOOL m_NoAlphaChannel;
|
||||
BOOL m_LockSysColors;
|
||||
BOOL m_SaveCaps;
|
||||
BOOL m_SingleProcAffinity;
|
||||
|
Binary file not shown.
@ -314,9 +314,9 @@ BEGIN
|
||||
CONTROL "Locked Surface",IDC_LOCKEDSURFACE,"Button",BS_AUTORADIOBUTTON,14,144,67,12
|
||||
CONTROL "Primary Surface",IDC_EMULATESURFACE,"Button",BS_AUTORADIOBUTTON,14,156,77,12
|
||||
GROUPBOX "DirectX Version Hook",IDC_STATIC,6,3,98,103,WS_GROUP
|
||||
GROUPBOX "Emulation",IDC_STATIC,7,109,98,61,WS_GROUP
|
||||
GROUPBOX "Emulation",IDC_STATIC,7,109,98,66,WS_GROUP
|
||||
CONTROL "Auto Primary Surface Refresh",IDC_AUTOREFRESH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,16,126,9
|
||||
GROUPBOX "DirectDraw Surface handling",IDC_STATIC,112,3,181,167
|
||||
GROUPBOX "DirectDraw Surface handling",IDC_STATIC,112,3,181,173
|
||||
CONTROL "switch VIDEO to SYSTEM on fail",IDC_VIDEOTOSYSTEMMEM,
|
||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,118,28,126,9
|
||||
CONTROL "Suppress DX common errors",IDC_SUPPRESSDXERRORS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,40,127,10
|
||||
@ -338,12 +338,15 @@ BEGIN
|
||||
EDITTEXT IDC_MINY,97,209,17,14,ES_AUTOHSCROLL,WS_EX_RIGHT
|
||||
EDITTEXT IDC_MAXX,124,209,17,14,ES_AUTOHSCROLL,WS_EX_RIGHT
|
||||
EDITTEXT IDC_MAXY,148,209,17,14,ES_AUTOHSCROLL,WS_EX_RIGHT
|
||||
CONTROL "DirectInput Hooking",IDC_HOOKDI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,182,97,12
|
||||
GROUPBOX "DirectInput",IDC_STATIC,7,172,286,61
|
||||
CONTROL "DirectInput Hooking",IDC_HOOKDI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,183,210,97,12
|
||||
GROUPBOX "DirectInput",IDC_STATIC,7,176,286,57
|
||||
CONTROL "Set AERO compatible mode",IDC_SETCOMPATIBILITY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,100,109,12
|
||||
CONTROL "Disable HAL support",IDC_DISABLEHAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,112,109,12
|
||||
CONTROL "Forces HEL ",IDC_FORCESHEL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,124,109,12
|
||||
CONTROL "Win7 color fix",IDC_COLORFIX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,136,109,12
|
||||
CONTROL "Don't fix the Pixel Format",IDC_NOPIXELFORMAT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,148,109,12
|
||||
CONTROL "by default set no ALPHACHANNEL",IDC_NOALPHACHANNEL,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,160,123,12
|
||||
END
|
||||
|
||||
IDD_TAB_MOUSE DIALOGEX 0, 0, 300, 240
|
||||
|
Binary file not shown.
@ -160,6 +160,8 @@ static void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg)
|
||||
if(dlg->m_DisableHAL) t->flags3 |= DISABLEHAL;
|
||||
if(dlg->m_ForcesHEL) t->flags3 |= FORCESHEL;
|
||||
if(dlg->m_ColorFix) t->flags3 |= COLORFIX;
|
||||
if(dlg->m_NoPixelFormat) t->flags3 |= NOPIXELFORMAT;
|
||||
if(dlg->m_NoAlphaChannel) t->flags4 |= NOALPHACHANNEL;
|
||||
if(dlg->m_LockSysColors) t->flags3 |= LOCKSYSCOLORS;
|
||||
if(dlg->m_ForceYUVtoRGB) t->flags3 |= YUV2RGB;
|
||||
if(dlg->m_ForceRGBtoYUV) t->flags3 |= RGB2YUV;
|
||||
@ -290,6 +292,8 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg)
|
||||
dlg->m_DisableHAL = t->flags3 & DISABLEHAL ? 1 : 0;
|
||||
dlg->m_ForcesHEL = t->flags3 & FORCESHEL ? 1 : 0;
|
||||
dlg->m_ColorFix = t->flags3 & COLORFIX ? 1 : 0;
|
||||
dlg->m_NoPixelFormat = t->flags3 & NOPIXELFORMAT ? 1 : 0;
|
||||
dlg->m_NoAlphaChannel = t->flags4 & NOALPHACHANNEL ? 1 : 0;
|
||||
dlg->m_LockSysColors = t->flags3 & LOCKSYSCOLORS ? 1 : 0;
|
||||
dlg->m_ForceRGBtoYUV = t->flags3 & RGB2YUV ? 1 : 0;
|
||||
dlg->m_ForceYUVtoRGB = t->flags3 & YUV2RGB ? 1 : 0;
|
||||
|
BIN
host/res/palette0.bmp
Normal file
BIN
host/res/palette0.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 314 B |
Loading…
x
Reference in New Issue
Block a user