mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-15 06:04:49 +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();
|
||||
if (tick_start >= tick_fps)
|
||||
{
|
||||
snprintf(
|
||||
_snprintf(
|
||||
debugText,
|
||||
sizeof(debugText),
|
||||
"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)
|
||||
{
|
||||
/* 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;
|
||||
*/
|
||||
}
|
||||
|
||||
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)
|
||||
This->real_dll = LoadLibrary("system32\\ddraw.dll");
|
||||
|
||||
if(!This->real_dll)
|
||||
if(This->real_dll && !This->DirectDrawCreate)
|
||||
{
|
||||
ddraw_Release(This);
|
||||
return DDERR_GENERIC;
|
||||
}
|
||||
|
||||
This->DirectDrawCreate =
|
||||
(HRESULT (WINAPI *)(GUID FAR*, LPDIRECTDRAW FAR*, IUnknown FAR*))GetProcAddress(This->real_dll, "DirectDrawCreate");
|
||||
|
||||
if(!This->DirectDrawCreate)
|
||||
{
|
||||
ddraw_Release(This);
|
||||
return DDERR_GENERIC;
|
||||
This->DirectDrawCreate =
|
||||
(HRESULT(WINAPI *)(GUID FAR*, LPDIRECTDRAW FAR*, IUnknown FAR*))GetProcAddress(This->real_dll, "DirectDrawCreate");
|
||||
}
|
||||
|
||||
InitializeCriticalSection(&This->cs);
|
||||
|
Loading…
x
Reference in New Issue
Block a user