make ddraw.dll lite more msvs frendly

svn path=/trunk/; revision=27184
This commit is contained in:
Magnus Olsen 2007-06-15 10:21:54 +00:00
parent 4db57afdf1
commit 4f5eb73a1f
4 changed files with 27 additions and 12 deletions

View file

@ -47,10 +47,10 @@ Main_DirectDraw_EnumDisplayModes(LPDIRECTDRAW7 iface, DWORD dwFlags,
while (EnumDisplaySettingsEx(NULL, iMode, &DevMode, 0) == TRUE) while (EnumDisplaySettingsEx(NULL, iMode, &DevMode, 0) == TRUE)
{ {
DX_STUB_str("here\n");
DDSURFACEDESC2 SurfaceDesc; DDSURFACEDESC2 SurfaceDesc;
DX_STUB_str("here\n");
iMode++; iMode++;
SurfaceDesc.dwSize = sizeof (DDSURFACEDESC2); SurfaceDesc.dwSize = sizeof (DDSURFACEDESC2);
@ -121,10 +121,10 @@ Main_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidth, DWORD dwHeig
DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags) DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags)
{ {
LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface; LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
DX_WINDBG_trace();
HRESULT ret = DD_OK; HRESULT ret = DD_OK;
DX_STUB_str("here\n");
_SEH_TRY _SEH_TRY
{ {
// FIXME: Check primary if surface is locked / busy etc. // FIXME: Check primary if surface is locked / busy etc.
@ -145,6 +145,7 @@ Main_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidth, DWORD dwHeig
} }
else else
{ {
LONG retval;
// Here we go // Here we go
DEVMODE DevMode; DEVMODE DevMode;
DevMode.dmFields = 0; DevMode.dmFields = 0;
@ -163,7 +164,8 @@ Main_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidth, DWORD dwHeig
DevMode.dmBitsPerPel = dwBPP; DevMode.dmBitsPerPel = dwBPP;
DevMode.dmDisplayFrequency = dwRefreshRate; DevMode.dmDisplayFrequency = dwRefreshRate;
LONG retval = ChangeDisplaySettings(&DevMode, CDS_FULLSCREEN); /* FIXME: Are we supposed to set CDS_SET_PRIMARY as well ? */ retval = ChangeDisplaySettings(&DevMode, CDS_FULLSCREEN);
/* FIXME: Are we supposed to set CDS_SET_PRIMARY as well ? */
if(retval == DISP_CHANGE_BADMODE) if(retval == DISP_CHANGE_BADMODE)
{ {
@ -200,10 +202,12 @@ Main_DirectDraw_RestoreDisplayMode (LPDIRECTDRAW7 iface)
_SEH_TRY _SEH_TRY
{ {
BOOL ModeChanged;
ChangeDisplaySettings(NULL, 0); ChangeDisplaySettings(NULL, 0);
// Update Interals // Update Interals
BOOL ModeChanged;
This->lpLcl->lpGbl->hDD = This->lpLcl->hDD; This->lpLcl->lpGbl->hDD = This->lpLcl->hDD;
DdReenableDirectDrawObject(This->lpLcl->lpGbl, &ModeChanged); DdReenableDirectDrawObject(This->lpLcl->lpGbl, &ModeChanged);

View file

@ -6,7 +6,7 @@
<define name="WINVER">0x0600</define> <define name="WINVER">0x0600</define>
<define name="_WIN32_WINNT">0x0501</define> <define name="_WIN32_WINNT">0x0501</define>
<library>ntdll</library>
<library>kernel32</library> <library>kernel32</library>
<library>user32</library> <library>user32</library>
<library>gdi32</library> <library>gdi32</library>

View file

@ -192,7 +192,7 @@ VOID Hal_DirectDraw_Release (LPDIRECTDRAW7);
} \ } \
return DD_OK; return DD_OK;
#ifdef __GNU__
#define DX_STUB_str(x) \ #define DX_STUB_str(x) \
{ \ { \
char buffer[1024]; \ char buffer[1024]; \
@ -200,6 +200,7 @@ VOID Hal_DirectDraw_Release (LPDIRECTDRAW7);
OutputDebugStringA(buffer); \ OutputDebugStringA(buffer); \
} }
#define DX_WINDBG_trace() \ #define DX_WINDBG_trace() \
static BOOL firstcallx = TRUE; \ static BOOL firstcallx = TRUE; \
if (firstcallx) \ if (firstcallx) \
@ -210,6 +211,8 @@ VOID Hal_DirectDraw_Release (LPDIRECTDRAW7);
firstcallx = TRUE; \ firstcallx = TRUE; \
} }
#define DX_WINDBG_trace_res(width,height,bpp) \ #define DX_WINDBG_trace_res(width,height,bpp) \
static BOOL firstcallxx = TRUE; \ static BOOL firstcallxx = TRUE; \
if (firstcallxx) \ if (firstcallxx) \
@ -220,4 +223,10 @@ VOID Hal_DirectDraw_Release (LPDIRECTDRAW7);
firstcallxx = FALSE; \ firstcallxx = FALSE; \
} }
#else
#define DX_WINDBG_trace() //
#define DX_STUB_str(x) //
#define DX_WINDBG_trace_res(width,height,bpp) //
#endif
#endif /* __DDRAW_PRIVATE */ #endif /* __DDRAW_PRIVATE */

View file

@ -37,11 +37,11 @@ Create_DirectDraw (LPGUID pGUID, LPDIRECTDRAW* pIface,
/* fixme linking too second link when we shall not doing it */ /* fixme linking too second link when we shall not doing it */
if (IsBadReadPtr(This,sizeof(LPDIRECTDRAW))) if (IsBadReadPtr(This,sizeof(LPDIRECTDRAW)))
{ {
DX_STUB_str("1. no linking\n");
/* We do not have a DirectDraw interface, we need alloc it*/ /* We do not have a DirectDraw interface, we need alloc it*/
LPDDRAWI_DIRECTDRAW_INT memThis; LPDDRAWI_DIRECTDRAW_INT memThis;
DX_STUB_str("1. no linking\n");
DxHeapMemAlloc(memThis, sizeof(DDRAWI_DIRECTDRAW_INT)); DxHeapMemAlloc(memThis, sizeof(DDRAWI_DIRECTDRAW_INT));
if (memThis == NULL) if (memThis == NULL)
{ {
@ -60,10 +60,11 @@ Create_DirectDraw (LPGUID pGUID, LPDIRECTDRAW* pIface,
} }
else else
{ {
DX_STUB_str("2.linking\n");
/* We got the DirectDraw interface alloc and we need create the link */ /* We got the DirectDraw interface alloc and we need create the link */
LPDDRAWI_DIRECTDRAW_INT newThis; LPDDRAWI_DIRECTDRAW_INT newThis;
DX_STUB_str("2.linking\n");
/* step 1.Alloc the new DDRAWI_DIRECTDRAW_INT for the lnking */ /* step 1.Alloc the new DDRAWI_DIRECTDRAW_INT for the lnking */
DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT)); DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT));
if (newThis == NULL) if (newThis == NULL)
@ -378,6 +379,7 @@ StartDirectDrawHal(LPDIRECTDRAW iface, BOOL reenable)
D3DHAL_GLOBALDRIVERDATA mD3dDriverData; D3DHAL_GLOBALDRIVERDATA mD3dDriverData;
DDHAL_DDEXEBUFCALLBACKS mD3dBufferCallbacks; DDHAL_DDEXEBUFCALLBACKS mD3dBufferCallbacks;
LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface; LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
DDHAL_GETDRIVERINFODATA DdGetDriverInfo = { 0 };
DX_WINDBG_trace(); DX_WINDBG_trace();
@ -533,7 +535,7 @@ StartDirectDrawHal(LPDIRECTDRAW iface, BOOL reenable)
/* FIXME D3D setup mD3dCallbacks and mD3dDriverData */ /* FIXME D3D setup mD3dCallbacks and mD3dDriverData */
DDHAL_GETDRIVERINFODATA DdGetDriverInfo = { 0 };
if (mHALInfo.dwFlags & DDHALINFO_GETDRIVERINFOSET) if (mHALInfo.dwFlags & DDHALINFO_GETDRIVERINFOSET)