102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
Loading...
Searching...
No Matches
graphics_com_private.h File Reference
#include <d3d.h>
#include <ddraw.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <windows.h>

Go to the source code of this file.

Data Structures

struct  DTTR_Graphics_COM_Direct3DDevice7_VT
struct  DTTR_Graphics_COM_Direct3DDevice7
struct  DTTR_Graphics_COM_DirectDraw7_VT
struct  DTTR_Graphics_COM_DirectDraw7
struct  DTTR_Graphics_COM_Direct3D7_VT
struct  DTTR_Graphics_COM_Direct3D7
struct  DTTR_Graphics_COM_Direct3DTexture2_VT
struct  DTTR_Graphics_COM_Direct3DTexture2
struct  DTTR_Graphics_COM_DirectDrawSurface7_VT
struct  DTTR_Graphics_COM_DirectDrawSurface7

Macros

#define DTTR_SIZEOF_D3DDEVICEDESC7   224
#define DTTR_SIZEOF_D3DMATERIAL7   76
#define DTTR_SIZEOF_D3DLIGHT7   104
#define DTTR_SIZEOF_D3DCLIPSTATUS   8
#define DTTR_SIZEOF_DDPIXELFORMAT   32
#define DTTR_SIZEOF_DDSCAPS2   16
#define DTTR_SIZEOF_DDSURFACEDESC   108
#define DTTR_SIZEOF_DDSURFACEDESC2   124
#define DTTR_SIZEOF_DDDEVICEIDENTIFIER2   1084
#define DTTR_DDBD_16   0x00000400
#define DTTR_DDBD_32   0x00000200
#define DTTR_DDERR_GENERIC   0x887601C2
#define DTTR_D3DFVF_POSITION_MASK   0x400E
#define DTTR_D3DFVF_XYZ   0x0002
#define DTTR_D3DFVF_XYZRHW   0x0004
#define DTTR_D3DFVF_XYZB1   0x0006
#define DTTR_D3DFVF_XYZB2   0x0008
#define DTTR_D3DFVF_XYZB3   0x000A
#define DTTR_D3DFVF_XYZB4   0x000C
#define DTTR_D3DFVF_XYZB5   0x000E
#define DTTR_D3DFVF_XYZW   0x4002
#define DTTR_D3DFVF_NORMAL   0x010
#define DTTR_D3DFVF_PSIZE   0x020
#define DTTR_D3DFVF_DIFFUSE   0x040
#define DTTR_D3DFVF_SPECULAR   0x080
#define DTTR_D3DFVF_TEXCOUNT_MASK   0xF00
#define DTTR_D3DFVF_TEXCOUNT_SHIFT   8
#define DTTR_D3DFVF_LASTBETA_UBYTE4   0x1000
#define DTTR_D3DFVF_LASTBETA_D3DCOLOR   0x8000
#define DTTR_D3DPT_POINTLIST   1
#define DTTR_D3DPT_LINELIST   2
#define DTTR_D3DPT_LINESTRIP   3
#define DTTR_D3DPT_TRIANGLELIST   4
#define DTTR_D3DPT_TRIANGLESTRIP   5
#define DTTR_D3DPT_TRIANGLEFAN   6
#define DTTR_COM_NOOP_HRESULT(fn, ...)
#define DTTR_COM_ADDREF(fn, type)
#define DTTR_COM_RELEASE(fn, type)
#define DTTR_COM_QI_SELF(fn, type)
#define DTTR_COM_STUB_SET(fn, out_type, val, ...)
#define DTTR_COM_STUB_MEMSET(fn, size, buf_type, ...)

Typedefs

typedef struct DTTR_Graphics_COM_Direct3D7 DTTR_Graphics_COM_Direct3D7
typedef struct DTTR_Graphics_COM_Direct3DDevice7 DTTR_Graphics_COM_Direct3DDevice7
typedef struct DTTR_Graphics_COM_DirectDraw7 DTTR_Graphics_COM_DirectDraw7
typedef struct DTTR_Graphics_COM_Direct3DDevice7_VT DTTR_Graphics_COM_Direct3DDevice7_VT
typedef struct DTTR_Graphics_COM_DirectDraw7_VT DTTR_Graphics_COM_DirectDraw7_VT
typedef struct DTTR_Graphics_COM_Direct3D7_VT DTTR_Graphics_COM_Direct3D7_VT
typedef struct DTTR_Graphics_COM_DirectDrawSurface7 DTTR_Graphics_COM_DirectDrawSurface7
typedef struct DTTR_Graphics_COM_Direct3DTexture2 DTTR_Graphics_COM_Direct3DTexture2
typedef struct DTTR_Graphics_COM_Direct3DTexture2_VT DTTR_Graphics_COM_Direct3DTexture2_VT
typedef struct DTTR_Graphics_COM_DirectDrawSurface7_VT DTTR_Graphics_COM_DirectDrawSurface7_VT

