mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-15 06:04:49 +01:00
support GetDDInterface
This commit is contained in:
parent
21555e06f7
commit
c3dd35f122
@ -5,6 +5,7 @@
|
||||
#include <windows.h>
|
||||
#include "IDirectDrawPalette.h"
|
||||
#include "IDirectDrawClipper.h"
|
||||
#include "IDirectDraw.h"
|
||||
#include "ddraw.h"
|
||||
|
||||
|
||||
@ -41,6 +42,7 @@ typedef struct IDirectDrawSurfaceImpl
|
||||
|
||||
struct IDirectDrawSurfaceImpl* backbuffer;
|
||||
struct IDirectDrawClipperImpl* clipper;
|
||||
struct IDirectDrawImpl* ddraw;
|
||||
|
||||
} IDirectDrawSurfaceImpl;
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <windows.h>
|
||||
#include "ddraw.h"
|
||||
#include "IDirectDrawSurface.h"
|
||||
#include "IDirectDraw.h"
|
||||
|
||||
// enables redraw via blt/unlock if there wasn't any flip for X ms
|
||||
#define FLIP_REDRAW_TIMEOUT 1000 / 10
|
||||
@ -28,8 +29,9 @@ HRESULT dds_SetColorKey(IDirectDrawSurfaceImpl* This, DWORD flags, LPDDCOLORKEY
|
||||
HRESULT dds_SetClipper(IDirectDrawSurfaceImpl* This, LPDIRECTDRAWCLIPPER lpClipper);
|
||||
HRESULT dds_SetPalette(IDirectDrawSurfaceImpl* This, LPDIRECTDRAWPALETTE lpDDPalette);
|
||||
HRESULT dds_Unlock(IDirectDrawSurfaceImpl* This, LPVOID lpRect);
|
||||
HRESULT dds_GetDDInterface(IDirectDrawSurfaceImpl* This, LPVOID* lplpDD);
|
||||
void* dds_GetBuffer(IDirectDrawSurfaceImpl* This);
|
||||
HRESULT dd_CreateSurface(LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE FAR* lpDDSurface, IUnknown FAR* unkOuter);
|
||||
HRESULT dd_CreateSurface(IDirectDrawImpl* This, LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE FAR* lpDDSurface, IUnknown FAR* unkOuter);
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -376,9 +376,9 @@ HRESULT __stdcall IDirectDrawSurface__UpdateOverlayZOrder(IDirectDrawSurfaceImpl
|
||||
|
||||
HRESULT __stdcall IDirectDrawSurface__GetDDInterface(IDirectDrawSurfaceImpl *This, LPVOID* lplpDD)
|
||||
{
|
||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||
HRESULT ret = DDERR_INVALIDOBJECT;
|
||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||
HRESULT ret = dds_GetDDInterface(This, lplpDD);
|
||||
dprintf("<- %s\n", __FUNCTION__);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1021,6 +1021,17 @@ HRESULT dds_Unlock(IDirectDrawSurfaceImpl *This, LPVOID lpRect)
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
HRESULT dds_GetDDInterface(IDirectDrawSurfaceImpl* This, LPVOID* lplpDD)
|
||||
{
|
||||
if (!lplpDD)
|
||||
return DDERR_INVALIDPARAMS;
|
||||
|
||||
*lplpDD = This->ddraw;
|
||||
IDirectDraw_AddRef(This->ddraw);
|
||||
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
void* dds_GetBuffer(IDirectDrawSurfaceImpl* This)
|
||||
{
|
||||
if (!This)
|
||||
@ -1032,7 +1043,7 @@ void* dds_GetBuffer(IDirectDrawSurfaceImpl* This)
|
||||
return This->surface;
|
||||
}
|
||||
|
||||
HRESULT dd_CreateSurface(LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE FAR *lpDDSurface, IUnknown FAR * unkOuter)
|
||||
HRESULT dd_CreateSurface(IDirectDrawImpl* This, LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE FAR *lpDDSurface, IUnknown FAR * unkOuter)
|
||||
{
|
||||
dbg_dump_dds_flags(lpDDSurfaceDesc->dwFlags);
|
||||
dbg_dump_dds_caps(lpDDSurfaceDesc->ddsCaps.dwCaps);
|
||||
@ -1059,6 +1070,7 @@ HRESULT dd_CreateSurface(LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE FA
|
||||
dst_surface->bpp = g_ddraw->bpp == 0 ? 16 : g_ddraw->bpp;
|
||||
dst_surface->flags = lpDDSurfaceDesc->dwFlags;
|
||||
dst_surface->caps = lpDDSurfaceDesc->ddsCaps.dwCaps;
|
||||
dst_surface->ddraw = This;
|
||||
|
||||
if (dst_surface->caps & DDSCAPS_PRIMARYSURFACE)
|
||||
{
|
||||
@ -1156,7 +1168,7 @@ HRESULT dd_CreateSurface(LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE FA
|
||||
desc.dwWidth = dst_surface->width;
|
||||
desc.dwHeight = dst_surface->height;
|
||||
|
||||
dd_CreateSurface(&desc, (LPDIRECTDRAWSURFACE*)&dst_surface->backbuffer, unkOuter);
|
||||
dd_CreateSurface(This, &desc, (LPDIRECTDRAWSURFACE*)&dst_surface->backbuffer, unkOuter);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user