mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-26 02:19:24 +01:00
refactoring
This commit is contained in:
parent
fa19797956
commit
1f11bf8b84
@ -80,7 +80,6 @@
|
|||||||
<ClInclude Include="inc\lodepng.h" />
|
<ClInclude Include="inc\lodepng.h" />
|
||||||
<ClInclude Include="inc\mouse.h" />
|
<ClInclude Include="inc\mouse.h" />
|
||||||
<ClInclude Include="inc\render_d3d9.h" />
|
<ClInclude Include="inc\render_d3d9.h" />
|
||||||
<ClInclude Include="inc\ddraw.h" />
|
|
||||||
<ClInclude Include="inc\debug.h" />
|
<ClInclude Include="inc\debug.h" />
|
||||||
<ClInclude Include="inc\dd.h" />
|
<ClInclude Include="inc\dd.h" />
|
||||||
<ClInclude Include="inc\opengl_utils.h" />
|
<ClInclude Include="inc\opengl_utils.h" />
|
||||||
|
@ -152,9 +152,6 @@
|
|||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="inc\ddraw.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="inc\debug.h">
|
<ClInclude Include="inc\debug.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
@ -28,14 +28,14 @@ struct IAMMediaStreamImplVtbl
|
|||||||
HRESULT(__stdcall* QueryInterface) (IAMMediaStreamImpl*, const IID* const riid, LPVOID* ppvObj);
|
HRESULT(__stdcall* QueryInterface) (IAMMediaStreamImpl*, const IID* const riid, LPVOID* ppvObj);
|
||||||
ULONG(__stdcall* AddRef) (IAMMediaStreamImpl*);
|
ULONG(__stdcall* AddRef) (IAMMediaStreamImpl*);
|
||||||
ULONG(__stdcall* Release) (IAMMediaStreamImpl*);
|
ULONG(__stdcall* Release) (IAMMediaStreamImpl*);
|
||||||
// IMediaStream
|
/* IMediaStream */
|
||||||
HRESULT(__stdcall* GetMultiMediaStream)(IAMMediaStreamImpl* This, int a);
|
HRESULT(__stdcall* GetMultiMediaStream)(IAMMediaStreamImpl* This, int a);
|
||||||
HRESULT(__stdcall* GetInformation)(IAMMediaStreamImpl* This, int a, int b);
|
HRESULT(__stdcall* GetInformation)(IAMMediaStreamImpl* This, int a, int b);
|
||||||
HRESULT(__stdcall* SetSameFormat)(IAMMediaStreamImpl* This, int a, int b);
|
HRESULT(__stdcall* SetSameFormat)(IAMMediaStreamImpl* This, int a, int b);
|
||||||
HRESULT(__stdcall* AllocateSample)(IAMMediaStreamImpl* This, int a, int b);
|
HRESULT(__stdcall* AllocateSample)(IAMMediaStreamImpl* This, int a, int b);
|
||||||
HRESULT(__stdcall* CreateSharedSample)(IAMMediaStreamImpl* This, int a, int b, int c);
|
HRESULT(__stdcall* CreateSharedSample)(IAMMediaStreamImpl* This, int a, int b, int c);
|
||||||
HRESULT(__stdcall* SendEndOfStream)(IAMMediaStreamImpl* This, int a);
|
HRESULT(__stdcall* SendEndOfStream)(IAMMediaStreamImpl* This, int a);
|
||||||
// IAMMediaStream
|
/* IAMMediaStream */
|
||||||
HRESULT(__stdcall* Initialize)(IAMMediaStreamImpl* This, int a, int b, int c, int d);
|
HRESULT(__stdcall* Initialize)(IAMMediaStreamImpl* This, int a, int b, int c, int d);
|
||||||
HRESULT(__stdcall* SetState)(IAMMediaStreamImpl* This, int a);
|
HRESULT(__stdcall* SetState)(IAMMediaStreamImpl* This, int a);
|
||||||
HRESULT(__stdcall* JoinAMMultiMediaStream)(IAMMediaStreamImpl* This, int a);
|
HRESULT(__stdcall* JoinAMMultiMediaStream)(IAMMediaStreamImpl* This, int a);
|
||||||
|
@ -18,25 +18,25 @@ DEFINE_GUID(IID_IDirect3D7, 0xf5049e77, 0x4861, 0x11d2, 0xa4, 0x7, 0x0, 0xa0, 0x
|
|||||||
struct iface##Vtbl
|
struct iface##Vtbl
|
||||||
|
|
||||||
|
|
||||||
// IID_IDirect3D
|
/* IID_IDirect3D */
|
||||||
|
|
||||||
DECLARE_D3D_INTERFACE(IDirect3DImpl)
|
DECLARE_D3D_INTERFACE(IDirect3DImpl)
|
||||||
{
|
{
|
||||||
HRESULT(__stdcall* QueryInterface) (IDirect3DImpl*, const IID* const riid, LPVOID* ppvObj);
|
HRESULT(__stdcall * QueryInterface) (IDirect3DImpl*, const IID* const riid, LPVOID * ppvObj);
|
||||||
ULONG(__stdcall* AddRef) (IDirect3DImpl*);
|
ULONG(__stdcall * AddRef) (IDirect3DImpl*);
|
||||||
ULONG(__stdcall* Release) (IDirect3DImpl*);
|
ULONG(__stdcall * Release) (IDirect3DImpl*);
|
||||||
|
|
||||||
HRESULT(__stdcall* Initialize)(IDirect3DImpl*, int);
|
HRESULT(__stdcall * Initialize)(IDirect3DImpl*, int);
|
||||||
HRESULT(__stdcall* EnumDevices)(IDirect3DImpl*, int, int);
|
HRESULT(__stdcall * EnumDevices)(IDirect3DImpl*, int, int);
|
||||||
HRESULT(__stdcall* CreateLight)(IDirect3DImpl*, int, int);
|
HRESULT(__stdcall * CreateLight)(IDirect3DImpl*, int, int);
|
||||||
HRESULT(__stdcall* CreateMaterial)(IDirect3DImpl*, int, int);
|
HRESULT(__stdcall * CreateMaterial)(IDirect3DImpl*, int, int);
|
||||||
HRESULT(__stdcall* CreateViewport)(IDirect3DImpl*, int, int);
|
HRESULT(__stdcall * CreateViewport)(IDirect3DImpl*, int, int);
|
||||||
HRESULT(__stdcall* FindDevice)(IDirect3DImpl*, int, int);
|
HRESULT(__stdcall * FindDevice)(IDirect3DImpl*, int, int);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct IDirect3DImplVtbl g_d3d_vtbl;
|
extern struct IDirect3DImplVtbl g_d3d_vtbl;
|
||||||
|
|
||||||
// IID_IDirect3D2
|
/* IID_IDirect3D2 */
|
||||||
|
|
||||||
DECLARE_D3D_INTERFACE(IDirect3D2Impl)
|
DECLARE_D3D_INTERFACE(IDirect3D2Impl)
|
||||||
{
|
{
|
||||||
@ -54,7 +54,7 @@ DECLARE_D3D_INTERFACE(IDirect3D2Impl)
|
|||||||
|
|
||||||
extern struct IDirect3D2ImplVtbl g_d3d2_vtbl;
|
extern struct IDirect3D2ImplVtbl g_d3d2_vtbl;
|
||||||
|
|
||||||
// IID_IDirect3D3
|
/* IID_IDirect3D3 */
|
||||||
|
|
||||||
DECLARE_D3D_INTERFACE(IDirect3D3Impl)
|
DECLARE_D3D_INTERFACE(IDirect3D3Impl)
|
||||||
{
|
{
|
||||||
@ -75,7 +75,7 @@ DECLARE_D3D_INTERFACE(IDirect3D3Impl)
|
|||||||
|
|
||||||
extern struct IDirect3D3ImplVtbl g_d3d3_vtbl;
|
extern struct IDirect3D3ImplVtbl g_d3d3_vtbl;
|
||||||
|
|
||||||
// IID_IDirect3D7
|
/* IID_IDirect3D7 */
|
||||||
|
|
||||||
DECLARE_D3D_INTERFACE(IDirect3D7Impl)
|
DECLARE_D3D_INTERFACE(IDirect3D7Impl)
|
||||||
{
|
{
|
||||||
|
@ -3,18 +3,9 @@
|
|||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "ddraw.h"
|
#include <ddraw.h>
|
||||||
|
|
||||||
|
|
||||||
DEFINE_GUID(IID_IDirectDraw4, 0x9c59509a, 0x39bd, 0x11d1, 0x8c, 0x4a, 0x00, 0xc0, 0x4f, 0xd9, 0x30, 0xc5);
|
|
||||||
DEFINE_GUID(IID_IDirectDraw7, 0x15e65ec0, 0x3b9c, 0x11d2, 0xb9, 0x2f, 0x00, 0x60, 0x97, 0x97, 0xea, 0x5b);
|
|
||||||
|
|
||||||
typedef BOOL(FAR PASCAL* LPDDENUMCALLBACKEXA)(GUID FAR*, LPSTR, LPSTR, LPVOID, HMONITOR);
|
|
||||||
typedef BOOL(FAR PASCAL* LPDDENUMCALLBACKEXW)(GUID FAR*, LPWSTR, LPWSTR, LPVOID, HMONITOR);
|
|
||||||
|
|
||||||
extern struct IDirectDrawImplVtbl g_dd_vtbl1;
|
|
||||||
extern struct IDirectDrawImplVtbl g_dd_vtblx;
|
|
||||||
|
|
||||||
struct IDirectDrawImpl;
|
struct IDirectDrawImpl;
|
||||||
struct IDirectDrawImplVtbl;
|
struct IDirectDrawImplVtbl;
|
||||||
|
|
||||||
@ -28,47 +19,53 @@ typedef struct IDirectDrawImpl
|
|||||||
|
|
||||||
typedef struct IDirectDrawImplVtbl IDirectDrawImplVtbl;
|
typedef struct IDirectDrawImplVtbl IDirectDrawImplVtbl;
|
||||||
|
|
||||||
|
#undef INTERFACE
|
||||||
|
#define INTERFACE IDirectDrawImpl
|
||||||
struct IDirectDrawImplVtbl
|
struct IDirectDrawImplVtbl
|
||||||
{
|
{
|
||||||
HRESULT(__stdcall* QueryInterface) (IDirectDrawImpl*, const IID* const riid, LPVOID* ppvObj);
|
/*** IUnknown methods ***/
|
||||||
ULONG(__stdcall* AddRef) (IDirectDrawImpl*);
|
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
|
||||||
ULONG(__stdcall* Release) (IDirectDrawImpl*);
|
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||||
|
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||||
HRESULT(__stdcall* Compact)(IDirectDrawImpl*);
|
/*** IDirectDraw methods ***/
|
||||||
HRESULT(__stdcall* CreateClipper)(IDirectDrawImpl*, DWORD, LPDIRECTDRAWCLIPPER*, IUnknown*);
|
STDMETHOD(Compact)(THIS) PURE;
|
||||||
HRESULT(__stdcall* CreatePalette)(IDirectDrawImpl*, DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE*, IUnknown*);
|
STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR*) PURE;
|
||||||
HRESULT(__stdcall* CreateSurface)(IDirectDrawImpl*, LPDDSURFACEDESC, LPDIRECTDRAWSURFACE*, IUnknown*);
|
STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR*) PURE;
|
||||||
HRESULT(__stdcall* DuplicateSurface)(IDirectDrawImpl*, LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE*);
|
STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC2, LPDIRECTDRAWSURFACE7 FAR*, IUnknown FAR*) PURE;
|
||||||
HRESULT(__stdcall* EnumDisplayModes)(IDirectDrawImpl*, DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK);
|
STDMETHOD(DuplicateSurface)(THIS_ LPDIRECTDRAWSURFACE7, LPDIRECTDRAWSURFACE7 FAR*) PURE;
|
||||||
HRESULT(__stdcall* EnumSurfaces)(IDirectDrawImpl*, DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMSURFACESCALLBACK);
|
STDMETHOD(EnumDisplayModes)(THIS_ DWORD, LPDDSURFACEDESC2, LPVOID, LPDDENUMMODESCALLBACK2) PURE;
|
||||||
HRESULT(__stdcall* FlipToGDISurface)(IDirectDrawImpl*);
|
STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC2, LPVOID, LPDDENUMSURFACESCALLBACK7) PURE;
|
||||||
HRESULT(__stdcall* GetCaps)(IDirectDrawImpl*, LPDDCAPS, LPDDCAPS);
|
STDMETHOD(FlipToGDISurface)(THIS) PURE;
|
||||||
HRESULT(__stdcall* GetDisplayMode)(IDirectDrawImpl*, LPDDSURFACEDESC);
|
STDMETHOD(GetCaps)(THIS_ LPDDCAPS, LPDDCAPS) PURE;
|
||||||
HRESULT(__stdcall* GetFourCCCodes)(IDirectDrawImpl*, LPDWORD, LPDWORD);
|
STDMETHOD(GetDisplayMode)(THIS_ LPDDSURFACEDESC2) PURE;
|
||||||
HRESULT(__stdcall* GetGDISurface)(IDirectDrawImpl*, LPDIRECTDRAWSURFACE*);
|
STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD, LPDWORD) PURE;
|
||||||
HRESULT(__stdcall* GetMonitorFrequency)(IDirectDrawImpl*, LPDWORD);
|
STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE7 FAR*) PURE;
|
||||||
HRESULT(__stdcall* GetScanLine)(IDirectDrawImpl*, LPDWORD);
|
STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE;
|
||||||
HRESULT(__stdcall* GetVerticalBlankStatus)(IDirectDrawImpl*, LPBOOL);
|
STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE;
|
||||||
HRESULT(__stdcall* Initialize)(IDirectDrawImpl*, GUID*);
|
STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL) PURE;
|
||||||
HRESULT(__stdcall* RestoreDisplayMode)(IDirectDrawImpl*);
|
STDMETHOD(Initialize)(THIS_ GUID FAR*) PURE;
|
||||||
HRESULT(__stdcall* SetCooperativeLevel)(IDirectDrawImpl*, HWND, DWORD);
|
STDMETHOD(RestoreDisplayMode)(THIS) PURE;
|
||||||
|
STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE;
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
LPVOID d;
|
LPVOID d;
|
||||||
HRESULT(__stdcall* SetDisplayMode)(IDirectDrawImpl*, DWORD, DWORD, DWORD);
|
STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD, DWORD) PURE;
|
||||||
HRESULT(__stdcall* SetDisplayModeX)(IDirectDrawImpl*, DWORD, DWORD, DWORD, DWORD, DWORD);
|
STDMETHOD(SetDisplayModeX)(THIS_ DWORD, DWORD, DWORD, DWORD, DWORD) PURE;
|
||||||
};
|
};
|
||||||
HRESULT(__stdcall* WaitForVerticalBlank)(IDirectDrawImpl*, DWORD, HANDLE);
|
STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE) PURE;
|
||||||
// v2
|
/*** Added in the v2 interface ***/
|
||||||
HRESULT(__stdcall* GetAvailableVidMem)(IDirectDrawImpl*, void*, LPDWORD, LPDWORD);
|
STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS2, LPDWORD, LPDWORD) PURE;
|
||||||
// v4
|
/*** Added in the V4 Interface ***/
|
||||||
HRESULT(__stdcall* GetSurfaceFromDC)(IDirectDrawImpl*, HDC, void*);
|
STDMETHOD(GetSurfaceFromDC) (THIS_ HDC, LPDIRECTDRAWSURFACE7*) PURE;
|
||||||
HRESULT(__stdcall* RestoreAllSurfaces)(IDirectDrawImpl*);
|
STDMETHOD(RestoreAllSurfaces)(THIS) PURE;
|
||||||
HRESULT(__stdcall* TestCooperativeLevel)(IDirectDrawImpl*);
|
STDMETHOD(TestCooperativeLevel)(THIS) PURE;
|
||||||
HRESULT(__stdcall* GetDeviceIdentifier)(IDirectDrawImpl*, void*, DWORD);
|
STDMETHOD(GetDeviceIdentifier)(THIS_ LPDDDEVICEIDENTIFIER2, DWORD) PURE;
|
||||||
// v7
|
/*** Added in the V7 Interface ***/
|
||||||
HRESULT(__stdcall* StartModeTest)(IDirectDrawImpl*, LPSIZE, DWORD, DWORD);
|
STDMETHOD(StartModeTest)(THIS_ LPSIZE, DWORD, DWORD) PURE;
|
||||||
HRESULT(__stdcall* EvaluateMode)(IDirectDrawImpl*, DWORD, DWORD*);
|
STDMETHOD(EvaluateMode)(THIS_ DWORD, DWORD*) PURE;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern struct IDirectDrawImplVtbl g_dd_vtbl1;
|
||||||
|
extern struct IDirectDrawImplVtbl g_dd_vtblx;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "ddraw.h"
|
#include <ddraw.h>
|
||||||
|
|
||||||
|
|
||||||
struct IDirectDrawClipperImpl;
|
struct IDirectDrawClipperImpl;
|
||||||
@ -11,7 +11,7 @@ struct IDirectDrawClipperImplVtbl;
|
|||||||
|
|
||||||
typedef struct IDirectDrawClipperImpl
|
typedef struct IDirectDrawClipperImpl
|
||||||
{
|
{
|
||||||
struct IDirectDrawClipperImplVtbl *lpVtbl;
|
struct IDirectDrawClipperImplVtbl* lpVtbl;
|
||||||
|
|
||||||
ULONG ref;
|
ULONG ref;
|
||||||
|
|
||||||
@ -19,20 +19,21 @@ typedef struct IDirectDrawClipperImpl
|
|||||||
|
|
||||||
typedef struct IDirectDrawClipperImplVtbl IDirectDrawClipperImplVtbl;
|
typedef struct IDirectDrawClipperImplVtbl IDirectDrawClipperImplVtbl;
|
||||||
|
|
||||||
|
#undef INTERFACE
|
||||||
|
#define INTERFACE IDirectDrawClipperImpl
|
||||||
struct IDirectDrawClipperImplVtbl
|
struct IDirectDrawClipperImplVtbl
|
||||||
{
|
{
|
||||||
/* IUnknown */
|
/*** IUnknown methods ***/
|
||||||
HRESULT (__stdcall *QueryInterface)(IDirectDrawClipperImpl *, REFIID, void **);
|
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
|
||||||
ULONG (__stdcall *AddRef)(IDirectDrawClipperImpl *);
|
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||||
ULONG (__stdcall *Release)(IDirectDrawClipperImpl *);
|
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||||
|
/*** IDirectDrawClipper methods ***/
|
||||||
/* IDirectDrawClipper */
|
STDMETHOD(GetClipList)(THIS_ LPRECT, LPRGNDATA, LPDWORD) PURE;
|
||||||
HRESULT (__stdcall *GetClipList)(IDirectDrawClipperImpl *, LPRECT, LPRGNDATA, LPDWORD);
|
STDMETHOD(GetHWnd)(THIS_ HWND FAR*) PURE;
|
||||||
HRESULT (__stdcall *GetHWnd)(IDirectDrawClipperImpl *, HWND FAR *);
|
STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, DWORD) PURE;
|
||||||
HRESULT (__stdcall *Initialize)(IDirectDrawClipperImpl *, LPDIRECTDRAW, DWORD);
|
STDMETHOD(IsClipListChanged)(THIS_ BOOL FAR*) PURE;
|
||||||
HRESULT (__stdcall *IsClipListChanged)(IDirectDrawClipperImpl *, BOOL FAR *);
|
STDMETHOD(SetClipList)(THIS_ LPRGNDATA, DWORD) PURE;
|
||||||
HRESULT (__stdcall *SetClipList)(IDirectDrawClipperImpl *, LPRGNDATA,DWORD);
|
STDMETHOD(SetHWnd)(THIS_ DWORD, HWND) PURE;
|
||||||
HRESULT (__stdcall *SetHWnd)(IDirectDrawClipperImpl *, DWORD, HWND );
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct IDirectDrawClipperImplVtbl g_ddc_vtbl;
|
extern struct IDirectDrawClipperImplVtbl g_ddc_vtbl;
|
||||||
|
@ -3,17 +3,15 @@
|
|||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "ddraw.h"
|
#include <ddraw.h>
|
||||||
|
|
||||||
|
|
||||||
DEFINE_GUID(IID_IDirectDrawGammaControl, 0x69C11C3E, 0xB46B, 0x11D1, 0xAD, 0x7A, 0x00, 0xC0, 0x4F, 0xC2, 0x9B, 0x4E);
|
|
||||||
|
|
||||||
struct IDirectDrawGammaControlImpl;
|
struct IDirectDrawGammaControlImpl;
|
||||||
struct IDirectDrawGammaControlImplVtbl;
|
struct IDirectDrawGammaControlImplVtbl;
|
||||||
|
|
||||||
typedef struct IDirectDrawGammaControlImpl
|
typedef struct IDirectDrawGammaControlImpl
|
||||||
{
|
{
|
||||||
struct IDirectDrawGammaControlImplVtbl *lpVtbl;
|
struct IDirectDrawGammaControlImplVtbl* lpVtbl;
|
||||||
|
|
||||||
ULONG ref;
|
ULONG ref;
|
||||||
|
|
||||||
@ -21,16 +19,17 @@ typedef struct IDirectDrawGammaControlImpl
|
|||||||
|
|
||||||
typedef struct IDirectDrawGammaControlImplVtbl IDirectDrawGammaControlImplVtbl;
|
typedef struct IDirectDrawGammaControlImplVtbl IDirectDrawGammaControlImplVtbl;
|
||||||
|
|
||||||
|
#undef INTERFACE
|
||||||
|
#define INTERFACE IDirectDrawGammaControlImpl
|
||||||
struct IDirectDrawGammaControlImplVtbl
|
struct IDirectDrawGammaControlImplVtbl
|
||||||
{
|
{
|
||||||
/* IUnknown */
|
/*** IUnknown methods ***/
|
||||||
HRESULT (__stdcall *QueryInterface)(IDirectDrawGammaControlImpl *, REFIID, void **);
|
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
|
||||||
ULONG (__stdcall *AddRef)(IDirectDrawGammaControlImpl *);
|
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||||
ULONG (__stdcall *Release)(IDirectDrawGammaControlImpl *);
|
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||||
|
/*** IDirectDrawGammaControl methods ***/
|
||||||
/* IDirectDrawGammaControl */
|
STDMETHOD(GetGammaRamp)(THIS_ DWORD, LPDDGAMMARAMP) PURE;
|
||||||
HRESULT(__stdcall* GetGammaRamp)(IDirectDrawGammaControlImpl*, DWORD, void*);
|
STDMETHOD(SetGammaRamp)(THIS_ DWORD, LPDDGAMMARAMP) PURE;
|
||||||
HRESULT(__stdcall* SetGammaRamp)(IDirectDrawGammaControlImpl*, DWORD, void*);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct IDirectDrawGammaControlImplVtbl g_ddgc_vtbl;
|
extern struct IDirectDrawGammaControlImplVtbl g_ddgc_vtbl;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "ddraw.h"
|
#include <ddraw.h>
|
||||||
|
|
||||||
|
|
||||||
struct IDirectDrawPaletteImpl;
|
struct IDirectDrawPaletteImpl;
|
||||||
@ -23,19 +23,19 @@ typedef struct IDirectDrawPaletteImpl
|
|||||||
|
|
||||||
typedef struct IDirectDrawPaletteImplVtbl IDirectDrawPaletteImplVtbl;
|
typedef struct IDirectDrawPaletteImplVtbl IDirectDrawPaletteImplVtbl;
|
||||||
|
|
||||||
|
#undef INTERFACE
|
||||||
|
#define INTERFACE IDirectDrawPaletteImpl
|
||||||
struct IDirectDrawPaletteImplVtbl
|
struct IDirectDrawPaletteImplVtbl
|
||||||
{
|
{
|
||||||
/* IUnknown */
|
/*** IUnknown methods ***/
|
||||||
HRESULT(__stdcall* QueryInterface)(IDirectDrawPaletteImpl*, REFIID, void**);
|
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
|
||||||
ULONG(__stdcall* AddRef)(IDirectDrawPaletteImpl*);
|
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||||
ULONG(__stdcall* Release)(IDirectDrawPaletteImpl*);
|
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||||
|
/*** IDirectDrawPalette methods ***/
|
||||||
/* IDirectDrawPalette */
|
STDMETHOD(GetCaps)(THIS_ LPDWORD) PURE;
|
||||||
HRESULT(__stdcall* GetCaps)(IDirectDrawPaletteImpl*, LPDWORD);
|
STDMETHOD(GetEntries)(THIS_ DWORD, DWORD, DWORD, LPPALETTEENTRY) PURE;
|
||||||
HRESULT(__stdcall* GetEntries)(IDirectDrawPaletteImpl*, DWORD, DWORD, DWORD, LPPALETTEENTRY);
|
STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, DWORD, LPPALETTEENTRY) PURE;
|
||||||
HRESULT(__stdcall* Initialize)(IDirectDrawPaletteImpl*, LPDIRECTDRAW, DWORD, LPPALETTEENTRY);
|
STDMETHOD(SetEntries)(THIS_ DWORD, DWORD, DWORD, LPPALETTEENTRY) PURE;
|
||||||
HRESULT(__stdcall* SetEntries)(IDirectDrawPaletteImpl*, DWORD, DWORD, DWORD, LPPALETTEENTRY);
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct IDirectDrawPaletteImplVtbl g_ddp_vtbl;
|
extern struct IDirectDrawPaletteImplVtbl g_ddp_vtbl;
|
||||||
|
@ -3,21 +3,18 @@
|
|||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <ddraw.h>
|
||||||
#include "IDirectDrawPalette.h"
|
#include "IDirectDrawPalette.h"
|
||||||
#include "IDirectDrawClipper.h"
|
#include "IDirectDrawClipper.h"
|
||||||
#include "IDirectDraw.h"
|
#include "IDirectDraw.h"
|
||||||
#include "ddraw.h"
|
|
||||||
|
|
||||||
|
|
||||||
DEFINE_GUID(IID_IDirectDrawSurface4, 0x0B2B8630, 0xAD35, 0x11D0, 0x8E, 0xA6, 0x00, 0x60, 0x97, 0x97, 0xEA, 0x5B);
|
|
||||||
DEFINE_GUID(IID_IDirectDrawSurface7, 0x06675a80, 0x3b9b, 0x11d2, 0xb9, 0x2f, 0x00, 0x60, 0x97, 0x97, 0xea, 0x5b);
|
|
||||||
|
|
||||||
struct IDirectDrawSurfaceImpl;
|
struct IDirectDrawSurfaceImpl;
|
||||||
struct IDirectDrawSurfaceImplVtbl;
|
struct IDirectDrawSurfaceImplVtbl;
|
||||||
|
|
||||||
typedef struct IDirectDrawSurfaceImpl
|
typedef struct IDirectDrawSurfaceImpl
|
||||||
{
|
{
|
||||||
struct IDirectDrawSurfaceImplVtbl *lpVtbl;
|
struct IDirectDrawSurfaceImplVtbl* lpVtbl;
|
||||||
|
|
||||||
ULONG ref;
|
ULONG ref;
|
||||||
|
|
||||||
@ -29,7 +26,7 @@ typedef struct IDirectDrawSurfaceImpl
|
|||||||
|
|
||||||
IDirectDrawPaletteImpl* palette;
|
IDirectDrawPaletteImpl* palette;
|
||||||
|
|
||||||
void *surface;
|
void* surface;
|
||||||
DWORD l_pitch;
|
DWORD l_pitch;
|
||||||
DWORD lx_pitch;
|
DWORD lx_pitch;
|
||||||
|
|
||||||
@ -48,64 +45,65 @@ typedef struct IDirectDrawSurfaceImpl
|
|||||||
|
|
||||||
typedef struct IDirectDrawSurfaceImplVtbl IDirectDrawSurfaceImplVtbl;
|
typedef struct IDirectDrawSurfaceImplVtbl IDirectDrawSurfaceImplVtbl;
|
||||||
|
|
||||||
|
#undef INTERFACE
|
||||||
|
#define INTERFACE IDirectDrawSurfaceImpl
|
||||||
struct IDirectDrawSurfaceImplVtbl
|
struct IDirectDrawSurfaceImplVtbl
|
||||||
{
|
{
|
||||||
/* IUnknown */
|
/*** IUnknown methods ***/
|
||||||
HRESULT (__stdcall *QueryInterface)(IDirectDrawSurfaceImpl*, REFIID, void**);
|
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
|
||||||
ULONG (__stdcall *AddRef)(IDirectDrawSurfaceImpl*);
|
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
||||||
ULONG (__stdcall *Release)(IDirectDrawSurfaceImpl*);
|
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
||||||
|
/*** IDirectDrawSurface methods ***/
|
||||||
/* IDirectDrawSurface */
|
STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE7) PURE;
|
||||||
HRESULT (__stdcall *AddAttachedSurface)(IDirectDrawSurfaceImpl*, LPDIRECTDRAWSURFACE);
|
STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE;
|
||||||
HRESULT (__stdcall *AddOverlayDirtyRect)(IDirectDrawSurfaceImpl*, LPRECT);
|
STDMETHOD(Blt)(THIS_ LPRECT, LPDIRECTDRAWSURFACE7, LPRECT, DWORD, LPDDBLTFX) PURE;
|
||||||
HRESULT (__stdcall *Blt)(IDirectDrawSurfaceImpl*, LPRECT,LPDIRECTDRAWSURFACE, LPRECT,DWORD, LPDDBLTFX);
|
STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD) PURE;
|
||||||
HRESULT (__stdcall *BltBatch)(IDirectDrawSurfaceImpl*, LPDDBLTBATCH, DWORD, DWORD );
|
STDMETHOD(BltFast)(THIS_ DWORD, DWORD, LPDIRECTDRAWSURFACE7, LPRECT, DWORD) PURE;
|
||||||
HRESULT (__stdcall *BltFast)(IDirectDrawSurfaceImpl*, DWORD,DWORD,LPDIRECTDRAWSURFACE, LPRECT,DWORD);
|
STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD, LPDIRECTDRAWSURFACE7) PURE;
|
||||||
HRESULT (__stdcall *DeleteAttachedSurface)(IDirectDrawSurfaceImpl*, DWORD,LPDIRECTDRAWSURFACE);
|
STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID, LPDDENUMSURFACESCALLBACK7) PURE;
|
||||||
HRESULT (__stdcall *EnumAttachedSurfaces)(IDirectDrawSurfaceImpl*, LPVOID,LPDDENUMSURFACESCALLBACK);
|
STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD, LPVOID, LPDDENUMSURFACESCALLBACK7) PURE;
|
||||||
HRESULT (__stdcall *EnumOverlayZOrders)(IDirectDrawSurfaceImpl*, DWORD,LPVOID,LPDDENUMSURFACESCALLBACK);
|
STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE7, DWORD) PURE;
|
||||||
HRESULT (__stdcall *Flip)(IDirectDrawSurfaceImpl*, LPDIRECTDRAWSURFACE, DWORD);
|
STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS2, LPDIRECTDRAWSURFACE7 FAR*) PURE;
|
||||||
HRESULT (__stdcall *GetAttachedSurface)(IDirectDrawSurfaceImpl*, LPDDSCAPS, LPDIRECTDRAWSURFACE FAR *);
|
STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE;
|
||||||
HRESULT (__stdcall *GetBltStatus)(IDirectDrawSurfaceImpl*, DWORD);
|
STDMETHOD(GetCaps)(THIS_ LPDDSCAPS2) PURE;
|
||||||
HRESULT (__stdcall *GetCaps)(IDirectDrawSurfaceImpl*, LPDDSCAPS);
|
STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE;
|
||||||
HRESULT (__stdcall *GetClipper)(IDirectDrawSurfaceImpl*, LPDIRECTDRAWCLIPPER FAR*);
|
STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
|
||||||
HRESULT (__stdcall *GetColorKey)(IDirectDrawSurfaceImpl*, DWORD, LPDDCOLORKEY);
|
STDMETHOD(GetDC)(THIS_ HDC FAR*) PURE;
|
||||||
HRESULT (__stdcall *GetDC)(IDirectDrawSurfaceImpl*, HDC FAR *);
|
STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE;
|
||||||
HRESULT (__stdcall *GetFlipStatus)(IDirectDrawSurfaceImpl*, DWORD);
|
STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG) PURE;
|
||||||
HRESULT (__stdcall *GetOverlayPosition)(IDirectDrawSurfaceImpl*, LPLONG, LPLONG );
|
STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE;
|
||||||
HRESULT (__stdcall *GetPalette)(IDirectDrawSurfaceImpl*, LPDIRECTDRAWPALETTE FAR*);
|
STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE;
|
||||||
HRESULT (__stdcall *GetPixelFormat)(IDirectDrawSurfaceImpl*, LPDDPIXELFORMAT);
|
STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC2) PURE;
|
||||||
HRESULT (__stdcall *GetSurfaceDesc)(IDirectDrawSurfaceImpl*, LPDDSURFACEDESC);
|
STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC2) PURE;
|
||||||
HRESULT (__stdcall *Initialize)(IDirectDrawSurfaceImpl*, LPDIRECTDRAW, LPDDSURFACEDESC);
|
STDMETHOD(IsLost)(THIS) PURE;
|
||||||
HRESULT (__stdcall *IsLost)(IDirectDrawSurfaceImpl*);
|
STDMETHOD(Lock)(THIS_ LPRECT, LPDDSURFACEDESC2, DWORD, HANDLE) PURE;
|
||||||
HRESULT (__stdcall *Lock)(IDirectDrawSurfaceImpl*, LPRECT,LPDDSURFACEDESC,DWORD,HANDLE);
|
STDMETHOD(ReleaseDC)(THIS_ HDC) PURE;
|
||||||
HRESULT (__stdcall *ReleaseDC)(IDirectDrawSurfaceImpl*, HDC);
|
STDMETHOD(Restore)(THIS) PURE;
|
||||||
HRESULT (__stdcall *Restore)(IDirectDrawSurfaceImpl*);
|
STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE;
|
||||||
HRESULT (__stdcall *SetClipper)(IDirectDrawSurfaceImpl*, LPDIRECTDRAWCLIPPER);
|
STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
|
||||||
HRESULT (__stdcall *SetColorKey)(IDirectDrawSurfaceImpl*, DWORD, LPDDCOLORKEY);
|
STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG) PURE;
|
||||||
HRESULT (__stdcall *SetOverlayPosition)(IDirectDrawSurfaceImpl*, LONG, LONG );
|
STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE;
|
||||||
HRESULT (__stdcall *SetPalette)(IDirectDrawSurfaceImpl*, LPDIRECTDRAWPALETTE);
|
STDMETHOD(Unlock)(THIS_ LPRECT) PURE;
|
||||||
HRESULT (__stdcall *Unlock)(IDirectDrawSurfaceImpl*, LPVOID);
|
STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE7, LPRECT, DWORD, LPDDOVERLAYFX) PURE;
|
||||||
HRESULT (__stdcall *UpdateOverlay)(IDirectDrawSurfaceImpl*, LPRECT, LPDIRECTDRAWSURFACE,LPRECT,DWORD, LPDDOVERLAYFX);
|
STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE;
|
||||||
HRESULT (__stdcall *UpdateOverlayDisplay)(IDirectDrawSurfaceImpl*, DWORD);
|
STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE7) PURE;
|
||||||
HRESULT (__stdcall *UpdateOverlayZOrder)(IDirectDrawSurfaceImpl*, DWORD, LPDIRECTDRAWSURFACE);
|
/*** Added in the v2 interface ***/
|
||||||
// v2
|
STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR*) PURE;
|
||||||
HRESULT (__stdcall *GetDDInterface)(IDirectDrawSurfaceImpl*, LPVOID*);
|
STDMETHOD(PageLock)(THIS_ DWORD) PURE;
|
||||||
HRESULT (__stdcall *PageLock)(IDirectDrawSurfaceImpl*, DWORD);
|
STDMETHOD(PageUnlock)(THIS_ DWORD) PURE;
|
||||||
HRESULT (__stdcall *PageUnlock)(IDirectDrawSurfaceImpl*, DWORD);
|
/*** Added in the v3 interface ***/
|
||||||
// v3
|
STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC2, DWORD) PURE;
|
||||||
HRESULT (__stdcall *SetSurfaceDesc)(IDirectDrawSurfaceImpl*, LPDDSURFACEDESC, DWORD);
|
/*** Added in the v4 interface ***/
|
||||||
// v4
|
STDMETHOD(SetPrivateData)(THIS_ REFGUID, LPVOID, DWORD, DWORD) PURE;
|
||||||
HRESULT (__stdcall *SetPrivateData)(IDirectDrawSurfaceImpl*, REFGUID, LPVOID, DWORD, DWORD);
|
STDMETHOD(GetPrivateData)(THIS_ REFGUID, LPVOID, LPDWORD) PURE;
|
||||||
HRESULT (__stdcall *GetPrivateData)(IDirectDrawSurfaceImpl*, REFGUID, LPVOID, LPDWORD);
|
STDMETHOD(FreePrivateData)(THIS_ REFGUID) PURE;
|
||||||
HRESULT (__stdcall *FreePrivateData)(IDirectDrawSurfaceImpl*, REFGUID);
|
STDMETHOD(GetUniquenessValue)(THIS_ LPDWORD) PURE;
|
||||||
HRESULT (__stdcall *GetUniquenessValue)(IDirectDrawSurfaceImpl*, LPDWORD);
|
STDMETHOD(ChangeUniquenessValue)(THIS) PURE;
|
||||||
HRESULT (__stdcall *ChangeUniquenessValue)(IDirectDrawSurfaceImpl*);
|
/*** Added in the v7 interface ***/
|
||||||
// v7
|
STDMETHOD(SetPriority)(THIS_ DWORD) PURE;
|
||||||
HRESULT (__stdcall *SetPriority)(IDirectDrawSurfaceImpl*, DWORD);
|
STDMETHOD(GetPriority)(THIS_ LPDWORD) PURE;
|
||||||
HRESULT (__stdcall *GetPriority)(IDirectDrawSurfaceImpl*, LPDWORD);
|
STDMETHOD(SetLOD)(THIS_ DWORD) PURE;
|
||||||
HRESULT (__stdcall *SetLOD)(IDirectDrawSurfaceImpl*, DWORD);
|
STDMETHOD(GetLOD)(THIS_ LPDWORD) PURE;
|
||||||
HRESULT (__stdcall *GetLOD)(IDirectDrawSurfaceImpl*, LPDWORD);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct IDirectDrawSurfaceImplVtbl g_dds_vtbl;
|
extern struct IDirectDrawSurfaceImplVtbl g_dds_vtbl;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
|
||||||
typedef struct cnc_ddraw_config
|
typedef struct CNCDDRAWCONFIG
|
||||||
{
|
{
|
||||||
RECT window_rect;
|
RECT window_rect;
|
||||||
int window_state;
|
int window_state;
|
||||||
@ -13,9 +13,9 @@ typedef struct cnc_ddraw_config
|
|||||||
char process_file_name[96];
|
char process_file_name[96];
|
||||||
int save_settings;
|
int save_settings;
|
||||||
|
|
||||||
} cnc_ddraw_config;
|
} CNCDDRAWCONFIG;
|
||||||
|
|
||||||
extern cnc_ddraw_config g_config;
|
extern CNCDDRAWCONFIG g_config;
|
||||||
|
|
||||||
void cfg_load();
|
void cfg_load();
|
||||||
void cfg_save();
|
void cfg_save();
|
||||||
|
37
inc/dd.h
37
inc/dd.h
@ -3,22 +3,22 @@
|
|||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "ddraw.h"
|
#include <ddraw.h>
|
||||||
|
|
||||||
|
|
||||||
typedef HRESULT(WINAPI* DIRECTDRAWCREATEPROC)(GUID FAR*, LPDIRECTDRAW FAR*, IUnknown FAR*);
|
typedef HRESULT(WINAPI* DIRECTDRAWCREATEPROC)(GUID FAR*, LPDIRECTDRAW FAR*, IUnknown FAR*);
|
||||||
|
|
||||||
ULONG dd_AddRef();
|
ULONG dd_AddRef();
|
||||||
ULONG dd_Release();
|
ULONG dd_Release();
|
||||||
HRESULT dd_EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK lpEnumModesCallback);
|
HRESULT dd_EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC2 lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK2 lpEnumModesCallback);
|
||||||
HRESULT dd_WaitForVerticalBlank(DWORD dwFlags, HANDLE h);
|
HRESULT dd_WaitForVerticalBlank(DWORD dwFlags, HANDLE hEvent);
|
||||||
HRESULT dd_SetDisplayMode(DWORD width, DWORD height, DWORD bpp, BOOL set_by_game);
|
HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, BOOL setByGame);
|
||||||
HRESULT dd_SetCooperativeLevel(HWND hwnd, DWORD dwFlags);
|
HRESULT dd_SetCooperativeLevel(HWND hwnd, DWORD dwFlags);
|
||||||
HRESULT dd_RestoreDisplayMode();
|
HRESULT dd_RestoreDisplayMode();
|
||||||
HRESULT dd_GetCaps(LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDEmulCaps);
|
HRESULT dd_GetCaps(LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDEmulCaps);
|
||||||
HRESULT dd_GetDisplayMode(LPDDSURFACEDESC lpDDSurfaceDesc);
|
HRESULT dd_GetDisplayMode(LPDDSURFACEDESC2 lpDDSurfaceDesc);
|
||||||
HRESULT dd_GetMonitorFrequency(LPDWORD lpdwFreq);
|
HRESULT dd_GetMonitorFrequency(LPDWORD lpdwFreq);
|
||||||
HRESULT dd_GetAvailableVidMem(void* lpDDCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree);
|
HRESULT dd_GetAvailableVidMem(LPDDSCAPS2 lpDDCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree);
|
||||||
HRESULT dd_GetVerticalBlankStatus(LPBOOL lpbIsInVB);
|
HRESULT dd_GetVerticalBlankStatus(LPBOOL lpbIsInVB);
|
||||||
HRESULT dd_CreateEx(GUID* lpGuid, LPVOID* lplpDD, REFIID iid, IUnknown* pUnkOuter);
|
HRESULT dd_CreateEx(GUID* lpGuid, LPVOID* lplpDD, REFIID iid, IUnknown* pUnkOuter);
|
||||||
|
|
||||||
@ -26,20 +26,20 @@ HRESULT dd_CreateEx(GUID* lpGuid, LPVOID* lplpDD, REFIID iid, IUnknown* pUnkOute
|
|||||||
#define RESLIST_MINI 1
|
#define RESLIST_MINI 1
|
||||||
#define RESLIST_FULL 2
|
#define RESLIST_FULL 2
|
||||||
|
|
||||||
typedef struct speed_limiter
|
typedef struct SPEEDLIMITER
|
||||||
{
|
{
|
||||||
DWORD tick_length;
|
DWORD tick_length;
|
||||||
LONGLONG tick_length_ns;
|
LONGLONG tick_length_ns;
|
||||||
HANDLE htimer;
|
HANDLE htimer;
|
||||||
LARGE_INTEGER due_time;
|
LARGE_INTEGER due_time;
|
||||||
BOOL use_blt_or_flip;
|
BOOL use_blt_or_flip;
|
||||||
} speed_limiter;
|
} SPEEDLIMITER;
|
||||||
|
|
||||||
struct IDirectDrawSurfaceImpl;
|
struct IDirectDrawSurfaceImpl;
|
||||||
|
|
||||||
extern struct cnc_ddraw *g_ddraw;
|
extern struct CNCDDRAW* g_ddraw;
|
||||||
|
|
||||||
typedef struct cnc_ddraw
|
typedef struct CNCDDRAW
|
||||||
{
|
{
|
||||||
ULONG ref;
|
ULONG ref;
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ typedef struct cnc_ddraw
|
|||||||
BOOL border;
|
BOOL border;
|
||||||
BOOL boxing;
|
BOOL boxing;
|
||||||
DEVMODE mode;
|
DEVMODE mode;
|
||||||
struct IDirectDrawSurfaceImpl *primary;
|
struct IDirectDrawSurfaceImpl* primary;
|
||||||
char title[128];
|
char title[128];
|
||||||
CRITICAL_SECTION cs;
|
CRITICAL_SECTION cs;
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ typedef struct cnc_ddraw
|
|||||||
int bpp;
|
int bpp;
|
||||||
|
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
int *tex;
|
int* tex;
|
||||||
|
|
||||||
HANDLE thread;
|
HANDLE thread;
|
||||||
BOOL run;
|
BOOL run;
|
||||||
@ -100,7 +100,7 @@ typedef struct cnc_ddraw
|
|||||||
BOOL iscnc1;
|
BOOL iscnc1;
|
||||||
BOOL iskkndx;
|
BOOL iskkndx;
|
||||||
LONG upscale_hack_active;
|
LONG upscale_hack_active;
|
||||||
DWORD (WINAPI *renderer)(void);
|
DWORD(WINAPI* renderer)(void);
|
||||||
BOOL fullscreen;
|
BOOL fullscreen;
|
||||||
BOOL maintas;
|
BOOL maintas;
|
||||||
BOOL noactivateapp;
|
BOOL noactivateapp;
|
||||||
@ -117,7 +117,6 @@ typedef struct cnc_ddraw
|
|||||||
BOOL fixwndprochook;
|
BOOL fixwndprochook;
|
||||||
BOOL d3d9linear;
|
BOOL d3d9linear;
|
||||||
BOOL gdilinear;
|
BOOL gdilinear;
|
||||||
BOOL backbuffer;
|
|
||||||
BOOL passthrough;
|
BOOL passthrough;
|
||||||
int resolutions;
|
int resolutions;
|
||||||
BOOL armadahack;
|
BOOL armadahack;
|
||||||
@ -129,13 +128,13 @@ typedef struct cnc_ddraw
|
|||||||
RECT bnet_win_rect;
|
RECT bnet_win_rect;
|
||||||
POINT bnet_pos;
|
POINT bnet_pos;
|
||||||
int mouse_y_adjust;
|
int mouse_y_adjust;
|
||||||
void* last_freed_palette; // Dungeon Keeper hack
|
void* last_freed_palette; /* Dungeon Keeper hack */
|
||||||
BOOL child_window_exists;
|
BOOL child_window_exists;
|
||||||
DWORD last_set_window_pos_tick; // WINE hack
|
DWORD last_set_window_pos_tick; /* WINE hack */
|
||||||
BOOL show_driver_warning;
|
BOOL show_driver_warning;
|
||||||
speed_limiter ticks_limiter;
|
SPEEDLIMITER ticks_limiter;
|
||||||
speed_limiter flip_limiter;
|
SPEEDLIMITER flip_limiter;
|
||||||
|
|
||||||
} cnc_ddraw;
|
} CNCDDRAW;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -3,9 +3,10 @@
|
|||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "ddraw.h"
|
#include <ddraw.h>
|
||||||
|
#include "IDirectDrawClipper.h"
|
||||||
|
|
||||||
|
|
||||||
HRESULT dd_CreateClipper(DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR* lplpDDClipper, IUnknown FAR* pUnkOuter);
|
HRESULT dd_CreateClipper(DWORD dwFlags, IDirectDrawClipperImpl** lplpDDClipper, IUnknown FAR* pUnkOuter);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -3,12 +3,12 @@
|
|||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "ddraw.h"
|
#include <ddraw.h>
|
||||||
#include "IDirectDrawPalette.h"
|
#include "IDirectDrawPalette.h"
|
||||||
#include "dd.h"
|
#include "dd.h"
|
||||||
|
|
||||||
HRESULT ddp_GetEntries(IDirectDrawPaletteImpl* This, DWORD dwFlags, DWORD dwBase, DWORD dwNumEntries, LPPALETTEENTRY lpEntries);
|
HRESULT ddp_GetEntries(IDirectDrawPaletteImpl* This, DWORD dwFlags, DWORD dwBase, DWORD dwNumEntries, LPPALETTEENTRY lpEntries);
|
||||||
HRESULT ddp_SetEntries(IDirectDrawPaletteImpl* This, DWORD dwFlags, DWORD dwStartingEntry, DWORD dwCount, LPPALETTEENTRY lpEntries);
|
HRESULT ddp_SetEntries(IDirectDrawPaletteImpl* This, DWORD dwFlags, DWORD dwStartingEntry, DWORD dwCount, LPPALETTEENTRY lpEntries);
|
||||||
HRESULT dd_CreatePalette(DWORD dwFlags, LPPALETTEENTRY lpDDColorArray, LPDIRECTDRAWPALETTE FAR* lpDDPalette, IUnknown FAR* unkOuter);
|
HRESULT dd_CreatePalette(DWORD dwFlags, LPPALETTEENTRY lpDDColorArray, IDirectDrawPaletteImpl** lpDDPalette, IUnknown FAR* unkOuter);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -3,36 +3,36 @@
|
|||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "ddraw.h"
|
#include <ddraw.h>
|
||||||
#include "IDirectDrawSurface.h"
|
#include "IDirectDrawSurface.h"
|
||||||
#include "IDirectDraw.h"
|
#include "IDirectDraw.h"
|
||||||
|
|
||||||
// enables redraw via blt/unlock if there wasn't any flip for X ms
|
/* enables redraw via blt/unlock if there wasn't any flip for X ms */
|
||||||
#define FLIP_REDRAW_TIMEOUT 1000 / 10
|
#define FLIP_REDRAW_TIMEOUT 1000 / 10
|
||||||
|
|
||||||
HRESULT dds_AddAttachedSurface(IDirectDrawSurfaceImpl* This, LPDIRECTDRAWSURFACE lpDDSurface);
|
HRESULT dds_AddAttachedSurface(IDirectDrawSurfaceImpl* This, IDirectDrawSurfaceImpl* lpDDSurface);
|
||||||
HRESULT dds_Blt(IDirectDrawSurfaceImpl* This, LPRECT lpDestRect, LPDIRECTDRAWSURFACE lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx);
|
HRESULT dds_Blt(IDirectDrawSurfaceImpl* This, LPRECT lpDestRect, IDirectDrawSurfaceImpl* lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx);
|
||||||
HRESULT dds_BltFast(IDirectDrawSurfaceImpl* This, DWORD dst_x, DWORD dst_y, LPDIRECTDRAWSURFACE lpDDSrcSurface, LPRECT lpSrcRect, DWORD flags);
|
HRESULT dds_BltFast(IDirectDrawSurfaceImpl* This, DWORD dwX, DWORD dwY, IDirectDrawSurfaceImpl* lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags);
|
||||||
HRESULT dds_DeleteAttachedSurface(IDirectDrawSurfaceImpl* This, DWORD dwFlags, LPDIRECTDRAWSURFACE lpDDSurface);
|
HRESULT dds_DeleteAttachedSurface(IDirectDrawSurfaceImpl* This, DWORD dwFlags, IDirectDrawSurfaceImpl* lpDDSurface);
|
||||||
HRESULT dds_GetSurfaceDesc(IDirectDrawSurfaceImpl* This, LPDDSURFACEDESC lpDDSurfaceDesc);
|
HRESULT dds_EnumAttachedSurfaces(IDirectDrawSurfaceImpl* This, LPVOID lpContext, LPDDENUMSURFACESCALLBACK7 lpEnumSurfacesCallback);
|
||||||
HRESULT dds_EnumAttachedSurfaces(IDirectDrawSurfaceImpl* This, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback);
|
HRESULT dds_Flip(IDirectDrawSurfaceImpl* This, IDirectDrawSurfaceImpl* lpDDSurfaceTargetOverride, DWORD dwFlags);
|
||||||
HRESULT dds_Flip(IDirectDrawSurfaceImpl* This, LPDIRECTDRAWSURFACE surface, DWORD flags);
|
HRESULT dds_GetAttachedSurface(IDirectDrawSurfaceImpl* This, LPDDSCAPS2 lpDdsCaps, IDirectDrawSurfaceImpl** lpDDsurface);
|
||||||
HRESULT dds_GetAttachedSurface(IDirectDrawSurfaceImpl* This, LPDDSCAPS lpDdsCaps, LPDIRECTDRAWSURFACE FAR* surface);
|
HRESULT dds_GetCaps(IDirectDrawSurfaceImpl* This, LPDDSCAPS2 lpDDSCaps);
|
||||||
HRESULT dds_GetCaps(IDirectDrawSurfaceImpl* This, LPDDSCAPS lpDDSCaps);
|
HRESULT dds_GetClipper(IDirectDrawSurfaceImpl* This, IDirectDrawClipperImpl** lpClipper);
|
||||||
HRESULT dds_GetClipper(IDirectDrawSurfaceImpl* This, LPDIRECTDRAWCLIPPER FAR* lpClipper);
|
HRESULT dds_GetColorKey(IDirectDrawSurfaceImpl* This, DWORD dwFlags, LPDDCOLORKEY lpColorKey);
|
||||||
HRESULT dds_GetColorKey(IDirectDrawSurfaceImpl* This, DWORD flags, LPDDCOLORKEY colorKey);
|
|
||||||
HRESULT dds_GetDC(IDirectDrawSurfaceImpl* This, HDC FAR* lpHDC);
|
HRESULT dds_GetDC(IDirectDrawSurfaceImpl* This, HDC FAR* lpHDC);
|
||||||
HRESULT dds_ReleaseDC(IDirectDrawSurfaceImpl* This, HDC hDC);
|
HRESULT dds_GetPalette(IDirectDrawSurfaceImpl* This, IDirectDrawPaletteImpl** lplpDDPalette);
|
||||||
HRESULT dds_GetPalette(IDirectDrawSurfaceImpl* This, LPDIRECTDRAWPALETTE FAR* lplpDDPalette);
|
|
||||||
HRESULT dds_GetPixelFormat(IDirectDrawSurfaceImpl* This, LPDDPIXELFORMAT ddpfPixelFormat);
|
HRESULT dds_GetPixelFormat(IDirectDrawSurfaceImpl* This, LPDDPIXELFORMAT ddpfPixelFormat);
|
||||||
HRESULT dds_Lock(IDirectDrawSurfaceImpl* This, LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent);
|
HRESULT dds_GetSurfaceDesc(IDirectDrawSurfaceImpl* This, LPDDSURFACEDESC2 lpDDSurfaceDesc);
|
||||||
HRESULT dds_SetColorKey(IDirectDrawSurfaceImpl* This, DWORD flags, LPDDCOLORKEY colorKey);
|
HRESULT dds_Lock(IDirectDrawSurfaceImpl* This, LPRECT lpDestRect, LPDDSURFACEDESC2 lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent);
|
||||||
HRESULT dds_SetClipper(IDirectDrawSurfaceImpl* This, LPDIRECTDRAWCLIPPER lpClipper);
|
HRESULT dds_ReleaseDC(IDirectDrawSurfaceImpl* This, HDC hDC);
|
||||||
HRESULT dds_SetPalette(IDirectDrawSurfaceImpl* This, LPDIRECTDRAWPALETTE lpDDPalette);
|
HRESULT dds_SetClipper(IDirectDrawSurfaceImpl* This, IDirectDrawClipperImpl* lpClipper);
|
||||||
|
HRESULT dds_SetColorKey(IDirectDrawSurfaceImpl* This, DWORD dwFlags, LPDDCOLORKEY lpColorKey);
|
||||||
|
HRESULT dds_SetPalette(IDirectDrawSurfaceImpl* This, IDirectDrawPaletteImpl* lpDDPalette);
|
||||||
HRESULT dds_Unlock(IDirectDrawSurfaceImpl* This, LPVOID lpRect);
|
HRESULT dds_Unlock(IDirectDrawSurfaceImpl* This, LPVOID lpRect);
|
||||||
HRESULT dds_GetDDInterface(IDirectDrawSurfaceImpl* This, LPVOID* lplpDD);
|
HRESULT dds_GetDDInterface(IDirectDrawSurfaceImpl* This, LPVOID* lplpDD);
|
||||||
void* dds_GetBuffer(IDirectDrawSurfaceImpl* This);
|
void* dds_GetBuffer(IDirectDrawSurfaceImpl* This);
|
||||||
HRESULT dd_CreateSurface(IDirectDrawImpl* This, LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE FAR* lpDDSurface, IUnknown FAR* unkOuter);
|
HRESULT dd_CreateSurface(IDirectDrawImpl* This, LPDDSURFACEDESC2 lpDDSurfaceDesc, IDirectDrawSurfaceImpl** lpDDSurface, IUnknown FAR* unkOuter);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
25
inc/debug.h
25
inc/debug.h
@ -7,12 +7,13 @@
|
|||||||
int dbg_exception_handler(EXCEPTION_POINTERS* exception);
|
int dbg_exception_handler(EXCEPTION_POINTERS* exception);
|
||||||
void dbg_counter_start();
|
void dbg_counter_start();
|
||||||
double dbg_counter_stop();
|
double dbg_counter_stop();
|
||||||
void dbg_debug_string(const char *format, ...);
|
void dbg_debug_string(const char* format, ...);
|
||||||
void dbg_draw_frame_info_start();
|
void dbg_draw_frame_info_start();
|
||||||
void dbg_draw_frame_info_end();
|
void dbg_draw_frame_info_end();
|
||||||
int dbg_printf(const char *fmt, ...);
|
int dbg_printf(const char* fmt, ...);
|
||||||
void dbg_init();
|
void dbg_init();
|
||||||
void dbg_dump_dds_blt_flags(DWORD flags);
|
void dbg_dump_dds_blt_flags(DWORD flags);
|
||||||
|
void dbg_dump_dds_blt_fx_flags(DWORD flags);
|
||||||
void dbg_dump_dds_caps(DWORD caps);
|
void dbg_dump_dds_caps(DWORD caps);
|
||||||
void dbg_dump_dds_flags(DWORD flags);
|
void dbg_dump_dds_flags(DWORD flags);
|
||||||
void dbg_dump_dds_blt_fast_flags(DWORD flags);
|
void dbg_dump_dds_blt_fast_flags(DWORD flags);
|
||||||
@ -24,10 +25,10 @@ extern DWORD g_dbg_frame_count;
|
|||||||
|
|
||||||
//#define _DEBUG 1
|
//#define _DEBUG 1
|
||||||
|
|
||||||
//use OutputDebugStringA rather than printf
|
/* use OutputDebugStringA rather than printf */
|
||||||
//#define _DEBUG_S 1
|
//#define _DEBUG_S 1
|
||||||
|
|
||||||
//log everything (slow)
|
/* log everything (slow) */
|
||||||
//#define _DEBUG_X 1
|
//#define _DEBUG_X 1
|
||||||
|
|
||||||
|
|
||||||
@ -36,29 +37,29 @@ extern DWORD g_dbg_frame_count;
|
|||||||
|
|
||||||
#ifdef _DEBUG_S
|
#ifdef _DEBUG_S
|
||||||
|
|
||||||
#define dprintf(format, ...) dbg_debug_string("xDBG " format, ##__VA_ARGS__)
|
#define TRACE(format, ...) dbg_debug_string("xDBG " format, ##__VA_ARGS__)
|
||||||
|
|
||||||
#ifdef _DEBUG_X
|
#ifdef _DEBUG_X
|
||||||
#define dprintfex(format, ...) dbg_debug_string("xDBG " format, ##__VA_ARGS__)
|
#define TRACE_EXT(format, ...) dbg_debug_string("xDBG " format, ##__VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#define dprintfex(format, ...)
|
#define TRACE_EXT(format, ...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define dprintf(format, ...) dbg_printf(format, ##__VA_ARGS__)
|
#define TRACE(format, ...) dbg_printf(format, ##__VA_ARGS__)
|
||||||
|
|
||||||
#ifdef _DEBUG_X
|
#ifdef _DEBUG_X
|
||||||
#define dprintfex(format, ...) dbg_printf(format, ##__VA_ARGS__)
|
#define TRACE_EXT(format, ...) dbg_printf(format, ##__VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#define dprintfex(format, ...)
|
#define TRACE_EXT(format, ...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#define dprintf(format, ...)
|
#define TRACE(format, ...)
|
||||||
#define dprintfex(format, ...)
|
#define TRACE_EXT(format, ...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -28,7 +28,7 @@ typedef NTSTATUS(WINAPI* D3DKMTWAITFORVERTICALBLANKEVENTPROC)(const D3DKMT_WAITF
|
|||||||
typedef NTSTATUS(WINAPI* D3DKMTOPENADAPTERFROMHDCPROC)(D3DKMT_OPENADAPTERFROMHDC* Arg1);
|
typedef NTSTATUS(WINAPI* D3DKMTOPENADAPTERFROMHDCPROC)(D3DKMT_OPENADAPTERFROMHDC* Arg1);
|
||||||
typedef NTSTATUS(WINAPI* D3DKMTCLOSEADAPTERPROC)(D3DKMT_CLOSEADAPTER* Arg1);
|
typedef NTSTATUS(WINAPI* D3DKMTCLOSEADAPTERPROC)(D3DKMT_CLOSEADAPTER* Arg1);
|
||||||
|
|
||||||
typedef struct fps_limiter
|
typedef struct FPSLIMITER
|
||||||
{
|
{
|
||||||
DWORD tick_start;
|
DWORD tick_start;
|
||||||
DWORD tick_end;
|
DWORD tick_end;
|
||||||
@ -48,9 +48,9 @@ typedef struct fps_limiter
|
|||||||
D3DKMTCLOSEADAPTERPROC D3DKMTCloseAdapter;
|
D3DKMTCLOSEADAPTERPROC D3DKMTCloseAdapter;
|
||||||
BOOL got_adapter;
|
BOOL got_adapter;
|
||||||
BOOL initialized;
|
BOOL initialized;
|
||||||
} fps_limiter;
|
} FPSLIMITER;
|
||||||
|
|
||||||
extern fps_limiter g_fpsl;
|
extern FPSLIMITER g_fpsl;
|
||||||
|
|
||||||
void fpsl_init();
|
void fpsl_init();
|
||||||
BOOL fpsl_wait_for_vblank(BOOL open_adapter);
|
BOOL fpsl_wait_for_vblank(BOOL open_adapter);
|
||||||
|
56
inc/hook.h
56
inc/hook.h
@ -5,37 +5,37 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
|
||||||
typedef struct hook_list_data { char function_name[32]; PROC new_function; PROC* function; } hook_list_data;
|
typedef struct HOOKLISTDATA { char function_name[32]; PROC new_function; PROC* function; } HOOKLISTDATA;
|
||||||
typedef struct hook_list { char module_name[32]; BOOL enabled; hook_list_data data[24]; } hook_list;
|
typedef struct HOOKLIST { char module_name[32]; BOOL enabled; HOOKLISTDATA data[24]; } HOOKLIST;
|
||||||
|
|
||||||
typedef BOOL (WINAPI* GETCURSORPOSPROC)(LPPOINT);
|
typedef BOOL(WINAPI* GETCURSORPOSPROC)(LPPOINT);
|
||||||
typedef BOOL(WINAPI* CLIPCURSORPROC)(const RECT*);
|
typedef BOOL(WINAPI* CLIPCURSORPROC)(const RECT*);
|
||||||
typedef int (WINAPI* SHOWCURSORPROC)(BOOL);
|
typedef int (WINAPI* SHOWCURSORPROC)(BOOL);
|
||||||
typedef HCURSOR (WINAPI* SETCURSORPROC)(HCURSOR);
|
typedef HCURSOR(WINAPI* SETCURSORPROC)(HCURSOR);
|
||||||
typedef BOOL (WINAPI* GETWINDOWRECTPROC)(HWND, LPRECT);
|
typedef BOOL(WINAPI* GETWINDOWRECTPROC)(HWND, LPRECT);
|
||||||
typedef BOOL (WINAPI* GETCLIENTRECTPROC)(HWND, LPRECT);
|
typedef BOOL(WINAPI* GETCLIENTRECTPROC)(HWND, LPRECT);
|
||||||
typedef BOOL (WINAPI* CLIENTTOSCREENPROC)(HWND, LPPOINT);
|
typedef BOOL(WINAPI* CLIENTTOSCREENPROC)(HWND, LPPOINT);
|
||||||
typedef BOOL (WINAPI* SCREENTOCLIENTPROC)(HWND, LPPOINT);
|
typedef BOOL(WINAPI* SCREENTOCLIENTPROC)(HWND, LPPOINT);
|
||||||
typedef BOOL (WINAPI* SETCURSORPOSPROC)(int, int);
|
typedef BOOL(WINAPI* SETCURSORPOSPROC)(int, int);
|
||||||
typedef HWND (WINAPI* WINDOWFROMPOINTPROC)(POINT);
|
typedef HWND(WINAPI* WINDOWFROMPOINTPROC)(POINT);
|
||||||
typedef BOOL (WINAPI* GETCLIPCURSORPROC)(LPRECT);
|
typedef BOOL(WINAPI* GETCLIPCURSORPROC)(LPRECT);
|
||||||
typedef BOOL (WINAPI* GETCURSORINFOPROC)(PCURSORINFO);
|
typedef BOOL(WINAPI* GETCURSORINFOPROC)(PCURSORINFO);
|
||||||
typedef int (WINAPI* GETSYSTEMMETRICSPROC)(int);
|
typedef int (WINAPI* GETSYSTEMMETRICSPROC)(int);
|
||||||
typedef BOOL (WINAPI* SETWINDOWPOSPROC)(HWND, HWND, int, int, int, int, UINT);
|
typedef BOOL(WINAPI* SETWINDOWPOSPROC)(HWND, HWND, int, int, int, int, UINT);
|
||||||
typedef BOOL (WINAPI* MOVEWINDOWPROC)(HWND, int, int, int, int, BOOL);
|
typedef BOOL(WINAPI* MOVEWINDOWPROC)(HWND, int, int, int, int, BOOL);
|
||||||
typedef LRESULT (WINAPI* SENDMESSAGEAPROC)(HWND, UINT, WPARAM, LPARAM);
|
typedef LRESULT(WINAPI* SENDMESSAGEAPROC)(HWND, UINT, WPARAM, LPARAM);
|
||||||
typedef LONG (WINAPI* SETWINDOWLONGAPROC)(HWND, int, LONG);
|
typedef LONG(WINAPI* SETWINDOWLONGAPROC)(HWND, int, LONG);
|
||||||
typedef LONG (WINAPI* GETWINDOWLONGAPROC)(HWND, int);
|
typedef LONG(WINAPI* GETWINDOWLONGAPROC)(HWND, int);
|
||||||
typedef BOOL (WINAPI* ENABLEWINDOWPROC)(HWND, BOOL);
|
typedef BOOL(WINAPI* ENABLEWINDOWPROC)(HWND, BOOL);
|
||||||
typedef HWND (WINAPI* CREATEWINDOWEXAPROC)(DWORD, LPCSTR, LPCSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID);
|
typedef HWND(WINAPI* CREATEWINDOWEXAPROC)(DWORD, LPCSTR, LPCSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID);
|
||||||
typedef BOOL (WINAPI* DESTROYWINDOWPROC)(HWND);
|
typedef BOOL(WINAPI* DESTROYWINDOWPROC)(HWND);
|
||||||
typedef int (WINAPI* MAPWINDOWPOINTSPROC)(HWND, HWND, LPPOINT, UINT);
|
typedef int (WINAPI* MAPWINDOWPOINTSPROC)(HWND, HWND, LPPOINT, UINT);
|
||||||
typedef HHOOK (WINAPI* SETWINDOWSHOOKEXAPROC)(int, HOOKPROC, HINSTANCE, DWORD);
|
typedef HHOOK(WINAPI* SETWINDOWSHOOKEXAPROC)(int, HOOKPROC, HINSTANCE, DWORD);
|
||||||
typedef int (WINAPI* GETDEVICECAPSPROC)(HDC, int);
|
typedef int (WINAPI* GETDEVICECAPSPROC)(HDC, int);
|
||||||
typedef HMODULE (WINAPI* LOADLIBRARYAPROC)(LPCSTR);
|
typedef HMODULE(WINAPI* LOADLIBRARYAPROC)(LPCSTR);
|
||||||
typedef HMODULE (WINAPI* LOADLIBRARYWPROC)(LPCWSTR);
|
typedef HMODULE(WINAPI* LOADLIBRARYWPROC)(LPCWSTR);
|
||||||
typedef HMODULE (WINAPI* LOADLIBRARYEXAPROC)(LPCSTR, HANDLE, DWORD);
|
typedef HMODULE(WINAPI* LOADLIBRARYEXAPROC)(LPCSTR, HANDLE, DWORD);
|
||||||
typedef HMODULE (WINAPI* LOADLIBRARYEXWPROC)(LPCWSTR, HANDLE, DWORD);
|
typedef HMODULE(WINAPI* LOADLIBRARYEXWPROC)(LPCWSTR, HANDLE, DWORD);
|
||||||
|
|
||||||
extern GETCURSORPOSPROC real_GetCursorPos;
|
extern GETCURSORPOSPROC real_GetCursorPos;
|
||||||
extern CLIPCURSORPROC real_ClipCursor;
|
extern CLIPCURSORPROC real_ClipCursor;
|
||||||
@ -73,8 +73,8 @@ void hook_init();
|
|||||||
void hook_early_init();
|
void hook_early_init();
|
||||||
void hook_exit();
|
void hook_exit();
|
||||||
void hook_patch_iat(HMODULE hmod, BOOL unhook, char* module_name, char* function_name, PROC new_function);
|
void hook_patch_iat(HMODULE hmod, BOOL unhook, char* module_name, char* function_name, PROC new_function);
|
||||||
void hook_patch_iat_list(HMODULE hmod, BOOL unhook, hook_list* hooks);
|
void hook_patch_iat_list(HMODULE hmod, BOOL unhook, HOOKLIST* hooks);
|
||||||
void hook_create(hook_list* hooks);
|
void hook_create(HOOKLIST* hooks);
|
||||||
void hook_revert(hook_list* hooks);
|
void hook_revert(HOOKLIST* hooks);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -3,11 +3,11 @@
|
|||||||
#include "glcorearb.h"
|
#include "glcorearb.h"
|
||||||
#include "wglext.h"
|
#include "wglext.h"
|
||||||
|
|
||||||
// wgl
|
/* wgl */
|
||||||
typedef HGLRC (APIENTRYP PFNWGLCREATECONTEXTPROC)(HDC);
|
typedef HGLRC(APIENTRYP PFNWGLCREATECONTEXTPROC)(HDC);
|
||||||
typedef BOOL (APIENTRYP PFNWGLDELETECONTEXTPROC)(HGLRC);
|
typedef BOOL(APIENTRYP PFNWGLDELETECONTEXTPROC)(HGLRC);
|
||||||
typedef PROC (APIENTRYP PFNWGLGETPROCADDRESSPROC)(LPCSTR);
|
typedef PROC(APIENTRYP PFNWGLGETPROCADDRESSPROC)(LPCSTR);
|
||||||
typedef BOOL (APIENTRYP PFNWGLMAKECURRENTPROC)(HDC, HGLRC);
|
typedef BOOL(APIENTRYP PFNWGLMAKECURRENTPROC)(HDC, HGLRC);
|
||||||
|
|
||||||
extern PFNWGLCREATECONTEXTPROC xwglCreateContext;
|
extern PFNWGLCREATECONTEXTPROC xwglCreateContext;
|
||||||
extern PFNWGLDELETECONTEXTPROC xwglDeleteContext;
|
extern PFNWGLDELETECONTEXTPROC xwglDeleteContext;
|
||||||
@ -18,7 +18,7 @@ extern PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB;
|
|||||||
extern PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB;
|
extern PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB;
|
||||||
|
|
||||||
|
|
||||||
//compat profile only --->
|
/* compat profile only ---> */
|
||||||
#define GL_LUMINANCE 0x1909
|
#define GL_LUMINANCE 0x1909
|
||||||
#define GL_LUMINANCE8 0x8040
|
#define GL_LUMINANCE8 0x8040
|
||||||
typedef void (APIENTRYP PFNGLBEGINPROC)(GLenum mode);
|
typedef void (APIENTRYP PFNGLBEGINPROC)(GLenum mode);
|
||||||
@ -30,14 +30,14 @@ extern PFNGLBEGINPROC glBegin;
|
|||||||
extern PFNGLENDPROC glEnd;
|
extern PFNGLENDPROC glEnd;
|
||||||
extern PFNGLTEXCOORD2FPROC glTexCoord2f;
|
extern PFNGLTEXCOORD2FPROC glTexCoord2f;
|
||||||
extern PFNGLVERTEX2FPROC glVertex2f;
|
extern PFNGLVERTEX2FPROC glVertex2f;
|
||||||
// <--- compat profile only
|
/* <--- compat profile only */
|
||||||
|
|
||||||
|
|
||||||
BOOL oglu_load_dll();
|
BOOL oglu_load_dll();
|
||||||
void oglu_init();
|
void oglu_init();
|
||||||
BOOL oglu_ext_exists(char *ext, HDC hdc);
|
BOOL oglu_ext_exists(char* ext, HDC hdc);
|
||||||
GLuint oglu_build_program(const GLchar *vert_source, const GLchar *frag_source);
|
GLuint oglu_build_program(const GLchar* vert_source, const GLchar* frag_source);
|
||||||
GLuint oglu_build_program_from_file(const char *file_path, BOOL core_profile);
|
GLuint oglu_build_program_from_file(const char* file_path, BOOL core_profile);
|
||||||
|
|
||||||
extern PFNGLVIEWPORTPROC glViewport;
|
extern PFNGLVIEWPORTPROC glViewport;
|
||||||
extern PFNGLBINDTEXTUREPROC glBindTexture;
|
extern PFNGLBINDTEXTUREPROC glBindTexture;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#ifndef OPENGLSHADER_H
|
#ifndef OPENGLSHADER_H
|
||||||
#define OPENGLSHADER_H
|
#define OPENGLSHADER_H
|
||||||
|
|
||||||
// OpenGL 2.0
|
/* OpenGL 2.0 */
|
||||||
|
|
||||||
const char PASSTHROUGH_VERT_SHADER_110[] =
|
const char PASSTHROUGH_VERT_SHADER_110[] =
|
||||||
"#version 110\n"
|
"#version 110\n"
|
||||||
@ -37,7 +37,7 @@ const char PASSTHROUGH_FRAG_SHADER_110[] =
|
|||||||
" gl_FragColor = texel; \n"
|
" gl_FragColor = texel; \n"
|
||||||
"}\n";
|
"}\n";
|
||||||
|
|
||||||
// OpenGL 3.0
|
/* OpenGL 3.0 */
|
||||||
|
|
||||||
const char PASSTHROUGH_VERT_SHADER[] =
|
const char PASSTHROUGH_VERT_SHADER[] =
|
||||||
"#version 130\n"
|
"#version 130\n"
|
||||||
@ -82,7 +82,7 @@ const char PASSTHROUGH_FRAG_SHADER[] =
|
|||||||
" FragColor = texel;\n"
|
" FragColor = texel;\n"
|
||||||
"}\n";
|
"}\n";
|
||||||
|
|
||||||
// OpenGL 3.2 (Core Profile)
|
/* OpenGL 3.2 (Core Profile) */
|
||||||
|
|
||||||
const char PASSTHROUGH_VERT_SHADER_CORE[] =
|
const char PASSTHROUGH_VERT_SHADER_CORE[] =
|
||||||
"#version 150\n"
|
"#version 150\n"
|
||||||
|
16
inc/patch.h
16
inc/patch.h
@ -4,27 +4,27 @@
|
|||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
static inline PROC patch_call(char *src, char *dst)
|
static inline PROC patch_call(char* src, char* dst)
|
||||||
{
|
{
|
||||||
DWORD op = PAGE_EXECUTE_READ;
|
DWORD op = PAGE_EXECUTE_READ;
|
||||||
VirtualProtect(src, 5, PAGE_EXECUTE_READWRITE, &op);
|
VirtualProtect(src, 5, PAGE_EXECUTE_READWRITE, &op);
|
||||||
src[0] = 0xE8;
|
src[0] = 0xE8;
|
||||||
DWORD org = *((DWORD *)(&src[1]));
|
DWORD org = *((DWORD*)(&src[1]));
|
||||||
*((DWORD *)(&src[1])) = dst - src - 5;
|
*((DWORD*)(&src[1])) = dst - src - 5;
|
||||||
VirtualProtect(src, 5, op, &op);
|
VirtualProtect(src, 5, op, &op);
|
||||||
return (PROC)(src + 5 + org);
|
return (PROC)(src + 5 + org);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void patch_ljmp(char *src, char *dst)
|
static inline void patch_ljmp(char* src, char* dst)
|
||||||
{
|
{
|
||||||
DWORD op = PAGE_EXECUTE_READ;
|
DWORD op = PAGE_EXECUTE_READ;
|
||||||
VirtualProtect(src, 5, PAGE_EXECUTE_READWRITE, &op);
|
VirtualProtect(src, 5, PAGE_EXECUTE_READWRITE, &op);
|
||||||
src[0] = 0xE9;
|
src[0] = 0xE9;
|
||||||
*((DWORD *)(&src[1])) = dst - src - 5;
|
*((DWORD*)(&src[1])) = dst - src - 5;
|
||||||
VirtualProtect(src, 5, op, &op);
|
VirtualProtect(src, 5, op, &op);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void patch_clear(char *start, char value, char *end)
|
static inline void patch_clear(char* start, char value, char* end)
|
||||||
{
|
{
|
||||||
DWORD op = PAGE_EXECUTE_READ;
|
DWORD op = PAGE_EXECUTE_READ;
|
||||||
VirtualProtect(start, end - start, PAGE_EXECUTE_READWRITE, &op);
|
VirtualProtect(start, end - start, PAGE_EXECUTE_READWRITE, &op);
|
||||||
@ -32,7 +32,7 @@ static inline void patch_clear(char *start, char value, char *end)
|
|||||||
VirtualProtect(start, end - start, op, &op);
|
VirtualProtect(start, end - start, op, &op);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline DWORD patch_setdword(DWORD *dst, DWORD value)
|
static inline DWORD patch_setdword(DWORD* dst, DWORD value)
|
||||||
{
|
{
|
||||||
DWORD op = PAGE_EXECUTE_READ;
|
DWORD op = PAGE_EXECUTE_READ;
|
||||||
VirtualProtect(dst, sizeof(DWORD), PAGE_EXECUTE_READWRITE, &op);
|
VirtualProtect(dst, sizeof(DWORD), PAGE_EXECUTE_READWRITE, &op);
|
||||||
@ -42,7 +42,7 @@ static inline DWORD patch_setdword(DWORD *dst, DWORD value)
|
|||||||
return org;
|
return org;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void patch_setbytes(char *dst, char *buf, size_t size)
|
static inline void patch_setbytes(char* dst, char* buf, size_t size)
|
||||||
{
|
{
|
||||||
DWORD op = PAGE_EXECUTE_READ;
|
DWORD op = PAGE_EXECUTE_READ;
|
||||||
VirtualProtect(dst, size, PAGE_EXECUTE_READWRITE, &op);
|
VirtualProtect(dst, size, PAGE_EXECUTE_READWRITE, &op);
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
typedef struct CUSTOMVERTEX { float x, y, z, rhw, u, v; } CUSTOMVERTEX;
|
typedef struct CUSTOMVERTEX { float x, y, z, rhw, u, v; } CUSTOMVERTEX;
|
||||||
|
|
||||||
typedef struct d3d9_renderer
|
typedef struct D3D9RENDERER
|
||||||
{
|
{
|
||||||
HMODULE hmodule;
|
HMODULE hmodule;
|
||||||
D3DPRESENT_PARAMETERS params;
|
D3DPRESENT_PARAMETERS params;
|
||||||
@ -22,7 +22,7 @@ typedef struct d3d9_renderer
|
|||||||
float scale_w;
|
float scale_w;
|
||||||
float scale_h;
|
float scale_h;
|
||||||
int bits_per_pixel;
|
int bits_per_pixel;
|
||||||
} d3d9_renderer;
|
} D3D9RENDERER;
|
||||||
|
|
||||||
BOOL d3d9_is_available();
|
BOOL d3d9_is_available();
|
||||||
DWORD WINAPI d3d9_render_main(void);
|
DWORD WINAPI d3d9_render_main(void);
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#define TEXTURE_COUNT 4
|
#define TEXTURE_COUNT 4
|
||||||
|
|
||||||
typedef struct ogl_renderer
|
typedef struct OGLRENDERER
|
||||||
{
|
{
|
||||||
HGLRC context;
|
HGLRC context;
|
||||||
GLuint main_program;
|
GLuint main_program;
|
||||||
@ -34,7 +34,7 @@ typedef struct ogl_renderer
|
|||||||
BOOL use_opengl;
|
BOOL use_opengl;
|
||||||
BOOL adjust_alignment;
|
BOOL adjust_alignment;
|
||||||
BOOL filter_bilinear;
|
BOOL filter_bilinear;
|
||||||
} ogl_renderer;
|
} OGLRENDERER;
|
||||||
|
|
||||||
DWORD WINAPI ogl_render_main(void);
|
DWORD WINAPI ogl_render_main(void);
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
|
|
||||||
BOOL WINAPI fake_GetCursorPos(LPPOINT lpPoint);
|
BOOL WINAPI fake_GetCursorPos(LPPOINT lpPoint);
|
||||||
BOOL WINAPI fake_ClipCursor(const RECT *lpRect);
|
BOOL WINAPI fake_ClipCursor(const RECT* lpRect);
|
||||||
int WINAPI fake_ShowCursor(BOOL bShow);
|
int WINAPI fake_ShowCursor(BOOL bShow);
|
||||||
HCURSOR WINAPI fake_SetCursor(HCURSOR hCursor);
|
HCURSOR WINAPI fake_SetCursor(HCURSOR hCursor);
|
||||||
BOOL WINAPI fake_GetWindowRect(HWND hWnd, LPRECT lpRect);
|
BOOL WINAPI fake_GetWindowRect(HWND hWnd, LPRECT lpRect);
|
||||||
|
@ -3,123 +3,123 @@
|
|||||||
|
|
||||||
HRESULT __stdcall IAMMediaStream__QueryInterface(IAMMediaStreamImpl* This, REFIID riid, void** obj)
|
HRESULT __stdcall IAMMediaStream__QueryInterface(IAMMediaStreamImpl* This, REFIID riid, void** obj)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p, riid=%08X, obj=%p)\n", __FUNCTION__, This, (unsigned int)riid, obj);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p, riid=%08X, obj=%p)\n", __FUNCTION__, This, (unsigned int)riid, obj);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_NOINTERFACE;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG __stdcall IAMMediaStream__AddRef(IAMMediaStreamImpl* This)
|
ULONG __stdcall IAMMediaStream__AddRef(IAMMediaStreamImpl* This)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
ULONG ret = ++This->ref;
|
ULONG ret = ++This->ref;
|
||||||
dprintf("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
TRACE("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG __stdcall IAMMediaStream__Release(IAMMediaStreamImpl* This)
|
ULONG __stdcall IAMMediaStream__Release(IAMMediaStreamImpl* This)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
|
|
||||||
ULONG ret = --This->ref;
|
ULONG ret = --This->ref;
|
||||||
|
|
||||||
if (This->ref == 0)
|
if (This->ref == 0)
|
||||||
{
|
{
|
||||||
dprintf(" Released (%p)\n", This);
|
TRACE(" Released (%p)\n", This);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
}
|
}
|
||||||
|
|
||||||
dprintf("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
TRACE("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI IAMMediaStream__GetMultiMediaStream(IAMMediaStreamImpl* This, int a)
|
HRESULT WINAPI IAMMediaStream__GetMultiMediaStream(IAMMediaStreamImpl* This, int a)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI IAMMediaStream__GetInformation(IAMMediaStreamImpl* This, int a, int b)
|
HRESULT WINAPI IAMMediaStream__GetInformation(IAMMediaStreamImpl* This, int a, int b)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI IAMMediaStream__SetSameFormat(IAMMediaStreamImpl* This, int a, int b)
|
HRESULT WINAPI IAMMediaStream__SetSameFormat(IAMMediaStreamImpl* This, int a, int b)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI IAMMediaStream__AllocateSample(IAMMediaStreamImpl* This, int a, int b)
|
HRESULT WINAPI IAMMediaStream__AllocateSample(IAMMediaStreamImpl* This, int a, int b)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI IAMMediaStream__CreateSharedSample(IAMMediaStreamImpl* This, int a, int b, int c)
|
HRESULT WINAPI IAMMediaStream__CreateSharedSample(IAMMediaStreamImpl* This, int a, int b, int c)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI IAMMediaStream__SendEndOfStream(IAMMediaStreamImpl* This, int a)
|
HRESULT WINAPI IAMMediaStream__SendEndOfStream(IAMMediaStreamImpl* This, int a)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
// IAMMediaStream
|
// IAMMediaStream
|
||||||
HRESULT WINAPI IAMMediaStream__Initialize(IAMMediaStreamImpl* This, int a, int b, int c, int d)
|
HRESULT WINAPI IAMMediaStream__Initialize(IAMMediaStreamImpl* This, int a, int b, int c, int d)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI IAMMediaStream__SetState(IAMMediaStreamImpl* This, int a)
|
HRESULT WINAPI IAMMediaStream__SetState(IAMMediaStreamImpl* This, int a)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI IAMMediaStream__JoinAMMultiMediaStream(IAMMediaStreamImpl* This, int a)
|
HRESULT WINAPI IAMMediaStream__JoinAMMultiMediaStream(IAMMediaStreamImpl* This, int a)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI IAMMediaStream__JoinFilter(IAMMediaStreamImpl* This, int a)
|
HRESULT WINAPI IAMMediaStream__JoinFilter(IAMMediaStreamImpl* This, int a)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI IAMMediaStream__JoinFilterGraph(IAMMediaStreamImpl* This, int a)
|
HRESULT WINAPI IAMMediaStream__JoinFilterGraph(IAMMediaStreamImpl* This, int a)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,82 +4,82 @@
|
|||||||
|
|
||||||
HRESULT __stdcall IDirect3D__QueryInterface(IDirect3DImpl* This, REFIID riid, void** obj)
|
HRESULT __stdcall IDirect3D__QueryInterface(IDirect3DImpl* This, REFIID riid, void** obj)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p, riid=%08X, obj=%p)\n", __FUNCTION__, This, (unsigned int)riid, obj);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p, riid=%08X, obj=%p)\n", __FUNCTION__, This, (unsigned int)riid, obj);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG __stdcall IDirect3D__AddRef(IDirect3DImpl* This)
|
ULONG __stdcall IDirect3D__AddRef(IDirect3DImpl* This)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
ULONG ret = ++This->ref;
|
ULONG ret = ++This->ref;
|
||||||
dprintf("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
TRACE("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG __stdcall IDirect3D__Release(IDirect3DImpl* This)
|
ULONG __stdcall IDirect3D__Release(IDirect3DImpl* This)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
|
|
||||||
ULONG ret = --This->ref;
|
ULONG ret = --This->ref;
|
||||||
|
|
||||||
if (This->ref == 0)
|
if (This->ref == 0)
|
||||||
{
|
{
|
||||||
dprintf(" Released (%p)\n", This);
|
TRACE(" Released (%p)\n", This);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
}
|
}
|
||||||
|
|
||||||
dprintf("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
TRACE("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D__Initialize(IDirect3DImpl* This, int a)
|
HRESULT __stdcall IDirect3D__Initialize(IDirect3DImpl* This, int a)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D__EnumDevices(IDirect3DImpl* This, int a, int b)
|
HRESULT __stdcall IDirect3D__EnumDevices(IDirect3DImpl* This, int a, int b)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D__CreateLight(IDirect3DImpl* This, int a, int b)
|
HRESULT __stdcall IDirect3D__CreateLight(IDirect3DImpl* This, int a, int b)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D__CreateMaterial(IDirect3DImpl* This, int a, int b)
|
HRESULT __stdcall IDirect3D__CreateMaterial(IDirect3DImpl* This, int a, int b)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D__CreateViewport(IDirect3DImpl* This, int a, int b)
|
HRESULT __stdcall IDirect3D__CreateViewport(IDirect3DImpl* This, int a, int b)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D__FindDevice(IDirect3DImpl* This, int a, int b)
|
HRESULT __stdcall IDirect3D__FindDevice(IDirect3DImpl* This, int a, int b)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,82 +4,82 @@
|
|||||||
|
|
||||||
HRESULT __stdcall IDirect3D2__QueryInterface(IDirect3D2Impl* This, REFIID riid, void** obj)
|
HRESULT __stdcall IDirect3D2__QueryInterface(IDirect3D2Impl* This, REFIID riid, void** obj)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p, riid=%08X, obj=%p)\n", __FUNCTION__, This, (unsigned int)riid, obj);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p, riid=%08X, obj=%p)\n", __FUNCTION__, This, (unsigned int)riid, obj);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG __stdcall IDirect3D2__AddRef(IDirect3D2Impl* This)
|
ULONG __stdcall IDirect3D2__AddRef(IDirect3D2Impl* This)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
ULONG ret = ++This->ref;
|
ULONG ret = ++This->ref;
|
||||||
dprintf("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
TRACE("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG __stdcall IDirect3D2__Release(IDirect3D2Impl* This)
|
ULONG __stdcall IDirect3D2__Release(IDirect3D2Impl* This)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
|
|
||||||
ULONG ret = --This->ref;
|
ULONG ret = --This->ref;
|
||||||
|
|
||||||
if (This->ref == 0)
|
if (This->ref == 0)
|
||||||
{
|
{
|
||||||
dprintf(" Released (%p)\n", This);
|
TRACE(" Released (%p)\n", This);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
}
|
}
|
||||||
|
|
||||||
dprintf("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
TRACE("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D2__EnumDevices(IDirect3D2Impl* This, int a, int b)
|
HRESULT __stdcall IDirect3D2__EnumDevices(IDirect3D2Impl* This, int a, int b)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D2__CreateLight(IDirect3D2Impl* This, int a, int b)
|
HRESULT __stdcall IDirect3D2__CreateLight(IDirect3D2Impl* This, int a, int b)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D2__CreateMaterial(IDirect3D2Impl* This, int a, int b)
|
HRESULT __stdcall IDirect3D2__CreateMaterial(IDirect3D2Impl* This, int a, int b)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D2__CreateViewport(IDirect3D2Impl* This, int a, int b)
|
HRESULT __stdcall IDirect3D2__CreateViewport(IDirect3D2Impl* This, int a, int b)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D2__FindDevice(IDirect3D2Impl* This, int a, int b)
|
HRESULT __stdcall IDirect3D2__FindDevice(IDirect3D2Impl* This, int a, int b)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D2__CreateDevice(IDirect3D2Impl* This, int a, int b, int c)
|
HRESULT __stdcall IDirect3D2__CreateDevice(IDirect3D2Impl* This, int a, int b, int c)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,106 +4,106 @@
|
|||||||
|
|
||||||
HRESULT __stdcall IDirect3D3__QueryInterface(IDirect3D3Impl* This, REFIID riid, void** obj)
|
HRESULT __stdcall IDirect3D3__QueryInterface(IDirect3D3Impl* This, REFIID riid, void** obj)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p, riid=%08X, obj=%p)\n", __FUNCTION__, This, (unsigned int)riid, obj);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p, riid=%08X, obj=%p)\n", __FUNCTION__, This, (unsigned int)riid, obj);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG __stdcall IDirect3D3__AddRef(IDirect3D3Impl* This)
|
ULONG __stdcall IDirect3D3__AddRef(IDirect3D3Impl* This)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
ULONG ret = ++This->ref;
|
ULONG ret = ++This->ref;
|
||||||
dprintf("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
TRACE("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG __stdcall IDirect3D3__Release(IDirect3D3Impl* This)
|
ULONG __stdcall IDirect3D3__Release(IDirect3D3Impl* This)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
|
|
||||||
ULONG ret = --This->ref;
|
ULONG ret = --This->ref;
|
||||||
|
|
||||||
if (This->ref == 0)
|
if (This->ref == 0)
|
||||||
{
|
{
|
||||||
dprintf(" Released (%p)\n", This);
|
TRACE(" Released (%p)\n", This);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
}
|
}
|
||||||
|
|
||||||
dprintf("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
TRACE("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D3__EnumDevices(IDirect3D3Impl* This, int a, int b)
|
HRESULT __stdcall IDirect3D3__EnumDevices(IDirect3D3Impl* This, int a, int b)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D3__CreateLight(IDirect3D3Impl* This, int a, int b)
|
HRESULT __stdcall IDirect3D3__CreateLight(IDirect3D3Impl* This, int a, int b)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D3__CreateMaterial(IDirect3D3Impl* This, int a, int b)
|
HRESULT __stdcall IDirect3D3__CreateMaterial(IDirect3D3Impl* This, int a, int b)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D3__CreateViewport(IDirect3D3Impl* This, int a, int b)
|
HRESULT __stdcall IDirect3D3__CreateViewport(IDirect3D3Impl* This, int a, int b)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D3__FindDevice(IDirect3D3Impl* This, int a, int b)
|
HRESULT __stdcall IDirect3D3__FindDevice(IDirect3D3Impl* This, int a, int b)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D3__CreateDevice(IDirect3D3Impl* This, int a, int b, int c, int d)
|
HRESULT __stdcall IDirect3D3__CreateDevice(IDirect3D3Impl* This, int a, int b, int c, int d)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D3__CreateVertexBuffer(IDirect3D3Impl* This, int a, int b, int c, int d)
|
HRESULT __stdcall IDirect3D3__CreateVertexBuffer(IDirect3D3Impl* This, int a, int b, int c, int d)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D3__EnumZBufferFormats(IDirect3D3Impl* This, int a, int b, int c)
|
HRESULT __stdcall IDirect3D3__EnumZBufferFormats(IDirect3D3Impl* This, int a, int b, int c)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D3__EvictManagedTextures(IDirect3D3Impl* This)
|
HRESULT __stdcall IDirect3D3__EvictManagedTextures(IDirect3D3Impl* This)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,74 +4,74 @@
|
|||||||
|
|
||||||
HRESULT __stdcall IDirect3D7__QueryInterface(IDirect3D7Impl* This, REFIID riid, void** obj)
|
HRESULT __stdcall IDirect3D7__QueryInterface(IDirect3D7Impl* This, REFIID riid, void** obj)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p, riid=%08X, obj=%p)\n", __FUNCTION__, This, (unsigned int)riid, obj);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p, riid=%08X, obj=%p)\n", __FUNCTION__, This, (unsigned int)riid, obj);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG __stdcall IDirect3D7__AddRef(IDirect3D7Impl* This)
|
ULONG __stdcall IDirect3D7__AddRef(IDirect3D7Impl* This)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
ULONG ret = ++This->ref;
|
ULONG ret = ++This->ref;
|
||||||
dprintf("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
TRACE("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG __stdcall IDirect3D7__Release(IDirect3D7Impl* This)
|
ULONG __stdcall IDirect3D7__Release(IDirect3D7Impl* This)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
|
|
||||||
ULONG ret = --This->ref;
|
ULONG ret = --This->ref;
|
||||||
|
|
||||||
if (This->ref == 0)
|
if (This->ref == 0)
|
||||||
{
|
{
|
||||||
dprintf(" Released (%p)\n", This);
|
TRACE(" Released (%p)\n", This);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
}
|
}
|
||||||
|
|
||||||
dprintf("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
TRACE("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D7__EnumDevices(IDirect3D7Impl* This, int a, int b)
|
HRESULT __stdcall IDirect3D7__EnumDevices(IDirect3D7Impl* This, int a, int b)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D7__CreateDevice(IDirect3D7Impl* This, int a, int b, int c)
|
HRESULT __stdcall IDirect3D7__CreateDevice(IDirect3D7Impl* This, int a, int b, int c)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D7__CreateVertexBuffer(IDirect3D7Impl* This, int a, int b, int c)
|
HRESULT __stdcall IDirect3D7__CreateVertexBuffer(IDirect3D7Impl* This, int a, int b, int c)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D7__EnumZBufferFormats(IDirect3D7Impl* This, int a, int b, int c)
|
HRESULT __stdcall IDirect3D7__EnumZBufferFormats(IDirect3D7Impl* This, int a, int b, int c)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirect3D7__EvictManagedTextures(IDirect3D7Impl* This)
|
HRESULT __stdcall IDirect3D7__EvictManagedTextures(IDirect3D7Impl* This)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,9 +9,10 @@
|
|||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__QueryInterface(IDirectDrawImpl* This, REFIID riid, void** obj)
|
HRESULT __stdcall IDirectDraw__QueryInterface(IDirectDrawImpl* This, REFIID riid, LPVOID FAR* ppvObj)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p, riid=%08X, obj=%p)\n", __FUNCTION__, This, (unsigned int)riid, obj);
|
TRACE("-> %s(This=%p, riid=%08X, obj=%p)\n", __FUNCTION__, This, (unsigned int)riid, ppvObj);
|
||||||
|
|
||||||
HRESULT ret = DDERR_UNSUPPORTED;
|
HRESULT ret = DDERR_UNSUPPORTED;
|
||||||
|
|
||||||
if (riid)
|
if (riid)
|
||||||
@ -20,79 +21,85 @@ HRESULT __stdcall IDirectDraw__QueryInterface(IDirectDrawImpl* This, REFIID riid
|
|||||||
IsEqualGUID(&IID_IDirectDraw4, riid) ||
|
IsEqualGUID(&IID_IDirectDraw4, riid) ||
|
||||||
IsEqualGUID(&IID_IDirectDraw7, riid))
|
IsEqualGUID(&IID_IDirectDraw7, riid))
|
||||||
{
|
{
|
||||||
IDirectDrawImpl* dd = (IDirectDrawImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectDrawImpl));
|
IDirectDrawImpl* dd =
|
||||||
|
(IDirectDrawImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectDrawImpl));
|
||||||
|
|
||||||
dprintf(" GUID = %08X (IID_IDirectDrawX), ddraw = %p\n", ((GUID*)riid)->Data1, dd);
|
TRACE(" GUID = %08X (IID_IDirectDrawX), ddraw = %p\n", ((GUID*)riid)->Data1, dd);
|
||||||
|
|
||||||
dd->lpVtbl = &g_dd_vtblx;
|
dd->lpVtbl = &g_dd_vtblx;
|
||||||
IDirectDraw_AddRef(dd);
|
IDirectDraw_AddRef(dd);
|
||||||
|
|
||||||
*obj = dd;
|
*ppvObj = dd;
|
||||||
|
|
||||||
ret = S_OK;
|
ret = S_OK;
|
||||||
}
|
}
|
||||||
else if (IsEqualGUID(&IID_IDirectDraw, riid))
|
else if (IsEqualGUID(&IID_IDirectDraw, riid))
|
||||||
{
|
{
|
||||||
IDirectDrawImpl* dd = (IDirectDrawImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectDrawImpl));
|
IDirectDrawImpl* dd =
|
||||||
|
(IDirectDrawImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectDrawImpl));
|
||||||
|
|
||||||
dprintf(" GUID = %08X (IID_IDirectDraw), ddraw = %p\n", ((GUID*)riid)->Data1, dd);
|
TRACE(" GUID = %08X (IID_IDirectDraw), ddraw = %p\n", ((GUID*)riid)->Data1, dd);
|
||||||
|
|
||||||
dd->lpVtbl = &g_dd_vtbl1;
|
dd->lpVtbl = &g_dd_vtbl1;
|
||||||
IDirectDraw_AddRef(dd);
|
IDirectDraw_AddRef(dd);
|
||||||
|
|
||||||
*obj = dd;
|
*ppvObj = dd;
|
||||||
|
|
||||||
ret = S_OK;
|
ret = S_OK;
|
||||||
}
|
}
|
||||||
else if (IsEqualGUID(&IID_IDirect3D, riid))
|
else if (IsEqualGUID(&IID_IDirect3D, riid))
|
||||||
{
|
{
|
||||||
IDirect3DImpl* d3d = (IDirect3DImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DImpl));
|
IDirect3DImpl* d3d =
|
||||||
|
(IDirect3DImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DImpl));
|
||||||
|
|
||||||
dprintf(" GUID = %08X (IID_IDirect3D), d3d = %p\n", ((GUID*)riid)->Data1, d3d);
|
TRACE(" GUID = %08X (IID_IDirect3D), d3d = %p\n", ((GUID*)riid)->Data1, d3d);
|
||||||
|
|
||||||
d3d->lpVtbl = &g_d3d_vtbl;
|
d3d->lpVtbl = &g_d3d_vtbl;
|
||||||
d3d->lpVtbl->AddRef(d3d);
|
d3d->lpVtbl->AddRef(d3d);
|
||||||
|
|
||||||
*obj = d3d;
|
*ppvObj = d3d;
|
||||||
|
|
||||||
ret = S_OK;
|
ret = S_OK;
|
||||||
}
|
}
|
||||||
else if (IsEqualGUID(&IID_IDirect3D2, riid))
|
else if (IsEqualGUID(&IID_IDirect3D2, riid))
|
||||||
{
|
{
|
||||||
IDirect3D2Impl* d3d = (IDirect3D2Impl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3D2Impl));
|
IDirect3D2Impl* d3d =
|
||||||
|
(IDirect3D2Impl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3D2Impl));
|
||||||
|
|
||||||
dprintf(" GUID = %08X (IID_IDirect3D2), d3d = %p\n", ((GUID*)riid)->Data1, d3d);
|
TRACE(" GUID = %08X (IID_IDirect3D2), d3d = %p\n", ((GUID*)riid)->Data1, d3d);
|
||||||
|
|
||||||
d3d->lpVtbl = &g_d3d2_vtbl;
|
d3d->lpVtbl = &g_d3d2_vtbl;
|
||||||
d3d->lpVtbl->AddRef(d3d);
|
d3d->lpVtbl->AddRef(d3d);
|
||||||
|
|
||||||
*obj = d3d;
|
*ppvObj = d3d;
|
||||||
|
|
||||||
ret = S_OK;
|
ret = S_OK;
|
||||||
}
|
}
|
||||||
else if (IsEqualGUID(&IID_IDirect3D3, riid))
|
else if (IsEqualGUID(&IID_IDirect3D3, riid))
|
||||||
{
|
{
|
||||||
IDirect3D3Impl* d3d = (IDirect3D3Impl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3D3Impl));
|
IDirect3D3Impl* d3d =
|
||||||
|
(IDirect3D3Impl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3D3Impl));
|
||||||
|
|
||||||
dprintf(" GUID = %08X (IID_IDirect3D3), d3d = %p\n", ((GUID*)riid)->Data1, d3d);
|
TRACE(" GUID = %08X (IID_IDirect3D3), d3d = %p\n", ((GUID*)riid)->Data1, d3d);
|
||||||
|
|
||||||
d3d->lpVtbl = &g_d3d3_vtbl;
|
d3d->lpVtbl = &g_d3d3_vtbl;
|
||||||
d3d->lpVtbl->AddRef(d3d);
|
d3d->lpVtbl->AddRef(d3d);
|
||||||
|
|
||||||
*obj = d3d;
|
*ppvObj = d3d;
|
||||||
|
|
||||||
ret = S_OK;
|
ret = S_OK;
|
||||||
}
|
}
|
||||||
else if (IsEqualGUID(&IID_IDirect3D7, riid))
|
else if (IsEqualGUID(&IID_IDirect3D7, riid))
|
||||||
{
|
{
|
||||||
IDirect3D7Impl* d3d = (IDirect3D7Impl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3D7Impl));
|
IDirect3D7Impl* d3d =
|
||||||
|
(IDirect3D7Impl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3D7Impl));
|
||||||
|
|
||||||
dprintf(" GUID = %08X (IID_IDirect3D7), d3d = %p\n", ((GUID*)riid)->Data1, d3d);
|
TRACE(" GUID = %08X (IID_IDirect3D7), d3d = %p\n", ((GUID*)riid)->Data1, d3d);
|
||||||
|
|
||||||
d3d->lpVtbl = &g_d3d7_vtbl;
|
d3d->lpVtbl = &g_d3d7_vtbl;
|
||||||
d3d->lpVtbl->AddRef(d3d);
|
d3d->lpVtbl->AddRef(d3d);
|
||||||
|
|
||||||
*obj = d3d;
|
*ppvObj = d3d;
|
||||||
|
|
||||||
ret = S_OK;
|
ret = S_OK;
|
||||||
}
|
}
|
||||||
@ -104,7 +111,7 @@ HRESULT __stdcall IDirectDraw__QueryInterface(IDirectDrawImpl* This, REFIID riid
|
|||||||
IAMMediaStreamImpl* ms =
|
IAMMediaStreamImpl* ms =
|
||||||
(IAMMediaStreamImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAMMediaStreamImpl));
|
(IAMMediaStreamImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAMMediaStreamImpl));
|
||||||
|
|
||||||
dprintf(" GUID = %08X (IID_IXXMediaStream), ms = %p\n", ((GUID*)riid)->Data1, ms);
|
TRACE(" GUID = %08X (IID_IXXMediaStream), ms = %p\n", ((GUID*)riid)->Data1, ms);
|
||||||
|
|
||||||
ms->lpVtbl = &g_ms_vtbl;
|
ms->lpVtbl = &g_ms_vtbl;
|
||||||
ms->lpVtbl->AddRef(ms);
|
ms->lpVtbl->AddRef(ms);
|
||||||
@ -116,7 +123,7 @@ HRESULT __stdcall IDirectDraw__QueryInterface(IDirectDrawImpl* This, REFIID riid
|
|||||||
*/
|
*/
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED GUID = %08X\n", ((GUID*)riid)->Data1);
|
TRACE("NOT_IMPLEMENTED GUID = %08X\n", ((GUID*)riid)->Data1);
|
||||||
|
|
||||||
if (!g_ddraw->real_dll)
|
if (!g_ddraw->real_dll)
|
||||||
g_ddraw->real_dll = LoadLibrary("system32\\ddraw.dll");
|
g_ddraw->real_dll = LoadLibrary("system32\\ddraw.dll");
|
||||||
@ -131,275 +138,363 @@ HRESULT __stdcall IDirectDraw__QueryInterface(IDirectDrawImpl* This, REFIID riid
|
|||||||
g_ddraw->DirectDrawCreate(NULL, &g_ddraw->real_dd, NULL);
|
g_ddraw->DirectDrawCreate(NULL, &g_ddraw->real_dd, NULL);
|
||||||
|
|
||||||
if (g_ddraw->real_dd)
|
if (g_ddraw->real_dd)
|
||||||
return IDirectDraw_QueryInterface(g_ddraw->real_dd, riid, obj);
|
return IDirectDraw_QueryInterface(g_ddraw->real_dd, riid, ppvObj);
|
||||||
|
|
||||||
ret = E_NOINTERFACE;
|
ret = E_NOINTERFACE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG __stdcall IDirectDraw__AddRef(IDirectDrawImpl* This)
|
ULONG __stdcall IDirectDraw__AddRef(IDirectDrawImpl* This)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
ULONG ret = ++This->ref;
|
ULONG ret = ++This->ref;
|
||||||
ULONG glob_ref = dd_AddRef();
|
ULONG glob_ref = dd_AddRef();
|
||||||
dprintf("<- %s(This ref=%u, global ref=%u)\n", __FUNCTION__, ret, glob_ref);
|
TRACE("<- %s(This ref=%u, global ref=%u)\n", __FUNCTION__, ret, glob_ref);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG __stdcall IDirectDraw__Release(IDirectDrawImpl* This)
|
ULONG __stdcall IDirectDraw__Release(IDirectDrawImpl* This)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
|
|
||||||
ULONG ret = --This->ref;
|
ULONG ret = --This->ref;
|
||||||
|
|
||||||
if (This->ref == 0)
|
if (This->ref == 0)
|
||||||
{
|
{
|
||||||
dprintf(" Released (%p)\n", This);
|
TRACE(" Released (%p)\n", This);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG glob_ref = dd_Release();
|
ULONG glob_ref = dd_Release();
|
||||||
|
|
||||||
dprintf("<- %s(This ref=%u, global ref=%u)\n", __FUNCTION__, ret, glob_ref);
|
TRACE("<- %s(This ref=%u, global ref=%u)\n", __FUNCTION__, ret, glob_ref);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__Compact(IDirectDrawImpl* This)
|
HRESULT __stdcall IDirectDraw__Compact(IDirectDrawImpl* This)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__CreateClipper(IDirectDrawImpl* This, DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR* lplpDDClipper, IUnknown FAR* pUnkOuter)
|
HRESULT __stdcall IDirectDraw__CreateClipper(
|
||||||
|
IDirectDrawImpl* This,
|
||||||
|
DWORD dwFlags,
|
||||||
|
LPDIRECTDRAWCLIPPER FAR* lplpDDClipper,
|
||||||
|
IUnknown FAR* pUnkOuter)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p, dwFlags=%08X, DDClipper=%p, unkOuter=%p)\n", __FUNCTION__, This, (int)dwFlags, lplpDDClipper, pUnkOuter);
|
TRACE(
|
||||||
HRESULT ret = dd_CreateClipper(dwFlags, lplpDDClipper, pUnkOuter);
|
"-> %s(This=%p, dwFlags=%08X, DDClipper=%p, unkOuter=%p)\n",
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
__FUNCTION__,
|
||||||
|
This,
|
||||||
|
dwFlags,
|
||||||
|
lplpDDClipper,
|
||||||
|
pUnkOuter);
|
||||||
|
|
||||||
|
HRESULT ret = dd_CreateClipper(dwFlags, (IDirectDrawClipperImpl**)lplpDDClipper, pUnkOuter);
|
||||||
|
|
||||||
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__CreatePalette(IDirectDrawImpl* This, DWORD dwFlags, LPPALETTEENTRY lpDDColorArray, LPDIRECTDRAWPALETTE FAR* lpDDPalette, IUnknown FAR* unkOuter)
|
HRESULT __stdcall IDirectDraw__CreatePalette(
|
||||||
|
IDirectDrawImpl* This,
|
||||||
|
DWORD dwFlags,
|
||||||
|
LPPALETTEENTRY lpDDColorArray,
|
||||||
|
LPDIRECTDRAWPALETTE FAR* lpDDPalette,
|
||||||
|
IUnknown FAR* unkOuter)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p, dwFlags=%08X, DDColorArray=%p, DDPalette=%p, unkOuter=%p)\n", __FUNCTION__, This, (int)dwFlags, lpDDColorArray, lpDDPalette, unkOuter);
|
TRACE(
|
||||||
HRESULT ret = dd_CreatePalette(dwFlags, lpDDColorArray, lpDDPalette, unkOuter);
|
"-> %s(This=%p, dwFlags=%08X, DDColorArray=%p, DDPalette=%p, unkOuter=%p)\n",
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
__FUNCTION__,
|
||||||
|
This,
|
||||||
|
dwFlags,
|
||||||
|
lpDDColorArray,
|
||||||
|
lpDDPalette,
|
||||||
|
unkOuter);
|
||||||
|
|
||||||
|
HRESULT ret = dd_CreatePalette(dwFlags, lpDDColorArray, (IDirectDrawPaletteImpl**)lpDDPalette, unkOuter);
|
||||||
|
|
||||||
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__CreateSurface(IDirectDrawImpl* This, LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE FAR* lpDDSurface, IUnknown FAR* unkOuter)
|
HRESULT __stdcall IDirectDraw__CreateSurface(
|
||||||
|
IDirectDrawImpl* This,
|
||||||
|
LPDDSURFACEDESC2 lpDDSurfaceDesc,
|
||||||
|
LPDIRECTDRAWSURFACE7 FAR* lpDDSurface,
|
||||||
|
IUnknown FAR* unkOuter)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p, lpDDSurfaceDesc=%p, lpDDSurface=%p, unkOuter=%p)\n", __FUNCTION__, This, lpDDSurfaceDesc, lpDDSurface, unkOuter);
|
TRACE(
|
||||||
HRESULT ret = dd_CreateSurface(This, lpDDSurfaceDesc, lpDDSurface, unkOuter);
|
"-> %s(This=%p, lpDDSurfaceDesc=%p, lpDDSurface=%p, unkOuter=%p)\n",
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
__FUNCTION__,
|
||||||
|
This,
|
||||||
|
lpDDSurfaceDesc,
|
||||||
|
lpDDSurface,
|
||||||
|
unkOuter);
|
||||||
|
|
||||||
|
HRESULT ret = dd_CreateSurface(This, lpDDSurfaceDesc, (IDirectDrawSurfaceImpl**)lpDDSurface, unkOuter);
|
||||||
|
|
||||||
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__DuplicateSurface(IDirectDrawImpl* This, LPDIRECTDRAWSURFACE src, LPDIRECTDRAWSURFACE* dest)
|
HRESULT __stdcall IDirectDraw__DuplicateSurface(
|
||||||
|
IDirectDrawImpl* This,
|
||||||
|
LPDIRECTDRAWSURFACE7 lpDDSrcSurface,
|
||||||
|
LPDIRECTDRAWSURFACE7* lpDDDestSurface)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DDERR_CANTDUPLICATE;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__EnumDisplayModes(IDirectDrawImpl* This, DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK lpEnumModesCallback)
|
HRESULT __stdcall IDirectDraw__EnumDisplayModes(
|
||||||
|
IDirectDrawImpl* This,
|
||||||
|
DWORD dwFlags,
|
||||||
|
LPDDSURFACEDESC2 lpDDSurfaceDesc,
|
||||||
|
LPVOID lpContext,
|
||||||
|
LPDDENUMMODESCALLBACK2 lpEnumModesCallback)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p, dwFlags=%08X, lpDDSurfaceDesc=%p, lpContext=%p, lpEnumModesCallback=%p)\n", __FUNCTION__, This, (unsigned int)dwFlags, lpDDSurfaceDesc, lpContext, lpEnumModesCallback);
|
TRACE(
|
||||||
|
"-> %s(This=%p, dwFlags=%08X, lpDDSurfaceDesc=%p, lpContext=%p, lpEnumModesCallback=%p)\n",
|
||||||
|
__FUNCTION__,
|
||||||
|
This,
|
||||||
|
dwFlags,
|
||||||
|
lpDDSurfaceDesc,
|
||||||
|
lpContext,
|
||||||
|
lpEnumModesCallback);
|
||||||
|
|
||||||
HRESULT ret = dd_EnumDisplayModes(dwFlags, lpDDSurfaceDesc, lpContext, lpEnumModesCallback);
|
HRESULT ret = dd_EnumDisplayModes(dwFlags, lpDDSurfaceDesc, lpContext, lpEnumModesCallback);
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
|
||||||
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__EnumSurfaces(IDirectDrawImpl* This, DWORD a, LPDDSURFACEDESC b, LPVOID c, LPDDENUMSURFACESCALLBACK d)
|
HRESULT __stdcall IDirectDraw__EnumSurfaces(
|
||||||
|
IDirectDrawImpl* This,
|
||||||
|
DWORD dwFlags,
|
||||||
|
LPDDSURFACEDESC2 lpDDSurfaceDesc,
|
||||||
|
LPVOID lpContext,
|
||||||
|
LPDDENUMSURFACESCALLBACK7 lpEnumSurfacesCallback)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__FlipToGDISurface(IDirectDrawImpl* This)
|
HRESULT __stdcall IDirectDraw__FlipToGDISurface(IDirectDrawImpl* This)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__GetCaps(IDirectDrawImpl* This, LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDEmulCaps)
|
HRESULT __stdcall IDirectDraw__GetCaps(IDirectDrawImpl* This, LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDEmulCaps)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p, lpDDDriverCaps=%p, lpDDEmulCaps=%p)\n", __FUNCTION__, This, lpDDDriverCaps, lpDDEmulCaps);
|
TRACE("-> %s(This=%p, lpDDDriverCaps=%p, lpDDEmulCaps=%p)\n", __FUNCTION__, This, lpDDDriverCaps, lpDDEmulCaps);
|
||||||
HRESULT ret = dd_GetCaps(lpDDDriverCaps, lpDDEmulCaps);
|
HRESULT ret = dd_GetCaps(lpDDDriverCaps, lpDDEmulCaps);
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__GetDisplayMode(IDirectDrawImpl* This, LPDDSURFACEDESC lpDDSurfaceDesc)
|
HRESULT __stdcall IDirectDraw__GetDisplayMode(IDirectDrawImpl* This, LPDDSURFACEDESC2 lpDDSurfaceDesc)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = dd_GetDisplayMode(lpDDSurfaceDesc);
|
HRESULT ret = dd_GetDisplayMode(lpDDSurfaceDesc);
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__GetFourCCCodes(IDirectDrawImpl* This, LPDWORD a, LPDWORD b)
|
HRESULT __stdcall IDirectDraw__GetFourCCCodes(IDirectDrawImpl* This, LPDWORD lpNumCodes, LPDWORD lpCodes)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DDERR_INVALIDOBJECT;
|
HRESULT ret = DDERR_INVALIDOBJECT;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__GetGDISurface(IDirectDrawImpl* This, LPDIRECTDRAWSURFACE* a)
|
HRESULT __stdcall IDirectDraw__GetGDISurface(IDirectDrawImpl* This, LPDIRECTDRAWSURFACE7* lplpGDIDDSurface)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DDERR_NOTFOUND;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__GetMonitorFrequency(IDirectDrawImpl* This, LPDWORD lpdwFreq)
|
HRESULT __stdcall IDirectDraw__GetMonitorFrequency(IDirectDrawImpl* This, LPDWORD lpdwFreq)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = dd_GetMonitorFrequency(lpdwFreq);
|
HRESULT ret = dd_GetMonitorFrequency(lpdwFreq);
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__GetScanLine(IDirectDrawImpl* This, LPDWORD a)
|
HRESULT __stdcall IDirectDraw__GetScanLine(IDirectDrawImpl* This, LPDWORD lpdwScanLine)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DDERR_UNSUPPORTED;
|
HRESULT ret = DDERR_UNSUPPORTED;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__GetVerticalBlankStatus(IDirectDrawImpl* This, LPBOOL lpbIsInVB)
|
HRESULT __stdcall IDirectDraw__GetVerticalBlankStatus(IDirectDrawImpl* This, LPBOOL lpbIsInVB)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p, lpbIsInVB=%p)\n", __FUNCTION__, This, lpbIsInVB);
|
TRACE("-> %s(This=%p, lpbIsInVB=%p)\n", __FUNCTION__, This, lpbIsInVB);
|
||||||
HRESULT ret = dd_GetVerticalBlankStatus(lpbIsInVB);
|
HRESULT ret = dd_GetVerticalBlankStatus(lpbIsInVB);
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__Initialize(IDirectDrawImpl* This, GUID* a)
|
HRESULT __stdcall IDirectDraw__Initialize(IDirectDrawImpl* This, GUID* lpGUID)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__RestoreDisplayMode(IDirectDrawImpl* This)
|
HRESULT __stdcall IDirectDraw__RestoreDisplayMode(IDirectDrawImpl* This)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = dd_RestoreDisplayMode();
|
HRESULT ret = dd_RestoreDisplayMode();
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__SetCooperativeLevel(IDirectDrawImpl* This, HWND hwnd, DWORD dwFlags)
|
HRESULT __stdcall IDirectDraw__SetCooperativeLevel(IDirectDrawImpl* This, HWND hwnd, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p, hwnd=0x%08X, dwFlags=0x%08X)\n", __FUNCTION__, This, (unsigned int)hwnd, (unsigned int)dwFlags);
|
TRACE("-> %s(This=%p, hwnd=%p, dwFlags=0x%08X)\n", __FUNCTION__, This, hwnd, dwFlags);
|
||||||
HRESULT ret = dd_SetCooperativeLevel(hwnd, dwFlags);
|
HRESULT ret = dd_SetCooperativeLevel(hwnd, dwFlags);
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__SetDisplayMode(IDirectDrawImpl* This, DWORD width, DWORD height, DWORD bpp)
|
HRESULT __stdcall IDirectDraw__SetDisplayMode(IDirectDrawImpl* This, DWORD dwWidth, DWORD dwHeight, DWORD dwBPP)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p, width=%d, height=%d, bpp=%d)\n", __FUNCTION__, This, (unsigned int)width, (unsigned int)height, (unsigned int)bpp);
|
TRACE("-> %s(This=%p, width=%d, height=%d, bpp=%d)\n", __FUNCTION__, This, dwWidth, dwHeight, dwBPP);
|
||||||
HRESULT ret = dd_SetDisplayMode(width, height, bpp, TRUE);
|
HRESULT ret = dd_SetDisplayMode(dwWidth, dwHeight, dwBPP, TRUE);
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__SetDisplayModeX(IDirectDrawImpl* This, DWORD width, DWORD height, DWORD bpp, DWORD refreshRate, DWORD flags)
|
HRESULT __stdcall IDirectDraw__SetDisplayModeX(
|
||||||
|
IDirectDrawImpl* This,
|
||||||
|
DWORD dwWidth,
|
||||||
|
DWORD dwHeight,
|
||||||
|
DWORD dwBPP,
|
||||||
|
DWORD dwRefreshRate,
|
||||||
|
DWORD dwFlags)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p, width=%d, height=%d, bpp=%d, refreshRate=%d, flags=%d)\n", __FUNCTION__, This, (unsigned int)width, (unsigned int)height, (unsigned int)bpp, (unsigned int)refreshRate, (unsigned int)flags);
|
TRACE(
|
||||||
HRESULT ret = dd_SetDisplayMode(width, height, bpp, TRUE);
|
"-> %s(This=%p, width=%d, height=%d, bpp=%d, refreshRate=%d, flags=%d)\n",
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
__FUNCTION__,
|
||||||
|
This,
|
||||||
|
dwWidth,
|
||||||
|
dwHeight,
|
||||||
|
dwBPP,
|
||||||
|
dwRefreshRate,
|
||||||
|
dwFlags);
|
||||||
|
|
||||||
|
HRESULT ret = dd_SetDisplayMode(dwWidth, dwHeight, dwBPP, TRUE);
|
||||||
|
|
||||||
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__WaitForVerticalBlank(IDirectDrawImpl* This, DWORD dwFlags, HANDLE h)
|
HRESULT __stdcall IDirectDraw__WaitForVerticalBlank(IDirectDrawImpl* This, DWORD dwFlags, HANDLE hEvent)
|
||||||
{
|
{
|
||||||
dprintfex("-> %s(This=%p, flags=%08X, handle=%p)\n", __FUNCTION__, This, dwFlags, h);
|
TRACE_EXT("-> %s(This=%p, flags=%08X, handle=%p)\n", __FUNCTION__, This, dwFlags, hEvent);
|
||||||
HRESULT ret = dd_WaitForVerticalBlank(dwFlags, h);
|
HRESULT ret = dd_WaitForVerticalBlank(dwFlags, hEvent);
|
||||||
dprintfex("<- %s\n", __FUNCTION__);
|
TRACE_EXT("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__GetAvailableVidMem(IDirectDrawImpl* This, void* lpDDCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree)
|
HRESULT __stdcall IDirectDraw__GetAvailableVidMem(
|
||||||
|
IDirectDrawImpl* This,
|
||||||
|
LPDDSCAPS2 lpDDCaps,
|
||||||
|
LPDWORD lpdwTotal,
|
||||||
|
LPDWORD lpdwFree)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p, lpDDCaps=%p, lpdwTotal=%p, lpdwFree=%p)\n", __FUNCTION__, This, lpDDCaps, lpdwTotal, lpdwFree);
|
TRACE(
|
||||||
|
"-> %s(This=%p, lpDDCaps=%p, lpdwTotal=%p, lpdwFree=%p)\n",
|
||||||
|
__FUNCTION__,
|
||||||
|
This,
|
||||||
|
lpDDCaps,
|
||||||
|
lpdwTotal,
|
||||||
|
lpdwFree);
|
||||||
|
|
||||||
HRESULT ret = dd_GetAvailableVidMem(lpDDCaps, lpdwTotal, lpdwFree);
|
HRESULT ret = dd_GetAvailableVidMem(lpDDCaps, lpdwTotal, lpdwFree);
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
|
||||||
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__GetSurfaceFromDC(IDirectDrawImpl* This, HDC hdc, void* lplpDDSurface)
|
HRESULT __stdcall IDirectDraw__GetSurfaceFromDC(IDirectDrawImpl* This, HDC hdc, LPDIRECTDRAWSURFACE7* lplpDDSurface)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DDERR_GENERIC;
|
HRESULT ret = DDERR_NOTFOUND;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__RestoreAllSurfaces(IDirectDrawImpl* This)
|
HRESULT __stdcall IDirectDraw__RestoreAllSurfaces(IDirectDrawImpl* This)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__TestCooperativeLevel(IDirectDrawImpl* This)
|
HRESULT __stdcall IDirectDraw__TestCooperativeLevel(IDirectDrawImpl* This)
|
||||||
{
|
{
|
||||||
dprintfex("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE_EXT("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintfex("<- %s\n", __FUNCTION__);
|
TRACE_EXT("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__GetDeviceIdentifier(IDirectDrawImpl* This, void* pDDDI, DWORD dwFlags)
|
HRESULT __stdcall IDirectDraw__GetDeviceIdentifier(IDirectDrawImpl* This, LPDDDEVICEIDENTIFIER2 pDDDI, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DDERR_INVALIDPARAMS;
|
HRESULT ret = DDERR_INVALIDPARAMS;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__StartModeTest(IDirectDrawImpl* This, LPSIZE pModes, DWORD dwNumModes, DWORD dwFlags)
|
HRESULT __stdcall IDirectDraw__StartModeTest(IDirectDrawImpl* This, LPSIZE pModes, DWORD dwNumModes, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DDERR_CURRENTLYNOTAVAIL;
|
HRESULT ret = DDERR_CURRENTLYNOTAVAIL;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDraw__EvaluateMode(IDirectDrawImpl* This, DWORD dwFlags, DWORD* pTimeout)
|
HRESULT __stdcall IDirectDraw__EvaluateMode(IDirectDrawImpl* This, DWORD dwFlags, DWORD* pTimeout)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DDERR_INVALIDOBJECT;
|
HRESULT ret = DDERR_INVALIDOBJECT;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct IDirectDrawImplVtbl g_dd_vtbl1 =
|
struct IDirectDrawImplVtbl g_dd_vtbl1 =
|
||||||
{
|
{
|
||||||
/* IUnknown */
|
/*** IUnknown methods ***/
|
||||||
IDirectDraw__QueryInterface,
|
IDirectDraw__QueryInterface,
|
||||||
IDirectDraw__AddRef,
|
IDirectDraw__AddRef,
|
||||||
IDirectDraw__Release,
|
IDirectDraw__Release,
|
||||||
/* IDirectDrawImpl */
|
/*** IDirectDraw methods ***/
|
||||||
IDirectDraw__Compact,
|
IDirectDraw__Compact,
|
||||||
IDirectDraw__CreateClipper,
|
IDirectDraw__CreateClipper,
|
||||||
IDirectDraw__CreatePalette,
|
IDirectDraw__CreatePalette,
|
||||||
@ -420,25 +515,25 @@ struct IDirectDrawImplVtbl g_dd_vtbl1 =
|
|||||||
IDirectDraw__SetCooperativeLevel,
|
IDirectDraw__SetCooperativeLevel,
|
||||||
{IDirectDraw__SetDisplayMode},
|
{IDirectDraw__SetDisplayMode},
|
||||||
IDirectDraw__WaitForVerticalBlank,
|
IDirectDraw__WaitForVerticalBlank,
|
||||||
// v2
|
/*** Added in the v2 Interface ***/
|
||||||
IDirectDraw__GetAvailableVidMem,
|
IDirectDraw__GetAvailableVidMem,
|
||||||
// v4
|
/*** Added in the v4 Interface ***/
|
||||||
IDirectDraw__GetSurfaceFromDC,
|
IDirectDraw__GetSurfaceFromDC,
|
||||||
IDirectDraw__RestoreAllSurfaces,
|
IDirectDraw__RestoreAllSurfaces,
|
||||||
IDirectDraw__TestCooperativeLevel,
|
IDirectDraw__TestCooperativeLevel,
|
||||||
IDirectDraw__GetDeviceIdentifier,
|
IDirectDraw__GetDeviceIdentifier,
|
||||||
// v7
|
/*** Added in the v7 Interface ***/
|
||||||
IDirectDraw__StartModeTest,
|
IDirectDraw__StartModeTest,
|
||||||
IDirectDraw__EvaluateMode,
|
IDirectDraw__EvaluateMode,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct IDirectDrawImplVtbl g_dd_vtblx =
|
struct IDirectDrawImplVtbl g_dd_vtblx =
|
||||||
{
|
{
|
||||||
/* IUnknown */
|
/*** IUnknown methods ***/
|
||||||
IDirectDraw__QueryInterface,
|
IDirectDraw__QueryInterface,
|
||||||
IDirectDraw__AddRef,
|
IDirectDraw__AddRef,
|
||||||
IDirectDraw__Release,
|
IDirectDraw__Release,
|
||||||
/* IDirectDrawImpl */
|
/*** IDirectDraw methods ***/
|
||||||
IDirectDraw__Compact,
|
IDirectDraw__Compact,
|
||||||
IDirectDraw__CreateClipper,
|
IDirectDraw__CreateClipper,
|
||||||
IDirectDraw__CreatePalette,
|
IDirectDraw__CreatePalette,
|
||||||
@ -459,14 +554,14 @@ struct IDirectDrawImplVtbl g_dd_vtblx =
|
|||||||
IDirectDraw__SetCooperativeLevel,
|
IDirectDraw__SetCooperativeLevel,
|
||||||
{IDirectDraw__SetDisplayModeX},
|
{IDirectDraw__SetDisplayModeX},
|
||||||
IDirectDraw__WaitForVerticalBlank,
|
IDirectDraw__WaitForVerticalBlank,
|
||||||
// v2
|
/*** Added in the v2 interface ***/
|
||||||
IDirectDraw__GetAvailableVidMem,
|
IDirectDraw__GetAvailableVidMem,
|
||||||
// v4
|
/*** Added in the v4 Interface ***/
|
||||||
IDirectDraw__GetSurfaceFromDC,
|
IDirectDraw__GetSurfaceFromDC,
|
||||||
IDirectDraw__RestoreAllSurfaces,
|
IDirectDraw__RestoreAllSurfaces,
|
||||||
IDirectDraw__TestCooperativeLevel,
|
IDirectDraw__TestCooperativeLevel,
|
||||||
IDirectDraw__GetDeviceIdentifier,
|
IDirectDraw__GetDeviceIdentifier,
|
||||||
// v7
|
/*** Added in the v7 Interface ***/
|
||||||
IDirectDraw__StartModeTest,
|
IDirectDraw__StartModeTest,
|
||||||
IDirectDraw__EvaluateMode,
|
IDirectDraw__EvaluateMode,
|
||||||
};
|
};
|
||||||
|
@ -2,94 +2,98 @@
|
|||||||
#include "ddclipper.h"
|
#include "ddclipper.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawClipper__QueryInterface(IDirectDrawClipperImpl *This, REFIID riid, void **obj)
|
HRESULT __stdcall IDirectDrawClipper__QueryInterface(IDirectDrawClipperImpl* This, REFIID riid, LPVOID FAR* ppvObj)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p, riid=%08X, obj=%p)\n", __FUNCTION__, This, (unsigned int)riid, obj);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p, riid=%08X, obj=%p)\n", __FUNCTION__, This, (unsigned int)riid, ppvObj);
|
||||||
HRESULT ret = S_OK;
|
HRESULT ret = E_NOINTERFACE;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG __stdcall IDirectDrawClipper__AddRef(IDirectDrawClipperImpl *This)
|
ULONG __stdcall IDirectDrawClipper__AddRef(IDirectDrawClipperImpl* This)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
ULONG ret = ++This->ref;
|
ULONG ret = ++This->ref;
|
||||||
dprintf("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
TRACE("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG __stdcall IDirectDrawClipper__Release(IDirectDrawClipperImpl *This)
|
ULONG __stdcall IDirectDrawClipper__Release(IDirectDrawClipperImpl* This)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
|
|
||||||
ULONG ret = --This->ref;
|
ULONG ret = --This->ref;
|
||||||
|
|
||||||
if (This->ref == 0)
|
if (This->ref == 0)
|
||||||
{
|
{
|
||||||
dprintf(" Released (%p)\n", This);
|
TRACE(" Released (%p)\n", This);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
}
|
}
|
||||||
|
|
||||||
dprintf("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
TRACE("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawClipper__GetClipList(IDirectDrawClipperImpl *This, LPRECT a, LPRGNDATA b, LPDWORD c)
|
HRESULT __stdcall IDirectDrawClipper__GetClipList(
|
||||||
|
IDirectDrawClipperImpl* This,
|
||||||
|
LPRECT lpRect,
|
||||||
|
LPRGNDATA lpClipList,
|
||||||
|
LPDWORD lpdwSiz)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DDERR_NOCLIPLIST;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawClipper__GetHWnd(IDirectDrawClipperImpl *This, HWND FAR *a)
|
HRESULT __stdcall IDirectDrawClipper__GetHWnd(IDirectDrawClipperImpl* This, HWND FAR* lphWnd)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DDERR_INVALIDOBJECT;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawClipper__Initialize(IDirectDrawClipperImpl *This, LPDIRECTDRAW a, DWORD b)
|
HRESULT __stdcall IDirectDrawClipper__Initialize(IDirectDrawClipperImpl* This, LPDIRECTDRAW lpDD, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawClipper__IsClipListChanged(IDirectDrawClipperImpl *This, BOOL FAR *a)
|
HRESULT __stdcall IDirectDrawClipper__IsClipListChanged(IDirectDrawClipperImpl* This, BOOL FAR* lpbChanged)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DDERR_INVALIDOBJECT;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawClipper__SetClipList(IDirectDrawClipperImpl *This, LPRGNDATA a, DWORD b)
|
HRESULT __stdcall IDirectDrawClipper__SetClipList(IDirectDrawClipperImpl* This, LPRGNDATA lpClipList, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawClipper__SetHWnd(IDirectDrawClipperImpl *This, DWORD a, HWND b)
|
HRESULT __stdcall IDirectDrawClipper__SetHWnd(IDirectDrawClipperImpl* This, DWORD dwFlags, HWND hWnd)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct IDirectDrawClipperImplVtbl g_ddc_vtbl =
|
struct IDirectDrawClipperImplVtbl g_ddc_vtbl =
|
||||||
{
|
{
|
||||||
/* IUnknown */
|
/*** IUnknown methods ***/
|
||||||
IDirectDrawClipper__QueryInterface,
|
IDirectDrawClipper__QueryInterface,
|
||||||
IDirectDrawClipper__AddRef,
|
IDirectDrawClipper__AddRef,
|
||||||
IDirectDrawClipper__Release,
|
IDirectDrawClipper__Release,
|
||||||
/* IDirectDrawClipper */
|
/*** IDirectDrawClipper methods ***/
|
||||||
IDirectDrawClipper__GetClipList,
|
IDirectDrawClipper__GetClipList,
|
||||||
IDirectDrawClipper__GetHWnd,
|
IDirectDrawClipper__GetHWnd,
|
||||||
IDirectDrawClipper__Initialize,
|
IDirectDrawClipper__Initialize,
|
||||||
|
@ -1,62 +1,62 @@
|
|||||||
#include "IDirectDrawGammaControl.h"
|
#include "IDirectDrawGammaControl.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawGammaControl__QueryInterface(IDirectDrawGammaControlImpl *This, REFIID riid, void **obj)
|
HRESULT __stdcall IDirectDrawGammaControl__QueryInterface(IDirectDrawGammaControlImpl* This, REFIID riid, LPVOID FAR* ppvObj)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p, riid=%08X, obj=%p)\n", __FUNCTION__, This, (unsigned int)riid, obj);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p, riid=%08X, obj=%p)\n", __FUNCTION__, This, (unsigned int)riid, ppvObj);
|
||||||
HRESULT ret = S_OK;
|
HRESULT ret = E_NOINTERFACE;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG __stdcall IDirectDrawGammaControl__AddRef(IDirectDrawGammaControlImpl *This)
|
ULONG __stdcall IDirectDrawGammaControl__AddRef(IDirectDrawGammaControlImpl* This)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
ULONG ret = ++This->ref;
|
ULONG ret = ++This->ref;
|
||||||
dprintf("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
TRACE("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG __stdcall IDirectDrawGammaControl__Release(IDirectDrawGammaControlImpl *This)
|
ULONG __stdcall IDirectDrawGammaControl__Release(IDirectDrawGammaControlImpl* This)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
|
|
||||||
ULONG ret = --This->ref;
|
ULONG ret = --This->ref;
|
||||||
|
|
||||||
if (This->ref == 0)
|
if (This->ref == 0)
|
||||||
{
|
{
|
||||||
dprintf(" Released (%p)\n", This);
|
TRACE(" Released (%p)\n", This);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
}
|
}
|
||||||
|
|
||||||
dprintf("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
TRACE("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawGammaControl__GetGammaRamp(IDirectDrawGammaControlImpl *This, DWORD dwFlags, void *lpRampData)
|
HRESULT __stdcall IDirectDrawGammaControl__GetGammaRamp(IDirectDrawGammaControlImpl* This, DWORD dwFlags, LPDDGAMMARAMP lpRampData)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DDERR_EXCEPTION;
|
HRESULT ret = DDERR_EXCEPTION;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawGammaControl__SetGammaRamp(IDirectDrawGammaControlImpl *This, DWORD dwFlags, void *lpRampData)
|
HRESULT __stdcall IDirectDrawGammaControl__SetGammaRamp(IDirectDrawGammaControlImpl* This, DWORD dwFlags, LPDDGAMMARAMP lpRampData)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DDERR_EXCEPTION;
|
HRESULT ret = DDERR_EXCEPTION;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct IDirectDrawGammaControlImplVtbl g_ddgc_vtbl =
|
struct IDirectDrawGammaControlImplVtbl g_ddgc_vtbl =
|
||||||
{
|
{
|
||||||
/* IUnknown */
|
/*** IUnknown methods ***/
|
||||||
IDirectDrawGammaControl__QueryInterface,
|
IDirectDrawGammaControl__QueryInterface,
|
||||||
IDirectDrawGammaControl__AddRef,
|
IDirectDrawGammaControl__AddRef,
|
||||||
IDirectDrawGammaControl__Release,
|
IDirectDrawGammaControl__Release,
|
||||||
/* IDirectDrawGammaControl */
|
/*** IDirectDrawGammaControl methods ***/
|
||||||
IDirectDrawGammaControl__GetGammaRamp,
|
IDirectDrawGammaControl__GetGammaRamp,
|
||||||
IDirectDrawGammaControl__SetGammaRamp,
|
IDirectDrawGammaControl__SetGammaRamp,
|
||||||
};
|
};
|
||||||
|
@ -4,31 +4,31 @@
|
|||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawPalette__QueryInterface(IDirectDrawPaletteImpl* This, REFIID riid, void** obj)
|
HRESULT __stdcall IDirectDrawPalette__QueryInterface(IDirectDrawPaletteImpl* This, REFIID riid, LPVOID FAR* ppvObj)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p, riid=%08X, obj=%p)\n", __FUNCTION__, This, (unsigned int)riid, obj);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p, riid=%08X, obj=%p)\n", __FUNCTION__, This, (unsigned int)riid, ppvObj);
|
||||||
HRESULT ret = S_OK;
|
HRESULT ret = E_NOINTERFACE;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG __stdcall IDirectDrawPalette__AddRef(IDirectDrawPaletteImpl* This)
|
ULONG __stdcall IDirectDrawPalette__AddRef(IDirectDrawPaletteImpl* This)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
ULONG ret = ++This->ref;
|
ULONG ret = ++This->ref;
|
||||||
dprintf("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
TRACE("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG __stdcall IDirectDrawPalette__Release(IDirectDrawPaletteImpl* This)
|
ULONG __stdcall IDirectDrawPalette__Release(IDirectDrawPaletteImpl* This)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
|
|
||||||
ULONG ret = --This->ref;
|
ULONG ret = --This->ref;
|
||||||
|
|
||||||
if (This->ref == 0)
|
if (This->ref == 0)
|
||||||
{
|
{
|
||||||
dprintf(" Released (%p)\n", This);
|
TRACE(" Released (%p)\n", This);
|
||||||
|
|
||||||
if (g_ddraw)
|
if (g_ddraw)
|
||||||
g_ddraw->last_freed_palette = This;
|
g_ddraw->last_freed_palette = This;
|
||||||
@ -36,49 +36,81 @@ ULONG __stdcall IDirectDrawPalette__Release(IDirectDrawPaletteImpl* This)
|
|||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
}
|
}
|
||||||
|
|
||||||
dprintf("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
TRACE("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawPalette__GetCaps(IDirectDrawPaletteImpl* This, LPDWORD caps)
|
HRESULT __stdcall IDirectDrawPalette__GetCaps(IDirectDrawPaletteImpl* This, LPDWORD lpdwCaps)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p, caps=%p)\n", __FUNCTION__, This, caps);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p, caps=%p)\n", __FUNCTION__, This, lpdwCaps);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DDERR_INVALIDOBJECT;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawPalette__GetEntries(IDirectDrawPaletteImpl *This, DWORD dwFlags, DWORD dwBase, DWORD dwNumEntries, LPPALETTEENTRY lpEntries)
|
HRESULT __stdcall IDirectDrawPalette__GetEntries(
|
||||||
|
IDirectDrawPaletteImpl* This,
|
||||||
|
DWORD dwFlags,
|
||||||
|
DWORD dwBase,
|
||||||
|
DWORD dwNumEntries,
|
||||||
|
LPPALETTEENTRY lpEntries)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p, dwFlags=%08X, dwBase=%d, dwNumEntries=%d, lpEntries=%p)\n", __FUNCTION__, This, (int)dwFlags, (int)dwBase, (int)dwNumEntries, lpEntries);
|
TRACE(
|
||||||
|
"-> %s(This=%p, dwFlags=%08X, dwBase=%u, dwNumEntries=%u, lpEntries=%p)\n",
|
||||||
|
__FUNCTION__,
|
||||||
|
This,
|
||||||
|
dwFlags,
|
||||||
|
dwBase,
|
||||||
|
dwNumEntries,
|
||||||
|
lpEntries);
|
||||||
|
|
||||||
HRESULT ret = ddp_GetEntries(This, dwFlags, dwBase, dwNumEntries, lpEntries);
|
HRESULT ret = ddp_GetEntries(This, dwFlags, dwBase, dwNumEntries, lpEntries);
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
|
||||||
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawPalette__Initialize(IDirectDrawPaletteImpl* This, LPDIRECTDRAW lpDD, DWORD dw, LPPALETTEENTRY paent)
|
HRESULT __stdcall IDirectDrawPalette__Initialize(
|
||||||
|
IDirectDrawPaletteImpl* This,
|
||||||
|
LPDIRECTDRAW lpDD,
|
||||||
|
DWORD dwFlags,
|
||||||
|
LPPALETTEENTRY lpDDColorTable)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawPalette__SetEntries(IDirectDrawPaletteImpl *This, DWORD dwFlags, DWORD dwStartingEntry, DWORD dwCount, LPPALETTEENTRY lpEntries)
|
HRESULT __stdcall IDirectDrawPalette__SetEntries(
|
||||||
|
IDirectDrawPaletteImpl* This,
|
||||||
|
DWORD dwFlags,
|
||||||
|
DWORD dwStartingEntry,
|
||||||
|
DWORD dwCount,
|
||||||
|
LPPALETTEENTRY lpEntries)
|
||||||
{
|
{
|
||||||
dprintfex("-> %s(This=%p, dwFlags=%08X, dwStartingEntry=%d, dwCount=%d, lpEntries=%p)\n", __FUNCTION__, This, (int)dwFlags, (int)dwStartingEntry, (int)dwCount, lpEntries);
|
TRACE_EXT(
|
||||||
|
"-> %s(This=%p, dwFlags=%08X, dwStartingEntry=%u, dwCount=%u, lpEntries=%p)\n",
|
||||||
|
__FUNCTION__,
|
||||||
|
This,
|
||||||
|
dwFlags,
|
||||||
|
dwStartingEntry,
|
||||||
|
dwCount,
|
||||||
|
lpEntries);
|
||||||
|
|
||||||
HRESULT ret = ddp_SetEntries(This, dwFlags, dwStartingEntry, dwCount, lpEntries);
|
HRESULT ret = ddp_SetEntries(This, dwFlags, dwStartingEntry, dwCount, lpEntries);
|
||||||
dprintfex("<- %s\n", __FUNCTION__);
|
|
||||||
|
TRACE_EXT("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct IDirectDrawPaletteImplVtbl g_ddp_vtbl =
|
struct IDirectDrawPaletteImplVtbl g_ddp_vtbl =
|
||||||
{
|
{
|
||||||
/* IUnknown */
|
/*** IUnknown methods ***/
|
||||||
IDirectDrawPalette__QueryInterface,
|
IDirectDrawPalette__QueryInterface,
|
||||||
IDirectDrawPalette__AddRef,
|
IDirectDrawPalette__AddRef,
|
||||||
IDirectDrawPalette__Release,
|
IDirectDrawPalette__Release,
|
||||||
/* IDirectDrawPalette */
|
/*** IDirectDrawPalette methods ***/
|
||||||
IDirectDrawPalette__GetCaps,
|
IDirectDrawPalette__GetCaps,
|
||||||
IDirectDrawPalette__GetEntries,
|
IDirectDrawPalette__GetEntries,
|
||||||
IDirectDrawPalette__Initialize,
|
IDirectDrawPalette__Initialize,
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__QueryInterface(IDirectDrawSurfaceImpl *This, REFIID riid, void **obj)
|
HRESULT __stdcall IDirectDrawSurface__QueryInterface(IDirectDrawSurfaceImpl* This, REFIID riid, LPVOID FAR* ppvObj)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p, riid=%08X, obj=%p)\n", __FUNCTION__, This, (unsigned int)riid, obj);
|
TRACE("-> %s(This=%p, riid=%08X, obj=%p)\n", __FUNCTION__, This, (unsigned int)riid, ppvObj);
|
||||||
HRESULT ret = S_OK;
|
HRESULT ret = S_OK;
|
||||||
|
|
||||||
if (riid)
|
if (riid)
|
||||||
@ -19,56 +19,60 @@ HRESULT __stdcall IDirectDrawSurface__QueryInterface(IDirectDrawSurfaceImpl *Thi
|
|||||||
IsEqualGUID(&IID_IDirectDrawSurface4, riid) ||
|
IsEqualGUID(&IID_IDirectDrawSurface4, riid) ||
|
||||||
IsEqualGUID(&IID_IDirectDrawSurface7, riid))
|
IsEqualGUID(&IID_IDirectDrawSurface7, riid))
|
||||||
{
|
{
|
||||||
dprintf(" GUID = %08X (IID_IDirectDrawSurfaceX)\n", ((GUID*)riid)->Data1);
|
TRACE(" GUID = %08X (IID_IDirectDrawSurfaceX)\n", ((GUID*)riid)->Data1);
|
||||||
|
|
||||||
IDirectDrawSurface_AddRef(This);
|
IDirectDrawSurface_AddRef(This);
|
||||||
|
|
||||||
*obj = This;
|
*ppvObj = This;
|
||||||
|
|
||||||
ret = S_OK;
|
ret = S_OK;
|
||||||
}
|
}
|
||||||
else if (IsEqualGUID(&IID_IDirectDrawGammaControl, riid))
|
else if (IsEqualGUID(&IID_IDirectDrawGammaControl, riid))
|
||||||
{
|
{
|
||||||
IDirectDrawGammaControlImpl* gc = (IDirectDrawGammaControlImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectDrawGammaControlImpl));
|
IDirectDrawGammaControlImpl* gc =
|
||||||
|
(IDirectDrawGammaControlImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectDrawGammaControlImpl));
|
||||||
|
|
||||||
dprintf("NOT_IMPLEMENTED GUID = %08X (IID_IDirectDrawGammaControl), gammacontrol = %p\n", ((GUID*)riid)->Data1, gc);
|
TRACE(
|
||||||
|
"NOT_IMPLEMENTED GUID = %08X (IID_IDirectDrawGammaControl), gammacontrol = %p\n",
|
||||||
|
((GUID*)riid)->Data1,
|
||||||
|
gc);
|
||||||
|
|
||||||
gc->lpVtbl = &g_ddgc_vtbl;
|
gc->lpVtbl = &g_ddgc_vtbl;
|
||||||
gc->lpVtbl->AddRef(gc);
|
gc->lpVtbl->AddRef(gc);
|
||||||
|
|
||||||
*obj = gc;
|
*ppvObj = gc;
|
||||||
|
|
||||||
ret = S_OK;
|
ret = S_OK;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED GUID = %08X\n", ((GUID*)riid)->Data1);
|
TRACE("NOT_IMPLEMENTED GUID = %08X\n", ((GUID*)riid)->Data1);
|
||||||
|
|
||||||
ret = E_NOINTERFACE;
|
ret = E_NOINTERFACE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG __stdcall IDirectDrawSurface__AddRef(IDirectDrawSurfaceImpl *This)
|
ULONG __stdcall IDirectDrawSurface__AddRef(IDirectDrawSurfaceImpl* This)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
ULONG ret = ++This->ref;
|
ULONG ret = ++This->ref;
|
||||||
dprintf("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
TRACE("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG __stdcall IDirectDrawSurface__Release(IDirectDrawSurfaceImpl *This)
|
ULONG __stdcall IDirectDrawSurface__Release(IDirectDrawSurfaceImpl* This)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
|
|
||||||
ULONG ret = --This->ref;
|
ULONG ret = --This->ref;
|
||||||
|
|
||||||
if(This->ref == 0)
|
if (This->ref == 0)
|
||||||
{
|
{
|
||||||
dprintf(" Released (%p)\n", This);
|
TRACE(" Released (%p)\n", This);
|
||||||
|
|
||||||
if (g_ddraw && (This->caps & DDSCAPS_PRIMARYSURFACE))
|
if (g_ddraw && (This->caps & DDSCAPS_PRIMARYSURFACE))
|
||||||
{
|
{
|
||||||
@ -98,7 +102,7 @@ ULONG __stdcall IDirectDrawSurface__Release(IDirectDrawSurfaceImpl *This)
|
|||||||
if (This->clipper)
|
if (This->clipper)
|
||||||
IDirectDrawClipper_Release(This->clipper);
|
IDirectDrawClipper_Release(This->clipper);
|
||||||
|
|
||||||
if(This->palette && (!g_ddraw || (void*)This->palette != g_ddraw->last_freed_palette))
|
if (This->palette && (!g_ddraw || (void*)This->palette != g_ddraw->last_freed_palette))
|
||||||
{
|
{
|
||||||
IDirectDrawPalette_Release(This->palette);
|
IDirectDrawPalette_Release(This->palette);
|
||||||
}
|
}
|
||||||
@ -106,385 +110,479 @@ ULONG __stdcall IDirectDrawSurface__Release(IDirectDrawSurfaceImpl *This)
|
|||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
}
|
}
|
||||||
|
|
||||||
dprintf("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
TRACE("<- %s(This ref=%u)\n", __FUNCTION__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__AddAttachedSurface(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWSURFACE lpDDSurface)
|
HRESULT __stdcall IDirectDrawSurface__AddAttachedSurface(IDirectDrawSurfaceImpl* This, LPDIRECTDRAWSURFACE7 lpDDSurface)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p, lpDDSurface=%p)\n", __FUNCTION__, This, lpDDSurface);
|
TRACE("-> %s(This=%p, lpDDSurface=%p)\n", __FUNCTION__, This, lpDDSurface);
|
||||||
HRESULT ret = dds_AddAttachedSurface(This, lpDDSurface);
|
HRESULT ret = dds_AddAttachedSurface(This, (IDirectDrawSurfaceImpl*)lpDDSurface);
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__AddOverlayDirtyRect(IDirectDrawSurfaceImpl *This, LPRECT a)
|
HRESULT __stdcall IDirectDrawSurface__AddOverlayDirtyRect(IDirectDrawSurfaceImpl* This, LPRECT lpRect)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__Blt(IDirectDrawSurfaceImpl *This, LPRECT lpDestRect, LPDIRECTDRAWSURFACE lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
|
HRESULT __stdcall IDirectDrawSurface__Blt(
|
||||||
|
IDirectDrawSurfaceImpl* This,
|
||||||
|
LPRECT lpDestRect,
|
||||||
|
LPDIRECTDRAWSURFACE7 lpDDSrcSurface,
|
||||||
|
LPRECT lpSrcRect,
|
||||||
|
DWORD dwFlags,
|
||||||
|
LPDDBLTFX lpDDBltFx)
|
||||||
{
|
{
|
||||||
dprintfex("-> %s(This=%p, lpDestRect=%p, lpDDSrcSurface=%p, lpSrcRect=%p, dwFlags=%08X, lpDDBltFx=%p)\n", __FUNCTION__, This, lpDestRect, lpDDSrcSurface, lpSrcRect, (int)dwFlags, lpDDBltFx);
|
TRACE_EXT(
|
||||||
HRESULT ret = dds_Blt(This, lpDestRect, lpDDSrcSurface, lpSrcRect, dwFlags, lpDDBltFx);
|
"-> %s(This=%p, lpDestRect=%p, lpDDSrcSurface=%p, lpSrcRect=%p, dwFlags=%08X, lpDDBltFx=%p)\n",
|
||||||
dprintfex("<- %s\n", __FUNCTION__);
|
__FUNCTION__,
|
||||||
|
This,
|
||||||
|
lpDestRect,
|
||||||
|
lpDDSrcSurface,
|
||||||
|
lpSrcRect,
|
||||||
|
dwFlags,
|
||||||
|
lpDDBltFx);
|
||||||
|
|
||||||
|
HRESULT ret = dds_Blt(This, lpDestRect, (IDirectDrawSurfaceImpl*)lpDDSrcSurface, lpSrcRect, dwFlags, lpDDBltFx);
|
||||||
|
|
||||||
|
TRACE_EXT("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__BltBatch(IDirectDrawSurfaceImpl *This, LPDDBLTBATCH a, DWORD b, DWORD c)
|
HRESULT __stdcall IDirectDrawSurface__BltBatch(
|
||||||
|
IDirectDrawSurfaceImpl* This,
|
||||||
|
LPDDBLTBATCH lpDDBltBatch,
|
||||||
|
DWORD dwCount,
|
||||||
|
DWORD dwFlags)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__BltFast(IDirectDrawSurfaceImpl *This, DWORD dst_x, DWORD dst_y, LPDIRECTDRAWSURFACE lpDDSrcSurface, LPRECT lpSrcRect, DWORD flags)
|
HRESULT __stdcall IDirectDrawSurface__BltFast(
|
||||||
|
IDirectDrawSurfaceImpl* This,
|
||||||
|
DWORD dwX,
|
||||||
|
DWORD dwY,
|
||||||
|
LPDIRECTDRAWSURFACE7 lpDDSrcSurface,
|
||||||
|
LPRECT lpSrcRect,
|
||||||
|
DWORD dwFlags)
|
||||||
{
|
{
|
||||||
dprintfex("-> %s(This=%p, x=%d, y=%d, lpDDSrcSurface=%p, lpSrcRect=%p, flags=%08X)\n", __FUNCTION__, This, dst_x, dst_y, lpDDSrcSurface, lpSrcRect, flags);
|
TRACE_EXT(
|
||||||
HRESULT ret = dds_BltFast(This, dst_x, dst_y, lpDDSrcSurface, lpSrcRect, flags);
|
"-> %s(This=%p, x=%d, y=%d, lpDDSrcSurface=%p, lpSrcRect=%p, flags=%08X)\n",
|
||||||
dprintfex("<- %s\n", __FUNCTION__);
|
__FUNCTION__,
|
||||||
|
This,
|
||||||
|
dwX,
|
||||||
|
dwY,
|
||||||
|
lpDDSrcSurface,
|
||||||
|
lpSrcRect,
|
||||||
|
dwFlags);
|
||||||
|
|
||||||
|
HRESULT ret = dds_BltFast(This, dwX, dwY, (IDirectDrawSurfaceImpl*)lpDDSrcSurface, lpSrcRect, dwFlags);
|
||||||
|
|
||||||
|
TRACE_EXT("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__DeleteAttachedSurface(IDirectDrawSurfaceImpl *This, DWORD dwFlags, LPDIRECTDRAWSURFACE lpDDSurface)
|
HRESULT __stdcall IDirectDrawSurface__DeleteAttachedSurface(
|
||||||
|
IDirectDrawSurfaceImpl* This,
|
||||||
|
DWORD dwFlags,
|
||||||
|
LPDIRECTDRAWSURFACE7 lpDDSurface)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p, dwFlags=%08X, lpDDSurface=%p)\n", __FUNCTION__, This, (int)dwFlags, lpDDSurface);
|
TRACE("-> %s(This=%p, dwFlags=%08X, lpDDSurface=%p)\n", __FUNCTION__, This, dwFlags, lpDDSurface);
|
||||||
HRESULT ret = dds_DeleteAttachedSurface(This, dwFlags, lpDDSurface);
|
HRESULT ret = dds_DeleteAttachedSurface(This, dwFlags, (IDirectDrawSurfaceImpl*)lpDDSurface);
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__GetSurfaceDesc(IDirectDrawSurfaceImpl *This, LPDDSURFACEDESC lpDDSurfaceDesc)
|
HRESULT __stdcall IDirectDrawSurface__EnumAttachedSurfaces(
|
||||||
|
IDirectDrawSurfaceImpl* This,
|
||||||
|
LPVOID lpContext,
|
||||||
|
LPDDENUMSURFACESCALLBACK7 lpEnumSurfacesCallback)
|
||||||
{
|
{
|
||||||
dprintfex("-> %s(This=%p, lpDDSurfaceDesc=%p)\n", __FUNCTION__, This, lpDDSurfaceDesc);
|
TRACE(
|
||||||
HRESULT ret = dds_GetSurfaceDesc(This, lpDDSurfaceDesc);
|
"-> %s(This=%p, lpContext=%p, lpEnumSurfacesCallback=%p)\n",
|
||||||
dprintfex("<- %s\n", __FUNCTION__);
|
__FUNCTION__,
|
||||||
return ret;
|
This,
|
||||||
}
|
lpContext,
|
||||||
|
lpEnumSurfacesCallback);
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__EnumAttachedSurfaces(IDirectDrawSurfaceImpl *This, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback)
|
|
||||||
{
|
|
||||||
dprintf("-> %s(This=%p, lpContext=%p, lpEnumSurfacesCallback=%p)\n", __FUNCTION__, This, lpContext, lpEnumSurfacesCallback);
|
|
||||||
HRESULT ret = dds_EnumAttachedSurfaces(This, lpContext, lpEnumSurfacesCallback);
|
HRESULT ret = dds_EnumAttachedSurfaces(This, lpContext, lpEnumSurfacesCallback);
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
|
||||||
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__EnumOverlayZOrders(IDirectDrawSurfaceImpl *This, DWORD a, LPVOID b, LPDDENUMSURFACESCALLBACK c)
|
HRESULT __stdcall IDirectDrawSurface__EnumOverlayZOrders(
|
||||||
|
IDirectDrawSurfaceImpl* This,
|
||||||
|
DWORD dwFlags,
|
||||||
|
LPVOID lpContext,
|
||||||
|
LPDDENUMSURFACESCALLBACK7 lpfnCallback)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__Flip(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWSURFACE surface, DWORD flags)
|
HRESULT __stdcall IDirectDrawSurface__Flip(
|
||||||
|
IDirectDrawSurfaceImpl* This,
|
||||||
|
LPDIRECTDRAWSURFACE7 lpDDSurfaceTargetOverride,
|
||||||
|
DWORD dwFlags)
|
||||||
{
|
{
|
||||||
dprintfex("-> %s(This=%p, surface=%p, flags=%08X)\n", __FUNCTION__, This, surface, flags);
|
TRACE_EXT("-> %s(This=%p, surface=%p, flags=%08X)\n", __FUNCTION__, This, lpDDSurfaceTargetOverride, dwFlags);
|
||||||
HRESULT ret = dds_Flip(This, surface, flags);
|
HRESULT ret = dds_Flip(This, (IDirectDrawSurfaceImpl*)lpDDSurfaceTargetOverride, dwFlags);
|
||||||
dprintfex("<- %s\n", __FUNCTION__);
|
TRACE_EXT("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__GetAttachedSurface(IDirectDrawSurfaceImpl *This, LPDDSCAPS lpDdsCaps, LPDIRECTDRAWSURFACE FAR *surface)
|
HRESULT __stdcall IDirectDrawSurface__GetAttachedSurface(
|
||||||
|
IDirectDrawSurfaceImpl* This,
|
||||||
|
LPDDSCAPS2 lpDdsCaps,
|
||||||
|
LPDIRECTDRAWSURFACE7 FAR* lpDDsurface)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p, dwCaps=%08X, surface=%p)\n", __FUNCTION__, This, lpDdsCaps->dwCaps, surface);
|
TRACE("-> %s(This=%p, dwCaps=%08X, surface=%p)\n", __FUNCTION__, This, lpDdsCaps->dwCaps, lpDDsurface);
|
||||||
HRESULT ret = dds_GetAttachedSurface(This, lpDdsCaps, surface);
|
HRESULT ret = dds_GetAttachedSurface(This, lpDdsCaps, (IDirectDrawSurfaceImpl**)lpDDsurface);
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__GetBltStatus(IDirectDrawSurfaceImpl *This, DWORD a)
|
HRESULT __stdcall IDirectDrawSurface__GetBltStatus(IDirectDrawSurfaceImpl* This, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
dprintfex("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE_EXT("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintfex("<- %s\n", __FUNCTION__);
|
TRACE_EXT("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__GetCaps(IDirectDrawSurfaceImpl *This, LPDDSCAPS lpDDSCaps)
|
HRESULT __stdcall IDirectDrawSurface__GetCaps(IDirectDrawSurfaceImpl* This, LPDDSCAPS2 lpDDSCaps)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p, lpDDSCaps=%p)\n", __FUNCTION__, This, lpDDSCaps);
|
TRACE("-> %s(This=%p, lpDDSCaps=%p)\n", __FUNCTION__, This, lpDDSCaps);
|
||||||
HRESULT ret = dds_GetCaps(This, lpDDSCaps);
|
HRESULT ret = dds_GetCaps(This, lpDDSCaps);
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__GetClipper(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWCLIPPER FAR *lpClipper)
|
HRESULT __stdcall IDirectDrawSurface__GetClipper(IDirectDrawSurfaceImpl* This, LPDIRECTDRAWCLIPPER FAR* lpClipper)
|
||||||
{
|
{
|
||||||
dprintfex("-> %s(This=%p, lpClipper=%p)\n", __FUNCTION__, This, lpClipper);
|
TRACE_EXT("-> %s(This=%p, lpClipper=%p)\n", __FUNCTION__, This, lpClipper);
|
||||||
HRESULT ret = dds_GetClipper(This, lpClipper);
|
HRESULT ret = dds_GetClipper(This, (IDirectDrawClipperImpl**)lpClipper);
|
||||||
dprintfex("<- %s\n", __FUNCTION__);
|
TRACE_EXT("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__GetColorKey(IDirectDrawSurfaceImpl *This, DWORD flags, LPDDCOLORKEY colorKey)
|
HRESULT __stdcall IDirectDrawSurface__GetColorKey(IDirectDrawSurfaceImpl* This, DWORD dwFlags, LPDDCOLORKEY lpColorKey)
|
||||||
{
|
{
|
||||||
dprintfex("-> %s(This=%p, flags=0x%08X, color_key=%p)\n", __FUNCTION__, This, flags, colorKey);
|
TRACE_EXT("-> %s(This=%p, flags=0x%08X, color_key=%p)\n", __FUNCTION__, This, dwFlags, lpColorKey);
|
||||||
HRESULT ret = dds_GetColorKey(This, flags, colorKey);
|
HRESULT ret = dds_GetColorKey(This, dwFlags, lpColorKey);
|
||||||
dprintfex("<- %s\n", __FUNCTION__);
|
TRACE_EXT("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__GetDC(IDirectDrawSurfaceImpl *This, HDC FAR *lpHDC)
|
HRESULT __stdcall IDirectDrawSurface__GetDC(IDirectDrawSurfaceImpl* This, HDC FAR* lpHDC)
|
||||||
{
|
{
|
||||||
dprintfex("-> %s(This=%p, lpHDC=%p)\n", __FUNCTION__, This);
|
TRACE_EXT("-> %s(This=%p, lpHDC=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = dds_GetDC(This, lpHDC);
|
HRESULT ret = dds_GetDC(This, lpHDC);
|
||||||
dprintfex("<- %s\n", __FUNCTION__);
|
TRACE_EXT("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__GetFlipStatus(IDirectDrawSurfaceImpl *This, DWORD a)
|
HRESULT __stdcall IDirectDrawSurface__GetFlipStatus(IDirectDrawSurfaceImpl* This, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
dprintfex("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE_EXT("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintfex("<- %s\n", __FUNCTION__);
|
TRACE_EXT("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__GetOverlayPosition(IDirectDrawSurfaceImpl *This, LPLONG a, LPLONG b)
|
HRESULT __stdcall IDirectDrawSurface__GetOverlayPosition(IDirectDrawSurfaceImpl* This, LPLONG lplX, LPLONG lplY)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DDERR_NOTAOVERLAYSURFACE;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__GetPalette(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWPALETTE FAR *lplpDDPalette)
|
HRESULT __stdcall IDirectDrawSurface__GetPalette(IDirectDrawSurfaceImpl* This, LPDIRECTDRAWPALETTE FAR* lplpDDPalette)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p, lplpDDPalette=%p)\n", __FUNCTION__, This, lplpDDPalette);
|
TRACE("-> %s(This=%p, lplpDDPalette=%p)\n", __FUNCTION__, This, lplpDDPalette);
|
||||||
HRESULT ret = dds_GetPalette(This, lplpDDPalette);
|
HRESULT ret = dds_GetPalette(This, (IDirectDrawPaletteImpl**)lplpDDPalette);
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__GetPixelFormat(IDirectDrawSurfaceImpl *This, LPDDPIXELFORMAT ddpfPixelFormat)
|
HRESULT __stdcall IDirectDrawSurface__GetPixelFormat(IDirectDrawSurfaceImpl* This, LPDDPIXELFORMAT ddpfPixelFormat)
|
||||||
{
|
{
|
||||||
dprintfex("-> %s(This=%p, ...)\n", __FUNCTION__, This);
|
TRACE_EXT("-> %s(This=%p, ...)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = dds_GetPixelFormat(This, ddpfPixelFormat);
|
HRESULT ret = dds_GetPixelFormat(This, ddpfPixelFormat);
|
||||||
dprintfex("<- %s\n", __FUNCTION__);
|
TRACE_EXT("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__Initialize(IDirectDrawSurfaceImpl *This, LPDIRECTDRAW a, LPDDSURFACEDESC b)
|
HRESULT __stdcall IDirectDrawSurface__GetSurfaceDesc(IDirectDrawSurfaceImpl* This, LPDDSURFACEDESC2 lpDDSurfaceDesc)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE_EXT("-> %s(This=%p, lpDDSurfaceDesc=%p)\n", __FUNCTION__, This, lpDDSurfaceDesc);
|
||||||
|
HRESULT ret = dds_GetSurfaceDesc(This, lpDDSurfaceDesc);
|
||||||
|
TRACE_EXT("<- %s\n", __FUNCTION__);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT __stdcall IDirectDrawSurface__Initialize(
|
||||||
|
IDirectDrawSurfaceImpl* This,
|
||||||
|
LPDIRECTDRAW lpDD,
|
||||||
|
LPDDSURFACEDESC2 lpDDSurfaceDesc)
|
||||||
|
{
|
||||||
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__IsLost(IDirectDrawSurfaceImpl *This)
|
HRESULT __stdcall IDirectDrawSurface__IsLost(IDirectDrawSurfaceImpl* This)
|
||||||
{
|
{
|
||||||
dprintfex("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE_EXT("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintfex("<- %s\n", __FUNCTION__);
|
TRACE_EXT("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__Lock(IDirectDrawSurfaceImpl *This, LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent)
|
HRESULT __stdcall IDirectDrawSurface__Lock(
|
||||||
|
IDirectDrawSurfaceImpl* This,
|
||||||
|
LPRECT lpDestRect,
|
||||||
|
LPDDSURFACEDESC2 lpDDSurfaceDesc,
|
||||||
|
DWORD dwFlags,
|
||||||
|
HANDLE hEvent)
|
||||||
{
|
{
|
||||||
dprintfex("-> %s(This=%p, lpDestRect=%p, lpDDSurfaceDesc=%p, dwFlags=%08X, hEvent=%p)\n", __FUNCTION__, This, lpDestRect, lpDDSurfaceDesc, (int)dwFlags, hEvent);
|
TRACE_EXT(
|
||||||
|
"-> %s(This=%p, lpDestRect=%p, lpDDSurfaceDesc=%p, dwFlags=%08X, hEvent=%p)\n",
|
||||||
|
__FUNCTION__,
|
||||||
|
This,
|
||||||
|
lpDestRect,
|
||||||
|
lpDDSurfaceDesc,
|
||||||
|
dwFlags,
|
||||||
|
hEvent);
|
||||||
|
|
||||||
HRESULT ret = dds_Lock(This, lpDestRect, lpDDSurfaceDesc, dwFlags, hEvent);
|
HRESULT ret = dds_Lock(This, lpDestRect, lpDDSurfaceDesc, dwFlags, hEvent);
|
||||||
dprintfex("<- %s\n", __FUNCTION__);
|
|
||||||
|
TRACE_EXT("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__ReleaseDC(IDirectDrawSurfaceImpl *This, HDC hDC)
|
HRESULT __stdcall IDirectDrawSurface__ReleaseDC(IDirectDrawSurfaceImpl* This, HDC hDC)
|
||||||
{
|
{
|
||||||
dprintfex("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE_EXT("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = dds_ReleaseDC(This, hDC);
|
HRESULT ret = dds_ReleaseDC(This, hDC);
|
||||||
dprintfex("<- %s\n", __FUNCTION__);
|
TRACE_EXT("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__Restore(IDirectDrawSurfaceImpl *This)
|
HRESULT __stdcall IDirectDrawSurface__Restore(IDirectDrawSurfaceImpl* This)
|
||||||
{
|
{
|
||||||
dprintfex("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE_EXT("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintfex("<- %s\n", __FUNCTION__);
|
TRACE_EXT("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__SetClipper(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWCLIPPER lpClipper)
|
HRESULT __stdcall IDirectDrawSurface__SetClipper(IDirectDrawSurfaceImpl* This, LPDIRECTDRAWCLIPPER lpClipper)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p, lpClipper=%p)\n", __FUNCTION__, This, lpClipper);
|
TRACE("-> %s(This=%p, lpClipper=%p)\n", __FUNCTION__, This, lpClipper);
|
||||||
HRESULT ret = dds_SetClipper(This, lpClipper);
|
HRESULT ret = dds_SetClipper(This, (IDirectDrawClipperImpl*)lpClipper);
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__SetColorKey(IDirectDrawSurfaceImpl *This, DWORD flags, LPDDCOLORKEY colorKey)
|
HRESULT __stdcall IDirectDrawSurface__SetColorKey(IDirectDrawSurfaceImpl* This, DWORD dwFlags, LPDDCOLORKEY lpColorKey)
|
||||||
{
|
{
|
||||||
dprintfex("-> %s(This=%p, flags=0x%08X, color_key=%p)\n", __FUNCTION__, This, flags, colorKey);
|
TRACE_EXT("-> %s(This=%p, flags=0x%08X, color_key=%p)\n", __FUNCTION__, This, dwFlags, lpColorKey);
|
||||||
HRESULT ret = dds_SetColorKey(This, flags, colorKey);
|
HRESULT ret = dds_SetColorKey(This, dwFlags, lpColorKey);
|
||||||
dprintfex("<- %s\n", __FUNCTION__);
|
TRACE_EXT("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__SetOverlayPosition(IDirectDrawSurfaceImpl *This, LONG a, LONG b)
|
HRESULT __stdcall IDirectDrawSurface__SetOverlayPosition(IDirectDrawSurfaceImpl* This, LONG lX, LONG lY)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__SetPalette(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWPALETTE lpDDPalette)
|
HRESULT __stdcall IDirectDrawSurface__SetPalette(IDirectDrawSurfaceImpl* This, LPDIRECTDRAWPALETTE lpDDPalette)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p, lpDDPalette=%p)\n", __FUNCTION__, This, lpDDPalette);
|
TRACE("-> %s(This=%p, lpDDPalette=%p)\n", __FUNCTION__, This, lpDDPalette);
|
||||||
HRESULT ret = dds_SetPalette(This, lpDDPalette);
|
HRESULT ret = dds_SetPalette(This, (IDirectDrawPaletteImpl*)lpDDPalette);
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__Unlock(IDirectDrawSurfaceImpl *This, LPVOID lpRect)
|
HRESULT __stdcall IDirectDrawSurface__Unlock(IDirectDrawSurfaceImpl* This, LPRECT lpRect)
|
||||||
{
|
{
|
||||||
dprintfex("-> %s(This=%p, lpRect=%p)\n", __FUNCTION__, This, lpRect);
|
TRACE_EXT("-> %s(This=%p, lpRect=%p)\n", __FUNCTION__, This, lpRect);
|
||||||
HRESULT ret = dds_Unlock(This, lpRect);
|
HRESULT ret = dds_Unlock(This, lpRect);
|
||||||
dprintfex("<- %s\n", __FUNCTION__);
|
TRACE_EXT("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__UpdateOverlay(IDirectDrawSurfaceImpl *This, LPRECT a, LPDIRECTDRAWSURFACE b, LPRECT c, DWORD d, LPDDOVERLAYFX e)
|
HRESULT __stdcall IDirectDrawSurface__UpdateOverlay(
|
||||||
|
IDirectDrawSurfaceImpl* This,
|
||||||
|
LPRECT lpSrcRect,
|
||||||
|
LPDIRECTDRAWSURFACE7 lpDDDestSurface,
|
||||||
|
LPRECT lpDestRect,
|
||||||
|
DWORD dwFlags,
|
||||||
|
LPDDOVERLAYFX lpDDOverlayFx)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__UpdateOverlayDisplay(IDirectDrawSurfaceImpl *This, DWORD a)
|
HRESULT __stdcall IDirectDrawSurface__UpdateOverlayDisplay(IDirectDrawSurfaceImpl* This, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__UpdateOverlayZOrder(IDirectDrawSurfaceImpl *This, DWORD a, LPDIRECTDRAWSURFACE b)
|
HRESULT __stdcall IDirectDrawSurface__UpdateOverlayZOrder(
|
||||||
|
IDirectDrawSurfaceImpl* This,
|
||||||
|
DWORD dwFlags,
|
||||||
|
LPDIRECTDRAWSURFACE7 lpDDSReference)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__GetDDInterface(IDirectDrawSurfaceImpl *This, LPVOID* lplpDD)
|
HRESULT __stdcall IDirectDrawSurface__GetDDInterface(IDirectDrawSurfaceImpl* This, LPVOID* lplpDD)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("-> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = dds_GetDDInterface(This, lplpDD);
|
HRESULT ret = dds_GetDDInterface(This, lplpDD);
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__PageLock(IDirectDrawSurfaceImpl *This, DWORD dwFlags)
|
HRESULT __stdcall IDirectDrawSurface__PageLock(IDirectDrawSurfaceImpl* This, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__PageUnlock(IDirectDrawSurfaceImpl *This, DWORD dwFlags)
|
HRESULT __stdcall IDirectDrawSurface__PageUnlock(IDirectDrawSurfaceImpl* This, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__SetSurfaceDesc(IDirectDrawSurfaceImpl *This, LPDDSURFACEDESC lpDDSD, DWORD dwFlags)
|
HRESULT __stdcall IDirectDrawSurface__SetSurfaceDesc(IDirectDrawSurfaceImpl* This, LPDDSURFACEDESC2 lpDDSD, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DDERR_UNSUPPORTED;
|
HRESULT ret = DDERR_UNSUPPORTED;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__SetPrivateData(IDirectDrawSurfaceImpl *This, REFGUID rtag, LPVOID lpData, DWORD dwSize, DWORD dwFlags)
|
HRESULT __stdcall IDirectDrawSurface__SetPrivateData(
|
||||||
|
IDirectDrawSurfaceImpl* This,
|
||||||
|
REFGUID rtag,
|
||||||
|
LPVOID lpData,
|
||||||
|
DWORD dwSize,
|
||||||
|
DWORD dwFlags)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DDERR_OUTOFMEMORY;
|
HRESULT ret = DDERR_OUTOFMEMORY;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__GetPrivateData(IDirectDrawSurfaceImpl *This, REFGUID rtag, LPVOID lpBuffer, LPDWORD lpdwBufferSize)
|
HRESULT __stdcall IDirectDrawSurface__GetPrivateData(
|
||||||
|
IDirectDrawSurfaceImpl* This,
|
||||||
|
REFGUID rtag,
|
||||||
|
LPVOID lpBuffer,
|
||||||
|
LPDWORD lpdwBufferSize)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DDERR_NOTFOUND;
|
HRESULT ret = DDERR_NOTFOUND;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__FreePrivateData(IDirectDrawSurfaceImpl *This, REFGUID rtag)
|
HRESULT __stdcall IDirectDrawSurface__FreePrivateData(IDirectDrawSurfaceImpl* This, REFGUID rtag)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DD_OK;
|
HRESULT ret = DD_OK;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__GetUniquenessValue(IDirectDrawSurfaceImpl *This, LPDWORD lpdwValue)
|
HRESULT __stdcall IDirectDrawSurface__GetUniquenessValue(IDirectDrawSurfaceImpl* This, LPDWORD lpdwValue)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DDERR_INVALIDOBJECT;
|
HRESULT ret = DDERR_INVALIDOBJECT;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__ChangeUniquenessValue(IDirectDrawSurfaceImpl *This)
|
HRESULT __stdcall IDirectDrawSurface__ChangeUniquenessValue(IDirectDrawSurfaceImpl* This)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DDERR_INVALIDOBJECT;
|
HRESULT ret = DDERR_INVALIDOBJECT;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__SetPriority(IDirectDrawSurfaceImpl *This, DWORD dwPrio)
|
HRESULT __stdcall IDirectDrawSurface__SetPriority(IDirectDrawSurfaceImpl* This, DWORD dwPrio)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DDERR_INVALIDOBJECT;
|
HRESULT ret = DDERR_INVALIDOBJECT;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__GetPriority(IDirectDrawSurfaceImpl *This, LPDWORD lpdwPrio)
|
HRESULT __stdcall IDirectDrawSurface__GetPriority(IDirectDrawSurfaceImpl* This, LPDWORD lpdwPrio)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DDERR_INVALIDOBJECT;
|
HRESULT ret = DDERR_INVALIDOBJECT;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__SetLOD(IDirectDrawSurfaceImpl *This, DWORD dwLod)
|
HRESULT __stdcall IDirectDrawSurface__SetLOD(IDirectDrawSurfaceImpl* This, DWORD dwLod)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DDERR_INVALIDOBJECT;
|
HRESULT ret = DDERR_INVALIDOBJECT;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT __stdcall IDirectDrawSurface__GetLOD(IDirectDrawSurfaceImpl *This, LPDWORD lpdwLod)
|
HRESULT __stdcall IDirectDrawSurface__GetLOD(IDirectDrawSurfaceImpl* This, LPDWORD lpdwLod)
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This);
|
||||||
HRESULT ret = DDERR_INVALIDOBJECT;
|
HRESULT ret = DDERR_INVALIDOBJECT;
|
||||||
dprintf("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct IDirectDrawSurfaceImplVtbl g_dds_vtbl =
|
struct IDirectDrawSurfaceImplVtbl g_dds_vtbl =
|
||||||
{
|
{
|
||||||
/* IUnknown */
|
/*** IUnknown methods ***/
|
||||||
IDirectDrawSurface__QueryInterface,
|
IDirectDrawSurface__QueryInterface,
|
||||||
IDirectDrawSurface__AddRef,
|
IDirectDrawSurface__AddRef,
|
||||||
IDirectDrawSurface__Release,
|
IDirectDrawSurface__Release,
|
||||||
/* IDirectDrawSurface */
|
/*** IDirectDrawSurface methods ***/
|
||||||
IDirectDrawSurface__AddAttachedSurface,
|
IDirectDrawSurface__AddAttachedSurface,
|
||||||
IDirectDrawSurface__AddOverlayDirtyRect,
|
IDirectDrawSurface__AddOverlayDirtyRect,
|
||||||
IDirectDrawSurface__Blt,
|
IDirectDrawSurface__Blt,
|
||||||
@ -518,19 +616,19 @@ struct IDirectDrawSurfaceImplVtbl g_dds_vtbl =
|
|||||||
IDirectDrawSurface__UpdateOverlay,
|
IDirectDrawSurface__UpdateOverlay,
|
||||||
IDirectDrawSurface__UpdateOverlayDisplay,
|
IDirectDrawSurface__UpdateOverlayDisplay,
|
||||||
IDirectDrawSurface__UpdateOverlayZOrder,
|
IDirectDrawSurface__UpdateOverlayZOrder,
|
||||||
// v2
|
/*** Added in the v2 interface ***/
|
||||||
IDirectDrawSurface__GetDDInterface,
|
IDirectDrawSurface__GetDDInterface,
|
||||||
IDirectDrawSurface__PageLock,
|
IDirectDrawSurface__PageLock,
|
||||||
IDirectDrawSurface__PageUnlock,
|
IDirectDrawSurface__PageUnlock,
|
||||||
// v3
|
/*** Added in the v3 interface ***/
|
||||||
IDirectDrawSurface__SetSurfaceDesc,
|
IDirectDrawSurface__SetSurfaceDesc,
|
||||||
// v4
|
/*** Added in the v4 interface ***/
|
||||||
IDirectDrawSurface__SetPrivateData,
|
IDirectDrawSurface__SetPrivateData,
|
||||||
IDirectDrawSurface__GetPrivateData,
|
IDirectDrawSurface__GetPrivateData,
|
||||||
IDirectDrawSurface__FreePrivateData,
|
IDirectDrawSurface__FreePrivateData,
|
||||||
IDirectDrawSurface__GetUniquenessValue,
|
IDirectDrawSurface__GetUniquenessValue,
|
||||||
IDirectDrawSurface__ChangeUniquenessValue,
|
IDirectDrawSurface__ChangeUniquenessValue,
|
||||||
// v7
|
/*** Added in the v7 interface ***/
|
||||||
IDirectDrawSurface__SetPriority,
|
IDirectDrawSurface__SetPriority,
|
||||||
IDirectDrawSurface__GetPriority,
|
IDirectDrawSurface__GetPriority,
|
||||||
IDirectDrawSurface__SetLOD,
|
IDirectDrawSurface__SetLOD,
|
||||||
|
31
src/config.c
31
src/config.c
@ -16,12 +16,12 @@ static int cfg_get_int(LPCSTR key, int default_value);
|
|||||||
static DWORD cfg_get_string(LPCSTR key, LPCSTR default_value, LPSTR out_string, DWORD out_size);
|
static DWORD cfg_get_string(LPCSTR key, LPCSTR default_value, LPSTR out_string, DWORD out_size);
|
||||||
static void cfg_create_ini();
|
static void cfg_create_ini();
|
||||||
|
|
||||||
cnc_ddraw_config g_config =
|
CNCDDRAWCONFIG g_config =
|
||||||
{ .window_rect = { .left = -32000, .top = -32000, .right = 0, .bottom = 0 }, .window_state = -1 };
|
{ .window_rect = {.left = -32000, .top = -32000, .right = 0, .bottom = 0 }, .window_state = -1 };
|
||||||
|
|
||||||
void cfg_load()
|
void cfg_load()
|
||||||
{
|
{
|
||||||
//set up settings ini
|
/* set up settings ini */
|
||||||
char cwd[MAX_PATH];
|
char cwd[MAX_PATH];
|
||||||
char tmp[256];
|
char tmp[256];
|
||||||
GetCurrentDirectoryA(sizeof(cwd), cwd);
|
GetCurrentDirectoryA(sizeof(cwd), cwd);
|
||||||
@ -30,12 +30,12 @@ void cfg_load()
|
|||||||
if (GetFileAttributes(g_config.ini_path) == INVALID_FILE_ATTRIBUTES)
|
if (GetFileAttributes(g_config.ini_path) == INVALID_FILE_ATTRIBUTES)
|
||||||
cfg_create_ini();
|
cfg_create_ini();
|
||||||
|
|
||||||
//get process filename
|
/* get process filename */
|
||||||
char process_file_path[MAX_PATH] = { 0 };
|
char process_file_path[MAX_PATH] = { 0 };
|
||||||
GetModuleFileNameA(NULL, process_file_path, MAX_PATH);
|
GetModuleFileNameA(NULL, process_file_path, MAX_PATH);
|
||||||
_splitpath(process_file_path, NULL, NULL, g_config.process_file_name, NULL);
|
_splitpath(process_file_path, NULL, NULL, g_config.process_file_name, NULL);
|
||||||
|
|
||||||
//load settings from ini
|
/* load settings from ini */
|
||||||
g_ddraw->windowed = cfg_get_bool("windowed", FALSE);
|
g_ddraw->windowed = cfg_get_bool("windowed", FALSE);
|
||||||
g_ddraw->border = cfg_get_bool("border", TRUE);
|
g_ddraw->border = cfg_get_bool("border", TRUE);
|
||||||
g_ddraw->boxing = cfg_get_bool("boxing", FALSE);
|
g_ddraw->boxing = cfg_get_bool("boxing", FALSE);
|
||||||
@ -53,7 +53,6 @@ void cfg_load()
|
|||||||
g_ddraw->fixwndprochook = cfg_get_bool("fixwndprochook", FALSE);
|
g_ddraw->fixwndprochook = cfg_get_bool("fixwndprochook", FALSE);
|
||||||
g_ddraw->d3d9linear = cfg_get_bool("d3d9linear", TRUE);
|
g_ddraw->d3d9linear = cfg_get_bool("d3d9linear", TRUE);
|
||||||
g_ddraw->gdilinear = cfg_get_bool("gdilinear", FALSE);
|
g_ddraw->gdilinear = cfg_get_bool("gdilinear", FALSE);
|
||||||
g_ddraw->backbuffer = cfg_get_bool("backbuffer", TRUE);
|
|
||||||
g_ddraw->passthrough = cfg_get_bool("passthrough", TRUE);
|
g_ddraw->passthrough = cfg_get_bool("passthrough", TRUE);
|
||||||
g_ddraw->resolutions = cfg_get_int("resolutions", RESLIST_NORMAL);
|
g_ddraw->resolutions = cfg_get_int("resolutions", RESLIST_NORMAL);
|
||||||
|
|
||||||
@ -81,9 +80,9 @@ void cfg_load()
|
|||||||
g_ddraw->render.minfps_tick_len = (DWORD)(1000.0f / g_ddraw->render.minfps);
|
g_ddraw->render.minfps_tick_len = (DWORD)(1000.0f / g_ddraw->render.minfps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* can't fully set it up here due to missing g_ddraw->mode.dmDisplayFrequency */
|
||||||
if (g_ddraw->accurate_timers || g_ddraw->vsync)
|
if (g_ddraw->accurate_timers || g_ddraw->vsync)
|
||||||
g_fpsl.htimer = CreateWaitableTimer(NULL, TRUE, NULL);
|
g_fpsl.htimer = CreateWaitableTimer(NULL, TRUE, NULL);
|
||||||
//can't fully set it up here due to missing g_ddraw->mode.dmDisplayFrequency
|
|
||||||
|
|
||||||
g_ddraw->maxgameticks = cfg_get_int("maxgameticks", 0);
|
g_ddraw->maxgameticks = cfg_get_int("maxgameticks", 0);
|
||||||
|
|
||||||
@ -99,7 +98,7 @@ void cfg_load()
|
|||||||
|
|
||||||
if (g_ddraw->maxgameticks >= 0 || g_ddraw->maxgameticks == -2)
|
if (g_ddraw->maxgameticks >= 0 || g_ddraw->maxgameticks == -2)
|
||||||
{
|
{
|
||||||
//always using 60 fps for flip...
|
/* always using 60 fps for flip... */
|
||||||
if (g_ddraw->accurate_timers)
|
if (g_ddraw->accurate_timers)
|
||||||
g_ddraw->flip_limiter.htimer = CreateWaitableTimer(NULL, TRUE, NULL);
|
g_ddraw->flip_limiter.htimer = CreateWaitableTimer(NULL, TRUE, NULL);
|
||||||
|
|
||||||
@ -139,21 +138,21 @@ void cfg_load()
|
|||||||
g_ddraw->render.bpp = 0;
|
g_ddraw->render.bpp = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// to do: read .glslp config file instead of the shader and apply the correct settings
|
/* to do: read .glslp config file instead of the shader and apply the correct settings */
|
||||||
cfg_get_string("shader", "", g_ddraw->shader, sizeof(g_ddraw->shader));
|
cfg_get_string("shader", "", g_ddraw->shader, sizeof(g_ddraw->shader));
|
||||||
|
|
||||||
cfg_get_string("renderer", "auto", tmp, sizeof(tmp));
|
cfg_get_string("renderer", "auto", tmp, sizeof(tmp));
|
||||||
dprintf(" Using %s renderer\n", tmp);
|
TRACE(" Using %s renderer\n", tmp);
|
||||||
|
|
||||||
if (tolower(tmp[0]) == 's' || tolower(tmp[0]) == 'g') //gdi
|
if (tolower(tmp[0]) == 's' || tolower(tmp[0]) == 'g') /* gdi */
|
||||||
{
|
{
|
||||||
g_ddraw->renderer = gdi_render_main;
|
g_ddraw->renderer = gdi_render_main;
|
||||||
}
|
}
|
||||||
else if (tolower(tmp[0]) == 'd') //direct3d9
|
else if (tolower(tmp[0]) == 'd') /* direct3d9 */
|
||||||
{
|
{
|
||||||
g_ddraw->renderer = d3d9_render_main;
|
g_ddraw->renderer = d3d9_render_main;
|
||||||
}
|
}
|
||||||
else if (tolower(tmp[0]) == 'o') //opengl
|
else if (tolower(tmp[0]) == 'o') /* opengl */
|
||||||
{
|
{
|
||||||
if (oglu_load_dll())
|
if (oglu_load_dll())
|
||||||
{
|
{
|
||||||
@ -165,7 +164,7 @@ void cfg_load()
|
|||||||
g_ddraw->renderer = gdi_render_main;
|
g_ddraw->renderer = gdi_render_main;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else //auto
|
else /* auto */
|
||||||
{
|
{
|
||||||
if (!g_ddraw->wine && d3d9_is_available())
|
if (!g_ddraw->wine && d3d9_is_available())
|
||||||
{
|
{
|
||||||
@ -189,7 +188,7 @@ void cfg_save()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
char buf[16];
|
char buf[16];
|
||||||
char *section = g_config.save_settings == 1 ? "ddraw" : g_config.process_file_name;
|
char* section = g_config.save_settings == 1 ? "ddraw" : g_config.process_file_name;
|
||||||
|
|
||||||
if (g_config.window_rect.right)
|
if (g_config.window_rect.right)
|
||||||
{
|
{
|
||||||
@ -223,7 +222,7 @@ void cfg_save()
|
|||||||
|
|
||||||
static void cfg_create_ini()
|
static void cfg_create_ini()
|
||||||
{
|
{
|
||||||
FILE *fh = fopen(g_config.ini_path, "w");
|
FILE* fh = fopen(g_config.ini_path, "w");
|
||||||
if (fh)
|
if (fh)
|
||||||
{
|
{
|
||||||
fputs(
|
fputs(
|
||||||
|
175
src/dd.c
175
src/dd.c
@ -1,6 +1,6 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <ddraw.h>
|
||||||
#include "IDirectDraw.h"
|
#include "IDirectDraw.h"
|
||||||
#include "ddraw.h"
|
|
||||||
#include "dd.h"
|
#include "dd.h"
|
||||||
#include "hook.h"
|
#include "hook.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@ -14,14 +14,18 @@
|
|||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
|
|
||||||
cnc_ddraw *g_ddraw = NULL;
|
CNCDDRAW* g_ddraw = NULL;
|
||||||
|
|
||||||
HRESULT dd_EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK lpEnumModesCallback)
|
HRESULT dd_EnumDisplayModes(
|
||||||
|
DWORD dwFlags,
|
||||||
|
LPDDSURFACEDESC2 lpDDSurfaceDesc,
|
||||||
|
LPVOID lpContext,
|
||||||
|
LPDDENUMMODESCALLBACK2 lpEnumModesCallback)
|
||||||
{
|
{
|
||||||
DWORD i = 0;
|
DWORD i = 0;
|
||||||
DDSURFACEDESC s;
|
DDSURFACEDESC2 s;
|
||||||
|
|
||||||
/* Some games crash when you feed them with too many resolutions... */
|
/* Some games crash when you feed them with too many resolutions so we have to keep the list short */
|
||||||
|
|
||||||
SIZE resolutions[] =
|
SIZE resolutions[] =
|
||||||
{
|
{
|
||||||
@ -40,7 +44,7 @@ HRESULT dd_EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVO
|
|||||||
|
|
||||||
if (g_ddraw->bpp || g_ddraw->resolutions == RESLIST_FULL)
|
if (g_ddraw->bpp || g_ddraw->resolutions == RESLIST_FULL)
|
||||||
{
|
{
|
||||||
dprintf(" g_ddraw->bpp=%u\n", g_ddraw->bpp);
|
TRACE(" g_ddraw->bpp=%u\n", g_ddraw->bpp);
|
||||||
|
|
||||||
/* set up some filters to keep the list short */
|
/* set up some filters to keep the list short */
|
||||||
DWORD refresh_rate = 0;
|
DWORD refresh_rate = 0;
|
||||||
@ -82,9 +86,15 @@ HRESULT dd_EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVO
|
|||||||
flags == m.dmDisplayFlags &&
|
flags == m.dmDisplayFlags &&
|
||||||
fixed_output == m.dmDisplayFixedOutput)
|
fixed_output == m.dmDisplayFixedOutput)
|
||||||
{
|
{
|
||||||
dprintfex(" %d: %dx%d@%d %d bpp\n", (int)i, (int)m.dmPelsWidth, (int)m.dmPelsHeight, (int)m.dmDisplayFrequency, (int)m.dmBitsPerPel);
|
TRACE_EXT(
|
||||||
|
" %u: %ux%u@%u %u bpp\n",
|
||||||
|
i,
|
||||||
|
m.dmPelsWidth,
|
||||||
|
m.dmPelsHeight,
|
||||||
|
m.dmDisplayFrequency,
|
||||||
|
m.dmBitsPerPel);
|
||||||
|
|
||||||
memset(&s, 0, sizeof(DDSURFACEDESC));
|
memset(&s, 0, sizeof(s));
|
||||||
|
|
||||||
s.dwSize = sizeof(DDSURFACEDESC);
|
s.dwSize = sizeof(DDSURFACEDESC);
|
||||||
s.dwFlags = DDSD_HEIGHT | DDSD_REFRESHRATE | DDSD_WIDTH | DDSD_PITCH | DDSD_PIXELFORMAT;
|
s.dwFlags = DDSD_HEIGHT | DDSD_REFRESHRATE | DDSD_WIDTH | DDSD_PITCH | DDSD_PIXELFORMAT;
|
||||||
@ -101,7 +111,7 @@ HRESULT dd_EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVO
|
|||||||
{
|
{
|
||||||
if (lpEnumModesCallback(&s, lpContext) == DDENUMRET_CANCEL)
|
if (lpEnumModesCallback(&s, lpContext) == DDENUMRET_CANCEL)
|
||||||
{
|
{
|
||||||
dprintf(" DDENUMRET_CANCEL returned, stopping\n");
|
TRACE(" DDENUMRET_CANCEL returned, stopping\n");
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -117,7 +127,7 @@ HRESULT dd_EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVO
|
|||||||
{
|
{
|
||||||
if (lpEnumModesCallback(&s, lpContext) == DDENUMRET_CANCEL)
|
if (lpEnumModesCallback(&s, lpContext) == DDENUMRET_CANCEL)
|
||||||
{
|
{
|
||||||
dprintf(" DDENUMRET_CANCEL returned, stopping\n");
|
TRACE(" DDENUMRET_CANCEL returned, stopping\n");
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -133,7 +143,7 @@ HRESULT dd_EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVO
|
|||||||
{
|
{
|
||||||
if (lpEnumModesCallback(&s, lpContext) == DDENUMRET_CANCEL)
|
if (lpEnumModesCallback(&s, lpContext) == DDENUMRET_CANCEL)
|
||||||
{
|
{
|
||||||
dprintf(" DDENUMRET_CANCEL returned, stopping\n");
|
TRACE(" DDENUMRET_CANCEL returned, stopping\n");
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -187,7 +197,7 @@ HRESULT dd_EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVO
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(&s, 0, sizeof(DDSURFACEDESC));
|
memset(&s, 0, sizeof(s));
|
||||||
|
|
||||||
s.dwSize = sizeof(DDSURFACEDESC);
|
s.dwSize = sizeof(DDSURFACEDESC);
|
||||||
s.dwFlags = DDSD_HEIGHT | DDSD_REFRESHRATE | DDSD_WIDTH | DDSD_PITCH | DDSD_PIXELFORMAT;
|
s.dwFlags = DDSD_HEIGHT | DDSD_REFRESHRATE | DDSD_WIDTH | DDSD_PITCH | DDSD_PIXELFORMAT;
|
||||||
@ -201,7 +211,7 @@ HRESULT dd_EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVO
|
|||||||
|
|
||||||
if (lpEnumModesCallback(&s, lpContext) == DDENUMRET_CANCEL)
|
if (lpEnumModesCallback(&s, lpContext) == DDENUMRET_CANCEL)
|
||||||
{
|
{
|
||||||
dprintf(" DDENUMRET_CANCEL returned, stopping\n");
|
TRACE(" DDENUMRET_CANCEL returned, stopping\n");
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,7 +224,7 @@ HRESULT dd_EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVO
|
|||||||
|
|
||||||
if (lpEnumModesCallback(&s, lpContext) == DDENUMRET_CANCEL)
|
if (lpEnumModesCallback(&s, lpContext) == DDENUMRET_CANCEL)
|
||||||
{
|
{
|
||||||
dprintf(" DDENUMRET_CANCEL returned, stopping\n");
|
TRACE(" DDENUMRET_CANCEL returned, stopping\n");
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,7 +240,7 @@ HRESULT dd_EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVO
|
|||||||
|
|
||||||
if (lpEnumModesCallback(&s, lpContext) == DDENUMRET_CANCEL)
|
if (lpEnumModesCallback(&s, lpContext) == DDENUMRET_CANCEL)
|
||||||
{
|
{
|
||||||
dprintf(" DDENUMRET_CANCEL returned, stopping\n");
|
TRACE(" DDENUMRET_CANCEL returned, stopping\n");
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -243,8 +253,15 @@ HRESULT dd_GetCaps(LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDEmulCaps)
|
|||||||
{
|
{
|
||||||
if (lpDDDriverCaps)
|
if (lpDDDriverCaps)
|
||||||
{
|
{
|
||||||
lpDDDriverCaps->dwSize = sizeof(DDCAPS);
|
lpDDDriverCaps->dwSize = sizeof(DDCAPS_DX5);
|
||||||
lpDDDriverCaps->dwCaps = DDCAPS_BLT | DDCAPS_PALETTE | DDCAPS_BLTCOLORFILL | DDCAPS_BLTSTRETCH | DDCAPS_CANCLIP | DDCAPS_CANBLTSYSMEM;
|
lpDDDriverCaps->dwCaps =
|
||||||
|
DDCAPS_BLT |
|
||||||
|
DDCAPS_PALETTE |
|
||||||
|
DDCAPS_BLTCOLORFILL |
|
||||||
|
DDCAPS_BLTSTRETCH |
|
||||||
|
DDCAPS_CANCLIP |
|
||||||
|
DDCAPS_CANBLTSYSMEM;
|
||||||
|
|
||||||
lpDDDriverCaps->dwCKeyCaps = 0;
|
lpDDDriverCaps->dwCKeyCaps = 0;
|
||||||
lpDDDriverCaps->dwPalCaps = DDPCAPS_8BIT | DDPCAPS_PRIMARYSURFACE;
|
lpDDDriverCaps->dwPalCaps = DDPCAPS_8BIT | DDPCAPS_PRIMARYSURFACE;
|
||||||
lpDDDriverCaps->dwVidMemTotal = 16777216;
|
lpDDDriverCaps->dwVidMemTotal = 16777216;
|
||||||
@ -267,13 +284,15 @@ HRESULT dd_GetCaps(LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDEmulCaps)
|
|||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT dd_GetDisplayMode(LPDDSURFACEDESC lpDDSurfaceDesc)
|
HRESULT dd_GetDisplayMode(LPDDSURFACEDESC2 lpDDSurfaceDesc)
|
||||||
{
|
{
|
||||||
if (lpDDSurfaceDesc)
|
if (lpDDSurfaceDesc)
|
||||||
{
|
{
|
||||||
memset(lpDDSurfaceDesc, 0, sizeof(DDSURFACEDESC));
|
int size = lpDDSurfaceDesc->dwSize == sizeof(DDSURFACEDESC2) ? sizeof(DDSURFACEDESC2) : sizeof(DDSURFACEDESC);
|
||||||
|
|
||||||
lpDDSurfaceDesc->dwSize = sizeof(DDSURFACEDESC);
|
memset(lpDDSurfaceDesc, 0, size);
|
||||||
|
|
||||||
|
lpDDSurfaceDesc->dwSize = size;
|
||||||
lpDDSurfaceDesc->dwFlags = DDSD_HEIGHT | DDSD_REFRESHRATE | DDSD_WIDTH | DDSD_PITCH | DDSD_PIXELFORMAT;
|
lpDDSurfaceDesc->dwFlags = DDSD_HEIGHT | DDSD_REFRESHRATE | DDSD_WIDTH | DDSD_PITCH | DDSD_PIXELFORMAT;
|
||||||
lpDDSurfaceDesc->dwHeight = g_ddraw->height ? g_ddraw->height : 768;
|
lpDDSurfaceDesc->dwHeight = g_ddraw->height ? g_ddraw->height : 768;
|
||||||
lpDDSurfaceDesc->dwWidth = g_ddraw->width ? g_ddraw->width : 1024;
|
lpDDSurfaceDesc->dwWidth = g_ddraw->width ? g_ddraw->width : 1024;
|
||||||
@ -351,9 +370,9 @@ HRESULT dd_RestoreDisplayMode()
|
|||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT dd_SetDisplayMode(DWORD width, DWORD height, DWORD bpp, BOOL set_by_game)
|
HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, BOOL setByGame)
|
||||||
{
|
{
|
||||||
if (bpp != 8 && bpp != 16 && bpp != 32)
|
if (dwBPP != 8 && dwBPP != 16 && dwBPP != 32)
|
||||||
return DDERR_INVALIDMODE;
|
return DDERR_INVALIDMODE;
|
||||||
|
|
||||||
if (g_ddraw->render.thread)
|
if (g_ddraw->render.thread)
|
||||||
@ -419,21 +438,21 @@ HRESULT dd_SetDisplayMode(DWORD width, DWORD height, DWORD bpp, BOOL set_by_game
|
|||||||
g_ddraw->render.height = g_config.window_rect.bottom;
|
g_ddraw->render.height = g_config.window_rect.bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
//temporary fix: center window for games that keep changing their resolution
|
/* temporary fix: center window for games that keep changing their resolution */
|
||||||
if (g_ddraw->width &&
|
if (g_ddraw->width &&
|
||||||
(g_ddraw->width != width || g_ddraw->height != height) &&
|
(g_ddraw->width != dwWidth || g_ddraw->height != dwHeight) &&
|
||||||
(width > g_config.window_rect.right || height > g_config.window_rect.bottom))
|
(dwWidth > g_config.window_rect.right || dwHeight > g_config.window_rect.bottom))
|
||||||
{
|
{
|
||||||
g_config.window_rect.left = -32000;
|
g_config.window_rect.left = -32000;
|
||||||
g_config.window_rect.top = -32000;
|
g_config.window_rect.top = -32000;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_ddraw->width = width;
|
g_ddraw->width = dwWidth;
|
||||||
g_ddraw->height = height;
|
g_ddraw->height = dwHeight;
|
||||||
g_ddraw->bpp = bpp;
|
g_ddraw->bpp = dwBPP;
|
||||||
|
|
||||||
g_ddraw->cursor.x = width / 2;
|
g_ddraw->cursor.x = dwWidth / 2;
|
||||||
g_ddraw->cursor.y = height / 2;
|
g_ddraw->cursor.y = dwHeight / 2;
|
||||||
|
|
||||||
BOOL border = g_ddraw->border;
|
BOOL border = g_ddraw->border;
|
||||||
|
|
||||||
@ -442,14 +461,14 @@ HRESULT dd_SetDisplayMode(DWORD width, DWORD height, DWORD bpp, BOOL set_by_game
|
|||||||
g_ddraw->render.width = g_ddraw->mode.dmPelsWidth;
|
g_ddraw->render.width = g_ddraw->mode.dmPelsWidth;
|
||||||
g_ddraw->render.height = g_ddraw->mode.dmPelsHeight;
|
g_ddraw->render.height = g_ddraw->mode.dmPelsHeight;
|
||||||
|
|
||||||
if (g_ddraw->windowed) //windowed-fullscreen aka borderless
|
if (g_ddraw->windowed) /* windowed-fullscreen aka borderless */
|
||||||
{
|
{
|
||||||
border = FALSE;
|
border = FALSE;
|
||||||
|
|
||||||
g_config.window_rect.left = -32000;
|
g_config.window_rect.left = -32000;
|
||||||
g_config.window_rect.top = -32000;
|
g_config.window_rect.top = -32000;
|
||||||
|
|
||||||
// prevent OpenGL from going automatically into fullscreen exclusive mode
|
/* prevent OpenGL from going automatically into fullscreen exclusive mode */
|
||||||
if (g_ddraw->renderer == ogl_render_main)
|
if (g_ddraw->renderer == ogl_render_main)
|
||||||
g_ddraw->render.height++;
|
g_ddraw->render.height++;
|
||||||
|
|
||||||
@ -474,7 +493,7 @@ HRESULT dd_SetDisplayMode(DWORD width, DWORD height, DWORD bpp, BOOL set_by_game
|
|||||||
memset(&g_ddraw->render.mode, 0, sizeof(DEVMODE));
|
memset(&g_ddraw->render.mode, 0, sizeof(DEVMODE));
|
||||||
|
|
||||||
g_ddraw->render.mode.dmSize = sizeof(DEVMODE);
|
g_ddraw->render.mode.dmSize = sizeof(DEVMODE);
|
||||||
g_ddraw->render.mode.dmFields = DM_PELSWIDTH|DM_PELSHEIGHT;
|
g_ddraw->render.mode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
|
||||||
g_ddraw->render.mode.dmPelsWidth = g_ddraw->render.width;
|
g_ddraw->render.mode.dmPelsWidth = g_ddraw->render.width;
|
||||||
g_ddraw->render.mode.dmPelsHeight = g_ddraw->render.height;
|
g_ddraw->render.mode.dmPelsHeight = g_ddraw->render.height;
|
||||||
|
|
||||||
@ -488,44 +507,46 @@ HRESULT dd_SetDisplayMode(DWORD width, DWORD height, DWORD bpp, BOOL set_by_game
|
|||||||
|
|
||||||
if (!g_ddraw->windowed)
|
if (!g_ddraw->windowed)
|
||||||
{
|
{
|
||||||
// Making sure the chosen resolution is valid
|
/* Making sure the chosen resolution is valid */
|
||||||
int old_width = g_ddraw->render.width;
|
int old_width = g_ddraw->render.width;
|
||||||
int old_height = g_ddraw->render.height;
|
int old_height = g_ddraw->render.height;
|
||||||
|
|
||||||
if (ChangeDisplaySettings(&g_ddraw->render.mode, CDS_TEST) != DISP_CHANGE_SUCCESSFUL)
|
if (ChangeDisplaySettings(&g_ddraw->render.mode, CDS_TEST) != DISP_CHANGE_SUCCESSFUL)
|
||||||
{
|
{
|
||||||
// fail... compare resolutions
|
/* fail... compare resolutions */
|
||||||
if (g_ddraw->render.width > g_ddraw->mode.dmPelsWidth || g_ddraw->render.height > g_ddraw->mode.dmPelsHeight)
|
if (g_ddraw->render.width > g_ddraw->mode.dmPelsWidth ||
|
||||||
|
g_ddraw->render.height > g_ddraw->mode.dmPelsHeight)
|
||||||
{
|
{
|
||||||
// chosen game resolution higher than current resolution, use windowed mode for this case
|
/* chosen game resolution higher than current resolution, use windowed mode for this case */
|
||||||
g_ddraw->windowed = TRUE;
|
g_ddraw->windowed = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Try 2x scaling
|
/* Try 2x scaling */
|
||||||
g_ddraw->render.width *= 2;
|
g_ddraw->render.width *= 2;
|
||||||
g_ddraw->render.height *= 2;
|
g_ddraw->render.height *= 2;
|
||||||
|
|
||||||
g_ddraw->render.mode.dmPelsWidth = g_ddraw->render.width;
|
g_ddraw->render.mode.dmPelsWidth = g_ddraw->render.width;
|
||||||
g_ddraw->render.mode.dmPelsHeight = g_ddraw->render.height;
|
g_ddraw->render.mode.dmPelsHeight = g_ddraw->render.height;
|
||||||
|
|
||||||
if ((g_ddraw->render.width > g_ddraw->mode.dmPelsWidth || g_ddraw->render.height > g_ddraw->mode.dmPelsHeight) ||
|
if ((g_ddraw->render.width > g_ddraw->mode.dmPelsWidth ||
|
||||||
|
g_ddraw->render.height > g_ddraw->mode.dmPelsHeight) ||
|
||||||
ChangeDisplaySettings(&g_ddraw->render.mode, CDS_TEST) != DISP_CHANGE_SUCCESSFUL)
|
ChangeDisplaySettings(&g_ddraw->render.mode, CDS_TEST) != DISP_CHANGE_SUCCESSFUL)
|
||||||
{
|
{
|
||||||
SIZE res = {0};
|
SIZE res = { 0 };
|
||||||
|
|
||||||
//try to get a resolution with the same aspect ratio as the requested resolution
|
/* try to get a resolution with the same aspect ratio as the requested resolution */
|
||||||
BOOL found_res = util_get_lowest_resolution(
|
BOOL found_res = util_get_lowest_resolution(
|
||||||
(float)old_width / old_height,
|
(float)old_width / old_height,
|
||||||
&res,
|
&res,
|
||||||
old_width + 1, //don't return the original resolution since we tested that one already
|
old_width + 1, /* don't return the original resolution since we tested that one already */
|
||||||
old_height + 1,
|
old_height + 1,
|
||||||
g_ddraw->mode.dmPelsWidth,
|
g_ddraw->mode.dmPelsWidth,
|
||||||
g_ddraw->mode.dmPelsHeight);
|
g_ddraw->mode.dmPelsHeight);
|
||||||
|
|
||||||
if (!found_res)
|
if (!found_res)
|
||||||
{
|
{
|
||||||
//try to get a resolution with the same aspect ratio as the current display mode
|
/* try to get a resolution with the same aspect ratio as the current display mode */
|
||||||
found_res = util_get_lowest_resolution(
|
found_res = util_get_lowest_resolution(
|
||||||
(float)g_ddraw->mode.dmPelsWidth / g_ddraw->mode.dmPelsHeight,
|
(float)g_ddraw->mode.dmPelsWidth / g_ddraw->mode.dmPelsHeight,
|
||||||
&res,
|
&res,
|
||||||
@ -546,7 +567,7 @@ HRESULT dd_SetDisplayMode(DWORD width, DWORD height, DWORD bpp, BOOL set_by_game
|
|||||||
|
|
||||||
if (!found_res || ChangeDisplaySettings(&g_ddraw->render.mode, CDS_TEST) != DISP_CHANGE_SUCCESSFUL)
|
if (!found_res || ChangeDisplaySettings(&g_ddraw->render.mode, CDS_TEST) != DISP_CHANGE_SUCCESSFUL)
|
||||||
{
|
{
|
||||||
// try current display settings
|
/* try current display settings */
|
||||||
g_ddraw->render.width = g_ddraw->mode.dmPelsWidth;
|
g_ddraw->render.width = g_ddraw->mode.dmPelsWidth;
|
||||||
g_ddraw->render.height = g_ddraw->mode.dmPelsHeight;
|
g_ddraw->render.height = g_ddraw->mode.dmPelsHeight;
|
||||||
|
|
||||||
@ -555,7 +576,7 @@ HRESULT dd_SetDisplayMode(DWORD width, DWORD height, DWORD bpp, BOOL set_by_game
|
|||||||
|
|
||||||
if (ChangeDisplaySettings(&g_ddraw->render.mode, CDS_TEST) != DISP_CHANGE_SUCCESSFUL)
|
if (ChangeDisplaySettings(&g_ddraw->render.mode, CDS_TEST) != DISP_CHANGE_SUCCESSFUL)
|
||||||
{
|
{
|
||||||
// everything failed, use windowed mode instead
|
/* everything failed, use windowed mode instead */
|
||||||
g_ddraw->render.width = old_width;
|
g_ddraw->render.width = old_width;
|
||||||
g_ddraw->render.height = old_height;
|
g_ddraw->render.height = old_height;
|
||||||
|
|
||||||
@ -592,8 +613,7 @@ HRESULT dd_SetDisplayMode(DWORD width, DWORD height, DWORD bpp, BOOL set_by_game
|
|||||||
g_ddraw->render.viewport.width = g_ddraw->width;
|
g_ddraw->render.viewport.width = g_ddraw->width;
|
||||||
g_ddraw->render.viewport.height = g_ddraw->height;
|
g_ddraw->render.viewport.height = g_ddraw->height;
|
||||||
|
|
||||||
int i;
|
for (int i = 20; i-- > 1;)
|
||||||
for (i = 20; i-- > 1;)
|
|
||||||
{
|
{
|
||||||
if (g_ddraw->width * i <= g_ddraw->render.width && g_ddraw->height * i <= g_ddraw->render.height)
|
if (g_ddraw->width * i <= g_ddraw->render.width && g_ddraw->height * i <= g_ddraw->render.height)
|
||||||
{
|
{
|
||||||
@ -609,7 +629,8 @@ HRESULT dd_SetDisplayMode(DWORD width, DWORD height, DWORD bpp, BOOL set_by_game
|
|||||||
else if (maintas)
|
else if (maintas)
|
||||||
{
|
{
|
||||||
g_ddraw->render.viewport.width = g_ddraw->render.width;
|
g_ddraw->render.viewport.width = g_ddraw->render.width;
|
||||||
g_ddraw->render.viewport.height = (int)(((float)g_ddraw->height / g_ddraw->width) * g_ddraw->render.viewport.width);
|
g_ddraw->render.viewport.height =
|
||||||
|
(int)(((float)g_ddraw->height / g_ddraw->width) * g_ddraw->render.viewport.width);
|
||||||
|
|
||||||
if (g_ddraw->render.viewport.height > g_ddraw->render.height)
|
if (g_ddraw->render.viewport.height > g_ddraw->render.height)
|
||||||
{
|
{
|
||||||
@ -630,20 +651,32 @@ HRESULT dd_SetDisplayMode(DWORD width, DWORD height, DWORD bpp, BOOL set_by_game
|
|||||||
|
|
||||||
if (g_ddraw->windowed)
|
if (g_ddraw->windowed)
|
||||||
{
|
{
|
||||||
MSG msg; // workaround for "Not Responding" window problem in cnc games
|
MSG msg; /* workaround for "Not Responding" window problem in cnc games */
|
||||||
PeekMessage(&msg, g_ddraw->hwnd, 0, 0, PM_NOREMOVE);
|
PeekMessage(&msg, g_ddraw->hwnd, 0, 0, PM_NOREMOVE);
|
||||||
|
|
||||||
if (!border)
|
if (!border)
|
||||||
{
|
{
|
||||||
real_SetWindowLongA(g_ddraw->hwnd, GWL_STYLE, GetWindowLong(g_ddraw->hwnd, GWL_STYLE) & ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU));
|
real_SetWindowLongA(
|
||||||
|
g_ddraw->hwnd,
|
||||||
|
GWL_STYLE,
|
||||||
|
GetWindowLong(
|
||||||
|
g_ddraw->hwnd, GWL_STYLE) & ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
real_SetWindowLongA(g_ddraw->hwnd, GWL_STYLE, (GetWindowLong(g_ddraw->hwnd, GWL_STYLE) | WS_OVERLAPPEDWINDOW));// &~WS_MAXIMIZEBOX);
|
real_SetWindowLongA(
|
||||||
|
g_ddraw->hwnd,
|
||||||
|
GWL_STYLE,
|
||||||
|
(GetWindowLong(g_ddraw->hwnd, GWL_STYLE) | WS_OVERLAPPEDWINDOW));// &~WS_MAXIMIZEBOX);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_ddraw->wine)
|
if (g_ddraw->wine)
|
||||||
real_SetWindowLongA(g_ddraw->hwnd, GWL_STYLE, (GetWindowLong(g_ddraw->hwnd, GWL_STYLE) | WS_MINIMIZEBOX) & ~(WS_MAXIMIZEBOX | WS_THICKFRAME));
|
{
|
||||||
|
real_SetWindowLongA(
|
||||||
|
g_ddraw->hwnd,
|
||||||
|
GWL_STYLE,
|
||||||
|
(GetWindowLong(g_ddraw->hwnd, GWL_STYLE) | WS_MINIMIZEBOX) & ~(WS_MAXIMIZEBOX | WS_THICKFRAME));
|
||||||
|
}
|
||||||
|
|
||||||
/* center the window with correct dimensions */
|
/* center the window with correct dimensions */
|
||||||
int cy = g_ddraw->mode.dmPelsWidth ? g_ddraw->mode.dmPelsWidth : g_ddraw->render.width;
|
int cy = g_ddraw->mode.dmPelsWidth ? g_ddraw->mode.dmPelsWidth : g_ddraw->render.width;
|
||||||
@ -680,7 +713,10 @@ HRESULT dd_SetDisplayMode(DWORD width, DWORD height, DWORD bpp, BOOL set_by_game
|
|||||||
|
|
||||||
if ((style & WS_CAPTION))
|
if ((style & WS_CAPTION))
|
||||||
{
|
{
|
||||||
real_SetWindowLongA(g_ddraw->hwnd, GWL_STYLE, style & ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU));
|
real_SetWindowLongA(
|
||||||
|
g_ddraw->hwnd,
|
||||||
|
GWL_STYLE,
|
||||||
|
style & ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU));
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL d3d9_active = FALSE;
|
BOOL d3d9_active = FALSE;
|
||||||
@ -701,7 +737,7 @@ HRESULT dd_SetDisplayMode(DWORD width, DWORD height, DWORD bpp, BOOL set_by_game
|
|||||||
{
|
{
|
||||||
g_ddraw->render.run = FALSE;
|
g_ddraw->render.run = FALSE;
|
||||||
g_ddraw->windowed = TRUE;
|
g_ddraw->windowed = TRUE;
|
||||||
return dd_SetDisplayMode(width, height, bpp, set_by_game);
|
return dd_SetDisplayMode(dwWidth, dwHeight, dwBPP, setByGame);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_ddraw->wine)
|
if (g_ddraw->wine)
|
||||||
@ -709,7 +745,15 @@ HRESULT dd_SetDisplayMode(DWORD width, DWORD height, DWORD bpp, BOOL set_by_game
|
|||||||
real_SetWindowLongA(g_ddraw->hwnd, GWL_STYLE, GetWindowLong(g_ddraw->hwnd, GWL_STYLE) | WS_MINIMIZEBOX);
|
real_SetWindowLongA(g_ddraw->hwnd, GWL_STYLE, GetWindowLong(g_ddraw->hwnd, GWL_STYLE) | WS_MINIMIZEBOX);
|
||||||
}
|
}
|
||||||
|
|
||||||
real_SetWindowPos(g_ddraw->hwnd, HWND_TOPMOST, 0, 0, g_ddraw->render.width, g_ddraw->render.height, SWP_SHOWWINDOW);
|
real_SetWindowPos(
|
||||||
|
g_ddraw->hwnd,
|
||||||
|
HWND_TOPMOST,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
g_ddraw->render.width,
|
||||||
|
g_ddraw->render.height,
|
||||||
|
SWP_SHOWWINDOW);
|
||||||
|
|
||||||
g_ddraw->last_set_window_pos_tick = timeGetTime();
|
g_ddraw->last_set_window_pos_tick = timeGetTime();
|
||||||
|
|
||||||
mouse_lock();
|
mouse_lock();
|
||||||
@ -729,7 +773,7 @@ HRESULT dd_SetDisplayMode(DWORD width, DWORD height, DWORD bpp, BOOL set_by_game
|
|||||||
g_ddraw->render.thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)g_ddraw->renderer, NULL, 0, NULL);
|
g_ddraw->render.thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)g_ddraw->renderer, NULL, 0, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (set_by_game)
|
if (setByGame)
|
||||||
{
|
{
|
||||||
real_SendMessageA(g_ddraw->hwnd, WM_SIZE_DDRAW, 0, MAKELPARAM(g_ddraw->width, g_ddraw->height));
|
real_SendMessageA(g_ddraw->hwnd, WM_SIZE_DDRAW, 0, MAKELPARAM(g_ddraw->width, g_ddraw->height));
|
||||||
real_SendMessageA(g_ddraw->hwnd, WM_MOVE_DDRAW, 0, MAKELPARAM(0, 0));
|
real_SendMessageA(g_ddraw->hwnd, WM_MOVE_DDRAW, 0, MAKELPARAM(0, 0));
|
||||||
@ -743,7 +787,6 @@ HRESULT dd_SetCooperativeLevel(HWND hwnd, DWORD dwFlags)
|
|||||||
{
|
{
|
||||||
PIXELFORMATDESCRIPTOR pfd;
|
PIXELFORMATDESCRIPTOR pfd;
|
||||||
|
|
||||||
/* Red Alert for some weird reason does this on Windows XP */
|
|
||||||
if (hwnd == NULL)
|
if (hwnd == NULL)
|
||||||
{
|
{
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
@ -768,7 +811,9 @@ HRESULT dd_SetCooperativeLevel(HWND hwnd, DWORD dwFlags)
|
|||||||
|
|
||||||
pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
|
pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
|
||||||
pfd.nVersion = 1;
|
pfd.nVersion = 1;
|
||||||
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_DOUBLEBUFFER | (g_ddraw->renderer == ogl_render_main ? PFD_SUPPORT_OPENGL : 0);
|
pfd.dwFlags =
|
||||||
|
PFD_DRAW_TO_WINDOW | PFD_DOUBLEBUFFER | (g_ddraw->renderer == ogl_render_main ? PFD_SUPPORT_OPENGL : 0);
|
||||||
|
|
||||||
pfd.iPixelType = PFD_TYPE_RGBA;
|
pfd.iPixelType = PFD_TYPE_RGBA;
|
||||||
pfd.cColorBits = g_ddraw->render.bpp ? g_ddraw->render.bpp : g_ddraw->mode.dmBitsPerPel;
|
pfd.cColorBits = g_ddraw->render.bpp ? g_ddraw->render.bpp : g_ddraw->mode.dmBitsPerPel;
|
||||||
pfd.iLayerType = PFD_MAIN_PLANE;
|
pfd.iLayerType = PFD_MAIN_PLANE;
|
||||||
@ -778,7 +823,7 @@ HRESULT dd_SetCooperativeLevel(HWND hwnd, DWORD dwFlags)
|
|||||||
|
|
||||||
if (g_ddraw->handlemouse && g_ddraw->windowed)
|
if (g_ddraw->handlemouse && g_ddraw->windowed)
|
||||||
{
|
{
|
||||||
while (real_ShowCursor(FALSE) > 0); //workaround for direct input games
|
while (real_ShowCursor(FALSE) > 0); /* workaround for direct input games */
|
||||||
while (real_ShowCursor(TRUE) < 0);
|
while (real_ShowCursor(TRUE) < 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -810,7 +855,7 @@ HRESULT dd_SetCooperativeLevel(HWND hwnd, DWORD dwFlags)
|
|||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT dd_WaitForVerticalBlank(DWORD dwFlags, HANDLE h)
|
HRESULT dd_WaitForVerticalBlank(DWORD dwFlags, HANDLE hEvent)
|
||||||
{
|
{
|
||||||
if (g_ddraw->maxgameticks == -2)
|
if (g_ddraw->maxgameticks == -2)
|
||||||
{
|
{
|
||||||
@ -952,7 +997,7 @@ ULONG dd_Release()
|
|||||||
return g_ddraw->ref;
|
return g_ddraw->ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT dd_GetAvailableVidMem(void* lpDDCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree)
|
HRESULT dd_GetAvailableVidMem(LPDDSCAPS2 lpDDCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree)
|
||||||
{
|
{
|
||||||
*lpdwTotal = 16777216;
|
*lpdwTotal = 16777216;
|
||||||
*lpdwFree = 16777216;
|
*lpdwFree = 16777216;
|
||||||
@ -977,7 +1022,7 @@ HRESULT dd_CreateEx(GUID* lpGuid, LPVOID* lplpDD, REFIID iid, IUnknown* pUnkOute
|
|||||||
g_ddraw->real_dll = LoadLibrary("system32\\ddraw.dll");
|
g_ddraw->real_dll = LoadLibrary("system32\\ddraw.dll");
|
||||||
|
|
||||||
if (g_ddraw->real_dll && !g_ddraw->DirectDrawCreate)
|
if (g_ddraw->real_dll && !g_ddraw->DirectDrawCreate)
|
||||||
g_ddraw->DirectDrawCreate = (DIRECTDRAWCREATEPROC)GetProcAddress(g_ddraw->real_dll, "DirectDrawCreate");
|
g_ddraw->DirectDrawCreate = (void*)GetProcAddress(g_ddraw->real_dll, "DirectDrawCreate");
|
||||||
|
|
||||||
if (g_ddraw->DirectDrawCreate == DirectDrawCreate)
|
if (g_ddraw->DirectDrawCreate == DirectDrawCreate)
|
||||||
g_ddraw->DirectDrawCreate = NULL;
|
g_ddraw->DirectDrawCreate = NULL;
|
||||||
@ -991,7 +1036,7 @@ HRESULT dd_CreateEx(GUID* lpGuid, LPVOID* lplpDD, REFIID iid, IUnknown* pUnkOute
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_ddraw = (cnc_ddraw*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(cnc_ddraw));
|
g_ddraw = (CNCDDRAW*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(CNCDDRAW));
|
||||||
g_ddraw->ref++;
|
g_ddraw->ref++;
|
||||||
|
|
||||||
InitializeCriticalSection(&g_ddraw->cs);
|
InitializeCriticalSection(&g_ddraw->cs);
|
||||||
@ -1007,13 +1052,13 @@ HRESULT dd_CreateEx(GUID* lpGuid, LPVOID* lplpDD, REFIID iid, IUnknown* pUnkOute
|
|||||||
|
|
||||||
if (iid && IsEqualGUID(&IID_IDirectDraw, iid))
|
if (iid && IsEqualGUID(&IID_IDirectDraw, iid))
|
||||||
{
|
{
|
||||||
dprintf(" GUID = %08X (IID_IDirectDraw), ddraw = %p\n", ((GUID*)iid)->Data1, dd);
|
TRACE(" GUID = %08X (IID_IDirectDraw), ddraw = %p\n", ((GUID*)iid)->Data1, dd);
|
||||||
|
|
||||||
dd->lpVtbl = &g_dd_vtbl1;
|
dd->lpVtbl = &g_dd_vtbl1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dprintf(" GUID = %08X (IID_IDirectDrawX), ddraw = %p\n", iid ? ((GUID*)iid)->Data1 : 0, dd);
|
TRACE(" GUID = %08X (IID_IDirectDrawX), ddraw = %p\n", iid ? ((GUID*)iid)->Data1 : 0, dd);
|
||||||
|
|
||||||
dd->lpVtbl = &g_dd_vtblx;
|
dd->lpVtbl = &g_dd_vtblx;
|
||||||
}
|
}
|
||||||
|
@ -5,19 +5,20 @@
|
|||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
|
|
||||||
HRESULT dd_CreateClipper(DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter )
|
HRESULT dd_CreateClipper(DWORD dwFlags, IDirectDrawClipperImpl** lplpDDClipper, IUnknown FAR* pUnkOuter)
|
||||||
{
|
{
|
||||||
if (!lplpDDClipper)
|
if (!lplpDDClipper)
|
||||||
return DDERR_INVALIDPARAMS;
|
return DDERR_INVALIDPARAMS;
|
||||||
|
|
||||||
IDirectDrawClipperImpl *c = (IDirectDrawClipperImpl *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectDrawClipperImpl));
|
IDirectDrawClipperImpl* c =
|
||||||
|
(IDirectDrawClipperImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectDrawClipperImpl));
|
||||||
|
|
||||||
dprintf(" Clipper = %p\n", c);
|
TRACE(" clipper = %p\n", c);
|
||||||
|
|
||||||
c->lpVtbl = &g_ddc_vtbl;
|
c->lpVtbl = &g_ddc_vtbl;
|
||||||
IDirectDrawClipper_AddRef(c);
|
IDirectDrawClipper_AddRef(c);
|
||||||
|
|
||||||
*lplpDDClipper = (LPDIRECTDRAWCLIPPER)c;
|
*lplpDDClipper = c;
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,12 @@
|
|||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
|
|
||||||
HRESULT ddp_GetEntries(IDirectDrawPaletteImpl *This, DWORD dwFlags, DWORD dwBase, DWORD dwNumEntries, LPPALETTEENTRY lpEntries)
|
HRESULT ddp_GetEntries(
|
||||||
|
IDirectDrawPaletteImpl* This,
|
||||||
|
DWORD dwFlags,
|
||||||
|
DWORD dwBase,
|
||||||
|
DWORD dwNumEntries,
|
||||||
|
LPPALETTEENTRY lpEntries)
|
||||||
{
|
{
|
||||||
for (int i = dwBase, x = 0; i < dwBase + dwNumEntries; i++, x++)
|
for (int i = dwBase, x = 0; i < dwBase + dwNumEntries; i++, x++)
|
||||||
{
|
{
|
||||||
@ -19,7 +24,12 @@ HRESULT ddp_GetEntries(IDirectDrawPaletteImpl *This, DWORD dwFlags, DWORD dwBase
|
|||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT ddp_SetEntries(IDirectDrawPaletteImpl *This, DWORD dwFlags, DWORD dwStartingEntry, DWORD dwCount, LPPALETTEENTRY lpEntries)
|
HRESULT ddp_SetEntries(
|
||||||
|
IDirectDrawPaletteImpl* This,
|
||||||
|
DWORD dwFlags,
|
||||||
|
DWORD dwStartingEntry,
|
||||||
|
DWORD dwCount,
|
||||||
|
LPPALETTEENTRY lpEntries)
|
||||||
{
|
{
|
||||||
for (int i = dwStartingEntry, x = 0; i < dwStartingEntry + dwCount; i++, x++)
|
for (int i = dwStartingEntry, x = 0; i < dwStartingEntry + dwCount; i++, x++)
|
||||||
{
|
{
|
||||||
@ -56,18 +66,26 @@ HRESULT ddp_SetEntries(IDirectDrawPaletteImpl *This, DWORD dwFlags, DWORD dwStar
|
|||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT dd_CreatePalette(DWORD dwFlags, LPPALETTEENTRY lpDDColorArray, LPDIRECTDRAWPALETTE FAR * lpDDPalette, IUnknown FAR * unkOuter)
|
HRESULT dd_CreatePalette(
|
||||||
|
DWORD dwFlags,
|
||||||
|
LPPALETTEENTRY lpDDColorArray,
|
||||||
|
IDirectDrawPaletteImpl** lpDDPalette,
|
||||||
|
IUnknown FAR* unkOuter)
|
||||||
{
|
{
|
||||||
IDirectDrawPaletteImpl *p = (IDirectDrawPaletteImpl *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectDrawPaletteImpl));
|
if (!lpDDPalette || !lpDDColorArray)
|
||||||
|
return DDERR_INVALIDPARAMS;
|
||||||
|
|
||||||
dprintf(" Palette = %p\n", p);
|
IDirectDrawPaletteImpl* p =
|
||||||
|
(IDirectDrawPaletteImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectDrawPaletteImpl));
|
||||||
|
|
||||||
|
TRACE(" palette = %p\n", p);
|
||||||
|
|
||||||
p->lpVtbl = &g_ddp_vtbl;
|
p->lpVtbl = &g_ddp_vtbl;
|
||||||
p->flags = dwFlags;
|
p->flags = dwFlags;
|
||||||
ddp_SetEntries(p, dwFlags, 0, 256, lpDDColorArray);
|
ddp_SetEntries(p, dwFlags, 0, 256, lpDDColorArray);
|
||||||
IDirectDrawPalette_AddRef(p);
|
IDirectDrawPalette_AddRef(p);
|
||||||
|
|
||||||
*lpDDPalette = (LPDIRECTDRAWPALETTE)p;
|
*lpDDPalette = p;
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
315
src/ddsurface.c
315
src/ddsurface.c
@ -12,29 +12,32 @@
|
|||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
|
|
||||||
HRESULT dds_AddAttachedSurface(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWSURFACE lpDDSurface)
|
HRESULT dds_AddAttachedSurface(IDirectDrawSurfaceImpl* This, IDirectDrawSurfaceImpl* lpDDSurface)
|
||||||
{
|
{
|
||||||
if (lpDDSurface)
|
if (lpDDSurface)
|
||||||
{
|
{
|
||||||
IDirectDrawSurface_AddRef(lpDDSurface);
|
IDirectDrawSurface_AddRef(lpDDSurface);
|
||||||
|
|
||||||
if (g_ddraw->backbuffer && !This->backbuffer)
|
if (!This->backbuffer)
|
||||||
{
|
{
|
||||||
IDirectDrawSurfaceImpl* surface = (IDirectDrawSurfaceImpl*)lpDDSurface;
|
lpDDSurface->caps |= DDSCAPS_BACKBUFFER;
|
||||||
surface->caps |= DDSCAPS_BACKBUFFER;
|
This->backbuffer = lpDDSurface;
|
||||||
|
|
||||||
This->backbuffer = surface;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT dds_Blt(IDirectDrawSurfaceImpl *This, LPRECT lpDestRect, LPDIRECTDRAWSURFACE lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
|
HRESULT dds_Blt(
|
||||||
|
IDirectDrawSurfaceImpl* This,
|
||||||
|
LPRECT lpDestRect,
|
||||||
|
IDirectDrawSurfaceImpl* lpDDSrcSurface,
|
||||||
|
LPRECT lpSrcRect,
|
||||||
|
DWORD dwFlags,
|
||||||
|
LPDDBLTFX lpDDBltFx)
|
||||||
{
|
{
|
||||||
IDirectDrawSurfaceImpl *src_surface = (IDirectDrawSurfaceImpl *)lpDDSrcSurface;
|
|
||||||
|
|
||||||
dbg_dump_dds_blt_flags(dwFlags);
|
dbg_dump_dds_blt_flags(dwFlags);
|
||||||
|
dbg_dump_dds_blt_fx_flags((dwFlags & DDBLT_DDFX) && lpDDBltFx ? lpDDBltFx->dwDDFX : 0);
|
||||||
|
|
||||||
if (g_ddraw->iskkndx &&
|
if (g_ddraw->iskkndx &&
|
||||||
(dwFlags & DDBLT_COLORFILL) &&
|
(dwFlags & DDBLT_COLORFILL) &&
|
||||||
@ -50,6 +53,8 @@ HRESULT dds_Blt(IDirectDrawSurfaceImpl *This, LPRECT lpDestRect, LPDIRECTDRAWSUR
|
|||||||
lpDestRect = NULL;
|
lpDestRect = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IDirectDrawSurfaceImpl* src_surface = lpDDSrcSurface;
|
||||||
|
|
||||||
RECT src_rect = { 0, 0, src_surface ? src_surface->width : 0, src_surface ? src_surface->height : 0 };
|
RECT src_rect = { 0, 0, src_surface ? src_surface->width : 0, src_surface ? src_surface->height : 0 };
|
||||||
RECT dst_rect = { 0, 0, This->width, This->height };
|
RECT dst_rect = { 0, 0, This->width, This->height };
|
||||||
|
|
||||||
@ -59,7 +64,7 @@ HRESULT dds_Blt(IDirectDrawSurfaceImpl *This, LPRECT lpDestRect, LPDIRECTDRAWSUR
|
|||||||
if (lpDestRect)
|
if (lpDestRect)
|
||||||
memcpy(&dst_rect, lpDestRect, sizeof(dst_rect));
|
memcpy(&dst_rect, lpDestRect, sizeof(dst_rect));
|
||||||
|
|
||||||
// stretch or clip?
|
/* stretch or clip? */
|
||||||
BOOL is_stretch_blt =
|
BOOL is_stretch_blt =
|
||||||
((src_rect.right - src_rect.left) != (dst_rect.right - dst_rect.left)) ||
|
((src_rect.right - src_rect.left) != (dst_rect.right - dst_rect.left)) ||
|
||||||
((src_rect.bottom - src_rect.top) != (dst_rect.bottom - dst_rect.top));
|
((src_rect.bottom - src_rect.top) != (dst_rect.bottom - dst_rect.top));
|
||||||
@ -118,8 +123,8 @@ HRESULT dds_Blt(IDirectDrawSurfaceImpl *This, LPRECT lpDestRect, LPDIRECTDRAWSUR
|
|||||||
|
|
||||||
if (dst_buf && (dwFlags & DDBLT_COLORFILL) && dst_w > 0 && dst_h > 0)
|
if (dst_buf && (dwFlags & DDBLT_COLORFILL) && dst_w > 0 && dst_h > 0)
|
||||||
{
|
{
|
||||||
unsigned char *dst = (unsigned char *)dst_buf + (dst_x * This->lx_pitch) + (This->l_pitch * dst_y);
|
unsigned char* dst = (unsigned char*)dst_buf + (dst_x * This->lx_pitch) + (This->l_pitch * dst_y);
|
||||||
unsigned char *first_row = dst;
|
unsigned char* first_row = dst;
|
||||||
unsigned int dst_pitch = dst_w * This->lx_pitch;
|
unsigned int dst_pitch = dst_w * This->lx_pitch;
|
||||||
int x, i;
|
int x, i;
|
||||||
|
|
||||||
@ -135,7 +140,7 @@ HRESULT dds_Blt(IDirectDrawSurfaceImpl *This, LPRECT lpDestRect, LPDIRECTDRAWSUR
|
|||||||
}
|
}
|
||||||
else if (This->bpp == 16)
|
else if (This->bpp == 16)
|
||||||
{
|
{
|
||||||
unsigned short *row1 = (unsigned short *)dst;
|
unsigned short* row1 = (unsigned short*)dst;
|
||||||
unsigned short color = (unsigned short)lpDDBltFx->dwFillColor;
|
unsigned short color = (unsigned short)lpDDBltFx->dwFillColor;
|
||||||
|
|
||||||
if ((color & 0xFF) == (color >> 8))
|
if ((color & 0xFF) == (color >> 8))
|
||||||
@ -195,7 +200,7 @@ HRESULT dds_Blt(IDirectDrawSurfaceImpl *This, LPRECT lpDestRect, LPDIRECTDRAWSUR
|
|||||||
{
|
{
|
||||||
if (This->bpp != src_surface->bpp)
|
if (This->bpp != src_surface->bpp)
|
||||||
{
|
{
|
||||||
dprintfex(" NOT_IMPLEMENTED This->bpp=%u, src_surface->bpp=%u\n", This->bpp, src_surface->bpp);
|
TRACE_EXT(" NOT_IMPLEMENTED This->bpp=%u, src_surface->bpp=%u\n", This->bpp, src_surface->bpp);
|
||||||
|
|
||||||
HDC dst_dc;
|
HDC dst_dc;
|
||||||
dds_GetDC(This, &dst_dc);
|
dds_GetDC(This, &dst_dc);
|
||||||
@ -316,11 +321,11 @@ HRESULT dds_Blt(IDirectDrawSurfaceImpl *This, LPRECT lpDestRect, LPDIRECTDRAWSUR
|
|||||||
int width = dst_w > src_w ? src_w : dst_w;
|
int width = dst_w > src_w ? src_w : dst_w;
|
||||||
int height = dst_h > src_h ? src_h : dst_h;
|
int height = dst_h > src_h ? src_h : dst_h;
|
||||||
|
|
||||||
unsigned char *src =
|
unsigned char* src =
|
||||||
(unsigned char *)src_buf + (src_x * src_surface->lx_pitch) + (src_surface->l_pitch * src_y);
|
(unsigned char*)src_buf + (src_x * src_surface->lx_pitch) + (src_surface->l_pitch * src_y);
|
||||||
|
|
||||||
unsigned char *dst =
|
unsigned char* dst =
|
||||||
(unsigned char *)dst_buf + (dst_x * This->lx_pitch) + (This->l_pitch * dst_y);
|
(unsigned char*)dst_buf + (dst_x * This->lx_pitch) + (This->l_pitch * dst_y);
|
||||||
|
|
||||||
unsigned int dst_pitch = width * This->lx_pitch;
|
unsigned int dst_pitch = width * This->lx_pitch;
|
||||||
|
|
||||||
@ -374,13 +379,13 @@ HRESULT dds_Blt(IDirectDrawSurfaceImpl *This, LPRECT lpDestRect, LPDIRECTDRAWSUR
|
|||||||
unsigned int s_src_x, s_src_y;
|
unsigned int s_src_x, s_src_y;
|
||||||
unsigned int dest_base, source_base;
|
unsigned int dest_base, source_base;
|
||||||
|
|
||||||
scale_pattern *pattern = malloc((dst_w + 1) * (sizeof(scale_pattern)));
|
scale_pattern* pattern = malloc((dst_w + 1) * (sizeof(scale_pattern)));
|
||||||
int pattern_idx = 0;
|
int pattern_idx = 0;
|
||||||
unsigned int last_src_x = 0;
|
unsigned int last_src_x = 0;
|
||||||
|
|
||||||
if (pattern != NULL)
|
if (pattern != NULL)
|
||||||
{
|
{
|
||||||
pattern[pattern_idx] = (scale_pattern) { ONCE, 0, 0, 1 };
|
pattern[pattern_idx] = (scale_pattern){ ONCE, 0, 0, 1 };
|
||||||
|
|
||||||
/* Build the pattern! */
|
/* Build the pattern! */
|
||||||
int x;
|
int x;
|
||||||
@ -396,7 +401,7 @@ HRESULT dds_Blt(IDirectDrawSurfaceImpl *This, LPRECT lpDestRect, LPDIRECTDRAWSUR
|
|||||||
else if (pattern[pattern_idx].type == SEQUENCE)
|
else if (pattern[pattern_idx].type == SEQUENCE)
|
||||||
{
|
{
|
||||||
pattern_idx++;
|
pattern_idx++;
|
||||||
pattern[pattern_idx] = (scale_pattern) { REPEAT, x, s_src_x, 1 };
|
pattern[pattern_idx] = (scale_pattern){ REPEAT, x, s_src_x, 1 };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (s_src_x == last_src_x + 1)
|
else if (s_src_x == last_src_x + 1)
|
||||||
@ -409,17 +414,17 @@ HRESULT dds_Blt(IDirectDrawSurfaceImpl *This, LPRECT lpDestRect, LPDIRECTDRAWSUR
|
|||||||
else if (pattern[pattern_idx].type == REPEAT)
|
else if (pattern[pattern_idx].type == REPEAT)
|
||||||
{
|
{
|
||||||
pattern_idx++;
|
pattern_idx++;
|
||||||
pattern[pattern_idx] = (scale_pattern) { ONCE, x, s_src_x, 1 };
|
pattern[pattern_idx] = (scale_pattern){ ONCE, x, s_src_x, 1 };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pattern_idx++;
|
pattern_idx++;
|
||||||
pattern[pattern_idx] = (scale_pattern) { ONCE, x, s_src_x, 1 };
|
pattern[pattern_idx] = (scale_pattern){ ONCE, x, s_src_x, 1 };
|
||||||
}
|
}
|
||||||
last_src_x = s_src_x;
|
last_src_x = s_src_x;
|
||||||
}
|
}
|
||||||
pattern[pattern_idx + 1] = (scale_pattern) { END, 0, 0, 0 };
|
pattern[pattern_idx + 1] = (scale_pattern){ END, 0, 0, 0 };
|
||||||
|
|
||||||
|
|
||||||
/* Do the actual blitting */
|
/* Do the actual blitting */
|
||||||
@ -435,13 +440,13 @@ HRESULT dds_Blt(IDirectDrawSurfaceImpl *This, LPRECT lpDestRect, LPDIRECTDRAWSUR
|
|||||||
source_base = src_x + src_surface->width * (s_src_y + src_y);
|
source_base = src_x + src_surface->width * (s_src_y + src_y);
|
||||||
|
|
||||||
pattern_idx = 0;
|
pattern_idx = 0;
|
||||||
scale_pattern *current = &pattern[pattern_idx];
|
scale_pattern* current = &pattern[pattern_idx];
|
||||||
|
|
||||||
if (This->bpp == 8)
|
if (This->bpp == 8)
|
||||||
{
|
{
|
||||||
unsigned char *d, *s, v;
|
unsigned char* d, * s, v;
|
||||||
unsigned char *src = (unsigned char *)src_buf;
|
unsigned char* src = (unsigned char*)src_buf;
|
||||||
unsigned char *dst = (unsigned char *)dst_buf;
|
unsigned char* dst = (unsigned char*)dst_buf;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
switch (current->type)
|
switch (current->type)
|
||||||
@ -465,7 +470,7 @@ HRESULT dds_Blt(IDirectDrawSurfaceImpl *This, LPRECT lpDestRect, LPDIRECTDRAWSUR
|
|||||||
d = dst + dest_base + current->dst_index;
|
d = dst + dest_base + current->dst_index;
|
||||||
s = src + source_base + current->src_index;
|
s = src + source_base + current->src_index;
|
||||||
|
|
||||||
memcpy((void *)d, (void *)s, current->count * This->lx_pitch);
|
memcpy((void*)d, (void*)s, current->count * This->lx_pitch);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case END:
|
case END:
|
||||||
@ -478,9 +483,9 @@ HRESULT dds_Blt(IDirectDrawSurfaceImpl *This, LPRECT lpDestRect, LPDIRECTDRAWSUR
|
|||||||
}
|
}
|
||||||
else if (This->bpp == 16)
|
else if (This->bpp == 16)
|
||||||
{
|
{
|
||||||
unsigned short *d, *s, v;
|
unsigned short* d, * s, v;
|
||||||
unsigned short *src = (unsigned short *)src_buf;
|
unsigned short* src = (unsigned short*)src_buf;
|
||||||
unsigned short *dst = (unsigned short *)dst_buf;
|
unsigned short* dst = (unsigned short*)dst_buf;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
switch (current->type)
|
switch (current->type)
|
||||||
@ -504,7 +509,7 @@ HRESULT dds_Blt(IDirectDrawSurfaceImpl *This, LPRECT lpDestRect, LPDIRECTDRAWSUR
|
|||||||
d = dst + dest_base + current->dst_index;
|
d = dst + dest_base + current->dst_index;
|
||||||
s = src + source_base + current->src_index;
|
s = src + source_base + current->src_index;
|
||||||
|
|
||||||
memcpy((void *)d, (void *)s, current->count * This->lx_pitch);
|
memcpy((void*)d, (void*)s, current->count * This->lx_pitch);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case END:
|
case END:
|
||||||
@ -562,7 +567,7 @@ HRESULT dds_Blt(IDirectDrawSurfaceImpl *This, LPRECT lpDestRect, LPDIRECTDRAWSUR
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if((This->caps & DDSCAPS_PRIMARYSURFACE) && g_ddraw->render.run)
|
if ((This->caps & DDSCAPS_PRIMARYSURFACE) && g_ddraw->render.run)
|
||||||
{
|
{
|
||||||
InterlockedExchange(&g_ddraw->render.surface_updated, TRUE);
|
InterlockedExchange(&g_ddraw->render.surface_updated, TRUE);
|
||||||
|
|
||||||
@ -584,11 +589,17 @@ HRESULT dds_Blt(IDirectDrawSurfaceImpl *This, LPRECT lpDestRect, LPDIRECTDRAWSUR
|
|||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT dds_BltFast(IDirectDrawSurfaceImpl *This, DWORD dst_x, DWORD dst_y, LPDIRECTDRAWSURFACE lpDDSrcSurface, LPRECT lpSrcRect, DWORD flags)
|
HRESULT dds_BltFast(
|
||||||
|
IDirectDrawSurfaceImpl* This,
|
||||||
|
DWORD dwX,
|
||||||
|
DWORD dwY,
|
||||||
|
IDirectDrawSurfaceImpl* lpDDSrcSurface,
|
||||||
|
LPRECT lpSrcRect,
|
||||||
|
DWORD dwFlags)
|
||||||
{
|
{
|
||||||
IDirectDrawSurfaceImpl *src_surface = (IDirectDrawSurfaceImpl *)lpDDSrcSurface;
|
dbg_dump_dds_blt_fast_flags(dwFlags);
|
||||||
|
|
||||||
dbg_dump_dds_blt_fast_flags(flags);
|
IDirectDrawSurfaceImpl* src_surface = lpDDSrcSurface;
|
||||||
|
|
||||||
RECT src_rect = { 0, 0, src_surface ? src_surface->width : 0, src_surface ? src_surface->height : 0 };
|
RECT src_rect = { 0, 0, src_surface ? src_surface->width : 0, src_surface ? src_surface->height : 0 };
|
||||||
|
|
||||||
@ -617,6 +628,8 @@ HRESULT dds_BltFast(IDirectDrawSurfaceImpl *This, DWORD dst_x, DWORD dst_y, LPDI
|
|||||||
|
|
||||||
int src_x = src_rect.left;
|
int src_x = src_rect.left;
|
||||||
int src_y = src_rect.top;
|
int src_y = src_rect.top;
|
||||||
|
int dst_x = dwX;
|
||||||
|
int dst_y = dwY;
|
||||||
|
|
||||||
RECT dst_rect = { dst_x, dst_y, (src_rect.right - src_rect.left) + dst_x, (src_rect.bottom - src_rect.top) + dst_y };
|
RECT dst_rect = { dst_x, dst_y, (src_rect.right - src_rect.left) + dst_x, (src_rect.bottom - src_rect.top) + dst_y };
|
||||||
|
|
||||||
@ -650,7 +663,7 @@ HRESULT dds_BltFast(IDirectDrawSurfaceImpl *This, DWORD dst_x, DWORD dst_y, LPDI
|
|||||||
{
|
{
|
||||||
if (This->bpp != src_surface->bpp)
|
if (This->bpp != src_surface->bpp)
|
||||||
{
|
{
|
||||||
dprintfex(" NOT_IMPLEMENTED This->bpp=%u, src_surface->bpp=%u\n", This->bpp, src_surface->bpp);
|
TRACE_EXT(" NOT_IMPLEMENTED This->bpp=%u, src_surface->bpp=%u\n", This->bpp, src_surface->bpp);
|
||||||
|
|
||||||
HDC dst_dc;
|
HDC dst_dc;
|
||||||
dds_GetDC(This, &dst_dc);
|
dds_GetDC(This, &dst_dc);
|
||||||
@ -660,7 +673,7 @@ HRESULT dds_BltFast(IDirectDrawSurfaceImpl *This, DWORD dst_x, DWORD dst_y, LPDI
|
|||||||
|
|
||||||
BitBlt(dst_dc, dst_x, dst_y, dst_w, dst_h, src_dc, src_x, src_y, SRCCOPY);
|
BitBlt(dst_dc, dst_x, dst_y, dst_w, dst_h, src_dc, src_x, src_y, SRCCOPY);
|
||||||
}
|
}
|
||||||
else if (flags & DDBLTFAST_SRCCOLORKEY)
|
else if (dwFlags & DDBLTFAST_SRCCOLORKEY)
|
||||||
{
|
{
|
||||||
if (This->bpp == 8)
|
if (This->bpp == 8)
|
||||||
{
|
{
|
||||||
@ -671,11 +684,12 @@ HRESULT dds_BltFast(IDirectDrawSurfaceImpl *This, DWORD dst_x, DWORD dst_y, LPDI
|
|||||||
|
|
||||||
for (int x = 0; x < dst_w; x++)
|
for (int x = 0; x < dst_w; x++)
|
||||||
{
|
{
|
||||||
unsigned char c = ((unsigned char *)src_buf)[x + src_x + src_row];
|
unsigned char c = ((unsigned char*)src_buf)[x + src_x + src_row];
|
||||||
|
|
||||||
if (c < src_surface->color_key.dwColorSpaceLowValue || c > src_surface->color_key.dwColorSpaceHighValue)
|
if (c < src_surface->color_key.dwColorSpaceLowValue ||
|
||||||
|
c > src_surface->color_key.dwColorSpaceHighValue)
|
||||||
{
|
{
|
||||||
((unsigned char *)dst_buf)[x + dst_x + dst_row] = c;
|
((unsigned char*)dst_buf)[x + dst_x + dst_row] = c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -689,11 +703,12 @@ HRESULT dds_BltFast(IDirectDrawSurfaceImpl *This, DWORD dst_x, DWORD dst_y, LPDI
|
|||||||
|
|
||||||
for (int x = 0; x < dst_w; x++)
|
for (int x = 0; x < dst_w; x++)
|
||||||
{
|
{
|
||||||
unsigned short c = ((unsigned short *)src_buf)[x + src_x + src_row];
|
unsigned short c = ((unsigned short*)src_buf)[x + src_x + src_row];
|
||||||
|
|
||||||
if (c < src_surface->color_key.dwColorSpaceLowValue || c > src_surface->color_key.dwColorSpaceHighValue)
|
if (c < src_surface->color_key.dwColorSpaceLowValue ||
|
||||||
|
c > src_surface->color_key.dwColorSpaceHighValue)
|
||||||
{
|
{
|
||||||
((unsigned short *)dst_buf)[x + dst_x + dst_row] = c;
|
((unsigned short*)dst_buf)[x + dst_x + dst_row] = c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -709,7 +724,8 @@ HRESULT dds_BltFast(IDirectDrawSurfaceImpl *This, DWORD dst_x, DWORD dst_y, LPDI
|
|||||||
{
|
{
|
||||||
unsigned int c = ((unsigned int*)src_buf)[x + src_x + src_row];
|
unsigned int c = ((unsigned int*)src_buf)[x + src_x + src_row];
|
||||||
|
|
||||||
if (c < src_surface->color_key.dwColorSpaceLowValue || c > src_surface->color_key.dwColorSpaceHighValue)
|
if (c < src_surface->color_key.dwColorSpaceLowValue ||
|
||||||
|
c > src_surface->color_key.dwColorSpaceHighValue)
|
||||||
{
|
{
|
||||||
((unsigned int*)dst_buf)[x + dst_x + dst_row] = c;
|
((unsigned int*)dst_buf)[x + dst_x + dst_row] = c;
|
||||||
}
|
}
|
||||||
@ -719,11 +735,11 @@ HRESULT dds_BltFast(IDirectDrawSurfaceImpl *This, DWORD dst_x, DWORD dst_y, LPDI
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unsigned char *src =
|
unsigned char* src =
|
||||||
(unsigned char *)src_buf + (src_x * src_surface->lx_pitch) + (src_surface->l_pitch * src_y);
|
(unsigned char*)src_buf + (src_x * src_surface->lx_pitch) + (src_surface->l_pitch * src_y);
|
||||||
|
|
||||||
unsigned char *dst =
|
unsigned char* dst =
|
||||||
(unsigned char *)dst_buf + (dst_x * This->lx_pitch) + (This->l_pitch * dst_y);
|
(unsigned char*)dst_buf + (dst_x * This->lx_pitch) + (This->l_pitch * dst_y);
|
||||||
|
|
||||||
unsigned int dst_pitch = dst_w * This->lx_pitch;
|
unsigned int dst_pitch = dst_w * This->lx_pitch;
|
||||||
|
|
||||||
@ -782,24 +798,28 @@ HRESULT dds_BltFast(IDirectDrawSurfaceImpl *This, DWORD dst_x, DWORD dst_y, LPDI
|
|||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT dds_DeleteAttachedSurface(IDirectDrawSurfaceImpl *This, DWORD dwFlags, LPDIRECTDRAWSURFACE lpDDSurface)
|
HRESULT dds_DeleteAttachedSurface(IDirectDrawSurfaceImpl* This, DWORD dwFlags, IDirectDrawSurfaceImpl* lpDDSurface)
|
||||||
{
|
{
|
||||||
if (lpDDSurface)
|
if (lpDDSurface)
|
||||||
{
|
{
|
||||||
IDirectDrawSurface_Release(lpDDSurface);
|
IDirectDrawSurface_Release(lpDDSurface);
|
||||||
|
|
||||||
|
if (lpDDSurface == This->backbuffer)
|
||||||
This->backbuffer = NULL;
|
This->backbuffer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT dds_GetSurfaceDesc(IDirectDrawSurfaceImpl *This, LPDDSURFACEDESC lpDDSurfaceDesc)
|
HRESULT dds_GetSurfaceDesc(IDirectDrawSurfaceImpl* This, LPDDSURFACEDESC2 lpDDSurfaceDesc)
|
||||||
{
|
{
|
||||||
if (lpDDSurfaceDesc)
|
if (lpDDSurfaceDesc)
|
||||||
{
|
{
|
||||||
memset(lpDDSurfaceDesc, 0, sizeof(DDSURFACEDESC));
|
int size = lpDDSurfaceDesc->dwSize == sizeof(DDSURFACEDESC2) ? sizeof(DDSURFACEDESC2) : sizeof(DDSURFACEDESC);
|
||||||
|
|
||||||
lpDDSurfaceDesc->dwSize = sizeof(DDSURFACEDESC);
|
memset(lpDDSurfaceDesc, 0, size);
|
||||||
|
|
||||||
|
lpDDSurfaceDesc->dwSize = size;
|
||||||
lpDDSurfaceDesc->dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH | DDSD_PIXELFORMAT | DDSD_LPSURFACE;
|
lpDDSurfaceDesc->dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH | DDSD_PIXELFORMAT | DDSD_LPSURFACE;
|
||||||
lpDDSurfaceDesc->dwWidth = This->width;
|
lpDDSurfaceDesc->dwWidth = This->width;
|
||||||
lpDDSurfaceDesc->dwHeight = This->height;
|
lpDDSurfaceDesc->dwHeight = This->height;
|
||||||
@ -810,7 +830,7 @@ HRESULT dds_GetSurfaceDesc(IDirectDrawSurfaceImpl *This, LPDDSURFACEDESC lpDDSur
|
|||||||
lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount = This->bpp;
|
lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount = This->bpp;
|
||||||
lpDDSurfaceDesc->ddsCaps.dwCaps = This->caps;
|
lpDDSurfaceDesc->ddsCaps.dwCaps = This->caps;
|
||||||
|
|
||||||
if ((This->caps & DDSCAPS_PRIMARYSURFACE) || (This->caps & DDSCAPS_BACKBUFFER))
|
if (This->caps & (DDSCAPS_PRIMARYSURFACE | DDSCAPS_BACKBUFFER))
|
||||||
{
|
{
|
||||||
lpDDSurfaceDesc->ddsCaps.dwCaps |= DDSCAPS_VIDEOMEMORY;
|
lpDDSurfaceDesc->ddsCaps.dwCaps |= DDSCAPS_VIDEOMEMORY;
|
||||||
}
|
}
|
||||||
@ -836,38 +856,31 @@ HRESULT dds_GetSurfaceDesc(IDirectDrawSurfaceImpl *This, LPDDSURFACEDESC lpDDSur
|
|||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT dds_EnumAttachedSurfaces(IDirectDrawSurfaceImpl *This, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback)
|
HRESULT dds_EnumAttachedSurfaces(
|
||||||
|
IDirectDrawSurfaceImpl* This,
|
||||||
|
LPVOID lpContext,
|
||||||
|
LPDDENUMSURFACESCALLBACK7 lpEnumSurfacesCallback)
|
||||||
{
|
{
|
||||||
static DDSURFACEDESC dd_surface_desc;
|
static DDSURFACEDESC2 desc;
|
||||||
memset(&dd_surface_desc, 0, sizeof(DDSURFACEDESC));
|
|
||||||
|
memset(&desc, 0, sizeof(desc));
|
||||||
|
|
||||||
if (This->backbuffer)
|
if (This->backbuffer)
|
||||||
{
|
{
|
||||||
dds_GetSurfaceDesc(This->backbuffer, &dd_surface_desc);
|
dds_GetSurfaceDesc(This->backbuffer, &desc);
|
||||||
IDirectDrawSurface_AddRef(This->backbuffer);
|
IDirectDrawSurface_AddRef(This->backbuffer);
|
||||||
lpEnumSurfacesCallback((LPDIRECTDRAWSURFACE)This->backbuffer, &dd_surface_desc, lpContext);
|
lpEnumSurfacesCallback((LPDIRECTDRAWSURFACE7)This->backbuffer, &desc, lpContext);
|
||||||
}
|
|
||||||
else if (!g_ddraw->backbuffer)
|
|
||||||
{
|
|
||||||
dds_GetSurfaceDesc(This, &dd_surface_desc);
|
|
||||||
This->caps |= DDSCAPS_BACKBUFFER; // Nox hack
|
|
||||||
lpEnumSurfacesCallback((LPDIRECTDRAWSURFACE)This, &dd_surface_desc, lpContext);
|
|
||||||
|
|
||||||
if ((This->caps & DDSCAPS_PRIMARYSURFACE) && (This->caps & DDSCAPS_FLIP) && !(This->caps & DDSCAPS_BACKBUFFER))
|
|
||||||
IDirectDrawSurface_AddRef(This);
|
|
||||||
|
|
||||||
This->caps &= ~DDSCAPS_BACKBUFFER;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT dds_Flip(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWSURFACE surface, DWORD flags)
|
HRESULT dds_Flip(IDirectDrawSurfaceImpl* This, IDirectDrawSurfaceImpl* lpDDSurfaceTargetOverride, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
if (This->backbuffer)
|
if (This->backbuffer)
|
||||||
{
|
{
|
||||||
EnterCriticalSection(&g_ddraw->cs);
|
EnterCriticalSection(&g_ddraw->cs);
|
||||||
IDirectDrawSurfaceImpl* backbuffer = surface ? (IDirectDrawSurfaceImpl*)surface : This->backbuffer;
|
IDirectDrawSurfaceImpl* backbuffer = lpDDSurfaceTargetOverride ? lpDDSurfaceTargetOverride : This->backbuffer;
|
||||||
|
|
||||||
void* buf = InterlockedExchangePointer(&This->surface, backbuffer->surface);
|
void* buf = InterlockedExchangePointer(&This->surface, backbuffer->surface);
|
||||||
HBITMAP bitmap = (HBITMAP)InterlockedExchangePointer(&This->bitmap, backbuffer->bitmap);
|
HBITMAP bitmap = (HBITMAP)InterlockedExchangePointer(&This->bitmap, backbuffer->bitmap);
|
||||||
@ -878,7 +891,7 @@ HRESULT dds_Flip(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWSURFACE surface, DWOR
|
|||||||
InterlockedExchangePointer(&backbuffer->hdc, dc);
|
InterlockedExchangePointer(&backbuffer->hdc, dc);
|
||||||
LeaveCriticalSection(&g_ddraw->cs);
|
LeaveCriticalSection(&g_ddraw->cs);
|
||||||
|
|
||||||
if (!surface && This->backbuffer->backbuffer)
|
if (!lpDDSurfaceTargetOverride && This->backbuffer->backbuffer)
|
||||||
{
|
{
|
||||||
dds_Flip(This->backbuffer, NULL, 0);
|
dds_Flip(This->backbuffer, NULL, 0);
|
||||||
}
|
}
|
||||||
@ -892,7 +905,7 @@ HRESULT dds_Flip(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWSURFACE surface, DWOR
|
|||||||
ReleaseSemaphore(g_ddraw->render.sem, 1, NULL);
|
ReleaseSemaphore(g_ddraw->render.sem, 1, NULL);
|
||||||
SwitchToThread();
|
SwitchToThread();
|
||||||
|
|
||||||
if ((flags & DDFLIP_WAIT) || g_ddraw->maxgameticks == -2)
|
if ((dwFlags & DDFLIP_WAIT) || g_ddraw->maxgameticks == -2)
|
||||||
{
|
{
|
||||||
dd_WaitForVerticalBlank(DDWAITVB_BLOCKEND, NULL);
|
dd_WaitForVerticalBlank(DDWAITVB_BLOCKEND, NULL);
|
||||||
}
|
}
|
||||||
@ -907,37 +920,37 @@ HRESULT dds_Flip(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWSURFACE surface, DWOR
|
|||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT dds_GetAttachedSurface(IDirectDrawSurfaceImpl *This, LPDDSCAPS lpDdsCaps, LPDIRECTDRAWSURFACE FAR *surface)
|
HRESULT dds_GetAttachedSurface(IDirectDrawSurfaceImpl* This, LPDDSCAPS2 lpDdsCaps, IDirectDrawSurfaceImpl** lpDDsurface)
|
||||||
{
|
{
|
||||||
if ((This->caps & DDSCAPS_PRIMARYSURFACE) && (This->caps & DDSCAPS_FLIP) && (lpDdsCaps->dwCaps & DDSCAPS_BACKBUFFER))
|
if ((This->caps & DDSCAPS_PRIMARYSURFACE) && (This->caps & DDSCAPS_FLIP) && (lpDdsCaps->dwCaps & DDSCAPS_BACKBUFFER))
|
||||||
{
|
{
|
||||||
if (This->backbuffer)
|
if (This->backbuffer)
|
||||||
{
|
{
|
||||||
IDirectDrawSurface_AddRef(This->backbuffer);
|
IDirectDrawSurface_AddRef(This->backbuffer);
|
||||||
*surface = (LPDIRECTDRAWSURFACE)This->backbuffer;
|
*lpDDsurface = This->backbuffer;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
IDirectDrawSurface_AddRef(This);
|
IDirectDrawSurface_AddRef(This);
|
||||||
*surface = (LPDIRECTDRAWSURFACE)This;
|
*lpDDsurface = This;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT dds_GetCaps(IDirectDrawSurfaceImpl *This, LPDDSCAPS lpDDSCaps)
|
HRESULT dds_GetCaps(IDirectDrawSurfaceImpl* This, LPDDSCAPS2 lpDDSCaps)
|
||||||
{
|
{
|
||||||
lpDDSCaps->dwCaps = This->caps;
|
lpDDSCaps->dwCaps = This->caps;
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT dds_GetClipper(IDirectDrawSurfaceImpl* This, LPDIRECTDRAWCLIPPER FAR* lpClipper)
|
HRESULT dds_GetClipper(IDirectDrawSurfaceImpl* This, IDirectDrawClipperImpl** lpClipper)
|
||||||
{
|
{
|
||||||
if (!lpClipper)
|
if (!lpClipper)
|
||||||
return DDERR_INVALIDPARAMS;
|
return DDERR_INVALIDPARAMS;
|
||||||
|
|
||||||
*lpClipper = (LPDIRECTDRAWCLIPPER)This->clipper;
|
*lpClipper = This->clipper;
|
||||||
|
|
||||||
if (This->clipper)
|
if (This->clipper)
|
||||||
{
|
{
|
||||||
@ -950,18 +963,18 @@ HRESULT dds_GetClipper(IDirectDrawSurfaceImpl* This, LPDIRECTDRAWCLIPPER FAR* lp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT dds_GetColorKey(IDirectDrawSurfaceImpl *This, DWORD flags, LPDDCOLORKEY colorKey)
|
HRESULT dds_GetColorKey(IDirectDrawSurfaceImpl* This, DWORD dwFlags, LPDDCOLORKEY lpColorKey)
|
||||||
{
|
{
|
||||||
if (colorKey)
|
if (lpColorKey)
|
||||||
{
|
{
|
||||||
colorKey->dwColorSpaceHighValue = This->color_key.dwColorSpaceHighValue;
|
lpColorKey->dwColorSpaceHighValue = This->color_key.dwColorSpaceHighValue;
|
||||||
colorKey->dwColorSpaceLowValue = This->color_key.dwColorSpaceLowValue;
|
lpColorKey->dwColorSpaceLowValue = This->color_key.dwColorSpaceLowValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT dds_GetDC(IDirectDrawSurfaceImpl *This, HDC FAR *lpHDC)
|
HRESULT dds_GetDC(IDirectDrawSurfaceImpl* This, HDC FAR* lpHDC)
|
||||||
{
|
{
|
||||||
if (!This)
|
if (!This)
|
||||||
{
|
{
|
||||||
@ -973,10 +986,10 @@ HRESULT dds_GetDC(IDirectDrawSurfaceImpl *This, HDC FAR *lpHDC)
|
|||||||
|
|
||||||
if ((This->l_pitch % 4))
|
if ((This->l_pitch % 4))
|
||||||
{
|
{
|
||||||
dprintf("NOT_IMPLEMENTED GetDC: width=%d height=%d\n", This->width, This->height);
|
TRACE("NOT_IMPLEMENTED GetDC: width=%d height=%d\n", This->width, This->height);
|
||||||
}
|
}
|
||||||
|
|
||||||
RGBQUAD *data =
|
RGBQUAD* data =
|
||||||
This->palette ? This->palette->data_rgb :
|
This->palette ? This->palette->data_rgb :
|
||||||
g_ddraw->primary && g_ddraw->primary->palette ? g_ddraw->primary->palette->data_rgb :
|
g_ddraw->primary && g_ddraw->primary->palette ? g_ddraw->primary->palette->data_rgb :
|
||||||
NULL;
|
NULL;
|
||||||
@ -995,30 +1008,12 @@ HRESULT dds_GetDC(IDirectDrawSurfaceImpl *This, HDC FAR *lpHDC)
|
|||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT dds_ReleaseDC(IDirectDrawSurfaceImpl* This, HDC hDC)
|
HRESULT dds_GetPalette(IDirectDrawSurfaceImpl* This, IDirectDrawPaletteImpl** lplpDDPalette)
|
||||||
{
|
|
||||||
if ((This->caps & DDSCAPS_PRIMARYSURFACE) && g_ddraw->render.run)
|
|
||||||
{
|
|
||||||
InterlockedExchange(&g_ddraw->render.surface_updated, TRUE);
|
|
||||||
|
|
||||||
DWORD time = timeGetTime();
|
|
||||||
|
|
||||||
if (!(This->flags & DDSD_BACKBUFFERCOUNT) ||
|
|
||||||
(This->last_flip_tick + FLIP_REDRAW_TIMEOUT < time && This->last_blt_tick + FLIP_REDRAW_TIMEOUT < time))
|
|
||||||
{
|
|
||||||
ReleaseSemaphore(g_ddraw->render.sem, 1, NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return DD_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
HRESULT dds_GetPalette(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWPALETTE FAR *lplpDDPalette)
|
|
||||||
{
|
{
|
||||||
if (!lplpDDPalette)
|
if (!lplpDDPalette)
|
||||||
return DDERR_INVALIDPARAMS;
|
return DDERR_INVALIDPARAMS;
|
||||||
|
|
||||||
*lplpDDPalette = (LPDIRECTDRAWPALETTE)This->palette;
|
*lplpDDPalette = This->palette;
|
||||||
|
|
||||||
if (This->palette)
|
if (This->palette)
|
||||||
{
|
{
|
||||||
@ -1031,7 +1026,7 @@ HRESULT dds_GetPalette(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWPALETTE FAR *lp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT dds_GetPixelFormat(IDirectDrawSurfaceImpl *This, LPDDPIXELFORMAT ddpfPixelFormat)
|
HRESULT dds_GetPixelFormat(IDirectDrawSurfaceImpl* This, LPDDPIXELFORMAT ddpfPixelFormat)
|
||||||
{
|
{
|
||||||
if (ddpfPixelFormat)
|
if (ddpfPixelFormat)
|
||||||
{
|
{
|
||||||
@ -1064,7 +1059,12 @@ HRESULT dds_GetPixelFormat(IDirectDrawSurfaceImpl *This, LPDDPIXELFORMAT ddpfPix
|
|||||||
return DDERR_INVALIDPARAMS;
|
return DDERR_INVALIDPARAMS;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT dds_Lock(IDirectDrawSurfaceImpl *This, LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent)
|
HRESULT dds_Lock(
|
||||||
|
IDirectDrawSurfaceImpl* This,
|
||||||
|
LPRECT lpDestRect,
|
||||||
|
LPDDSURFACEDESC2 lpDDSurfaceDesc,
|
||||||
|
DWORD dwFlags,
|
||||||
|
HANDLE hEvent)
|
||||||
{
|
{
|
||||||
dbg_dump_dds_lock_flags(dwFlags);
|
dbg_dump_dds_lock_flags(dwFlags);
|
||||||
|
|
||||||
@ -1089,21 +1089,25 @@ HRESULT dds_Lock(IDirectDrawSurfaceImpl *This, LPRECT lpDestRect, LPDDSURFACEDES
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT dds_SetColorKey(IDirectDrawSurfaceImpl *This, DWORD flags, LPDDCOLORKEY colorKey)
|
HRESULT dds_ReleaseDC(IDirectDrawSurfaceImpl* This, HDC hDC)
|
||||||
{
|
{
|
||||||
if (colorKey)
|
if ((This->caps & DDSCAPS_PRIMARYSURFACE) && g_ddraw->render.run)
|
||||||
{
|
{
|
||||||
dprintfex(" dwColorSpaceHighValue=%d\n", colorKey->dwColorSpaceHighValue);
|
InterlockedExchange(&g_ddraw->render.surface_updated, TRUE);
|
||||||
dprintfex(" dwColorSpaceLowValue=%d\n", colorKey->dwColorSpaceLowValue);
|
|
||||||
|
|
||||||
This->color_key.dwColorSpaceHighValue = colorKey->dwColorSpaceHighValue;
|
DWORD time = timeGetTime();
|
||||||
This->color_key.dwColorSpaceLowValue = colorKey->dwColorSpaceLowValue;
|
|
||||||
|
if (!(This->flags & DDSD_BACKBUFFERCOUNT) ||
|
||||||
|
(This->last_flip_tick + FLIP_REDRAW_TIMEOUT < time && This->last_blt_tick + FLIP_REDRAW_TIMEOUT < time))
|
||||||
|
{
|
||||||
|
ReleaseSemaphore(g_ddraw->render.sem, 1, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT dds_SetClipper(IDirectDrawSurfaceImpl* This, LPDIRECTDRAWCLIPPER lpClipper)
|
HRESULT dds_SetClipper(IDirectDrawSurfaceImpl* This, IDirectDrawClipperImpl* lpClipper)
|
||||||
{
|
{
|
||||||
if (lpClipper)
|
if (lpClipper)
|
||||||
IDirectDrawClipper_AddRef(lpClipper);
|
IDirectDrawClipper_AddRef(lpClipper);
|
||||||
@ -1111,12 +1115,26 @@ HRESULT dds_SetClipper(IDirectDrawSurfaceImpl* This, LPDIRECTDRAWCLIPPER lpClipp
|
|||||||
if (This->clipper)
|
if (This->clipper)
|
||||||
IDirectDrawClipper_Release(This->clipper);
|
IDirectDrawClipper_Release(This->clipper);
|
||||||
|
|
||||||
This->clipper = (IDirectDrawClipperImpl*)lpClipper;
|
This->clipper = lpClipper;
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT dds_SetPalette(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWPALETTE lpDDPalette)
|
HRESULT dds_SetColorKey(IDirectDrawSurfaceImpl* This, DWORD dwFlags, LPDDCOLORKEY lpColorKey)
|
||||||
|
{
|
||||||
|
if (lpColorKey)
|
||||||
|
{
|
||||||
|
TRACE_EXT(" dwColorSpaceHighValue=%d\n", lpColorKey->dwColorSpaceHighValue);
|
||||||
|
TRACE_EXT(" dwColorSpaceLowValue=%d\n", lpColorKey->dwColorSpaceLowValue);
|
||||||
|
|
||||||
|
This->color_key.dwColorSpaceHighValue = lpColorKey->dwColorSpaceHighValue;
|
||||||
|
This->color_key.dwColorSpaceLowValue = lpColorKey->dwColorSpaceLowValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return DD_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT dds_SetPalette(IDirectDrawSurfaceImpl* This, IDirectDrawPaletteImpl* lpDDPalette)
|
||||||
{
|
{
|
||||||
if (lpDDPalette)
|
if (lpDDPalette)
|
||||||
IDirectDrawPalette_AddRef(lpDDPalette);
|
IDirectDrawPalette_AddRef(lpDDPalette);
|
||||||
@ -1127,7 +1145,7 @@ HRESULT dds_SetPalette(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWPALETTE lpDDPal
|
|||||||
if (This->caps & DDSCAPS_PRIMARYSURFACE)
|
if (This->caps & DDSCAPS_PRIMARYSURFACE)
|
||||||
{
|
{
|
||||||
EnterCriticalSection(&g_ddraw->cs);
|
EnterCriticalSection(&g_ddraw->cs);
|
||||||
This->palette = (IDirectDrawPaletteImpl*)lpDDPalette;
|
This->palette = lpDDPalette;
|
||||||
LeaveCriticalSection(&g_ddraw->cs);
|
LeaveCriticalSection(&g_ddraw->cs);
|
||||||
|
|
||||||
if (g_ddraw->render.run)
|
if (g_ddraw->render.run)
|
||||||
@ -1138,14 +1156,15 @@ HRESULT dds_SetPalette(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWPALETTE lpDDPal
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
This->palette = (IDirectDrawPaletteImpl*)lpDDPalette;
|
This->palette = lpDDPalette;
|
||||||
}
|
}
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT dds_Unlock(IDirectDrawSurfaceImpl *This, LPVOID lpRect)
|
HRESULT dds_Unlock(IDirectDrawSurfaceImpl* This, LPVOID lpRect)
|
||||||
{
|
{
|
||||||
|
/* Hack for Warcraft II BNE and Diablo */
|
||||||
HWND hwnd = g_ddraw->bnet_active ? FindWindowEx(HWND_DESKTOP, NULL, "SDlgDialog", NULL) : NULL;
|
HWND hwnd = g_ddraw->bnet_active ? FindWindowEx(HWND_DESKTOP, NULL, "SDlgDialog", NULL) : NULL;
|
||||||
|
|
||||||
if (hwnd && (This->caps & DDSCAPS_PRIMARYSURFACE))
|
if (hwnd && (This->caps & DDSCAPS_PRIMARYSURFACE))
|
||||||
@ -1153,7 +1172,7 @@ HRESULT dds_Unlock(IDirectDrawSurfaceImpl *This, LPVOID lpRect)
|
|||||||
HDC primary_dc;
|
HDC primary_dc;
|
||||||
dds_GetDC(g_ddraw->primary, &primary_dc);
|
dds_GetDC(g_ddraw->primary, &primary_dc);
|
||||||
|
|
||||||
//GdiTransparentBlt idea taken from Aqrit's war2 ddraw
|
/* GdiTransparentBlt idea taken from Aqrit's war2 ddraw */
|
||||||
|
|
||||||
RGBQUAD quad;
|
RGBQUAD quad;
|
||||||
GetDIBColorTable(primary_dc, 0xFE, 1, &quad);
|
GetDIBColorTable(primary_dc, 0xFE, 1, &quad);
|
||||||
@ -1200,7 +1219,7 @@ HRESULT dds_Unlock(IDirectDrawSurfaceImpl *This, LPVOID lpRect)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Hack for Star Trek Armada */
|
||||||
hwnd = g_ddraw->armadahack ? FindWindowEx(HWND_DESKTOP, NULL, "#32770", NULL) : NULL;
|
hwnd = g_ddraw->armadahack ? FindWindowEx(HWND_DESKTOP, NULL, "#32770", NULL) : NULL;
|
||||||
|
|
||||||
if (hwnd && (This->caps & DDSCAPS_PRIMARYSURFACE))
|
if (hwnd && (This->caps & DDSCAPS_PRIMARYSURFACE))
|
||||||
@ -1280,7 +1299,11 @@ void* dds_GetBuffer(IDirectDrawSurfaceImpl* This)
|
|||||||
return This->surface;
|
return This->surface;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT dd_CreateSurface(IDirectDrawImpl* This, LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE FAR *lpDDSurface, IUnknown FAR * unkOuter)
|
HRESULT dd_CreateSurface(
|
||||||
|
IDirectDrawImpl* This,
|
||||||
|
LPDDSURFACEDESC2 lpDDSurfaceDesc,
|
||||||
|
IDirectDrawSurfaceImpl** lpDDSurface,
|
||||||
|
IUnknown FAR* unkOuter)
|
||||||
{
|
{
|
||||||
dbg_dump_dds_flags(lpDDSurfaceDesc->dwFlags);
|
dbg_dump_dds_flags(lpDDSurfaceDesc->dwFlags);
|
||||||
dbg_dump_dds_caps(lpDDSurfaceDesc->ddsCaps.dwCaps);
|
dbg_dump_dds_caps(lpDDSurfaceDesc->ddsCaps.dwCaps);
|
||||||
@ -1292,13 +1315,14 @@ HRESULT dd_CreateSurface(IDirectDrawImpl* This, LPDDSURFACEDESC lpDDSurfaceDesc,
|
|||||||
g_ddraw->primary->height == g_ddraw->height &&
|
g_ddraw->primary->height == g_ddraw->height &&
|
||||||
g_ddraw->primary->bpp == g_ddraw->bpp)
|
g_ddraw->primary->bpp == g_ddraw->bpp)
|
||||||
{
|
{
|
||||||
*lpDDSurface = (LPDIRECTDRAWSURFACE)g_ddraw->primary;
|
*lpDDSurface = g_ddraw->primary;
|
||||||
IDirectDrawSurface_AddRef(g_ddraw->primary);
|
IDirectDrawSurface_AddRef(g_ddraw->primary);
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
IDirectDrawSurfaceImpl *dst_surface = (IDirectDrawSurfaceImpl *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectDrawSurfaceImpl));
|
IDirectDrawSurfaceImpl* dst_surface =
|
||||||
|
(IDirectDrawSurfaceImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectDrawSurfaceImpl));
|
||||||
|
|
||||||
dst_surface->lpVtbl = &g_dds_vtbl;
|
dst_surface->lpVtbl = &g_dds_vtbl;
|
||||||
|
|
||||||
@ -1317,17 +1341,17 @@ HRESULT dd_CreateSurface(IDirectDrawImpl* This, LPDDSURFACEDESC lpDDSurfaceDesc,
|
|||||||
dst_surface->bpp = 8;
|
dst_surface->bpp = 8;
|
||||||
break;
|
break;
|
||||||
case 15:
|
case 15:
|
||||||
dprintf(" NOT_IMPLEMENTED bpp=%u\n", lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount);
|
TRACE(" NOT_IMPLEMENTED bpp=%u\n", lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount);
|
||||||
case 16:
|
case 16:
|
||||||
dst_surface->bpp = 16;
|
dst_surface->bpp = 16;
|
||||||
break;
|
break;
|
||||||
case 24:
|
case 24:
|
||||||
dprintf(" NOT_IMPLEMENTED bpp=%u\n", lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount);
|
TRACE(" NOT_IMPLEMENTED bpp=%u\n", lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount);
|
||||||
case 32:
|
case 32:
|
||||||
dst_surface->bpp = 32;
|
dst_surface->bpp = 32;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dprintf(" NOT_IMPLEMENTED bpp=%u\n", lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount);
|
TRACE(" NOT_IMPLEMENTED bpp=%u\n", lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1358,7 +1382,9 @@ HRESULT dd_CreateSurface(IDirectDrawImpl* This, LPDDSURFACEDESC lpDDSurfaceDesc,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dst_surface->bmi = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256);
|
dst_surface->bmi =
|
||||||
|
HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256);
|
||||||
|
|
||||||
dst_surface->bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
dst_surface->bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
||||||
dst_surface->bmi->bmiHeader.biWidth = dst_surface->width;
|
dst_surface->bmi->bmiHeader.biWidth = dst_surface->width;
|
||||||
dst_surface->bmi->bmiHeader.biHeight = -((int)dst_surface->height + 200);
|
dst_surface->bmi->bmiHeader.biHeight = -((int)dst_surface->height + 200);
|
||||||
@ -1373,7 +1399,8 @@ HRESULT dd_CreateSurface(IDirectDrawImpl* This, LPDDSURFACEDESC lpDDSurfaceDesc,
|
|||||||
dst_surface->bmi->bmiHeader.biClrUsed = (1 << clr_bits);
|
dst_surface->bmi->bmiHeader.biClrUsed = (1 << clr_bits);
|
||||||
}
|
}
|
||||||
|
|
||||||
dst_surface->bmi->bmiHeader.biSizeImage = ((dst_surface->width * clr_bits + 31) & ~31) / 8 * dst_surface->height;
|
dst_surface->bmi->bmiHeader.biSizeImage =
|
||||||
|
((dst_surface->width * clr_bits + 31) & ~31) / 8 * dst_surface->height;
|
||||||
|
|
||||||
if (dst_surface->bpp == 8)
|
if (dst_surface->bpp == 8)
|
||||||
{
|
{
|
||||||
@ -1399,7 +1426,9 @@ HRESULT dd_CreateSurface(IDirectDrawImpl* This, LPDDSURFACEDESC lpDDSurfaceDesc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
dst_surface->hdc = CreateCompatibleDC(g_ddraw->render.hdc);
|
dst_surface->hdc = CreateCompatibleDC(g_ddraw->render.hdc);
|
||||||
dst_surface->bitmap = CreateDIBSection(dst_surface->hdc, dst_surface->bmi, DIB_RGB_COLORS, (void **)&dst_surface->surface, NULL, 0);
|
dst_surface->bitmap =
|
||||||
|
CreateDIBSection(dst_surface->hdc, dst_surface->bmi, DIB_RGB_COLORS, (void**)&dst_surface->surface, NULL, 0);
|
||||||
|
|
||||||
dst_surface->bmi->bmiHeader.biHeight = -((int)dst_surface->height);
|
dst_surface->bmi->bmiHeader.biHeight = -((int)dst_surface->height);
|
||||||
|
|
||||||
if (!dst_surface->bitmap)
|
if (!dst_surface->bitmap)
|
||||||
@ -1422,12 +1451,10 @@ HRESULT dd_CreateSurface(IDirectDrawImpl* This, LPDDSURFACEDESC lpDDSurfaceDesc,
|
|||||||
|
|
||||||
if (dst_surface->flags & DDSD_BACKBUFFERCOUNT)
|
if (dst_surface->flags & DDSD_BACKBUFFERCOUNT)
|
||||||
{
|
{
|
||||||
dprintf(" dwBackBufferCount=%d\n", lpDDSurfaceDesc->dwBackBufferCount);
|
TRACE(" dwBackBufferCount=%d\n", lpDDSurfaceDesc->dwBackBufferCount);
|
||||||
|
|
||||||
if (g_ddraw->backbuffer)
|
DDSURFACEDESC2 desc;
|
||||||
{
|
memset(&desc, 0, sizeof(desc));
|
||||||
DDSURFACEDESC desc;
|
|
||||||
memset(&desc, 0, sizeof(DDSURFACEDESC));
|
|
||||||
|
|
||||||
if (lpDDSurfaceDesc->dwBackBufferCount > 1)
|
if (lpDDSurfaceDesc->dwBackBufferCount > 1)
|
||||||
{
|
{
|
||||||
@ -1440,13 +1467,17 @@ HRESULT dd_CreateSurface(IDirectDrawImpl* This, LPDDSURFACEDESC lpDDSurfaceDesc,
|
|||||||
desc.dwWidth = dst_surface->width;
|
desc.dwWidth = dst_surface->width;
|
||||||
desc.dwHeight = dst_surface->height;
|
desc.dwHeight = dst_surface->height;
|
||||||
|
|
||||||
dd_CreateSurface(This, &desc, (LPDIRECTDRAWSURFACE*)&dst_surface->backbuffer, unkOuter);
|
dd_CreateSurface(This, &desc, &dst_surface->backbuffer, unkOuter);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dprintf(" surface = %p (%dx%d@%d)\n", dst_surface, (int)dst_surface->width, (int)dst_surface->height, (int)dst_surface->bpp);
|
TRACE(
|
||||||
|
" surface = %p (%ux%u@%u)\n",
|
||||||
|
dst_surface,
|
||||||
|
dst_surface->width,
|
||||||
|
dst_surface->height,
|
||||||
|
dst_surface->bpp);
|
||||||
|
|
||||||
*lpDDSurface = (LPDIRECTDRAWSURFACE)dst_surface;
|
*lpDDSurface = dst_surface;
|
||||||
|
|
||||||
dst_surface->ref = 0;
|
dst_surface->ref = 0;
|
||||||
IDirectDrawSurface_AddRef(dst_surface);
|
IDirectDrawSurface_AddRef(dst_surface);
|
||||||
|
393
src/debug.c
393
src/debug.c
@ -1,8 +1,8 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <dbghelp.h>
|
#include <dbghelp.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <ddraw.h>
|
||||||
#include "dd.h"
|
#include "dd.h"
|
||||||
#include "ddraw.h"
|
|
||||||
#include "ddsurface.h"
|
#include "ddsurface.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ double dbg_counter_stop()
|
|||||||
return (double)(li.QuadPart - g_dbg_counter_start_time) / g_dbg_counter_freq;
|
return (double)(li.QuadPart - g_dbg_counter_start_time) / g_dbg_counter_freq;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dbg_debug_string(const char *format, ...)
|
void dbg_debug_string(const char* format, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, format);
|
va_start(args, format);
|
||||||
@ -110,7 +110,7 @@ void dbg_debug_string(const char *format, ...)
|
|||||||
OutputDebugStringA(buffer);
|
OutputDebugStringA(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
int dbg_printf(const char *fmt, ...)
|
int dbg_printf(const char* fmt, ...)
|
||||||
{
|
{
|
||||||
static CRITICAL_SECTION cs;
|
static CRITICAL_SECTION cs;
|
||||||
static BOOL initialized;
|
static BOOL initialized;
|
||||||
@ -129,7 +129,14 @@ int dbg_printf(const char *fmt, ...)
|
|||||||
SYSTEMTIME st;
|
SYSTEMTIME st;
|
||||||
GetLocalTime(&st);
|
GetLocalTime(&st);
|
||||||
|
|
||||||
fprintf(stdout, "[%lu] %02d:%02d:%02d.%03d ", GetCurrentThreadId(), st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);
|
fprintf(
|
||||||
|
stdout,
|
||||||
|
"[%lu] %02d:%02d:%02d.%03d ",
|
||||||
|
GetCurrentThreadId(),
|
||||||
|
st.wHour,
|
||||||
|
st.wMinute,
|
||||||
|
st.wSecond,
|
||||||
|
st.wMilliseconds);
|
||||||
|
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
ret = vfprintf(stdout, fmt, args);
|
ret = vfprintf(stdout, fmt, args);
|
||||||
@ -162,7 +169,7 @@ void dbg_draw_frame_info_start()
|
|||||||
{
|
{
|
||||||
_snprintf(
|
_snprintf(
|
||||||
debug_text,
|
debug_text,
|
||||||
sizeof(debug_text)-1,
|
sizeof(debug_text) - 1,
|
||||||
"FPS: %lu | Time: %2.2f ms ",
|
"FPS: %lu | Time: %2.2f ms ",
|
||||||
g_dbg_frame_count,
|
g_dbg_frame_count,
|
||||||
g_dbg_frame_time);
|
g_dbg_frame_time);
|
||||||
@ -186,82 +193,130 @@ void dbg_dump_dds_blt_flags(DWORD flags)
|
|||||||
{
|
{
|
||||||
#ifdef _DEBUG_X
|
#ifdef _DEBUG_X
|
||||||
if (flags & DDBLT_ALPHADEST) {
|
if (flags & DDBLT_ALPHADEST) {
|
||||||
dprintf(" DDBLT_ALPHADEST\n");
|
TRACE(" DDBLT_ALPHADEST\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_ALPHADESTCONSTOVERRIDE) {
|
if (flags & DDBLT_ALPHADESTCONSTOVERRIDE) {
|
||||||
dprintf(" DDBLT_ALPHADESTCONSTOVERRIDE\n");
|
TRACE(" DDBLT_ALPHADESTCONSTOVERRIDE\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_ALPHADESTNEG) {
|
if (flags & DDBLT_ALPHADESTNEG) {
|
||||||
dprintf(" DDBLT_ALPHADESTNEG\n");
|
TRACE(" DDBLT_ALPHADESTNEG\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_ALPHADESTSURFACEOVERRIDE) {
|
if (flags & DDBLT_ALPHADESTSURFACEOVERRIDE) {
|
||||||
dprintf(" DDBLT_ALPHADESTSURFACEOVERRIDE\n");
|
TRACE(" DDBLT_ALPHADESTSURFACEOVERRIDE\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_ALPHAEDGEBLEND) {
|
if (flags & DDBLT_ALPHAEDGEBLEND) {
|
||||||
dprintf(" DDBLT_ALPHAEDGEBLEND\n");
|
TRACE(" DDBLT_ALPHAEDGEBLEND\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_ALPHASRC) {
|
if (flags & DDBLT_ALPHASRC) {
|
||||||
dprintf(" DDBLT_ALPHASRC\n");
|
TRACE(" DDBLT_ALPHASRC\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_ALPHASRCCONSTOVERRIDE) {
|
if (flags & DDBLT_ALPHASRCCONSTOVERRIDE) {
|
||||||
dprintf(" DDBLT_ALPHASRCCONSTOVERRIDE\n");
|
TRACE(" DDBLT_ALPHASRCCONSTOVERRIDE\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_ALPHASRCNEG) {
|
if (flags & DDBLT_ALPHASRCNEG) {
|
||||||
dprintf(" DDBLT_ALPHASRCNEG\n");
|
TRACE(" DDBLT_ALPHASRCNEG\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_ALPHASRCSURFACEOVERRIDE) {
|
if (flags & DDBLT_ALPHASRCSURFACEOVERRIDE) {
|
||||||
dprintf(" DDBLT_ALPHASRCSURFACEOVERRIDE\n");
|
TRACE(" DDBLT_ALPHASRCSURFACEOVERRIDE\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_ASYNC) {
|
if (flags & DDBLT_ASYNC) {
|
||||||
dprintf(" DDBLT_ASYNC\n");
|
TRACE(" DDBLT_ASYNC\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_COLORFILL) {
|
if (flags & DDBLT_COLORFILL) {
|
||||||
dprintf(" DDBLT_COLORFILL\n");
|
TRACE(" DDBLT_COLORFILL\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_DDFX) {
|
if (flags & DDBLT_DDFX) {
|
||||||
dprintf(" DDBLT_DDFX\n");
|
TRACE(" DDBLT_DDFX\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_DDROPS) {
|
if (flags & DDBLT_DDROPS) {
|
||||||
dprintf(" DDBLT_DDROPS\n");
|
TRACE(" DDBLT_DDROPS\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_KEYDEST) {
|
if (flags & DDBLT_KEYDEST) {
|
||||||
dprintf(" DDBLT_KEYDEST\n");
|
TRACE(" DDBLT_KEYDEST\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_KEYDESTOVERRIDE) {
|
if (flags & DDBLT_KEYDESTOVERRIDE) {
|
||||||
dprintf(" DDBLT_KEYDESTOVERRIDE\n");
|
TRACE(" DDBLT_KEYDESTOVERRIDE\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_KEYSRC) {
|
if (flags & DDBLT_KEYSRC) {
|
||||||
dprintf(" DDBLT_KEYSRC\n");
|
TRACE(" DDBLT_KEYSRC\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_KEYSRCOVERRIDE) {
|
if (flags & DDBLT_KEYSRCOVERRIDE) {
|
||||||
dprintf(" DDBLT_KEYSRCOVERRIDE\n");
|
TRACE(" DDBLT_KEYSRCOVERRIDE\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_ROP) {
|
if (flags & DDBLT_ROP) {
|
||||||
dprintf(" DDBLT_ROP\n");
|
TRACE(" DDBLT_ROP\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_ROTATIONANGLE) {
|
if (flags & DDBLT_ROTATIONANGLE) {
|
||||||
dprintf(" DDBLT_ROTATIONANGLE\n");
|
TRACE(" DDBLT_ROTATIONANGLE\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_ZBUFFER) {
|
if (flags & DDBLT_ZBUFFER) {
|
||||||
dprintf(" DDBLT_ZBUFFER\n");
|
TRACE(" DDBLT_ZBUFFER\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_ZBUFFERDESTCONSTOVERRIDE) {
|
if (flags & DDBLT_ZBUFFERDESTCONSTOVERRIDE) {
|
||||||
dprintf(" DDBLT_ZBUFFERDESTCONSTOVERRIDE\n");
|
TRACE(" DDBLT_ZBUFFERDESTCONSTOVERRIDE\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_ZBUFFERDESTOVERRIDE) {
|
if (flags & DDBLT_ZBUFFERDESTOVERRIDE) {
|
||||||
dprintf(" DDBLT_ZBUFFERDESTOVERRIDE\n");
|
TRACE(" DDBLT_ZBUFFERDESTOVERRIDE\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_ZBUFFERSRCCONSTOVERRIDE) {
|
if (flags & DDBLT_ZBUFFERSRCCONSTOVERRIDE) {
|
||||||
dprintf(" DDBLT_ZBUFFERSRCCONSTOVERRIDE\n");
|
TRACE(" DDBLT_ZBUFFERSRCCONSTOVERRIDE\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_ZBUFFERSRCOVERRIDE) {
|
if (flags & DDBLT_ZBUFFERSRCOVERRIDE) {
|
||||||
dprintf(" DDBLT_ZBUFFERSRCOVERRIDE\n");
|
TRACE(" DDBLT_ZBUFFERSRCOVERRIDE\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_WAIT) {
|
if (flags & DDBLT_WAIT) {
|
||||||
dprintf(" DDBLT_WAIT\n");
|
TRACE(" DDBLT_WAIT\n");
|
||||||
}
|
}
|
||||||
if (flags & DDBLT_DEPTHFILL) {
|
if (flags & DDBLT_DEPTHFILL) {
|
||||||
dprintf(" DDBLT_DEPTHFILL\n");
|
TRACE(" DDBLT_DEPTHFILL\n");
|
||||||
|
}
|
||||||
|
if (flags & DDBLT_DONOTWAIT) {
|
||||||
|
TRACE(" DDBLT_DONOTWAIT\n");
|
||||||
|
}
|
||||||
|
if (flags & DDBLT_PRESENTATION) {
|
||||||
|
TRACE(" DDBLT_PRESENTATION\n");
|
||||||
|
}
|
||||||
|
if (flags & DDBLT_LAST_PRESENTATION) {
|
||||||
|
TRACE(" DDBLT_LAST_PRESENTATION\n");
|
||||||
|
}
|
||||||
|
if (flags & DDBLT_EXTENDED_FLAGS) {
|
||||||
|
TRACE(" DDBLT_EXTENDED_FLAGS\n");
|
||||||
|
}
|
||||||
|
if (flags & DDBLT_EXTENDED_LINEAR_CONTENT) {
|
||||||
|
TRACE(" DDBLT_EXTENDED_LINEAR_CONTENT\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void dbg_dump_dds_blt_fx_flags(DWORD flags)
|
||||||
|
{
|
||||||
|
#ifdef _DEBUG_X
|
||||||
|
if (flags & DDBLTFX_ARITHSTRETCHY) {
|
||||||
|
TRACE(" DDBLTFX_ARITHSTRETCHY\n");
|
||||||
|
}
|
||||||
|
if (flags & DDBLTFX_MIRRORLEFTRIGHT) {
|
||||||
|
TRACE(" DDBLTFX_MIRRORLEFTRIGHT\n");
|
||||||
|
}
|
||||||
|
if (flags & DDBLTFX_MIRRORUPDOWN) {
|
||||||
|
TRACE(" DDBLTFX_MIRRORUPDOWN\n");
|
||||||
|
}
|
||||||
|
if (flags & DDBLTFX_NOTEARING) {
|
||||||
|
TRACE(" DDBLTFX_NOTEARING\n");
|
||||||
|
}
|
||||||
|
if (flags & DDBLTFX_ROTATE180) {
|
||||||
|
TRACE(" DDBLTFX_ROTATE180\n");
|
||||||
|
}
|
||||||
|
if (flags & DDBLTFX_ROTATE270) {
|
||||||
|
TRACE(" DDBLTFX_ROTATE270\n");
|
||||||
|
}
|
||||||
|
if (flags & DDBLTFX_ROTATE90) {
|
||||||
|
TRACE(" DDBLTFX_ROTATE90\n");
|
||||||
|
}
|
||||||
|
if (flags & DDBLTFX_ZBUFFERRANGE) {
|
||||||
|
TRACE(" DDBLTFX_ZBUFFERRANGE\n");
|
||||||
|
}
|
||||||
|
if (flags & DDBLTFX_ZBUFFERBASEDEST) {
|
||||||
|
TRACE(" DDBLTFX_ZBUFFERBASEDEST\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -269,45 +324,95 @@ void dbg_dump_dds_blt_flags(DWORD flags)
|
|||||||
void dbg_dump_dds_caps(DWORD caps)
|
void dbg_dump_dds_caps(DWORD caps)
|
||||||
{
|
{
|
||||||
#ifdef _DEBUG_X
|
#ifdef _DEBUG_X
|
||||||
if (caps & DDSCAPS_ALPHA)
|
if (caps & DDSCAPS_RESERVED1) {
|
||||||
{
|
TRACE(" DDSCAPS_RESERVED1\n");
|
||||||
dprintf(" DDSCAPS_ALPHA\n");
|
|
||||||
}
|
}
|
||||||
if (caps & DDSCAPS_BACKBUFFER)
|
if (caps & DDSCAPS_ALPHA) {
|
||||||
{
|
TRACE(" DDSCAPS_ALPHA\n");
|
||||||
dprintf(" DDSCAPS_BACKBUFFER\n");
|
|
||||||
}
|
}
|
||||||
if (caps & DDSCAPS_FLIP)
|
if (caps & DDSCAPS_BACKBUFFER) {
|
||||||
{
|
TRACE(" DDSCAPS_BACKBUFFER\n");
|
||||||
dprintf(" DDSCAPS_FLIP\n");
|
|
||||||
}
|
}
|
||||||
if (caps & DDSCAPS_FRONTBUFFER)
|
if (caps & DDSCAPS_COMPLEX) {
|
||||||
{
|
TRACE(" DDSCAPS_COMPLEX\n");
|
||||||
dprintf(" DDSCAPS_FRONTBUFFER\n");
|
|
||||||
}
|
}
|
||||||
if (caps & DDSCAPS_PALETTE)
|
if (caps & DDSCAPS_FLIP) {
|
||||||
{
|
TRACE(" DDSCAPS_FLIP\n");
|
||||||
dprintf(" DDSCAPS_PALETTE\n");
|
|
||||||
}
|
}
|
||||||
if (caps & DDSCAPS_TEXTURE)
|
if (caps & DDSCAPS_FRONTBUFFER) {
|
||||||
{
|
TRACE(" DDSCAPS_FRONTBUFFER\n");
|
||||||
dprintf(" DDSCAPS_TEXTURE\n");
|
|
||||||
}
|
}
|
||||||
if (caps & DDSCAPS_PRIMARYSURFACE)
|
if (caps & DDSCAPS_OFFSCREENPLAIN) {
|
||||||
{
|
TRACE(" DDSCAPS_OFFSCREENPLAIN\n");
|
||||||
dprintf(" DDSCAPS_PRIMARYSURFACE\n");
|
|
||||||
}
|
}
|
||||||
if (caps & DDSCAPS_OFFSCREENPLAIN)
|
if (caps & DDSCAPS_OVERLAY) {
|
||||||
{
|
TRACE(" DDSCAPS_OVERLAY\n");
|
||||||
dprintf(" DDSCAPS_OFFSCREENPLAIN\n");
|
|
||||||
}
|
}
|
||||||
if (caps & DDSCAPS_VIDEOMEMORY)
|
if (caps & DDSCAPS_PALETTE) {
|
||||||
{
|
TRACE(" DDSCAPS_PALETTE\n");
|
||||||
dprintf(" DDSCAPS_VIDEOMEMORY\n");
|
|
||||||
}
|
}
|
||||||
if (caps & DDSCAPS_LOCALVIDMEM)
|
if (caps & DDSCAPS_PRIMARYSURFACE) {
|
||||||
{
|
TRACE(" DDSCAPS_PRIMARYSURFACE\n");
|
||||||
dprintf(" DDSCAPS_LOCALVIDMEM\n");
|
}
|
||||||
|
if (caps & DDSCAPS_RESERVED3) {
|
||||||
|
TRACE(" DDSCAPS_RESERVED3\n");
|
||||||
|
}
|
||||||
|
if (caps & DDSCAPS_PRIMARYSURFACELEFT) {
|
||||||
|
TRACE(" DDSCAPS_PRIMARYSURFACELEFT\n");
|
||||||
|
}
|
||||||
|
if (caps & DDSCAPS_SYSTEMMEMORY) {
|
||||||
|
TRACE(" DDSCAPS_SYSTEMMEMORY\n");
|
||||||
|
}
|
||||||
|
if (caps & DDSCAPS_TEXTURE) {
|
||||||
|
TRACE(" DDSCAPS_TEXTURE\n");
|
||||||
|
}
|
||||||
|
if (caps & DDSCAPS_3DDEVICE) {
|
||||||
|
TRACE(" DDSCAPS_3DDEVICE\n");
|
||||||
|
}
|
||||||
|
if (caps & DDSCAPS_VIDEOMEMORY) {
|
||||||
|
TRACE(" DDSCAPS_VIDEOMEMORY\n");
|
||||||
|
}
|
||||||
|
if (caps & DDSCAPS_VISIBLE) {
|
||||||
|
TRACE(" DDSCAPS_VISIBLE\n");
|
||||||
|
}
|
||||||
|
if (caps & DDSCAPS_ZBUFFER) {
|
||||||
|
TRACE(" DDSCAPS_ZBUFFER\n");
|
||||||
|
}
|
||||||
|
if (caps & DDSCAPS_OWNDC) {
|
||||||
|
TRACE(" DDSCAPS_OWNDC\n");
|
||||||
|
}
|
||||||
|
if (caps & DDSCAPS_LIVEVIDEO) {
|
||||||
|
TRACE(" DDSCAPS_LIVEVIDEO\n");
|
||||||
|
}
|
||||||
|
if (caps & DDSCAPS_HWCODEC) {
|
||||||
|
TRACE(" DDSCAPS_HWCODEC\n");
|
||||||
|
}
|
||||||
|
if (caps & DDSCAPS_MODEX) {
|
||||||
|
TRACE(" DDSCAPS_MODEX\n");
|
||||||
|
}
|
||||||
|
if (caps & DDSCAPS_MIPMAP) {
|
||||||
|
TRACE(" DDSCAPS_MIPMAP\n");
|
||||||
|
}
|
||||||
|
if (caps & DDSCAPS_RESERVED2) {
|
||||||
|
TRACE(" DDSCAPS_RESERVED2\n");
|
||||||
|
}
|
||||||
|
if (caps & DDSCAPS_ALLOCONLOAD) {
|
||||||
|
TRACE(" DDSCAPS_ALLOCONLOAD\n");
|
||||||
|
}
|
||||||
|
if (caps & DDSCAPS_VIDEOPORT) {
|
||||||
|
TRACE(" DDSCAPS_VIDEOPORT\n");
|
||||||
|
}
|
||||||
|
if (caps & DDSCAPS_LOCALVIDMEM) {
|
||||||
|
TRACE(" DDSCAPS_LOCALVIDMEM\n");
|
||||||
|
}
|
||||||
|
if (caps & DDSCAPS_NONLOCALVIDMEM) {
|
||||||
|
TRACE(" DDSCAPS_NONLOCALVIDMEM\n");
|
||||||
|
}
|
||||||
|
if (caps & DDSCAPS_STANDARDVGAMODE) {
|
||||||
|
TRACE(" DDSCAPS_STANDARDVGAMODE\n");
|
||||||
|
}
|
||||||
|
if (caps & DDSCAPS_OPTIMIZED) {
|
||||||
|
TRACE(" DDSCAPS_OPTIMIZED\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -315,73 +420,68 @@ void dbg_dump_dds_caps(DWORD caps)
|
|||||||
void dbg_dump_dds_flags(DWORD flags)
|
void dbg_dump_dds_flags(DWORD flags)
|
||||||
{
|
{
|
||||||
#ifdef _DEBUG_X
|
#ifdef _DEBUG_X
|
||||||
if (flags & DDSD_CAPS)
|
if (flags & DDSD_CAPS) {
|
||||||
{
|
TRACE(" DDSD_CAPS\n");
|
||||||
dprintf(" DDSD_CAPS\n");
|
|
||||||
}
|
}
|
||||||
if (flags & DDSD_HEIGHT)
|
if (flags & DDSD_HEIGHT) {
|
||||||
{
|
TRACE(" DDSD_HEIGHT\n");
|
||||||
dprintf(" DDSD_HEIGHT\n");
|
|
||||||
}
|
}
|
||||||
if (flags & DDSD_WIDTH)
|
if (flags & DDSD_WIDTH) {
|
||||||
{
|
TRACE(" DDSD_WIDTH\n");
|
||||||
dprintf(" DDSD_WIDTH\n");
|
|
||||||
}
|
}
|
||||||
if (flags & DDSD_PITCH)
|
if (flags & DDSD_PITCH) {
|
||||||
{
|
TRACE(" DDSD_PITCH\n");
|
||||||
dprintf(" DDSD_PITCH\n");
|
|
||||||
}
|
}
|
||||||
if (flags & DDSD_BACKBUFFERCOUNT)
|
if (flags & DDSD_BACKBUFFERCOUNT) {
|
||||||
{
|
TRACE(" DDSD_BACKBUFFERCOUNT\n");
|
||||||
dprintf(" DDSD_BACKBUFFERCOUNT\n");
|
|
||||||
}
|
}
|
||||||
if (flags & DDSD_ZBUFFERBITDEPTH)
|
if (flags & DDSD_ZBUFFERBITDEPTH) {
|
||||||
{
|
TRACE(" DDSD_ZBUFFERBITDEPTH\n");
|
||||||
dprintf(" DDSD_ZBUFFERBITDEPTH\n");
|
|
||||||
}
|
}
|
||||||
if (flags & DDSD_ALPHABITDEPTH)
|
if (flags & DDSD_ALPHABITDEPTH) {
|
||||||
{
|
TRACE(" DDSD_ALPHABITDEPTH\n");
|
||||||
dprintf(" DDSD_ALPHABITDEPTH\n");
|
|
||||||
}
|
}
|
||||||
if (flags & DDSD_LPSURFACE)
|
if (flags & DDSD_LPSURFACE) {
|
||||||
{
|
TRACE(" DDSD_LPSURFACE\n");
|
||||||
dprintf(" DDSD_LPSURFACE\n");
|
|
||||||
}
|
}
|
||||||
if (flags & DDSD_PIXELFORMAT)
|
if (flags & DDSD_PIXELFORMAT) {
|
||||||
{
|
TRACE(" DDSD_PIXELFORMAT\n");
|
||||||
dprintf(" DDSD_PIXELFORMAT\n");
|
|
||||||
}
|
}
|
||||||
if (flags & DDSD_CKDESTOVERLAY)
|
if (flags & DDSD_CKDESTOVERLAY) {
|
||||||
{
|
TRACE(" DDSD_CKDESTOVERLAY\n");
|
||||||
dprintf(" DDSD_CKDESTOVERLAY\n");
|
|
||||||
}
|
}
|
||||||
if (flags & DDSD_CKDESTBLT)
|
if (flags & DDSD_CKDESTBLT) {
|
||||||
{
|
TRACE(" DDSD_CKDESTBLT\n");
|
||||||
dprintf(" DDSD_CKDESTBLT\n");
|
|
||||||
}
|
}
|
||||||
if (flags & DDSD_CKSRCOVERLAY)
|
if (flags & DDSD_CKSRCOVERLAY) {
|
||||||
{
|
TRACE(" DDSD_CKSRCOVERLAY\n");
|
||||||
dprintf(" DDSD_CKSRCOVERLAY\n");
|
|
||||||
}
|
}
|
||||||
if (flags & DDSD_CKSRCBLT)
|
if (flags & DDSD_CKSRCBLT) {
|
||||||
{
|
TRACE(" DDSD_CKSRCBLT\n");
|
||||||
dprintf(" DDSD_CKSRCBLT\n");
|
|
||||||
}
|
}
|
||||||
if (flags & DDSD_MIPMAPCOUNT)
|
if (flags & DDSD_MIPMAPCOUNT) {
|
||||||
{
|
TRACE(" DDSD_MIPMAPCOUNT\n");
|
||||||
dprintf(" DDSD_MIPMAPCOUNT\n");
|
|
||||||
}
|
}
|
||||||
if (flags & DDSD_REFRESHRATE)
|
if (flags & DDSD_REFRESHRATE) {
|
||||||
{
|
TRACE(" DDSD_REFRESHRATE\n");
|
||||||
dprintf(" DDSD_REFRESHRATE\n");
|
|
||||||
}
|
}
|
||||||
if (flags & DDSD_LINEARSIZE)
|
if (flags & DDSD_LINEARSIZE) {
|
||||||
{
|
TRACE(" DDSD_LINEARSIZE\n");
|
||||||
dprintf(" DDSD_LINEARSIZE\n");
|
|
||||||
}
|
}
|
||||||
if (flags & DDSD_ALL)
|
if (flags & DDSD_TEXTURESTAGE) {
|
||||||
{
|
TRACE(" DDSD_TEXTURESTAGE\n");
|
||||||
dprintf(" DDSD_ALL\n");
|
}
|
||||||
|
if (flags & DDSD_FVF) {
|
||||||
|
TRACE(" DDSD_FVF\n");
|
||||||
|
}
|
||||||
|
if (flags & DDSD_SRCVBHANDLE) {
|
||||||
|
TRACE(" DDSD_SRCVBHANDLE\n");
|
||||||
|
}
|
||||||
|
if (flags & DDSD_DEPTH) {
|
||||||
|
TRACE(" DDSD_DEPTH\n");
|
||||||
|
}
|
||||||
|
if (flags & DDSD_ALL) {
|
||||||
|
TRACE(" DDSD_ALL\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -389,19 +489,20 @@ void dbg_dump_dds_flags(DWORD flags)
|
|||||||
void dbg_dump_dds_blt_fast_flags(DWORD flags)
|
void dbg_dump_dds_blt_fast_flags(DWORD flags)
|
||||||
{
|
{
|
||||||
#ifdef _DEBUG_X
|
#ifdef _DEBUG_X
|
||||||
if (flags & DDBLTFAST_NOCOLORKEY)
|
if (flags & DDBLTFAST_NOCOLORKEY) {
|
||||||
{
|
TRACE(" DDBLTFAST_NOCOLORKEY\n");
|
||||||
dprintf(" DDBLTFAST_NOCOLORKEY\n");
|
|
||||||
}
|
}
|
||||||
|
if (flags & DDBLTFAST_SRCCOLORKEY) {
|
||||||
if (flags & DDBLTFAST_SRCCOLORKEY)
|
TRACE(" DDBLTFAST_SRCCOLORKEY\n");
|
||||||
{
|
|
||||||
dprintf(" DDBLTFAST_SRCCOLORKEY\n");
|
|
||||||
}
|
}
|
||||||
|
if (flags & DDBLTFAST_DESTCOLORKEY) {
|
||||||
if (flags & DDBLTFAST_DESTCOLORKEY)
|
TRACE(" DDBLTFAST_DESTCOLORKEY\n");
|
||||||
{
|
}
|
||||||
dprintf(" DDBLTFAST_DESTCOLORKEY\n");
|
if (flags & DDBLTFAST_WAIT) {
|
||||||
|
TRACE(" DDBLTFAST_WAIT\n");
|
||||||
|
}
|
||||||
|
if (flags & DDBLTFAST_DONOTWAIT) {
|
||||||
|
TRACE(" DDBLTFAST_DONOTWAIT\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -409,25 +510,41 @@ void dbg_dump_dds_blt_fast_flags(DWORD flags)
|
|||||||
void dbg_dump_dds_lock_flags(DWORD flags)
|
void dbg_dump_dds_lock_flags(DWORD flags)
|
||||||
{
|
{
|
||||||
#ifdef _DEBUG_X
|
#ifdef _DEBUG_X
|
||||||
if (flags & DDLOCK_SURFACEMEMORYPTR)
|
if (flags & DDLOCK_SURFACEMEMORYPTR) {
|
||||||
{
|
TRACE(" DDLOCK_SURFACEMEMORYPTR\n");
|
||||||
dprintf(" dwFlags: DDLOCK_SURFACEMEMORYPTR\n");
|
|
||||||
}
|
}
|
||||||
if (flags & DDLOCK_WAIT)
|
if (flags & DDLOCK_WAIT) {
|
||||||
{
|
TRACE(" DDLOCK_WAIT\n");
|
||||||
dprintf(" dwFlags: DDLOCK_WAIT\n");
|
|
||||||
}
|
}
|
||||||
if (flags & DDLOCK_EVENT)
|
if (flags & DDLOCK_EVENT) {
|
||||||
{
|
TRACE(" DDLOCK_EVENT\n");
|
||||||
dprintf(" dwFlags: DDLOCK_EVENT\n");
|
|
||||||
}
|
}
|
||||||
if (flags & DDLOCK_READONLY)
|
if (flags & DDLOCK_READONLY) {
|
||||||
{
|
TRACE(" DDLOCK_READONLY\n");
|
||||||
dprintf(" dwFlags: DDLOCK_READONLY\n");
|
|
||||||
}
|
}
|
||||||
if (flags & DDLOCK_WRITEONLY)
|
if (flags & DDLOCK_WRITEONLY) {
|
||||||
{
|
TRACE(" DDLOCK_WRITEONLY\n");
|
||||||
dprintf(" dwFlags: DDLOCK_WRITEONLY\n");
|
}
|
||||||
|
if (flags & DDLOCK_NOSYSLOCK) {
|
||||||
|
TRACE(" DDLOCK_NOSYSLOCK\n");
|
||||||
|
}
|
||||||
|
if (flags & DDLOCK_NOOVERWRITE) {
|
||||||
|
TRACE(" DDLOCK_NOOVERWRITE\n");
|
||||||
|
}
|
||||||
|
if (flags & DDLOCK_DISCARDCONTENTS) {
|
||||||
|
TRACE(" DDLOCK_DISCARDCONTENTS\n");
|
||||||
|
}
|
||||||
|
if (flags & DDLOCK_OKTOSWAP) {
|
||||||
|
TRACE(" DDLOCK_OKTOSWAP\n");
|
||||||
|
}
|
||||||
|
if (flags & DDLOCK_DONOTWAIT) {
|
||||||
|
TRACE(" DDLOCK_DONOTWAIT\n");
|
||||||
|
}
|
||||||
|
if (flags & DDLOCK_HASVOLUMETEXTUREBOXRECT) {
|
||||||
|
TRACE(" DDLOCK_HASVOLUMETEXTUREBOXRECT\n");
|
||||||
|
}
|
||||||
|
if (flags & DDLOCK_NODIRTYUPDATE) {
|
||||||
|
TRACE(" DDLOCK_NODIRTYUPDATE\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ static DICREATEDEVICEEXPROC real_di_CreateDeviceEx;
|
|||||||
static DIDSETCOOPERATIVELEVELPROC real_did_SetCooperativeLevel;
|
static DIDSETCOOPERATIVELEVELPROC real_did_SetCooperativeLevel;
|
||||||
static DIDGETDEVICEDATAPROC real_did_GetDeviceData;
|
static DIDGETDEVICEDATAPROC real_did_GetDeviceData;
|
||||||
|
|
||||||
static PROC hook_func(PROC *org_func, PROC new_func)
|
static PROC hook_func(PROC* org_func, PROC new_func)
|
||||||
{
|
{
|
||||||
PROC org = *org_func;
|
PROC org = *org_func;
|
||||||
DWORD old_protect;
|
DWORD old_protect;
|
||||||
@ -33,16 +33,21 @@ static PROC hook_func(PROC *org_func, PROC new_func)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI fake_did_SetCooperativeLevel(IDirectInputDeviceA *This, HWND hwnd, DWORD dwFlags)
|
static HRESULT WINAPI fake_did_SetCooperativeLevel(IDirectInputDeviceA* This, HWND hwnd, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
dprintf("DirectInput SetCooperativeLevel\n");
|
TRACE("DirectInput SetCooperativeLevel\n");
|
||||||
|
|
||||||
return real_did_SetCooperativeLevel(This, hwnd, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE);
|
return real_did_SetCooperativeLevel(This, hwnd, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI fake_did_GetDeviceData(IDirectInputDeviceA *This, DWORD cbObjectData, LPDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags)
|
static HRESULT WINAPI fake_did_GetDeviceData(
|
||||||
|
IDirectInputDeviceA* This,
|
||||||
|
DWORD cbObjectData,
|
||||||
|
LPDIDEVICEOBJECTDATA rgdod,
|
||||||
|
LPDWORD pdwInOut,
|
||||||
|
DWORD dwFlags)
|
||||||
{
|
{
|
||||||
//dprintf("DirectInput GetDeviceData\n");
|
//TRACE("DirectInput GetDeviceData\n");
|
||||||
|
|
||||||
HRESULT result = real_did_GetDeviceData(This, cbObjectData, rgdod, pdwInOut, dwFlags);
|
HRESULT result = real_did_GetDeviceData(This, cbObjectData, rgdod, pdwInOut, dwFlags);
|
||||||
|
|
||||||
@ -54,9 +59,13 @@ static HRESULT WINAPI fake_did_GetDeviceData(IDirectInputDeviceA *This, DWORD cb
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI fake_di_CreateDevice(IDirectInputA *This, REFGUID rguid, LPDIRECTINPUTDEVICEA * lplpDIDevice, LPUNKNOWN pUnkOuter)
|
static HRESULT WINAPI fake_di_CreateDevice(
|
||||||
|
IDirectInputA* This,
|
||||||
|
REFGUID rguid,
|
||||||
|
LPDIRECTINPUTDEVICEA* lplpDIDevice,
|
||||||
|
LPUNKNOWN pUnkOuter)
|
||||||
{
|
{
|
||||||
dprintf("DirectInput CreateDevice\n");
|
TRACE("DirectInput CreateDevice\n");
|
||||||
|
|
||||||
HRESULT result = real_di_CreateDevice(This, rguid, lplpDIDevice, pUnkOuter);
|
HRESULT result = real_di_CreateDevice(This, rguid, lplpDIDevice, pUnkOuter);
|
||||||
|
|
||||||
@ -64,7 +73,7 @@ static HRESULT WINAPI fake_di_CreateDevice(IDirectInputA *This, REFGUID rguid, L
|
|||||||
{
|
{
|
||||||
real_did_SetCooperativeLevel =
|
real_did_SetCooperativeLevel =
|
||||||
(DIDSETCOOPERATIVELEVELPROC)hook_func(
|
(DIDSETCOOPERATIVELEVELPROC)hook_func(
|
||||||
(PROC *)&(*lplpDIDevice)->lpVtbl->SetCooperativeLevel, (PROC)fake_did_SetCooperativeLevel);
|
(PROC*)&(*lplpDIDevice)->lpVtbl->SetCooperativeLevel, (PROC)fake_did_SetCooperativeLevel);
|
||||||
|
|
||||||
real_did_GetDeviceData =
|
real_did_GetDeviceData =
|
||||||
(DIDGETDEVICEDATAPROC)hook_func(
|
(DIDGETDEVICEDATAPROC)hook_func(
|
||||||
@ -74,9 +83,14 @@ static HRESULT WINAPI fake_di_CreateDevice(IDirectInputA *This, REFGUID rguid, L
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI fake_di_CreateDeviceEx(IDirectInputA* This, REFGUID rguid, REFIID riid, LPDIRECTINPUTDEVICEA* lplpDIDevice, LPUNKNOWN pUnkOuter)
|
static HRESULT WINAPI fake_di_CreateDeviceEx(
|
||||||
|
IDirectInputA* This,
|
||||||
|
REFGUID rguid,
|
||||||
|
REFIID riid,
|
||||||
|
LPDIRECTINPUTDEVICEA* lplpDIDevice,
|
||||||
|
LPUNKNOWN pUnkOuter)
|
||||||
{
|
{
|
||||||
dprintf("DirectInput CreateDeviceEx\n");
|
TRACE("DirectInput CreateDeviceEx\n");
|
||||||
|
|
||||||
HRESULT result = real_di_CreateDeviceEx(This, rguid, riid, lplpDIDevice, pUnkOuter);
|
HRESULT result = real_di_CreateDeviceEx(This, rguid, riid, lplpDIDevice, pUnkOuter);
|
||||||
|
|
||||||
@ -94,9 +108,13 @@ static HRESULT WINAPI fake_di_CreateDeviceEx(IDirectInputA* This, REFGUID rguid,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI fake_DirectInputCreateA(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTA* lplpDirectInput, LPUNKNOWN punkOuter)
|
HRESULT WINAPI fake_DirectInputCreateA(
|
||||||
|
HINSTANCE hinst,
|
||||||
|
DWORD dwVersion,
|
||||||
|
LPDIRECTINPUTA* lplpDirectInput,
|
||||||
|
LPUNKNOWN punkOuter)
|
||||||
{
|
{
|
||||||
dprintf("DirectInputCreateA\n");
|
TRACE("DirectInputCreateA\n");
|
||||||
|
|
||||||
if (!real_DirectInputCreateA)
|
if (!real_DirectInputCreateA)
|
||||||
{
|
{
|
||||||
@ -112,15 +130,19 @@ HRESULT WINAPI fake_DirectInputCreateA(HINSTANCE hinst, DWORD dwVersion, LPDIREC
|
|||||||
if (SUCCEEDED(result) && !real_di_CreateDevice)
|
if (SUCCEEDED(result) && !real_di_CreateDevice)
|
||||||
{
|
{
|
||||||
real_di_CreateDevice =
|
real_di_CreateDevice =
|
||||||
(DICREATEDEVICEPROC)hook_func((PROC *)&(*lplpDirectInput)->lpVtbl->CreateDevice, (PROC)fake_di_CreateDevice);
|
(DICREATEDEVICEPROC)hook_func((PROC*)&(*lplpDirectInput)->lpVtbl->CreateDevice, (PROC)fake_di_CreateDevice);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI fake_DirectInputCreateW(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTW* lplpDirectInput, LPUNKNOWN punkOuter)
|
HRESULT WINAPI fake_DirectInputCreateW(
|
||||||
|
HINSTANCE hinst,
|
||||||
|
DWORD dwVersion,
|
||||||
|
LPDIRECTINPUTW* lplpDirectInput,
|
||||||
|
LPUNKNOWN punkOuter)
|
||||||
{
|
{
|
||||||
dprintf("DirectInputCreateW\n");
|
TRACE("DirectInputCreateW\n");
|
||||||
|
|
||||||
if (!real_DirectInputCreateW)
|
if (!real_DirectInputCreateW)
|
||||||
{
|
{
|
||||||
@ -142,9 +164,14 @@ HRESULT WINAPI fake_DirectInputCreateW(HINSTANCE hinst, DWORD dwVersion, LPDIREC
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI fake_DirectInputCreateEx(HINSTANCE hinst, DWORD dwVersion, REFIID riidltf, LPDIRECTINPUT7A* ppvOut, LPUNKNOWN punkOuter)
|
HRESULT WINAPI fake_DirectInputCreateEx(
|
||||||
|
HINSTANCE hinst,
|
||||||
|
DWORD dwVersion,
|
||||||
|
REFIID riidltf,
|
||||||
|
LPDIRECTINPUT7A* ppvOut,
|
||||||
|
LPUNKNOWN punkOuter)
|
||||||
{
|
{
|
||||||
dprintf("DirectInputCreateEx\n");
|
TRACE("DirectInputCreateEx\n");
|
||||||
|
|
||||||
if (!real_DirectInputCreateEx)
|
if (!real_DirectInputCreateEx)
|
||||||
{
|
{
|
||||||
@ -175,9 +202,14 @@ HRESULT WINAPI fake_DirectInputCreateEx(HINSTANCE hinst, DWORD dwVersion, REFIID
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI fake_DirectInput8Create(HINSTANCE hinst, DWORD dwVersion, REFIID riidltf, LPDIRECTINPUT8* ppvOut, LPUNKNOWN punkOuter)
|
HRESULT WINAPI fake_DirectInput8Create(
|
||||||
|
HINSTANCE hinst,
|
||||||
|
DWORD dwVersion,
|
||||||
|
REFIID riidltf,
|
||||||
|
LPDIRECTINPUT8* ppvOut,
|
||||||
|
LPUNKNOWN punkOuter)
|
||||||
{
|
{
|
||||||
dprintf("DirectInput8Create\n");
|
TRACE("DirectInput8Create\n");
|
||||||
|
|
||||||
if (!real_DirectInput8Create)
|
if (!real_DirectInput8Create)
|
||||||
{
|
{
|
||||||
|
@ -10,10 +10,10 @@
|
|||||||
#include "hook.h"
|
#include "hook.h"
|
||||||
|
|
||||||
|
|
||||||
// export for cncnet cnc games
|
/* export for cncnet cnc games */
|
||||||
BOOL GameHandlesClose;
|
BOOL GameHandlesClose;
|
||||||
|
|
||||||
// export for some warcraft II tools
|
/* export for some warcraft II tools */
|
||||||
PVOID FakePrimarySurface;
|
PVOID FakePrimarySurface;
|
||||||
|
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
|
|||||||
{
|
{
|
||||||
#if _DEBUG
|
#if _DEBUG
|
||||||
dbg_init();
|
dbg_init();
|
||||||
dprintf("cnc-ddraw = %p\n", hDll);
|
TRACE("cnc-ddraw = %p\n", hDll);
|
||||||
SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)dbg_exception_handler);
|
SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)dbg_exception_handler);
|
||||||
#endif
|
#endif
|
||||||
g_ddraw_module = hDll;
|
g_ddraw_module = hDll;
|
||||||
@ -104,7 +104,7 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
|
|||||||
}
|
}
|
||||||
case DLL_PROCESS_DETACH:
|
case DLL_PROCESS_DETACH:
|
||||||
{
|
{
|
||||||
dprintf("cnc-ddraw DLL_PROCESS_DETACH\n");
|
TRACE("cnc-ddraw DLL_PROCESS_DETACH\n");
|
||||||
|
|
||||||
cfg_save();
|
cfg_save();
|
||||||
|
|
||||||
@ -119,98 +119,108 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
|
|||||||
|
|
||||||
HRESULT WINAPI DirectDrawCreate(GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnknown FAR* pUnkOuter)
|
HRESULT WINAPI DirectDrawCreate(GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnknown FAR* pUnkOuter)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(lpGUID=%p, lplpDD=%p, pUnkOuter=%p)\n", __FUNCTION__, lpGUID, lplpDD, pUnkOuter);
|
TRACE("-> %s(lpGUID=%p, lplpDD=%p, pUnkOuter=%p)\n", __FUNCTION__, lpGUID, lplpDD, pUnkOuter);
|
||||||
HRESULT ret = dd_CreateEx(lpGUID, (LPVOID*)lplpDD, &IID_IDirectDraw, pUnkOuter);
|
HRESULT ret = dd_CreateEx(lpGUID, (LPVOID*)lplpDD, &IID_IDirectDraw, pUnkOuter);
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI DirectDrawCreateClipper(DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR* lplpDDClipper, IUnknown FAR* pUnkOuter)
|
HRESULT WINAPI DirectDrawCreateClipper(DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR* lplpDDClipper, IUnknown FAR* pUnkOuter)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(dwFlags=%08X, DDClipper=%p, unkOuter=%p)\n", __FUNCTION__, (int)dwFlags, lplpDDClipper, pUnkOuter);
|
TRACE("-> %s(dwFlags=%08X, DDClipper=%p, unkOuter=%p)\n", __FUNCTION__, (int)dwFlags, lplpDDClipper, pUnkOuter);
|
||||||
HRESULT ret = dd_CreateClipper(dwFlags, lplpDDClipper, pUnkOuter);
|
HRESULT ret = dd_CreateClipper(dwFlags, (IDirectDrawClipperImpl**)lplpDDClipper, pUnkOuter);
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI DirectDrawCreateEx(GUID* lpGuid, LPVOID* lplpDD, REFIID iid, IUnknown* pUnkOuter)
|
HRESULT WINAPI DirectDrawCreateEx(GUID* lpGuid, LPVOID* lplpDD, REFIID iid, IUnknown* pUnkOuter)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(lpGUID=%p, lplpDD=%p, riid=%08X, pUnkOuter=%p)\n", __FUNCTION__, lpGuid, lplpDD, iid, pUnkOuter);
|
TRACE("-> %s(lpGUID=%p, lplpDD=%p, riid=%08X, pUnkOuter=%p)\n", __FUNCTION__, lpGuid, lplpDD, iid, pUnkOuter);
|
||||||
HRESULT ret = dd_CreateEx(lpGuid, lplpDD, iid, pUnkOuter);
|
HRESULT ret = dd_CreateEx(lpGuid, lplpDD, iid, pUnkOuter);
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI DirectDrawEnumerateA(LPDDENUMCALLBACK lpCallback, LPVOID lpContext)
|
HRESULT WINAPI DirectDrawEnumerateA(LPDDENUMCALLBACK lpCallback, LPVOID lpContext)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(lpCallback=%p, lpContext=%p)\n", __FUNCTION__, lpCallback, lpContext);
|
TRACE("-> %s(lpCallback=%p, lpContext=%p)\n", __FUNCTION__, lpCallback, lpContext);
|
||||||
|
|
||||||
if (lpCallback)
|
if (lpCallback)
|
||||||
lpCallback(NULL, "Primary Display Driver", "display", lpContext);
|
lpCallback(NULL, "Primary Display Driver", "display", lpContext);
|
||||||
|
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI DirectDrawEnumerateExA(LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags)
|
HRESULT WINAPI DirectDrawEnumerateExA(LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(lpCallback=%p, lpContext=%p, dwFlags=%d)\n", __FUNCTION__, lpCallback, lpContext, dwFlags);
|
TRACE("-> %s(lpCallback=%p, lpContext=%p, dwFlags=%d)\n", __FUNCTION__, lpCallback, lpContext, dwFlags);
|
||||||
|
|
||||||
if (lpCallback)
|
if (lpCallback)
|
||||||
lpCallback(NULL, "Primary Display Driver", "display", lpContext, NULL);
|
lpCallback(NULL, "Primary Display Driver", "display", lpContext, NULL);
|
||||||
|
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI DirectDrawEnumerateExW(LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags)
|
HRESULT WINAPI DirectDrawEnumerateExW(LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(lpCallback=%p, lpContext=%p, dwFlags=%d)\n", __FUNCTION__, lpCallback, lpContext, dwFlags);
|
TRACE("-> %s(lpCallback=%p, lpContext=%p, dwFlags=%d)\n", __FUNCTION__, lpCallback, lpContext, dwFlags);
|
||||||
|
|
||||||
if (lpCallback)
|
if (lpCallback)
|
||||||
lpCallback(NULL, L"Primary Display Driver", L"display", lpContext, NULL);
|
lpCallback(NULL, L"Primary Display Driver", L"display", lpContext, NULL);
|
||||||
|
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI DirectDrawEnumerateW(LPDDENUMCALLBACKW lpCallback, LPVOID lpContext)
|
HRESULT WINAPI DirectDrawEnumerateW(LPDDENUMCALLBACKW lpCallback, LPVOID lpContext)
|
||||||
{
|
{
|
||||||
dprintf("-> %s(lpCallback=%p, lpContext=%p)\n", __FUNCTION__, lpCallback, lpContext);
|
TRACE("-> %s(lpCallback=%p, lpContext=%p)\n", __FUNCTION__, lpCallback, lpContext);
|
||||||
|
|
||||||
if (lpCallback)
|
if (lpCallback)
|
||||||
lpCallback(NULL, L"Primary Display Driver", L"display", lpContext);
|
lpCallback(NULL, L"Primary Display Driver", L"display", lpContext);
|
||||||
|
|
||||||
dprintf("<- %s\n", __FUNCTION__);
|
TRACE("<- %s\n", __FUNCTION__);
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI D3DParseUnknownCommand(LPVOID lpCmd, LPVOID* lpRetCmd)
|
HRESULT WINAPI D3DParseUnknownCommand(LPVOID lpCmd, LPVOID* lpRetCmd)
|
||||||
{
|
{
|
||||||
dprintf("-> %s()\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED -> %s(lpCmd=%p, lpRetCmd=%p)\n", __FUNCTION__, lpCmd, lpRetCmd);
|
||||||
return E_FAIL;
|
HRESULT ret = E_FAIL;
|
||||||
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD WINAPI AcquireDDThreadLock()
|
DWORD WINAPI AcquireDDThreadLock()
|
||||||
{
|
{
|
||||||
dprintf("-> %s()\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED -> %s()\n", __FUNCTION__);
|
||||||
return 0;
|
DWORD ret = 0;
|
||||||
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD WINAPI ReleaseDDThreadLock()
|
DWORD WINAPI ReleaseDDThreadLock()
|
||||||
{
|
{
|
||||||
dprintf("-> %s()\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED -> %s()\n", __FUNCTION__);
|
||||||
return 0;
|
DWORD ret = 0;
|
||||||
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD WINAPI DDInternalLock(DWORD a, DWORD b)
|
DWORD WINAPI DDInternalLock(DWORD a, DWORD b)
|
||||||
{
|
{
|
||||||
dprintf("-> %s()\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED -> %s()\n", __FUNCTION__);
|
||||||
return 0;
|
DWORD ret = 0;
|
||||||
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD WINAPI DDInternalUnlock(DWORD a)
|
DWORD WINAPI DDInternalUnlock(DWORD a)
|
||||||
{
|
{
|
||||||
dprintf("-> %s()\n", __FUNCTION__);
|
TRACE("NOT_IMPLEMENTED -> %s()\n", __FUNCTION__);
|
||||||
return 0;
|
DWORD ret = 0;
|
||||||
|
TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include "dd.h"
|
#include "dd.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
fps_limiter g_fpsl;
|
FPSLIMITER g_fpsl;
|
||||||
|
|
||||||
void fpsl_init()
|
void fpsl_init()
|
||||||
{
|
{
|
||||||
|
32
src/hook.c
32
src/hook.c
@ -45,7 +45,7 @@ LOADLIBRARYWPROC real_LoadLibraryW = LoadLibraryW;
|
|||||||
LOADLIBRARYEXAPROC real_LoadLibraryExA = LoadLibraryExA;
|
LOADLIBRARYEXAPROC real_LoadLibraryExA = LoadLibraryExA;
|
||||||
LOADLIBRARYEXWPROC real_LoadLibraryExW = LoadLibraryExW;
|
LOADLIBRARYEXWPROC real_LoadLibraryExW = LoadLibraryExW;
|
||||||
|
|
||||||
static hook_list g_hooks[] =
|
static HOOKLIST g_hooks[] =
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
"user32.dll",
|
"user32.dll",
|
||||||
@ -106,19 +106,19 @@ static hook_list g_hooks[] =
|
|||||||
|
|
||||||
void hook_patch_iat(HMODULE hmod, BOOL unhook, char* module_name, char* function_name, PROC new_function)
|
void hook_patch_iat(HMODULE hmod, BOOL unhook, char* module_name, char* function_name, PROC new_function)
|
||||||
{
|
{
|
||||||
hook_list hooks[2];
|
HOOKLIST hooks[2];
|
||||||
memset(&hooks, 0, sizeof(hooks));
|
memset(&hooks, 0, sizeof(hooks));
|
||||||
|
|
||||||
hooks[0].enabled = TRUE;
|
hooks[0].enabled = TRUE;
|
||||||
hooks[0].data[0].new_function = new_function;
|
hooks[0].data[0].new_function = new_function;
|
||||||
|
|
||||||
strncpy(hooks[0].module_name, module_name, sizeof(hooks[0].module_name)-1);
|
strncpy(hooks[0].module_name, module_name, sizeof(hooks[0].module_name) - 1);
|
||||||
strncpy(hooks[0].data[0].function_name, function_name, sizeof(hooks[0].data[0].function_name) - 1);
|
strncpy(hooks[0].data[0].function_name, function_name, sizeof(hooks[0].data[0].function_name) - 1);
|
||||||
|
|
||||||
hook_patch_iat_list(hmod, unhook, (hook_list*)&hooks);
|
hook_patch_iat_list(hmod, unhook, (HOOKLIST*)&hooks);
|
||||||
}
|
}
|
||||||
|
|
||||||
void hook_patch_iat_list(HMODULE hmod, BOOL unhook, hook_list* hooks)
|
void hook_patch_iat_list(HMODULE hmod, BOOL unhook, HOOKLIST* hooks)
|
||||||
{
|
{
|
||||||
if (!hmod || hmod == INVALID_HANDLE_VALUE || !hooks)
|
if (!hmod || hmod == INVALID_HANDLE_VALUE || !hooks)
|
||||||
return;
|
return;
|
||||||
@ -219,7 +219,7 @@ void hook_patch_iat_list(HMODULE hmod, BOOL unhook, hook_list* hooks)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void hook_create(hook_list* hooks)
|
void hook_create(HOOKLIST* hooks)
|
||||||
{
|
{
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
if (g_hook_method == 2)
|
if (g_hook_method == 2)
|
||||||
@ -270,7 +270,7 @@ void hook_create(hook_list* hooks)
|
|||||||
|
|
||||||
if (GetModuleFileNameA(hmod, mod_path, MAX_PATH))
|
if (GetModuleFileNameA(hmod, mod_path, MAX_PATH))
|
||||||
{
|
{
|
||||||
dprintfex("Module %s = %p\n", mod_path, hmod);
|
TRACE_EXT("Module %s = %p\n", mod_path, hmod);
|
||||||
|
|
||||||
_splitpath(mod_path, NULL, mod_dir, mod_filename, NULL);
|
_splitpath(mod_path, NULL, mod_dir, mod_filename, NULL);
|
||||||
|
|
||||||
@ -298,7 +298,7 @@ void hook_create(hook_list* hooks)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void hook_revert(hook_list* hooks)
|
void hook_revert(HOOKLIST* hooks)
|
||||||
{
|
{
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
if (g_hook_method == 2)
|
if (g_hook_method == 2)
|
||||||
@ -375,7 +375,8 @@ void hook_init()
|
|||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
if (!g_hook_active && g_hook_method == 3)
|
if (!g_hook_active && g_hook_method == 3)
|
||||||
{
|
{
|
||||||
real_DirectInputCreateA = (DIRECTINPUTCREATEAPROC)GetProcAddress(LoadLibraryA("dinput.dll"), "DirectInputCreateA");
|
real_DirectInputCreateA =
|
||||||
|
(DIRECTINPUTCREATEAPROC)GetProcAddress(LoadLibraryA("dinput.dll"), "DirectInputCreateA");
|
||||||
|
|
||||||
if (real_DirectInputCreateA)
|
if (real_DirectInputCreateA)
|
||||||
{
|
{
|
||||||
@ -385,7 +386,8 @@ void hook_init()
|
|||||||
DetourTransactionCommit();
|
DetourTransactionCommit();
|
||||||
}
|
}
|
||||||
|
|
||||||
real_DirectInputCreateW = (DIRECTINPUTCREATEWPROC)GetProcAddress(LoadLibraryA("dinput.dll"), "DirectInputCreateW");
|
real_DirectInputCreateW =
|
||||||
|
(DIRECTINPUTCREATEWPROC)GetProcAddress(LoadLibraryA("dinput.dll"), "DirectInputCreateW");
|
||||||
|
|
||||||
if (real_DirectInputCreateW)
|
if (real_DirectInputCreateW)
|
||||||
{
|
{
|
||||||
@ -395,7 +397,8 @@ void hook_init()
|
|||||||
DetourTransactionCommit();
|
DetourTransactionCommit();
|
||||||
}
|
}
|
||||||
|
|
||||||
real_DirectInputCreateEx = (DIRECTINPUTCREATEEXPROC)GetProcAddress(LoadLibraryA("dinput.dll"), "DirectInputCreateEx");
|
real_DirectInputCreateEx =
|
||||||
|
(DIRECTINPUTCREATEEXPROC)GetProcAddress(LoadLibraryA("dinput.dll"), "DirectInputCreateEx");
|
||||||
|
|
||||||
if (real_DirectInputCreateEx)
|
if (real_DirectInputCreateEx)
|
||||||
{
|
{
|
||||||
@ -405,7 +408,8 @@ void hook_init()
|
|||||||
DetourTransactionCommit();
|
DetourTransactionCommit();
|
||||||
}
|
}
|
||||||
|
|
||||||
real_DirectInput8Create = (DIRECTINPUT8CREATEPROC)GetProcAddress(LoadLibraryA("dinput8.dll"), "DirectInput8Create");
|
real_DirectInput8Create =
|
||||||
|
(DIRECTINPUT8CREATEPROC)GetProcAddress(LoadLibraryA("dinput8.dll"), "DirectInput8Create");
|
||||||
|
|
||||||
if (real_DirectInput8Create)
|
if (real_DirectInput8Create)
|
||||||
{
|
{
|
||||||
@ -430,7 +434,7 @@ void hook_init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hook_create((hook_list*)&g_hooks);
|
hook_create((HOOKLIST*)&g_hooks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -486,7 +490,7 @@ void hook_exit()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
hook_revert((hook_list*)&g_hooks);
|
hook_revert((HOOKLIST*)&g_hooks);
|
||||||
}
|
}
|
||||||
|
|
||||||
hook_patch_iat(GetModuleHandle(NULL), TRUE, "dinput.dll", "DirectInputCreateA", (PROC)fake_DirectInputCreateA);
|
hook_patch_iat(GetModuleHandle(NULL), TRUE, "dinput.dll", "DirectInputCreateA", (PROC)fake_DirectInputCreateA);
|
||||||
|
16
src/mouse.c
16
src/mouse.c
@ -14,17 +14,17 @@ void mouse_lock()
|
|||||||
if (g_ddraw->devmode)
|
if (g_ddraw->devmode)
|
||||||
{
|
{
|
||||||
if (g_ddraw->handlemouse)
|
if (g_ddraw->handlemouse)
|
||||||
while(real_ShowCursor(FALSE) >= 0);
|
while (real_ShowCursor(FALSE) >= 0);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_hook_active && !g_ddraw->locked)
|
if (g_hook_active && !g_ddraw->locked)
|
||||||
{
|
{
|
||||||
// Get the window client area.
|
/* Get the window client area */
|
||||||
real_GetClientRect(g_ddraw->hwnd, &rc);
|
real_GetClientRect(g_ddraw->hwnd, &rc);
|
||||||
|
|
||||||
if(g_ddraw->adjmouse)
|
if (g_ddraw->adjmouse)
|
||||||
{
|
{
|
||||||
rc.right = g_ddraw->render.viewport.width;
|
rc.right = g_ddraw->render.viewport.width;
|
||||||
rc.bottom = g_ddraw->render.viewport.height;
|
rc.bottom = g_ddraw->render.viewport.height;
|
||||||
@ -35,7 +35,7 @@ void mouse_lock()
|
|||||||
rc.bottom = g_ddraw->height;
|
rc.bottom = g_ddraw->height;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert the client area to screen coordinates.
|
/* Convert the client area to screen coordinates */
|
||||||
POINT pt = { rc.left, rc.top };
|
POINT pt = { rc.left, rc.top };
|
||||||
POINT pt2 = { rc.right, rc.bottom };
|
POINT pt2 = { rc.right, rc.bottom };
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ void mouse_lock()
|
|||||||
|
|
||||||
rc.bottom -= (LONG)((g_ddraw->mouse_y_adjust * 2) * g_ddraw->render.scale_h);
|
rc.bottom -= (LONG)((g_ddraw->mouse_y_adjust * 2) * g_ddraw->render.scale_h);
|
||||||
|
|
||||||
if(g_ddraw->adjmouse)
|
if (g_ddraw->adjmouse)
|
||||||
{
|
{
|
||||||
real_SetCursorPos(
|
real_SetCursorPos(
|
||||||
(int)(rc.left + (g_ddraw->cursor.x * g_ddraw->render.scale_w)),
|
(int)(rc.left + (g_ddraw->cursor.x * g_ddraw->render.scale_w)),
|
||||||
@ -84,7 +84,7 @@ void mouse_unlock()
|
|||||||
if (g_ddraw->devmode)
|
if (g_ddraw->devmode)
|
||||||
{
|
{
|
||||||
if (g_ddraw->handlemouse)
|
if (g_ddraw->handlemouse)
|
||||||
while(real_ShowCursor(TRUE) < 0);
|
while (real_ShowCursor(TRUE) < 0);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -98,10 +98,10 @@ void mouse_unlock()
|
|||||||
{
|
{
|
||||||
g_ddraw->locked = FALSE;
|
g_ddraw->locked = FALSE;
|
||||||
|
|
||||||
// Get the window client area.
|
/* Get the window client area */
|
||||||
real_GetClientRect(g_ddraw->hwnd, &rc);
|
real_GetClientRect(g_ddraw->hwnd, &rc);
|
||||||
|
|
||||||
// Convert the client area to screen coordinates.
|
/* Convert the client area to screen coordinates */
|
||||||
POINT pt = { rc.left, rc.top };
|
POINT pt = { rc.left, rc.top };
|
||||||
POINT pt2 = { rc.right, rc.bottom };
|
POINT pt2 = { rc.right, rc.bottom };
|
||||||
|
|
||||||
|
@ -131,7 +131,6 @@ BOOL oglu_load_dll()
|
|||||||
|
|
||||||
void oglu_init()
|
void oglu_init()
|
||||||
{
|
{
|
||||||
// Program
|
|
||||||
glCreateProgram = (PFNGLCREATEPROGRAMPROC)xwglGetProcAddress("glCreateProgram");
|
glCreateProgram = (PFNGLCREATEPROGRAMPROC)xwglGetProcAddress("glCreateProgram");
|
||||||
glDeleteProgram = (PFNGLDELETEPROGRAMPROC)xwglGetProcAddress("glDeleteProgram");
|
glDeleteProgram = (PFNGLDELETEPROGRAMPROC)xwglGetProcAddress("glDeleteProgram");
|
||||||
glUseProgram = (PFNGLUSEPROGRAMPROC)xwglGetProcAddress("glUseProgram");
|
glUseProgram = (PFNGLUSEPROGRAMPROC)xwglGetProcAddress("glUseProgram");
|
||||||
@ -190,10 +189,10 @@ void oglu_init()
|
|||||||
|
|
||||||
glTexBuffer = (PFNGLTEXBUFFERPROC)xwglGetProcAddress("glTexBuffer");
|
glTexBuffer = (PFNGLTEXBUFFERPROC)xwglGetProcAddress("glTexBuffer");
|
||||||
|
|
||||||
char *glversion = (char *)glGetString(GL_VERSION);
|
char* glversion = (char*)glGetString(GL_VERSION);
|
||||||
if (glversion)
|
if (glversion)
|
||||||
{
|
{
|
||||||
strncpy(g_oglu_version, glversion, sizeof(g_oglu_version)-1);
|
strncpy(g_oglu_version, glversion, sizeof(g_oglu_version) - 1);
|
||||||
const char deli[2] = " ";
|
const char deli[2] = " ";
|
||||||
strtok(g_oglu_version, deli);
|
strtok(g_oglu_version, deli);
|
||||||
}
|
}
|
||||||
@ -217,9 +216,9 @@ void oglu_init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL oglu_ext_exists(char *ext, HDC hdc)
|
BOOL oglu_ext_exists(char* ext, HDC hdc)
|
||||||
{
|
{
|
||||||
char *glext = (char *)glGetString(GL_EXTENSIONS);
|
char* glext = (char*)glGetString(GL_EXTENSIONS);
|
||||||
|
|
||||||
if (glext)
|
if (glext)
|
||||||
{
|
{
|
||||||
@ -229,7 +228,7 @@ BOOL oglu_ext_exists(char *ext, HDC hdc)
|
|||||||
|
|
||||||
if (wglGetExtensionsStringARB)
|
if (wglGetExtensionsStringARB)
|
||||||
{
|
{
|
||||||
char *wglext = (char *)wglGetExtensionsStringARB(hdc);
|
char* wglext = (char*)wglGetExtensionsStringARB(hdc);
|
||||||
|
|
||||||
if (wglext)
|
if (wglext)
|
||||||
{
|
{
|
||||||
@ -241,7 +240,7 @@ BOOL oglu_ext_exists(char *ext, HDC hdc)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLuint oglu_build_program(const GLchar *vert_source, const GLchar *frag_source)
|
GLuint oglu_build_program(const GLchar* vert_source, const GLchar* frag_source)
|
||||||
{
|
{
|
||||||
if (!glCreateShader || !glShaderSource || !glCompileShader || !glCreateProgram ||
|
if (!glCreateShader || !glShaderSource || !glCompileShader || !glCreateProgram ||
|
||||||
!glAttachShader || !glLinkProgram || !glUseProgram || !glDetachShader)
|
!glAttachShader || !glLinkProgram || !glUseProgram || !glDetachShader)
|
||||||
@ -317,30 +316,30 @@ GLuint oglu_build_program(const GLchar *vert_source, const GLchar *frag_source)
|
|||||||
return program;
|
return program;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLuint oglu_build_program_from_file(const char *file_path, BOOL core_profile)
|
GLuint oglu_build_program_from_file(const char* file_path, BOOL core_profile)
|
||||||
{
|
{
|
||||||
GLuint program = 0;
|
GLuint program = 0;
|
||||||
|
|
||||||
FILE *file = fopen(file_path, "rb");
|
FILE* file = fopen(file_path, "rb");
|
||||||
if (file)
|
if (file)
|
||||||
{
|
{
|
||||||
fseek(file, 0, SEEK_END);
|
fseek(file, 0, SEEK_END);
|
||||||
long file_size = ftell(file);
|
long file_size = ftell(file);
|
||||||
fseek(file, 0, SEEK_SET);
|
fseek(file, 0, SEEK_SET);
|
||||||
|
|
||||||
char *source = file_size > 0 ? calloc(file_size + 1, 1) : NULL;
|
char* source = file_size > 0 ? calloc(file_size + 1, 1) : NULL;
|
||||||
|
|
||||||
if (source)
|
if (source)
|
||||||
{
|
{
|
||||||
fread(source, file_size, 1, file);
|
fread(source, file_size, 1, file);
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
|
||||||
char *vert_source = calloc(file_size + 50, 1);
|
char* vert_source = calloc(file_size + 50, 1);
|
||||||
char *frag_source = calloc(file_size + 50, 1);
|
char* frag_source = calloc(file_size + 50, 1);
|
||||||
|
|
||||||
if (frag_source && vert_source)
|
if (frag_source && vert_source)
|
||||||
{
|
{
|
||||||
char *version_start = strstr(source, "#version");
|
char* version_start = strstr(source, "#version");
|
||||||
|
|
||||||
if (version_start)
|
if (version_start)
|
||||||
{
|
{
|
||||||
@ -354,7 +353,7 @@ GLuint oglu_build_program_from_file(const char *file_path, BOOL core_profile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char deli[2] = "\n";
|
const char deli[2] = "\n";
|
||||||
char *version = strtok(version_start, deli);
|
char* version = strtok(version_start, deli);
|
||||||
|
|
||||||
strcpy(vert_source, source);
|
strcpy(vert_source, source);
|
||||||
strcpy(frag_source, source);
|
strcpy(frag_source, source);
|
||||||
|
@ -15,7 +15,7 @@ static BOOL d3d9_create_resouces();
|
|||||||
static BOOL d3d9_set_states();
|
static BOOL d3d9_set_states();
|
||||||
static BOOL d3d9_update_vertices(BOOL upscale_hack, BOOL stretch);
|
static BOOL d3d9_update_vertices(BOOL upscale_hack, BOOL stretch);
|
||||||
|
|
||||||
static d3d9_renderer g_d3d9;
|
static D3D9RENDERER g_d3d9;
|
||||||
|
|
||||||
BOOL d3d9_is_available()
|
BOOL d3d9_is_available()
|
||||||
{
|
{
|
||||||
@ -45,15 +45,15 @@ BOOL d3d9_create()
|
|||||||
{
|
{
|
||||||
if (g_ddraw->nonexclusive)
|
if (g_ddraw->nonexclusive)
|
||||||
{
|
{
|
||||||
int (WINAPI* d3d9_enable_shim)(BOOL) =
|
int (WINAPI * d3d9_enable_shim)(BOOL) =
|
||||||
(int (WINAPI*)(BOOL))GetProcAddress(g_d3d9.hmodule, "Direct3D9EnableMaximizedWindowedModeShim");
|
(int (WINAPI*)(BOOL))GetProcAddress(g_d3d9.hmodule, "Direct3D9EnableMaximizedWindowedModeShim");
|
||||||
|
|
||||||
if (d3d9_enable_shim)
|
if (d3d9_enable_shim)
|
||||||
d3d9_enable_shim(TRUE);
|
d3d9_enable_shim(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
IDirect3D9 *(WINAPI *d3d_create9)(UINT) =
|
IDirect3D9* (WINAPI * d3d_create9)(UINT) =
|
||||||
(IDirect3D9 *(WINAPI *)(UINT))GetProcAddress(g_d3d9.hmodule, "Direct3DCreate9");
|
(IDirect3D9 * (WINAPI*)(UINT))GetProcAddress(g_d3d9.hmodule, "Direct3DCreate9");
|
||||||
|
|
||||||
if (d3d_create9 && (g_d3d9.instance = d3d_create9(D3D_SDK_VERSION)))
|
if (d3d_create9 && (g_d3d9.instance = d3d_create9(D3D_SDK_VERSION)))
|
||||||
{
|
{
|
||||||
@ -78,8 +78,7 @@ BOOL d3d9_create()
|
|||||||
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
|
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
|
||||||
};
|
};
|
||||||
|
|
||||||
int i;
|
for (int i = 0; i < sizeof(behavior_flags) / sizeof(behavior_flags[0]); i++)
|
||||||
for (i = 0; i < sizeof(behavior_flags) / sizeof(behavior_flags[0]); i++)
|
|
||||||
{
|
{
|
||||||
if (SUCCEEDED(
|
if (SUCCEEDED(
|
||||||
IDirect3D9_CreateDevice(
|
IDirect3D9_CreateDevice(
|
||||||
@ -234,7 +233,7 @@ static BOOL d3d9_create_resouces()
|
|||||||
if (g_ddraw->bpp == 8)
|
if (g_ddraw->bpp == 8)
|
||||||
{
|
{
|
||||||
err = err || FAILED(
|
err = err || FAILED(
|
||||||
IDirect3DDevice9_CreatePixelShader(g_d3d9.device, (DWORD *)D3D9_PALETTE_SHADER, &g_d3d9.pixel_shader));
|
IDirect3DDevice9_CreatePixelShader(g_d3d9.device, (DWORD*)D3D9_PALETTE_SHADER, &g_d3d9.pixel_shader));
|
||||||
}
|
}
|
||||||
|
|
||||||
return g_d3d9.vertex_buf && (g_d3d9.pixel_shader || g_ddraw->bpp == 16 || g_ddraw->bpp == 32) && !err;
|
return g_d3d9.vertex_buf && (g_d3d9.pixel_shader || g_ddraw->bpp == 16 || g_ddraw->bpp == 32) && !err;
|
||||||
@ -246,11 +245,11 @@ static BOOL d3d9_set_states()
|
|||||||
|
|
||||||
err = err || FAILED(IDirect3DDevice9_SetFVF(g_d3d9.device, D3DFVF_XYZRHW | D3DFVF_TEX1));
|
err = err || FAILED(IDirect3DDevice9_SetFVF(g_d3d9.device, D3DFVF_XYZRHW | D3DFVF_TEX1));
|
||||||
err = err || FAILED(IDirect3DDevice9_SetStreamSource(g_d3d9.device, 0, g_d3d9.vertex_buf, 0, sizeof(CUSTOMVERTEX)));
|
err = err || FAILED(IDirect3DDevice9_SetStreamSource(g_d3d9.device, 0, g_d3d9.vertex_buf, 0, sizeof(CUSTOMVERTEX)));
|
||||||
err = err || FAILED(IDirect3DDevice9_SetTexture(g_d3d9.device, 0, (IDirect3DBaseTexture9 *)g_d3d9.surface_tex[0]));
|
err = err || FAILED(IDirect3DDevice9_SetTexture(g_d3d9.device, 0, (IDirect3DBaseTexture9*)g_d3d9.surface_tex[0]));
|
||||||
|
|
||||||
if (g_ddraw->bpp == 8)
|
if (g_ddraw->bpp == 8)
|
||||||
{
|
{
|
||||||
err = err || FAILED(IDirect3DDevice9_SetTexture(g_d3d9.device, 1, (IDirect3DBaseTexture9 *)g_d3d9.palette_tex[0]));
|
err = err || FAILED(IDirect3DDevice9_SetTexture(g_d3d9.device, 1, (IDirect3DBaseTexture9*)g_d3d9.palette_tex[0]));
|
||||||
err = err || FAILED(IDirect3DDevice9_SetPixelShader(g_d3d9.device, g_d3d9.pixel_shader));
|
err = err || FAILED(IDirect3DDevice9_SetPixelShader(g_d3d9.device, g_d3d9.pixel_shader));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -294,7 +293,7 @@ static BOOL d3d9_update_vertices(BOOL upscale_hack, BOOL stretch)
|
|||||||
{ vp_w - 0.5f, vp_y - 0.5f, 0.0f, 1.0f, s_w, 0.0f }
|
{ vp_w - 0.5f, vp_y - 0.5f, 0.0f, 1.0f, s_w, 0.0f }
|
||||||
};
|
};
|
||||||
|
|
||||||
void *data;
|
void* data;
|
||||||
if (g_d3d9.vertex_buf && SUCCEEDED(IDirect3DVertexBuffer9_Lock(g_d3d9.vertex_buf, 0, 0, (void**)&data, 0)))
|
if (g_d3d9.vertex_buf && SUCCEEDED(IDirect3DVertexBuffer9_Lock(g_d3d9.vertex_buf, 0, 0, (void**)&data, 0)))
|
||||||
{
|
{
|
||||||
memcpy(data, vertices, sizeof(vertices));
|
memcpy(data, vertices, sizeof(vertices));
|
||||||
@ -354,11 +353,11 @@ DWORD WINAPI d3d9_render_main(void)
|
|||||||
|
|
||||||
RECT rc = { 0, 0, g_ddraw->width, g_ddraw->height };
|
RECT rc = { 0, 0, g_ddraw->width, g_ddraw->height };
|
||||||
|
|
||||||
if (SUCCEEDED(IDirect3DDevice9_SetTexture(g_d3d9.device, 0, (IDirect3DBaseTexture9 *)g_d3d9.surface_tex[tex_index])) &&
|
if (SUCCEEDED(IDirect3DDevice9_SetTexture(g_d3d9.device, 0, (IDirect3DBaseTexture9*)g_d3d9.surface_tex[tex_index])) &&
|
||||||
SUCCEEDED(IDirect3DTexture9_LockRect(g_d3d9.surface_tex[tex_index], 0, &lock_rc, &rc, 0)))
|
SUCCEEDED(IDirect3DTexture9_LockRect(g_d3d9.surface_tex[tex_index], 0, &lock_rc, &rc, 0)))
|
||||||
{
|
{
|
||||||
unsigned char *src = (unsigned char *)g_ddraw->primary->surface;
|
unsigned char* src = (unsigned char*)g_ddraw->primary->surface;
|
||||||
unsigned char *dst = (unsigned char *)lock_rc.pBits;
|
unsigned char* dst = (unsigned char*)lock_rc.pBits;
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < g_ddraw->height; i++)
|
for (i = 0; i < g_ddraw->height; i++)
|
||||||
@ -381,7 +380,7 @@ DWORD WINAPI d3d9_render_main(void)
|
|||||||
|
|
||||||
RECT rc = { 0,0,256,1 };
|
RECT rc = { 0,0,256,1 };
|
||||||
|
|
||||||
if (SUCCEEDED(IDirect3DDevice9_SetTexture(g_d3d9.device, 1, (IDirect3DBaseTexture9 *)g_d3d9.palette_tex[pal_index])) &&
|
if (SUCCEEDED(IDirect3DDevice9_SetTexture(g_d3d9.device, 1, (IDirect3DBaseTexture9*)g_d3d9.palette_tex[pal_index])) &&
|
||||||
SUCCEEDED(IDirect3DTexture9_LockRect(g_d3d9.palette_tex[pal_index], 0, &lock_rc, &rc, 0)))
|
SUCCEEDED(IDirect3DTexture9_LockRect(g_d3d9.palette_tex[pal_index], 0, &lock_rc, &rc, 0)))
|
||||||
{
|
{
|
||||||
memcpy(lock_rc.pBits, g_ddraw->primary->palette->data_rgb, 256 * sizeof(int));
|
memcpy(lock_rc.pBits, g_ddraw->primary->palette->data_rgb, 256 * sizeof(int));
|
||||||
|
@ -24,7 +24,8 @@ DWORD WINAPI gdi_render_main(void)
|
|||||||
PostMessage(g_ddraw->hwnd, WM_AUTORENDERER, 0, 0);
|
PostMessage(g_ddraw->hwnd, WM_AUTORENDERER, 0, 0);
|
||||||
|
|
||||||
_snprintf(
|
_snprintf(
|
||||||
warning_text, sizeof(warning_text),
|
warning_text,
|
||||||
|
sizeof(warning_text),
|
||||||
"-WARNING- Using slow software rendering, please update your graphics card driver (%s)",
|
"-WARNING- Using slow software rendering, please update your graphics card driver (%s)",
|
||||||
strlen(g_oglu_version) > 10 ? "" : g_oglu_version);
|
strlen(g_oglu_version) > 10 ? "" : g_oglu_version);
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ static void ogl_delete_context(HGLRC context);
|
|||||||
static BOOL ogl_texture_upload_test();
|
static BOOL ogl_texture_upload_test();
|
||||||
static BOOL ogl_shader_test();
|
static BOOL ogl_shader_test();
|
||||||
|
|
||||||
static ogl_renderer g_ogl;
|
static OGLRENDERER g_ogl;
|
||||||
|
|
||||||
DWORD WINAPI ogl_render_main(void)
|
DWORD WINAPI ogl_render_main(void)
|
||||||
{
|
{
|
||||||
@ -476,7 +476,16 @@ static void ogl_init_scale_program()
|
|||||||
glBindTexture(GL_TEXTURE_2D, g_ogl.frame_buffer_tex_id);
|
glBindTexture(GL_TEXTURE_2D, g_ogl.frame_buffer_tex_id);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, g_ogl.filter_bilinear ? GL_LINEAR : GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, g_ogl.filter_bilinear ? GL_LINEAR : GL_NEAREST);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, g_ogl.filter_bilinear ? GL_LINEAR : GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, g_ogl.filter_bilinear ? GL_LINEAR : GL_NEAREST);
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, g_ogl.surface_tex_width, g_ogl.surface_tex_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
|
glTexImage2D(
|
||||||
|
GL_TEXTURE_2D,
|
||||||
|
0,
|
||||||
|
GL_RGBA8,
|
||||||
|
g_ogl.surface_tex_width,
|
||||||
|
g_ogl.surface_tex_height,
|
||||||
|
0,
|
||||||
|
GL_RGBA,
|
||||||
|
GL_UNSIGNED_BYTE,
|
||||||
|
0);
|
||||||
|
|
||||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, g_ogl.frame_buffer_tex_id, 0);
|
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, g_ogl.frame_buffer_tex_id, 0);
|
||||||
|
|
||||||
@ -733,7 +742,7 @@ static void ogl_render()
|
|||||||
|
|
||||||
if (g_ogl.scale_program && g_ogl.main_program)
|
if (g_ogl.scale_program && g_ogl.main_program)
|
||||||
{
|
{
|
||||||
// draw surface into framebuffer
|
/* draw surface into framebuffer */
|
||||||
glUseProgram(g_ogl.main_program);
|
glUseProgram(g_ogl.main_program);
|
||||||
|
|
||||||
glViewport(0, 0, g_ddraw->width, g_ddraw->height);
|
glViewport(0, 0, g_ddraw->width, g_ddraw->height);
|
||||||
@ -760,7 +769,7 @@ static void ogl_render()
|
|||||||
g_ddraw->render.viewport.width, g_ddraw->render.viewport.height);
|
g_ddraw->render.viewport.width, g_ddraw->render.viewport.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
// apply filter
|
/* apply filter */
|
||||||
|
|
||||||
glUseProgram(g_ogl.scale_program);
|
glUseProgram(g_ogl.scale_program);
|
||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
@ -784,8 +793,8 @@ static void ogl_render()
|
|||||||
{
|
{
|
||||||
glBegin(GL_TRIANGLE_FAN);
|
glBegin(GL_TRIANGLE_FAN);
|
||||||
glTexCoord2f(0, 0); glVertex2f(-1, 1);
|
glTexCoord2f(0, 0); glVertex2f(-1, 1);
|
||||||
glTexCoord2f(g_ogl.scale_w, 0); glVertex2f( 1, 1);
|
glTexCoord2f(g_ogl.scale_w, 0); glVertex2f(1, 1);
|
||||||
glTexCoord2f(g_ogl.scale_w, g_ogl.scale_h); glVertex2f( 1, -1);
|
glTexCoord2f(g_ogl.scale_w, g_ogl.scale_h); glVertex2f(1, -1);
|
||||||
glTexCoord2f(0, g_ogl.scale_h); glVertex2f(-1, -1);
|
glTexCoord2f(0, g_ogl.scale_h); glVertex2f(-1, -1);
|
||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
@ -935,7 +944,16 @@ static BOOL ogl_shader_test()
|
|||||||
glBindTexture(GL_TEXTURE_2D, fbo_tex_id);
|
glBindTexture(GL_TEXTURE_2D, fbo_tex_id);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, g_ogl.surface_tex_width, g_ogl.surface_tex_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, g_ogl.surface_tex);
|
glTexImage2D(
|
||||||
|
GL_TEXTURE_2D,
|
||||||
|
0,
|
||||||
|
GL_RGBA8,
|
||||||
|
g_ogl.surface_tex_width,
|
||||||
|
g_ogl.surface_tex_height,
|
||||||
|
0,
|
||||||
|
GL_RGBA,
|
||||||
|
GL_UNSIGNED_BYTE,
|
||||||
|
g_ogl.surface_tex);
|
||||||
|
|
||||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fbo_tex_id, 0);
|
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fbo_tex_id, 0);
|
||||||
|
|
||||||
|
@ -45,37 +45,37 @@ static BOOL ss_screenshot_8bit(char* filename, IDirectDrawSurfaceImpl* src)
|
|||||||
static BOOL ss_screenshot_16bit(char* filename, IDirectDrawSurfaceImpl* src)
|
static BOOL ss_screenshot_16bit(char* filename, IDirectDrawSurfaceImpl* src)
|
||||||
{
|
{
|
||||||
unsigned int error = TRUE;
|
unsigned int error = TRUE;
|
||||||
unsigned int* src_buf = malloc(src->width * src->height * 4);
|
unsigned int* dst_buf = malloc(src->width * src->height * 4);
|
||||||
|
|
||||||
if (src_buf)
|
if (dst_buf)
|
||||||
{
|
{
|
||||||
unsigned short* surface = (unsigned short*)dds_GetBuffer(src);
|
unsigned short* src_buf = (unsigned short*)dds_GetBuffer(src);
|
||||||
|
|
||||||
for (int y = 0; y < src->height; y++)
|
for (int y = 0; y < src->height; y++)
|
||||||
{
|
{
|
||||||
int src_y = y * src->width;
|
int dst_row = y * src->width;
|
||||||
|
|
||||||
for (int x = 0; x < src->width; x++)
|
for (int x = 0; x < src->width; x++)
|
||||||
{
|
{
|
||||||
unsigned short pixel = surface[src_y + x];
|
unsigned short pixel = src_buf[dst_row + x];
|
||||||
|
|
||||||
BYTE red = ((pixel & 0xF800) >> 11) << 3;
|
BYTE red = ((pixel & 0xF800) >> 11) << 3;
|
||||||
BYTE green = ((pixel & 0x07E0) >> 5) << 2;
|
BYTE green = ((pixel & 0x07E0) >> 5) << 2;
|
||||||
BYTE blue = ((pixel & 0x001F)) << 3;
|
BYTE blue = ((pixel & 0x001F)) << 3;
|
||||||
|
|
||||||
src_buf[src_y + x] = (0xFF << 24) | (blue << 16) | (green << 8) | red;
|
dst_buf[dst_row + x] = (0xFF << 24) | (blue << 16) | (green << 8) | red;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
error = lodepng_encode32_file(filename, (unsigned char*)src_buf, src->width, src->height);
|
error = lodepng_encode32_file(filename, (unsigned char*)dst_buf, src->width, src->height);
|
||||||
|
|
||||||
free(src_buf);
|
free(dst_buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
return !error;
|
return !error;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL ss_take_screenshot(IDirectDrawSurfaceImpl *src)
|
BOOL ss_take_screenshot(IDirectDrawSurfaceImpl* src)
|
||||||
{
|
{
|
||||||
if (!src || !dds_GetBuffer(src))
|
if (!src || !dds_GetBuffer(src))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -87,7 +87,7 @@ BOOL ss_take_screenshot(IDirectDrawSurfaceImpl *src)
|
|||||||
|
|
||||||
strncpy(title, g_ddraw->title, sizeof(g_ddraw->title));
|
strncpy(title, g_ddraw->title, sizeof(g_ddraw->title));
|
||||||
|
|
||||||
for (int i = 0; i<strlen(title); i++)
|
for (int i = 0; i < strlen(title); i++)
|
||||||
{
|
{
|
||||||
if (title[i] == ' ')
|
if (title[i] == ' ')
|
||||||
{
|
{
|
||||||
@ -111,5 +111,5 @@ BOOL ss_take_screenshot(IDirectDrawSurfaceImpl *src)
|
|||||||
return ss_screenshot_16bit(filename, src);
|
return ss_screenshot_16bit(filename, src);
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
23
src/utils.c
23
src/utils.c
@ -1,5 +1,5 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "ddraw.h"
|
#include <ddraw.h>
|
||||||
#include "dd.h"
|
#include "dd.h"
|
||||||
#include "ddsurface.h"
|
#include "ddsurface.h"
|
||||||
#include "hook.h"
|
#include "hook.h"
|
||||||
@ -16,7 +16,7 @@ void util_limit_game_ticks()
|
|||||||
FILETIME ft = { 0 };
|
FILETIME ft = { 0 };
|
||||||
GetSystemTimeAsFileTime(&ft);
|
GetSystemTimeAsFileTime(&ft);
|
||||||
|
|
||||||
if (CompareFileTime((FILETIME *)&g_ddraw->ticks_limiter.due_time, &ft) == -1)
|
if (CompareFileTime((FILETIME*)&g_ddraw->ticks_limiter.due_time, &ft) == -1)
|
||||||
{
|
{
|
||||||
memcpy(&g_ddraw->ticks_limiter.due_time, &ft, sizeof(LARGE_INTEGER));
|
memcpy(&g_ddraw->ticks_limiter.due_time, &ft, sizeof(LARGE_INTEGER));
|
||||||
}
|
}
|
||||||
@ -148,7 +148,13 @@ void util_update_bnet_pos(int new_x, int new_y)
|
|||||||
old_y = new_y;
|
old_y = new_y;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL util_get_lowest_resolution(float ratio, SIZE *out_res, DWORD min_width, DWORD min_height, DWORD max_width, DWORD max_height)
|
BOOL util_get_lowest_resolution(
|
||||||
|
float ratio,
|
||||||
|
SIZE* out_res,
|
||||||
|
DWORD min_width,
|
||||||
|
DWORD min_height,
|
||||||
|
DWORD max_width,
|
||||||
|
DWORD max_height)
|
||||||
{
|
{
|
||||||
BOOL result = FALSE;
|
BOOL result = FALSE;
|
||||||
int org_ratio = (int)((ratio + 0.005f) * 100);
|
int org_ratio = (int)((ratio + 0.005f) * 100);
|
||||||
@ -229,7 +235,13 @@ void util_toggle_fullscreen()
|
|||||||
mouse_unlock();
|
mouse_unlock();
|
||||||
|
|
||||||
g_config.window_state = g_ddraw->windowed = FALSE;
|
g_config.window_state = g_ddraw->windowed = FALSE;
|
||||||
real_SetWindowLongA(g_ddraw->hwnd, GWL_STYLE, GetWindowLong(g_ddraw->hwnd, GWL_STYLE) & ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU));
|
LONG style = GetWindowLong(g_ddraw->hwnd, GWL_STYLE);
|
||||||
|
|
||||||
|
real_SetWindowLongA(
|
||||||
|
g_ddraw->hwnd,
|
||||||
|
GWL_STYLE,
|
||||||
|
style & ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU));
|
||||||
|
|
||||||
g_ddraw->altenter = TRUE;
|
g_ddraw->altenter = TRUE;
|
||||||
dd_SetDisplayMode(g_ddraw->width, g_ddraw->height, g_ddraw->bpp, FALSE);
|
dd_SetDisplayMode(g_ddraw->width, g_ddraw->height, g_ddraw->bpp, FALSE);
|
||||||
util_update_bnet_pos(0, 0);
|
util_update_bnet_pos(0, 0);
|
||||||
@ -335,7 +347,8 @@ BOOL CALLBACK util_enum_child_proc(HWND hwnd, LPARAM lparam)
|
|||||||
|
|
||||||
static unsigned char util_get_pixel(int x, int y)
|
static unsigned char util_get_pixel(int x, int y)
|
||||||
{
|
{
|
||||||
return ((unsigned char*)dds_GetBuffer(g_ddraw->primary))[y * g_ddraw->primary->l_pitch + x * g_ddraw->primary->lx_pitch];
|
return ((unsigned char*)dds_GetBuffer(
|
||||||
|
g_ddraw->primary))[y * g_ddraw->primary->l_pitch + x * g_ddraw->primary->lx_pitch];
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL util_detect_low_res_screen()
|
BOOL util_detect_low_res_screen()
|
||||||
|
@ -20,9 +20,9 @@ BOOL WINAPI fake_GetCursorPos(LPPOINT lpPoint)
|
|||||||
realpt.x = pt.x;
|
realpt.x = pt.x;
|
||||||
realpt.y = pt.y;
|
realpt.y = pt.y;
|
||||||
|
|
||||||
if(g_ddraw->locked && (!g_ddraw->windowed || real_ScreenToClient(g_ddraw->hwnd, &pt)))
|
if (g_ddraw->locked && (!g_ddraw->windowed || real_ScreenToClient(g_ddraw->hwnd, &pt)))
|
||||||
{
|
{
|
||||||
//fallback solution for possible ClipCursor failure
|
/* fallback solution for possible ClipCursor failure */
|
||||||
int diffx = 0, diffy = 0;
|
int diffx = 0, diffy = 0;
|
||||||
|
|
||||||
int max_width = g_ddraw->adjmouse ? g_ddraw->render.viewport.width : g_ddraw->width;
|
int max_width = g_ddraw->adjmouse ? g_ddraw->render.viewport.width : g_ddraw->width;
|
||||||
@ -56,7 +56,7 @@ BOOL WINAPI fake_GetCursorPos(LPPOINT lpPoint)
|
|||||||
real_SetCursorPos(realpt.x - diffx, realpt.y - diffy);
|
real_SetCursorPos(realpt.x - diffx, realpt.y - diffy);
|
||||||
|
|
||||||
|
|
||||||
if(g_ddraw->adjmouse)
|
if (g_ddraw->adjmouse)
|
||||||
{
|
{
|
||||||
g_ddraw->cursor.x = (DWORD)(pt.x * g_ddraw->render.unscale_w);
|
g_ddraw->cursor.x = (DWORD)(pt.x * g_ddraw->render.unscale_w);
|
||||||
g_ddraw->cursor.y = (DWORD)(pt.y * g_ddraw->render.unscale_h);
|
g_ddraw->cursor.y = (DWORD)(pt.y * g_ddraw->render.unscale_h);
|
||||||
@ -98,9 +98,9 @@ BOOL WINAPI fake_GetCursorPos(LPPOINT lpPoint)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL WINAPI fake_ClipCursor(const RECT *lpRect)
|
BOOL WINAPI fake_ClipCursor(const RECT* lpRect)
|
||||||
{
|
{
|
||||||
if(lpRect)
|
if (lpRect)
|
||||||
{
|
{
|
||||||
/* hack for 640x480 mode */
|
/* hack for 640x480 mode */
|
||||||
if (lpRect->bottom == 400 && g_ddraw && g_ddraw->height == 480)
|
if (lpRect->bottom == 400 && g_ddraw && g_ddraw->height == 480)
|
||||||
@ -315,7 +315,7 @@ LRESULT WINAPI fake_SendMessageA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPar
|
|||||||
|
|
||||||
if (result && g_ddraw && Msg == CB_GETDROPPEDCONTROLRECT)
|
if (result && g_ddraw && Msg == CB_GETDROPPEDCONTROLRECT)
|
||||||
{
|
{
|
||||||
RECT *rc = (RECT *)lParam;
|
RECT* rc = (RECT*)lParam;
|
||||||
if (rc)
|
if (rc)
|
||||||
real_MapWindowPoints(HWND_DESKTOP, g_ddraw->hwnd, (LPPOINT)rc, 2);
|
real_MapWindowPoints(HWND_DESKTOP, g_ddraw->hwnd, (LPPOINT)rc, 2);
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
dprintf(
|
TRACE(
|
||||||
" uMsg = %s (%d), wParam = %08X (%d), lParam = %08X (%d)\n",
|
" uMsg = %s (%d), wParam = %08X (%d), lParam = %08X (%d)\n",
|
||||||
dbg_mes_to_str(uMsg),
|
dbg_mes_to_str(uMsg),
|
||||||
uMsg,
|
uMsg,
|
||||||
@ -31,7 +31,7 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
|||||||
static BOOL in_size_move = FALSE;
|
static BOOL in_size_move = FALSE;
|
||||||
static int redraw_count = 0;
|
static int redraw_count = 0;
|
||||||
|
|
||||||
switch(uMsg)
|
switch (uMsg)
|
||||||
{
|
{
|
||||||
case WM_GETMINMAXINFO:
|
case WM_GETMINMAXINFO:
|
||||||
case WM_MOVING:
|
case WM_MOVING:
|
||||||
@ -169,9 +169,12 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
|||||||
}
|
}
|
||||||
case WM_WINDOWPOSCHANGED:
|
case WM_WINDOWPOSCHANGED:
|
||||||
{
|
{
|
||||||
WINDOWPOS *pos = (WINDOWPOS *)lParam;
|
WINDOWPOS* pos = (WINDOWPOS*)lParam;
|
||||||
|
|
||||||
if (g_ddraw->wine && !g_ddraw->windowed && (pos->x > 0 || pos->y > 0) && g_ddraw->last_set_window_pos_tick + 500 < timeGetTime())
|
if (g_ddraw->wine &&
|
||||||
|
!g_ddraw->windowed &&
|
||||||
|
(pos->x > 0 || pos->y > 0) &&
|
||||||
|
g_ddraw->last_set_window_pos_tick + 500 < timeGetTime())
|
||||||
{
|
{
|
||||||
PostMessage(g_ddraw->hwnd, WM_WINEFULLSCREEN, 0, 0);
|
PostMessage(g_ddraw->hwnd, WM_WINEFULLSCREEN, 0, 0);
|
||||||
}
|
}
|
||||||
@ -183,8 +186,24 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
|||||||
if (!g_ddraw->windowed)
|
if (!g_ddraw->windowed)
|
||||||
{
|
{
|
||||||
g_ddraw->last_set_window_pos_tick = timeGetTime();
|
g_ddraw->last_set_window_pos_tick = timeGetTime();
|
||||||
real_SetWindowPos(g_ddraw->hwnd, HWND_TOPMOST, 1, 1, g_ddraw->render.width, g_ddraw->render.height, SWP_SHOWWINDOW);
|
|
||||||
real_SetWindowPos(g_ddraw->hwnd, HWND_TOPMOST, 0, 0, g_ddraw->render.width, g_ddraw->render.height, SWP_SHOWWINDOW);
|
real_SetWindowPos(
|
||||||
|
g_ddraw->hwnd,
|
||||||
|
HWND_TOPMOST,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
g_ddraw->render.width,
|
||||||
|
g_ddraw->render.height,
|
||||||
|
SWP_SHOWWINDOW);
|
||||||
|
|
||||||
|
real_SetWindowPos(
|
||||||
|
g_ddraw->hwnd,
|
||||||
|
HWND_TOPMOST,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
g_ddraw->render.width,
|
||||||
|
g_ddraw->render.height,
|
||||||
|
SWP_SHOWWINDOW);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -209,7 +228,7 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
|||||||
}
|
}
|
||||||
case WM_SIZING:
|
case WM_SIZING:
|
||||||
{
|
{
|
||||||
RECT *windowrc = (RECT *)lParam;
|
RECT* windowrc = (RECT*)lParam;
|
||||||
|
|
||||||
if (g_ddraw->windowed)
|
if (g_ddraw->windowed)
|
||||||
{
|
{
|
||||||
@ -228,7 +247,7 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
|||||||
|
|
||||||
RECT clientrc = { 0 };
|
RECT clientrc = { 0 };
|
||||||
|
|
||||||
// maintain aspect ratio
|
/* maintain aspect ratio */
|
||||||
if (g_ddraw->maintas &&
|
if (g_ddraw->maintas &&
|
||||||
CopyRect(&clientrc, windowrc) &&
|
CopyRect(&clientrc, windowrc) &&
|
||||||
util_unadjust_window_rect(&clientrc, GetWindowLong(hWnd, GWL_STYLE), FALSE, GetWindowLong(hWnd, GWL_EXSTYLE)) &&
|
util_unadjust_window_rect(&clientrc, GetWindowLong(hWnd, GWL_STYLE), FALSE, GetWindowLong(hWnd, GWL_EXSTYLE)) &&
|
||||||
@ -262,7 +281,7 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//enforce minimum window size
|
/* enforce minimum window size */
|
||||||
if (CopyRect(&clientrc, windowrc) &&
|
if (CopyRect(&clientrc, windowrc) &&
|
||||||
util_unadjust_window_rect(&clientrc, GetWindowLong(hWnd, GWL_STYLE), FALSE, GetWindowLong(hWnd, GWL_EXSTYLE)) &&
|
util_unadjust_window_rect(&clientrc, GetWindowLong(hWnd, GWL_STYLE), FALSE, GetWindowLong(hWnd, GWL_EXSTYLE)) &&
|
||||||
SetRect(&clientrc, 0, 0, clientrc.right - clientrc.left, clientrc.bottom - clientrc.top))
|
SetRect(&clientrc, 0, 0, clientrc.right - clientrc.left, clientrc.bottom - clientrc.top))
|
||||||
@ -314,7 +333,7 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//save new window position
|
/* save new window position */
|
||||||
if (CopyRect(&clientrc, windowrc) &&
|
if (CopyRect(&clientrc, windowrc) &&
|
||||||
util_unadjust_window_rect(&clientrc, GetWindowLong(hWnd, GWL_STYLE), FALSE, GetWindowLong(hWnd, GWL_EXSTYLE)))
|
util_unadjust_window_rect(&clientrc, GetWindowLong(hWnd, GWL_STYLE), FALSE, GetWindowLong(hWnd, GWL_EXSTYLE)))
|
||||||
{
|
{
|
||||||
@ -375,7 +394,7 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
|||||||
if (in_size_move || g_ddraw->wine)
|
if (in_size_move || g_ddraw->wine)
|
||||||
{
|
{
|
||||||
if (x != -32000)
|
if (x != -32000)
|
||||||
g_config.window_rect.left = x; // -32000 = Exit/Minimize
|
g_config.window_rect.left = x; /* -32000 = Exit/Minimize */
|
||||||
|
|
||||||
if (y != -32000)
|
if (y != -32000)
|
||||||
g_config.window_rect.top = y;
|
g_config.window_rect.top = y;
|
||||||
@ -387,7 +406,6 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
|||||||
|
|
||||||
return DefWindowProc(hWnd, uMsg, wParam, lParam); /* Carmageddon fix */
|
return DefWindowProc(hWnd, uMsg, wParam, lParam); /* Carmageddon fix */
|
||||||
}
|
}
|
||||||
|
|
||||||
case WM_NCMOUSELEAVE:
|
case WM_NCMOUSELEAVE:
|
||||||
{
|
{
|
||||||
if (!g_ddraw->wine) /* hack: disable aero snap */
|
if (!g_ddraw->wine) /* hack: disable aero snap */
|
||||||
@ -402,7 +420,7 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case WM_SYSCOMMAND:
|
case WM_SYSCOMMAND:
|
||||||
|
{
|
||||||
if ((wParam & ~0x0F) == SC_MOVE && !g_ddraw->wine) /* hack: disable aero snap */
|
if ((wParam & ~0x0F) == SC_MOVE && !g_ddraw->wine) /* hack: disable aero snap */
|
||||||
{
|
{
|
||||||
LONG style = GetWindowLong(g_ddraw->hwnd, GWL_STYLE);
|
LONG style = GetWindowLong(g_ddraw->hwnd, GWL_STYLE);
|
||||||
@ -435,13 +453,13 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
|||||||
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
//workaround for a bug where sometimes a background window steals the focus
|
|
||||||
case WM_WINDOWPOSCHANGING:
|
case WM_WINDOWPOSCHANGING:
|
||||||
{
|
{
|
||||||
|
/* workaround for a bug where sometimes a background window steals the focus */
|
||||||
if (g_ddraw->locked)
|
if (g_ddraw->locked)
|
||||||
{
|
{
|
||||||
WINDOWPOS *pos = (WINDOWPOS *)lParam;
|
WINDOWPOS* pos = (WINDOWPOS*)lParam;
|
||||||
|
|
||||||
if (pos->flags == SWP_NOMOVE + SWP_NOSIZE)
|
if (pos->flags == SWP_NOMOVE + SWP_NOSIZE)
|
||||||
{
|
{
|
||||||
@ -453,7 +471,6 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case WM_MOUSELEAVE:
|
case WM_MOUSELEAVE:
|
||||||
{
|
{
|
||||||
mouse_unlock();
|
mouse_unlock();
|
||||||
@ -690,7 +707,7 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
|
|||||||
{
|
{
|
||||||
switch (LOWORD(wParam))
|
switch (LOWORD(wParam))
|
||||||
{
|
{
|
||||||
case WM_DESTROY: //Workaround for invisible menu on Load/Save/Delete in Tiberian Sun
|
case WM_DESTROY: /* Workaround for invisible menu on Load/Save/Delete in Tiberian Sun */
|
||||||
redraw_count = 2;
|
redraw_count = 2;
|
||||||
break;
|
break;
|
||||||
case WM_LBUTTONDOWN:
|
case WM_LBUTTONDOWN:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user