Functions

DTTR_Graphics_COM_DirectDraw7dttr_graphics_com_create_directdraw7 ()
DTTR_Graphics_COM_Direct3D7dttr_graphics_com_create_direct3d7 ()
DTTR_Graphics_COM_Direct3DDevice7dttr_graphics_com_create_direct3ddevice7 ()
DTTR_Graphics_COM_DirectDrawSurface7dttr_graphics_com_create_directdrawsurface7 (uint32_t width, uint32_t height, uint32_t bpp, uint32_t r_mask, uint32_t g_mask, uint32_t b_mask, uint32_t a_mask)
HRESULT dttr_graphics_com_validate_directdrawsurface7 (uint32_t width, uint32_t height, uint32_t bpp, uint32_t *out_pitch, size_t *out_pixel_size)
DTTR_Graphics_COM_Direct3DTexture2dttr_graphics_com_create_direct3d_texture2 (DTTR_Graphics_COM_DirectDrawSurface7 *surface)

Macro Definition Documentation

◆ DTTR_COM_ADDREF

#define DTTR_COM_ADDREF ( fn,
type )
Value:
static ULONG __stdcall fn(type *self) { \
return 1; \
}
DTTR_Graphics_COM_Direct3DDevice7 * self
const DTTR_PrimitiveType type

Definition at line 69 of file graphics_com_private.h.

◆ DTTR_COM_NOOP_HRESULT

◆ DTTR_COM_QI_SELF

#define DTTR_COM_QI_SELF ( fn,
type )
Value:
static HRESULT __stdcall fn(type *self, void *riid, void **ppv) { \
if (ppv) \
*ppv = self; \
return S_OK; \
}

Definition at line 79 of file graphics_com_private.h.

◆ DTTR_COM_RELEASE

#define DTTR_COM_RELEASE ( fn,
type )
Value:
static ULONG __stdcall fn(type *self) { \
return 0; \
}

Definition at line 74 of file graphics_com_private.h.

◆ DTTR_COM_STUB_MEMSET

#define DTTR_COM_STUB_MEMSET ( fn,
size,
buf_type,
... )
Value:
static HRESULT __stdcall fn(__VA_ARGS__, buf_type *buf) { \
if (buf) \
memset(buf, 0, size); \
return S_OK; \
}
const DWORD size

Definition at line 93 of file graphics_com_private.h.

Referenced by DTTR_COM_NOOP_HRESULT(), DTTR_COM_NOOP_HRESULT(), DTTR_COM_STUB_MEMSET(), and DTTR_COM_STUB_MEMSET().

◆ DTTR_COM_STUB_SET

#define DTTR_COM_STUB_SET ( fn,
out_type,
val,
... )

◆ DTTR_D3DFVF_DIFFUSE

#define DTTR_D3DFVF_DIFFUSE   0x040

Definition at line 48 of file graphics_com_private.h.

◆ DTTR_D3DFVF_LASTBETA_D3DCOLOR

#define DTTR_D3DFVF_LASTBETA_D3DCOLOR   0x8000

Definition at line 53 of file graphics_com_private.h.

Referenced by if().

◆ DTTR_D3DFVF_LASTBETA_UBYTE4

#define DTTR_D3DFVF_LASTBETA_UBYTE4   0x1000

Definition at line 52 of file graphics_com_private.h.

Referenced by if().

◆ DTTR_D3DFVF_NORMAL

#define DTTR_D3DFVF_NORMAL   0x010

Definition at line 46 of file graphics_com_private.h.

◆ DTTR_D3DFVF_POSITION_MASK

#define DTTR_D3DFVF_POSITION_MASK   0x400E

Definition at line 35 of file graphics_com_private.h.

◆ DTTR_D3DFVF_PSIZE

#define DTTR_D3DFVF_PSIZE   0x020

Definition at line 47 of file graphics_com_private.h.

◆ DTTR_D3DFVF_SPECULAR

#define DTTR_D3DFVF_SPECULAR   0x080

Definition at line 49 of file graphics_com_private.h.

◆ DTTR_D3DFVF_TEXCOUNT_MASK

#define DTTR_D3DFVF_TEXCOUNT_MASK   0xF00

