mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +01:00
make real ddraw fully optional (keep old XP workaround..)
This commit is contained in:
parent
45ceb74df2
commit
eced18d01f
@ -53,7 +53,7 @@ void DrawFrameInfoStart()
|
|||||||
DWORD tick_start = timeGetTime();
|
DWORD tick_start = timeGetTime();
|
||||||
if (tick_start >= tick_fps)
|
if (tick_start >= tick_fps)
|
||||||
{
|
{
|
||||||
snprintf(
|
_snprintf(
|
||||||
debugText,
|
debugText,
|
||||||
sizeof(debugText),
|
sizeof(debugText),
|
||||||
"FPS: %lu | Time: %2.2f ms ",
|
"FPS: %lu | Time: %2.2f ms ",
|
||||||
|
21
src/main.c
21
src/main.c
@ -1323,12 +1323,10 @@ HRESULT WINAPI DirectDrawCreate(GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnk
|
|||||||
if(ddraw)
|
if(ddraw)
|
||||||
{
|
{
|
||||||
/* FIXME: check the calling module before passing the call! */
|
/* FIXME: check the calling module before passing the call! */
|
||||||
return ddraw->DirectDrawCreate(lpGUID, lplpDD, pUnkOuter);
|
if (ddraw->DirectDrawCreate)
|
||||||
|
return ddraw->DirectDrawCreate(lpGUID, lplpDD, pUnkOuter);
|
||||||
|
|
||||||
/*
|
|
||||||
printf(" returning DDERR_DIRECTDRAWALREADYCREATED\n");
|
|
||||||
return DDERR_DIRECTDRAWALREADYCREATED;
|
return DDERR_DIRECTDRAWALREADYCREATED;
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IDirectDrawImpl *This = (IDirectDrawImpl *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectDrawImpl));
|
IDirectDrawImpl *This = (IDirectDrawImpl *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectDrawImpl));
|
||||||
@ -1343,19 +1341,10 @@ HRESULT WINAPI DirectDrawCreate(GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnk
|
|||||||
if (!This->real_dll)
|
if (!This->real_dll)
|
||||||
This->real_dll = LoadLibrary("system32\\ddraw.dll");
|
This->real_dll = LoadLibrary("system32\\ddraw.dll");
|
||||||
|
|
||||||
if(!This->real_dll)
|
if(This->real_dll && !This->DirectDrawCreate)
|
||||||
{
|
{
|
||||||
ddraw_Release(This);
|
This->DirectDrawCreate =
|
||||||
return DDERR_GENERIC;
|
(HRESULT(WINAPI *)(GUID FAR*, LPDIRECTDRAW FAR*, IUnknown FAR*))GetProcAddress(This->real_dll, "DirectDrawCreate");
|
||||||
}
|
|
||||||
|
|
||||||
This->DirectDrawCreate =
|
|
||||||
(HRESULT (WINAPI *)(GUID FAR*, LPDIRECTDRAW FAR*, IUnknown FAR*))GetProcAddress(This->real_dll, "DirectDrawCreate");
|
|
||||||
|
|
||||||
if(!This->DirectDrawCreate)
|
|
||||||
{
|
|
||||||
ddraw_Release(This);
|
|
||||||
return DDERR_GENERIC;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
InitializeCriticalSection(&This->cs);
|
InitializeCriticalSection(&This->cs);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user