Definition at line 50 of file graphics_com_private.h.

◆ DTTR_D3DFVF_TEXCOUNT_SHIFT

#define DTTR_D3DFVF_TEXCOUNT_SHIFT   8

Definition at line 51 of file graphics_com_private.h.

◆ DTTR_D3DFVF_XYZ

#define DTTR_D3DFVF_XYZ   0x0002

Definition at line 37 of file graphics_com_private.h.

◆ DTTR_D3DFVF_XYZB1

#define DTTR_D3DFVF_XYZB1   0x0006

Definition at line 39 of file graphics_com_private.h.

Referenced by if(), and switch().

◆ DTTR_D3DFVF_XYZB2

#define DTTR_D3DFVF_XYZB2   0x0008

Definition at line 40 of file graphics_com_private.h.

Referenced by switch().

◆ DTTR_D3DFVF_XYZB3

#define DTTR_D3DFVF_XYZB3   0x000A

Definition at line 41 of file graphics_com_private.h.

Referenced by switch().

◆ DTTR_D3DFVF_XYZB4

#define DTTR_D3DFVF_XYZB4   0x000C

Definition at line 42 of file graphics_com_private.h.

Referenced by switch().

◆ DTTR_D3DFVF_XYZB5

#define DTTR_D3DFVF_XYZB5   0x000E

Definition at line 43 of file graphics_com_private.h.

Referenced by if(), and switch().

◆ DTTR_D3DFVF_XYZRHW

#define DTTR_D3DFVF_XYZRHW   0x0004

Definition at line 38 of file graphics_com_private.h.

Referenced by switch().

◆ DTTR_D3DFVF_XYZW

#define DTTR_D3DFVF_XYZW   0x4002

Definition at line 44 of file graphics_com_private.h.

Referenced by switch().

◆ DTTR_D3DPT_LINELIST

#define DTTR_D3DPT_LINELIST   2

Definition at line 58 of file graphics_com_private.h.

Referenced by d3d_device7_map_primitive_type().

◆ DTTR_D3DPT_LINESTRIP

#define DTTR_D3DPT_LINESTRIP   3

Definition at line 59 of file graphics_com_private.h.

Referenced by d3d_device7_map_primitive_type().

◆ DTTR_D3DPT_POINTLIST

#define DTTR_D3DPT_POINTLIST   1

Definition at line 57 of file graphics_com_private.h.

Referenced by d3d_device7_map_primitive_type().

◆ DTTR_D3DPT_TRIANGLEFAN

#define DTTR_D3DPT_TRIANGLEFAN   6

Definition at line 62 of file graphics_com_private.h.

Referenced by d3d_device7_map_primitive_type().

◆ DTTR_D3DPT_TRIANGLELIST

#define DTTR_D3DPT_TRIANGLELIST   4

Definition at line 60 of file graphics_com_private.h.

Referenced by d3d_device7_map_primitive_type().

◆ DTTR_D3DPT_TRIANGLESTRIP

#define DTTR_D3DPT_TRIANGLESTRIP   5

Definition at line 61 of file graphics_com_private.h.

Referenced by d3d_device7_map_primitive_type().

◆ DTTR_DDBD_16

#define DTTR_DDBD_16   0x00000400

Definition at line 26 of file graphics_com_private.h.

Referenced by d3d7_enum_devices().

◆ DTTR_DDBD_32

#define DTTR_DDBD_32   0x00000200

Definition at line 27 of file graphics_com_private.h.

Referenced by d3d7_enum_devices().

◆ DTTR_DDERR_GENERIC

#define DTTR_DDERR_GENERIC   0x887601C2

Definition at line 30 of file graphics_com_private.h.

◆ DTTR_SIZEOF_D3DCLIPSTATUS

#define DTTR_SIZEOF_D3DCLIPSTATUS   8

Definition at line 17 of file graphics_com_private.h.

Referenced by DTTR_COM_STUB_MEMSET().

◆ DTTR_SIZEOF_D3DDEVICEDESC7

#define DTTR_SIZEOF_D3DDEVICEDESC7   224

Definition at line 14 of file graphics_com_private.h.

Referenced by DTTR_COM_STUB_MEMSET().

◆ DTTR_SIZEOF_D3DLIGHT7

#define DTTR_SIZEOF_D3DLIGHT7   104

Definition at line 16 of file graphics_com_private.h.

◆ DTTR_SIZEOF_D3DMATERIAL7

#define DTTR_SIZEOF_D3DMATERIAL7   76

Definition at line 15 of file graphics_com_private.h.

◆ DTTR_SIZEOF_DDDEVICEIDENTIFIER2

#define DTTR_SIZEOF_DDDEVICEIDENTIFIER2   1084

Definition at line 22 of file graphics_com_private.h.

◆ DTTR_SIZEOF_DDPIXELFORMAT

#define DTTR_SIZEOF_DDPIXELFORMAT   32

Definition at line 18 of file graphics_com_private.h.

◆ DTTR_SIZEOF_DDSCAPS2

#define DTTR_SIZEOF_DDSCAPS2   16

Definition at line 19 of file graphics_com_private.h.

◆ DTTR_SIZEOF_DDSURFACEDESC

#define DTTR_SIZEOF_DDSURFACEDESC   108

Definition at line 20 of file graphics_com_private.h.

Referenced by ddrawsurface7_getsurfacedesc(), and if().

◆ DTTR_SIZEOF_DDSURFACEDESC2

#define DTTR_SIZEOF_DDSURFACEDESC2   124

Definition at line 21 of file graphics_com_private.h.

Referenced by ddrawsurface7_getsurfacedesc(), and if().

Typedef Documentation

◆ DTTR_Graphics_COM_Direct3D7

typedef struct DTTR_Graphics_COM_Direct3D7 DTTR_Graphics_COM_Direct3D7

Definition at line 100 of file graphics_com_private.h.

◆ DTTR_Graphics_COM_Direct3D7_VT

typedef struct DTTR_Graphics_COM_Direct3D7_VT DTTR_Graphics_COM_Direct3D7_VT

◆ DTTR_Graphics_COM_Direct3DDevice7

typedef struct DTTR_Graphics_COM_Direct3DDevice7 DTTR_Graphics_COM_Direct3DDevice7

Definition at line 101 of file graphics_com_private.h.

◆ DTTR_Graphics_COM_Direct3DDevice7_VT

typedef struct DTTR_Graphics_COM_Direct3DDevice7_VT DTTR_Graphics_COM_Direct3DDevice7_VT

◆ DTTR_Graphics_COM_Direct3DTexture2

typedef struct DTTR_Graphics_COM_Direct3DTexture2 DTTR_Graphics_COM_Direct3DTexture2

Definition at line 537 of file graphics_com_private.h.

◆ DTTR_Graphics_COM_Direct3DTexture2_VT

typedef struct DTTR_Graphics_COM_Direct3DTexture2_VT DTTR_Graphics_COM_Direct3DTexture2_VT

◆ DTTR_Graphics_COM_DirectDraw7

typedef struct DTTR_Graphics_COM_DirectDraw7 DTTR_Graphics_COM_DirectDraw7

Definition at line 102 of file graphics_com_private.h.

◆ DTTR_Graphics_COM_DirectDraw7_VT

typedef struct DTTR_Graphics_COM_DirectDraw7_VT DTTR_Graphics_COM_DirectDraw7_VT

◆ DTTR_Graphics_COM_DirectDrawSurface7

typedef struct DTTR_Graphics_COM_DirectDrawSurface7 DTTR_Graphics_COM_DirectDrawSurface7

Definition at line 536 of file graphics_com_private.h.

◆ DTTR_Graphics_COM_DirectDrawSurface7_VT

typedef struct DTTR_Graphics_COM_DirectDrawSurface7_VT DTTR_Graphics_COM_DirectDrawSurface7_VT

Function Documentation

◆ dttr_graphics_com_create_direct3d7()

DTTR_Graphics_COM_Direct3D7 * dttr_graphics_com_create_direct3d7 ( )

Definition at line 154 of file com_direct3d7.c.

References DTTR_Graphics_COM_Direct3D7::vtbl, and vtbl.

Referenced by ddraw7_get_direct3d().

◆ dttr_graphics_com_create_direct3d_texture2()

◆ dttr_graphics_com_create_direct3ddevice7()

DTTR_Graphics_COM_Direct3DDevice7 * dttr_graphics_com_create_direct3ddevice7 ( )

Definition at line 1222 of file com_direct3ddevice7.c.

References DTTR_Graphics_COM_Direct3DDevice7::vtbl, and vtbl.

Referenced by d3d7_get_device().

◆ dttr_graphics_com_create_directdraw7()

◆ dttr_graphics_com_create_directdrawsurface7()

◆ dttr_graphics_com_validate_directdrawsurface7()

HRESULT dttr_graphics_com_validate_directdrawsurface7 ( uint32_t width,
uint32_t height,
uint32_t bpp,
uint32_t * out_pitch,
size_t * out_pixel_size )