ReactOS  0.4.15-dev-489-g75a0787
device.c File Reference
#include "config.h"
#include "wine/port.h"
#include "ddraw_private.h"
Include dependency graph for device.c:

Go to the source code of this file.

Classes

struct  tss_lookup
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (ddraw)
 
 WINE_DECLARE_DEBUG_CHANNEL (winediag)
 
static void set_fpu_control_word (WORD fpucw)
 
static WORD d3d_fpu_setup (void)
 
static struct d3d_deviceimpl_from_IUnknown (IUnknown *iface)
 
static HRESULT WINAPI d3d_device_inner_QueryInterface (IUnknown *iface, REFIID riid, void **out)
 
static HRESULT WINAPI d3d_device7_QueryInterface (IDirect3DDevice7 *iface, REFIID riid, void **out)
 
static HRESULT WINAPI d3d_device3_QueryInterface (IDirect3DDevice3 *iface, REFIID riid, void **out)
 
static HRESULT WINAPI d3d_device2_QueryInterface (IDirect3DDevice2 *iface, REFIID riid, void **out)
 
static HRESULT WINAPI d3d_device1_QueryInterface (IDirect3DDevice *iface, REFIID riid, void **out)
 
static ULONG WINAPI d3d_device_inner_AddRef (IUnknown *iface)
 
static ULONG WINAPI d3d_device7_AddRef (IDirect3DDevice7 *iface)
 
static ULONG WINAPI d3d_device3_AddRef (IDirect3DDevice3 *iface)
 
static ULONG WINAPI d3d_device2_AddRef (IDirect3DDevice2 *iface)
 
static ULONG WINAPI d3d_device1_AddRef (IDirect3DDevice *iface)
 
static ULONG WINAPI d3d_device_inner_Release (IUnknown *iface)
 
static ULONG WINAPI d3d_device7_Release (IDirect3DDevice7 *iface)
 
static ULONG WINAPI d3d_device3_Release (IDirect3DDevice3 *iface)
 
static ULONG WINAPI d3d_device2_Release (IDirect3DDevice2 *iface)
 
static ULONG WINAPI d3d_device1_Release (IDirect3DDevice *iface)
 
static HRESULT WINAPI d3d_device1_Initialize (IDirect3DDevice *iface, IDirect3D *d3d, GUID *guid, D3DDEVICEDESC *device_desc)
 
static HRESULT d3d_device7_GetCaps (IDirect3DDevice7 *iface, D3DDEVICEDESC7 *device_desc)
 
static HRESULT WINAPI d3d_device7_GetCaps_FPUSetup (IDirect3DDevice7 *iface, D3DDEVICEDESC7 *desc)
 
static HRESULT WINAPI d3d_device7_GetCaps_FPUPreserve (IDirect3DDevice7 *iface, D3DDEVICEDESC7 *desc)
 
static BOOL check_d3ddevicedesc_size (DWORD size)
 
static HRESULT WINAPI d3d_device3_GetCaps (IDirect3DDevice3 *iface, D3DDEVICEDESC *HWDesc, D3DDEVICEDESC *HelDesc)
 
static HRESULT WINAPI d3d_device2_GetCaps (IDirect3DDevice2 *iface, D3DDEVICEDESC *hw_desc, D3DDEVICEDESC *hel_desc)
 
static HRESULT WINAPI d3d_device1_GetCaps (IDirect3DDevice *iface, D3DDEVICEDESC *hw_desc, D3DDEVICEDESC *hel_desc)
 
static HRESULT WINAPI d3d_device2_SwapTextureHandles (IDirect3DDevice2 *iface, IDirect3DTexture2 *tex1, IDirect3DTexture2 *tex2)
 
static HRESULT WINAPI d3d_device1_SwapTextureHandles (IDirect3DDevice *iface, IDirect3DTexture *tex1, IDirect3DTexture *tex2)
 
static HRESULT WINAPI d3d_device3_GetStats (IDirect3DDevice3 *iface, D3DSTATS *Stats)
 
static HRESULT WINAPI d3d_device2_GetStats (IDirect3DDevice2 *iface, D3DSTATS *stats)
 
static HRESULT WINAPI d3d_device1_GetStats (IDirect3DDevice *iface, D3DSTATS *stats)
 
static HRESULT WINAPI d3d_device1_CreateExecuteBuffer (IDirect3DDevice *iface, D3DEXECUTEBUFFERDESC *buffer_desc, IDirect3DExecuteBuffer **ExecuteBuffer, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d_device1_Execute (IDirect3DDevice *iface, IDirect3DExecuteBuffer *ExecuteBuffer, IDirect3DViewport *viewport, DWORD flags)
 
static HRESULT WINAPI d3d_device3_AddViewport (IDirect3DDevice3 *iface, IDirect3DViewport3 *viewport)
 
static HRESULT WINAPI d3d_device2_AddViewport (IDirect3DDevice2 *iface, IDirect3DViewport2 *viewport)
 
static HRESULT WINAPI d3d_device1_AddViewport (IDirect3DDevice *iface, IDirect3DViewport *viewport)
 
static HRESULT WINAPI d3d_device3_DeleteViewport (IDirect3DDevice3 *iface, IDirect3DViewport3 *viewport)
 
static HRESULT WINAPI d3d_device2_DeleteViewport (IDirect3DDevice2 *iface, IDirect3DViewport2 *viewport)
 
static HRESULT WINAPI d3d_device1_DeleteViewport (IDirect3DDevice *iface, IDirect3DViewport *viewport)
 
static HRESULT WINAPI d3d_device3_NextViewport (IDirect3DDevice3 *iface, IDirect3DViewport3 *Viewport3, IDirect3DViewport3 **lplpDirect3DViewport3, DWORD flags)
 
static HRESULT WINAPI d3d_device2_NextViewport (IDirect3DDevice2 *iface, IDirect3DViewport2 *viewport, IDirect3DViewport2 **next, DWORD flags)
 
static HRESULT WINAPI d3d_device1_NextViewport (IDirect3DDevice *iface, IDirect3DViewport *viewport, IDirect3DViewport **next, DWORD flags)
 
static HRESULT WINAPI d3d_device1_Pick (IDirect3DDevice *iface, IDirect3DExecuteBuffer *buffer, IDirect3DViewport *viewport, DWORD flags, D3DRECT *rect)
 
static HRESULT WINAPI d3d_device1_GetPickRecords (IDirect3DDevice *iface, DWORD *count, D3DPICKRECORD *records)
 
static HRESULT d3d_device7_EnumTextureFormats (IDirect3DDevice7 *iface, LPD3DENUMPIXELFORMATSCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d_device7_EnumTextureFormats_FPUSetup (IDirect3DDevice7 *iface, LPD3DENUMPIXELFORMATSCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d_device7_EnumTextureFormats_FPUPreserve (IDirect3DDevice7 *iface, LPD3DENUMPIXELFORMATSCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d_device3_EnumTextureFormats (IDirect3DDevice3 *iface, LPD3DENUMPIXELFORMATSCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d_device2_EnumTextureFormats (IDirect3DDevice2 *iface, LPD3DENUMTEXTUREFORMATSCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d_device1_EnumTextureFormats (IDirect3DDevice *iface, LPD3DENUMTEXTUREFORMATSCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d_device1_CreateMatrix (IDirect3DDevice *iface, D3DMATRIXHANDLE *D3DMatHandle)
 
static HRESULT WINAPI d3d_device1_SetMatrix (IDirect3DDevice *iface, D3DMATRIXHANDLE D3DMatHandle, D3DMATRIX *D3DMatrix)
 
static HRESULT WINAPI d3d_device1_GetMatrix (IDirect3DDevice *iface, D3DMATRIXHANDLE D3DMatHandle, D3DMATRIX *D3DMatrix)
 
static HRESULT WINAPI d3d_device1_DeleteMatrix (IDirect3DDevice *iface, D3DMATRIXHANDLE D3DMatHandle)
 
static HRESULT d3d_device7_BeginScene (IDirect3DDevice7 *iface)
 
static HRESULT WINAPI d3d_device7_BeginScene_FPUSetup (IDirect3DDevice7 *iface)
 
static HRESULT WINAPI d3d_device7_BeginScene_FPUPreserve (IDirect3DDevice7 *iface)
 
static HRESULT WINAPI d3d_device3_BeginScene (IDirect3DDevice3 *iface)
 
static HRESULT WINAPI d3d_device2_BeginScene (IDirect3DDevice2 *iface)
 
static HRESULT WINAPI d3d_device1_BeginScene (IDirect3DDevice *iface)
 
static HRESULT d3d_device7_EndScene (IDirect3DDevice7 *iface)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device7_EndScene_FPUSetup (IDirect3DDevice7 *iface)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device7_EndScene_FPUPreserve (IDirect3DDevice7 *iface)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device3_EndScene (IDirect3DDevice3 *iface)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device2_EndScene (IDirect3DDevice2 *iface)
 
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device1_EndScene (IDirect3DDevice *iface)
 
static HRESULT WINAPI d3d_device7_GetDirect3D (IDirect3DDevice7 *iface, IDirect3D7 **d3d)
 
static HRESULT WINAPI d3d_device3_GetDirect3D (IDirect3DDevice3 *iface, IDirect3D3 **d3d)
 
static HRESULT WINAPI d3d_device2_GetDirect3D (IDirect3DDevice2 *iface, IDirect3D2 **d3d)
 
static HRESULT WINAPI d3d_device1_GetDirect3D (IDirect3DDevice *iface, IDirect3D **d3d)
 
static HRESULT WINAPI d3d_device3_SetCurrentViewport (IDirect3DDevice3 *iface, IDirect3DViewport3 *Direct3DViewport3)
 
static HRESULT WINAPI d3d_device2_SetCurrentViewport (IDirect3DDevice2 *iface, IDirect3DViewport2 *viewport)
 
static HRESULT WINAPI d3d_device3_GetCurrentViewport (IDirect3DDevice3 *iface, IDirect3DViewport3 **viewport)
 
static HRESULT WINAPI d3d_device2_GetCurrentViewport (IDirect3DDevice2 *iface, IDirect3DViewport2 **viewport)
 
static BOOL validate_surface_palette (struct ddraw_surface *surface)
 
static HRESULT d3d_device_set_render_target (struct d3d_device *device, struct ddraw_surface *target, IUnknown *rt_iface)
 
static HRESULT d3d_device7_SetRenderTarget (IDirect3DDevice7 *iface, IDirectDrawSurface7 *target, DWORD flags)
 
static HRESULT WINAPI d3d_device7_SetRenderTarget_FPUSetup (IDirect3DDevice7 *iface, IDirectDrawSurface7 *NewTarget, DWORD flags)
 
static HRESULT WINAPI d3d_device7_SetRenderTarget_FPUPreserve (IDirect3DDevice7 *iface, IDirectDrawSurface7 *NewTarget, DWORD flags)
 
static HRESULT WINAPI d3d_device3_SetRenderTarget (IDirect3DDevice3 *iface, IDirectDrawSurface4 *target, DWORD flags)
 
static HRESULT WINAPI d3d_device2_SetRenderTarget (IDirect3DDevice2 *iface, IDirectDrawSurface *target, DWORD flags)
 
static HRESULT WINAPI d3d_device7_GetRenderTarget (IDirect3DDevice7 *iface, IDirectDrawSurface7 **RenderTarget)
 
static HRESULT WINAPI d3d_device3_GetRenderTarget (IDirect3DDevice3 *iface, IDirectDrawSurface4 **RenderTarget)
 
static HRESULT WINAPI d3d_device2_GetRenderTarget (IDirect3DDevice2 *iface, IDirectDrawSurface **RenderTarget)
 
static HRESULT WINAPI d3d_device3_Begin (IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, DWORD flags)
 
static HRESULT WINAPI d3d_device2_Begin (IDirect3DDevice2 *iface, D3DPRIMITIVETYPE primitive_type, D3DVERTEXTYPE vertex_type, DWORD flags)
 
static HRESULT WINAPI d3d_device3_BeginIndexed (IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, DWORD flags)
 
static HRESULT WINAPI d3d_device2_BeginIndexed (IDirect3DDevice2 *iface, D3DPRIMITIVETYPE primitive_type, D3DVERTEXTYPE vertex_type, void *vertices, DWORD vertex_count, DWORD flags)
 
static HRESULT WINAPI d3d_device3_Vertex (IDirect3DDevice3 *iface, void *vertex)
 
static HRESULT WINAPI d3d_device2_Vertex (IDirect3DDevice2 *iface, void *vertex)
 
static HRESULT WINAPI d3d_device3_Index (IDirect3DDevice3 *iface, WORD index)
 
static HRESULT WINAPI d3d_device2_Index (IDirect3DDevice2 *iface, WORD index)
 
static HRESULT d3d_device7_GetRenderState (IDirect3DDevice7 *iface, D3DRENDERSTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d_device7_GetRenderState_FPUSetup (IDirect3DDevice7 *iface, D3DRENDERSTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d_device7_GetRenderState_FPUPreserve (IDirect3DDevice7 *iface, D3DRENDERSTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d_device3_GetRenderState (IDirect3DDevice3 *iface, D3DRENDERSTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d_device2_GetRenderState (IDirect3DDevice2 *iface, D3DRENDERSTATETYPE state, DWORD *value)
 
static HRESULT d3d_device7_SetRenderState (IDirect3DDevice7 *iface, D3DRENDERSTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device7_SetRenderState_FPUSetup (IDirect3DDevice7 *iface, D3DRENDERSTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device7_SetRenderState_FPUPreserve (IDirect3DDevice7 *iface, D3DRENDERSTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device3_SetRenderState (IDirect3DDevice3 *iface, D3DRENDERSTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device2_SetRenderState (IDirect3DDevice2 *iface, D3DRENDERSTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device3_SetLightState (IDirect3DDevice3 *iface, D3DLIGHTSTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device2_SetLightState (IDirect3DDevice2 *iface, D3DLIGHTSTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device3_GetLightState (IDirect3DDevice3 *iface, D3DLIGHTSTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d_device2_GetLightState (IDirect3DDevice2 *iface, D3DLIGHTSTATETYPE state, DWORD *value)
 
static HRESULT d3d_device7_SetTransform (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device7_SetTransform_FPUSetup (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device7_SetTransform_FPUPreserve (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device3_SetTransform (IDirect3DDevice3 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device2_SetTransform (IDirect3DDevice2 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT d3d_device7_GetTransform (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device7_GetTransform_FPUSetup (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device7_GetTransform_FPUPreserve (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device3_GetTransform (IDirect3DDevice3 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device2_GetTransform (IDirect3DDevice2 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT d3d_device7_MultiplyTransform (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device7_MultiplyTransform_FPUSetup (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device7_MultiplyTransform_FPUPreserve (IDirect3DDevice7 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device3_MultiplyTransform (IDirect3DDevice3 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT WINAPI d3d_device2_MultiplyTransform (IDirect3DDevice2 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
 
static HRESULT d3d_device_prepare_vertex_buffer (struct d3d_device *device, UINT min_size)
 
static HRESULT d3d_device7_DrawPrimitive (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, DWORD flags)
 
static HRESULT WINAPI d3d_device7_DrawPrimitive_FPUSetup (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, DWORD flags)
 
static HRESULT WINAPI d3d_device7_DrawPrimitive_FPUPreserve (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, DWORD flags)
 
static void setup_lighting (const struct d3d_device *device, DWORD fvf, DWORD flags)
 
static HRESULT WINAPI d3d_device3_DrawPrimitive (IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, DWORD flags)
 
static HRESULT WINAPI d3d_device2_DrawPrimitive (IDirect3DDevice2 *iface, D3DPRIMITIVETYPE primitive_type, D3DVERTEXTYPE vertex_type, void *vertices, DWORD vertex_count, DWORD flags)
 
static HRESULT d3d_device_prepare_index_buffer (struct d3d_device *device, UINT min_size)
 
static HRESULT d3d_device7_DrawIndexedPrimitive (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
 
static HRESULT WINAPI d3d_device7_DrawIndexedPrimitive_FPUSetup (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
 
static HRESULT WINAPI d3d_device7_DrawIndexedPrimitive_FPUPreserve (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
 
static HRESULT WINAPI d3d_device3_DrawIndexedPrimitive (IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
 
static HRESULT WINAPI d3d_device2_DrawIndexedPrimitive (IDirect3DDevice2 *iface, D3DPRIMITIVETYPE primitive_type, D3DVERTEXTYPE vertex_type, void *vertices, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
 
static HRESULT WINAPI d3d_device3_End (IDirect3DDevice3 *iface, DWORD flags)
 
static HRESULT WINAPI d3d_device2_End (IDirect3DDevice2 *iface, DWORD flags)
 
static HRESULT WINAPI d3d_device7_SetClipStatus (IDirect3DDevice7 *iface, D3DCLIPSTATUS *clip_status)
 
static HRESULT WINAPI d3d_device3_SetClipStatus (IDirect3DDevice3 *iface, D3DCLIPSTATUS *clip_status)
 
static HRESULT WINAPI d3d_device2_SetClipStatus (IDirect3DDevice2 *iface, D3DCLIPSTATUS *clip_status)
 
static HRESULT WINAPI d3d_device7_GetClipStatus (IDirect3DDevice7 *iface, D3DCLIPSTATUS *clip_status)
 
static HRESULT WINAPI d3d_device3_GetClipStatus (IDirect3DDevice3 *iface, D3DCLIPSTATUS *clip_status)
 
static HRESULT WINAPI d3d_device2_GetClipStatus (IDirect3DDevice2 *iface, D3DCLIPSTATUS *clip_status)
 
static void pack_strided_data (BYTE *dst, DWORD count, const D3DDRAWPRIMITIVESTRIDEDDATA *src, DWORD fvf)
 
static HRESULT d3d_device7_DrawPrimitiveStrided (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, D3DDRAWPRIMITIVESTRIDEDDATA *strided_data, DWORD vertex_count, DWORD flags)
 
static HRESULT WINAPI d3d_device7_DrawPrimitiveStrided_FPUSetup (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE PrimitiveType, DWORD VertexType, D3DDRAWPRIMITIVESTRIDEDDATA *D3DDrawPrimStrideData, DWORD VertexCount, DWORD Flags)
 
static HRESULT WINAPI d3d_device7_DrawPrimitiveStrided_FPUPreserve (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE PrimitiveType, DWORD VertexType, D3DDRAWPRIMITIVESTRIDEDDATA *D3DDrawPrimStrideData, DWORD VertexCount, DWORD Flags)
 
static HRESULT WINAPI d3d_device3_DrawPrimitiveStrided (IDirect3DDevice3 *iface, D3DPRIMITIVETYPE PrimitiveType, DWORD VertexType, D3DDRAWPRIMITIVESTRIDEDDATA *D3DDrawPrimStrideData, DWORD VertexCount, DWORD Flags)
 
static HRESULT d3d_device7_DrawIndexedPrimitiveStrided (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, D3DDRAWPRIMITIVESTRIDEDDATA *strided_data, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
 
static HRESULT WINAPI d3d_device7_DrawIndexedPrimitiveStrided_FPUSetup (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE PrimitiveType, DWORD VertexType, D3DDRAWPRIMITIVESTRIDEDDATA *D3DDrawPrimStrideData, DWORD VertexCount, WORD *Indices, DWORD IndexCount, DWORD Flags)
 
static HRESULT WINAPI d3d_device7_DrawIndexedPrimitiveStrided_FPUPreserve (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE PrimitiveType, DWORD VertexType, D3DDRAWPRIMITIVESTRIDEDDATA *D3DDrawPrimStrideData, DWORD VertexCount, WORD *Indices, DWORD IndexCount, DWORD Flags)
 
static HRESULT WINAPI d3d_device3_DrawIndexedPrimitiveStrided (IDirect3DDevice3 *iface, D3DPRIMITIVETYPE PrimitiveType, DWORD VertexType, D3DDRAWPRIMITIVESTRIDEDDATA *D3DDrawPrimStrideData, DWORD VertexCount, WORD *Indices, DWORD IndexCount, DWORD Flags)
 
static HRESULT d3d_device7_DrawPrimitiveVB (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, IDirect3DVertexBuffer7 *vb, DWORD start_vertex, DWORD vertex_count, DWORD flags)
 
static HRESULT WINAPI d3d_device7_DrawPrimitiveVB_FPUSetup (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE PrimitiveType, IDirect3DVertexBuffer7 *D3DVertexBuf, DWORD StartVertex, DWORD NumVertices, DWORD Flags)
 
static HRESULT WINAPI d3d_device7_DrawPrimitiveVB_FPUPreserve (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE PrimitiveType, IDirect3DVertexBuffer7 *D3DVertexBuf, DWORD StartVertex, DWORD NumVertices, DWORD Flags)
 
static HRESULT WINAPI d3d_device3_DrawPrimitiveVB (IDirect3DDevice3 *iface, D3DPRIMITIVETYPE PrimitiveType, IDirect3DVertexBuffer *D3DVertexBuf, DWORD StartVertex, DWORD NumVertices, DWORD Flags)
 
static HRESULT d3d_device7_DrawIndexedPrimitiveVB (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE primitive_type, IDirect3DVertexBuffer7 *vb, DWORD start_vertex, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
 
static HRESULT WINAPI d3d_device7_DrawIndexedPrimitiveVB_FPUSetup (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE PrimitiveType, IDirect3DVertexBuffer7 *D3DVertexBuf, DWORD StartVertex, DWORD NumVertices, WORD *Indices, DWORD IndexCount, DWORD Flags)
 
static HRESULT WINAPI d3d_device7_DrawIndexedPrimitiveVB_FPUPreserve (IDirect3DDevice7 *iface, D3DPRIMITIVETYPE PrimitiveType, IDirect3DVertexBuffer7 *D3DVertexBuf, DWORD StartVertex, DWORD NumVertices, WORD *Indices, DWORD IndexCount, DWORD Flags)
 
static HRESULT WINAPI d3d_device3_DrawIndexedPrimitiveVB (IDirect3DDevice3 *iface, D3DPRIMITIVETYPE PrimitiveType, IDirect3DVertexBuffer *D3DVertexBuf, WORD *Indices, DWORD IndexCount, DWORD Flags)
 
static DWORD in_plane (UINT idx, struct wined3d_vec4 p, D3DVECTOR center, D3DVALUE radius, BOOL equality)
 
static void prepare_clip_space_planes (struct d3d_device *device, struct wined3d_vec4 *plane)
 
static void compute_sphere_visibility (struct wined3d_vec4 plane[12], DWORD enabled_planes, BOOL equality, D3DVECTOR *centers, D3DVALUE *radii, DWORD sphere_count, DWORD *return_values)
 
static HRESULT WINAPI d3d_device7_ComputeSphereVisibility (IDirect3DDevice7 *iface, D3DVECTOR *centers, D3DVALUE *radii, DWORD sphere_count, DWORD flags, DWORD *return_values)
 
static HRESULT WINAPI d3d_device3_ComputeSphereVisibility (IDirect3DDevice3 *iface, D3DVECTOR *centers, D3DVALUE *radii, DWORD sphere_count, DWORD flags, DWORD *return_values)
 
static HRESULT d3d_device7_GetTexture (IDirect3DDevice7 *iface, DWORD stage, IDirectDrawSurface7 **texture)
 
static HRESULT WINAPI d3d_device7_GetTexture_FPUSetup (IDirect3DDevice7 *iface, DWORD stage, IDirectDrawSurface7 **Texture)
 
static HRESULT WINAPI d3d_device7_GetTexture_FPUPreserve (IDirect3DDevice7 *iface, DWORD stage, IDirectDrawSurface7 **Texture)
 
static HRESULT WINAPI d3d_device3_GetTexture (IDirect3DDevice3 *iface, DWORD stage, IDirect3DTexture2 **Texture2)
 
static HRESULT d3d_device7_SetTexture (IDirect3DDevice7 *iface, DWORD stage, IDirectDrawSurface7 *texture)
 
static HRESULT WINAPI d3d_device7_SetTexture_FPUSetup (IDirect3DDevice7 *iface, DWORD stage, IDirectDrawSurface7 *texture)
 
static HRESULT WINAPI d3d_device7_SetTexture_FPUPreserve (IDirect3DDevice7 *iface, DWORD stage, IDirectDrawSurface7 *texture)
 
static HRESULT WINAPI d3d_device3_SetTexture (IDirect3DDevice3 *iface, DWORD stage, IDirect3DTexture2 *texture)
 
static HRESULT d3d_device7_GetTextureStageState (IDirect3DDevice7 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d_device7_GetTextureStageState_FPUSetup (IDirect3DDevice7 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d_device7_GetTextureStageState_FPUPreserve (IDirect3DDevice7 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD *value)
 
static HRESULT WINAPI d3d_device3_GetTextureStageState (IDirect3DDevice3 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD *value)
 
static HRESULT d3d_device7_SetTextureStageState (IDirect3DDevice7 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device7_SetTextureStageState_FPUSetup (IDirect3DDevice7 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device7_SetTextureStageState_FPUPreserve (IDirect3DDevice7 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD value)
 
static HRESULT WINAPI d3d_device3_SetTextureStageState (IDirect3DDevice3 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD value)
 
static HRESULT d3d_device7_ValidateDevice (IDirect3DDevice7 *iface, DWORD *pass_count)
 
static HRESULT WINAPI d3d_device7_ValidateDevice_FPUSetup (IDirect3DDevice7 *iface, DWORD *pass_count)
 
static HRESULT WINAPI d3d_device7_ValidateDevice_FPUPreserve (IDirect3DDevice7 *iface, DWORD *pass_count)
 
static HRESULT WINAPI d3d_device3_ValidateDevice (IDirect3DDevice3 *iface, DWORD *pass_count)
 
static HRESULT d3d_device7_Clear (IDirect3DDevice7 *iface, DWORD count, D3DRECT *rects, DWORD flags, D3DCOLOR color, D3DVALUE z, DWORD stencil)
 
static HRESULT WINAPI d3d_device7_Clear_FPUSetup (IDirect3DDevice7 *iface, DWORD count, D3DRECT *rects, DWORD flags, D3DCOLOR color, D3DVALUE z, DWORD stencil)
 
static HRESULT WINAPI d3d_device7_Clear_FPUPreserve (IDirect3DDevice7 *iface, DWORD count, D3DRECT *rects, DWORD flags, D3DCOLOR color, D3DVALUE z, DWORD stencil)
 
static HRESULT d3d_device7_SetViewport (IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
 
static HRESULT WINAPI d3d_device7_SetViewport_FPUSetup (IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
 
static HRESULT WINAPI d3d_device7_SetViewport_FPUPreserve (IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
 
static HRESULT d3d_device7_GetViewport (IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
 
static HRESULT WINAPI d3d_device7_GetViewport_FPUSetup (IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
 
static HRESULT WINAPI d3d_device7_GetViewport_FPUPreserve (IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
 
static HRESULT d3d_device7_SetMaterial (IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
 
static HRESULT WINAPI d3d_device7_SetMaterial_FPUSetup (IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
 
static HRESULT WINAPI d3d_device7_SetMaterial_FPUPreserve (IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
 
static HRESULT d3d_device7_GetMaterial (IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
 
static HRESULT WINAPI d3d_device7_GetMaterial_FPUSetup (IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
 
static HRESULT WINAPI d3d_device7_GetMaterial_FPUPreserve (IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
 
static HRESULT d3d_device7_SetLight (IDirect3DDevice7 *iface, DWORD light_idx, D3DLIGHT7 *light)
 
static HRESULT WINAPI d3d_device7_SetLight_FPUSetup (IDirect3DDevice7 *iface, DWORD light_idx, D3DLIGHT7 *light)
 
static HRESULT WINAPI d3d_device7_SetLight_FPUPreserve (IDirect3DDevice7 *iface, DWORD light_idx, D3DLIGHT7 *light)
 
static HRESULT d3d_device7_GetLight (IDirect3DDevice7 *iface, DWORD light_idx, D3DLIGHT7 *light)
 
static HRESULT WINAPI d3d_device7_GetLight_FPUSetup (IDirect3DDevice7 *iface, DWORD light_idx, D3DLIGHT7 *light)
 
static HRESULT WINAPI d3d_device7_GetLight_FPUPreserve (IDirect3DDevice7 *iface, DWORD light_idx, D3DLIGHT7 *light)
 
static HRESULT d3d_device7_BeginStateBlock (IDirect3DDevice7 *iface)
 
static HRESULT WINAPI d3d_device7_BeginStateBlock_FPUSetup (IDirect3DDevice7 *iface)
 
static HRESULT WINAPI d3d_device7_BeginStateBlock_FPUPreserve (IDirect3DDevice7 *iface)
 
static HRESULT d3d_device7_EndStateBlock (IDirect3DDevice7 *iface, DWORD *stateblock)
 
static HRESULT WINAPI d3d_device7_EndStateBlock_FPUSetup (IDirect3DDevice7 *iface, DWORD *stateblock)
 
static HRESULT WINAPI d3d_device7_EndStateBlock_FPUPreserve (IDirect3DDevice7 *iface, DWORD *stateblock)
 
static HRESULT d3d_device7_PreLoad (IDirect3DDevice7 *iface, IDirectDrawSurface7 *texture)
 
static HRESULT WINAPI d3d_device7_PreLoad_FPUSetup (IDirect3DDevice7 *iface, IDirectDrawSurface7 *texture)
 
static HRESULT WINAPI d3d_device7_PreLoad_FPUPreserve (IDirect3DDevice7 *iface, IDirectDrawSurface7 *texture)
 
static HRESULT d3d_device7_ApplyStateBlock (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT WINAPI d3d_device7_ApplyStateBlock_FPUSetup (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT WINAPI d3d_device7_ApplyStateBlock_FPUPreserve (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT d3d_device7_CaptureStateBlock (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT WINAPI d3d_device7_CaptureStateBlock_FPUSetup (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT WINAPI d3d_device7_CaptureStateBlock_FPUPreserve (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT d3d_device7_DeleteStateBlock (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT WINAPI d3d_device7_DeleteStateBlock_FPUSetup (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT WINAPI d3d_device7_DeleteStateBlock_FPUPreserve (IDirect3DDevice7 *iface, DWORD stateblock)
 
static HRESULT d3d_device7_CreateStateBlock (IDirect3DDevice7 *iface, D3DSTATEBLOCKTYPE type, DWORD *stateblock)
 
static HRESULT WINAPI d3d_device7_CreateStateBlock_FPUSetup (IDirect3DDevice7 *iface, D3DSTATEBLOCKTYPE type, DWORD *stateblock)
 
static HRESULT WINAPI d3d_device7_CreateStateBlock_FPUPreserve (IDirect3DDevice7 *iface, D3DSTATEBLOCKTYPE type, DWORD *stateblock)
 
static BOOL is_mip_level_subset (struct ddraw_surface *dest, struct ddraw_surface *src)
 
static void copy_mipmap_chain (struct d3d_device *device, struct ddraw_surface *dst, struct ddraw_surface *src, const POINT *DestPoint, const RECT *SrcRect)
 
static HRESULT d3d_device7_Load (IDirect3DDevice7 *iface, IDirectDrawSurface7 *dst_texture, POINT *dst_pos, IDirectDrawSurface7 *src_texture, RECT *src_rect, DWORD flags)
 
static HRESULT WINAPI d3d_device7_Load_FPUSetup (IDirect3DDevice7 *iface, IDirectDrawSurface7 *dst_texture, POINT *dst_pos, IDirectDrawSurface7 *src_texture, RECT *src_rect, DWORD flags)
 
static HRESULT WINAPI d3d_device7_Load_FPUPreserve (IDirect3DDevice7 *iface, IDirectDrawSurface7 *dst_texture, POINT *dst_pos, IDirectDrawSurface7 *src_texture, RECT *src_rect, DWORD flags)
 
static HRESULT d3d_device7_LightEnable (IDirect3DDevice7 *iface, DWORD light_idx, BOOL enabled)
 
static HRESULT WINAPI d3d_device7_LightEnable_FPUSetup (IDirect3DDevice7 *iface, DWORD light_idx, BOOL enabled)
 
static HRESULT WINAPI d3d_device7_LightEnable_FPUPreserve (IDirect3DDevice7 *iface, DWORD light_idx, BOOL enabled)
 
static HRESULT d3d_device7_GetLightEnable (IDirect3DDevice7 *iface, DWORD light_idx, BOOL *enabled)
 
static HRESULT WINAPI d3d_device7_GetLightEnable_FPUSetup (IDirect3DDevice7 *iface, DWORD light_idx, BOOL *enabled)
 
static HRESULT WINAPI d3d_device7_GetLightEnable_FPUPreserve (IDirect3DDevice7 *iface, DWORD light_idx, BOOL *enabled)
 
static HRESULT d3d_device7_SetClipPlane (IDirect3DDevice7 *iface, DWORD idx, D3DVALUE *plane)
 
static HRESULT WINAPI d3d_device7_SetClipPlane_FPUSetup (IDirect3DDevice7 *iface, DWORD idx, D3DVALUE *plane)
 
static HRESULT WINAPI d3d_device7_SetClipPlane_FPUPreserve (IDirect3DDevice7 *iface, DWORD idx, D3DVALUE *plane)
 
static HRESULT d3d_device7_GetClipPlane (IDirect3DDevice7 *iface, DWORD idx, D3DVALUE *plane)
 
static HRESULT WINAPI d3d_device7_GetClipPlane_FPUSetup (IDirect3DDevice7 *iface, DWORD idx, D3DVALUE *plane)
 
static HRESULT WINAPI d3d_device7_GetClipPlane_FPUPreserve (IDirect3DDevice7 *iface, DWORD idx, D3DVALUE *plane)
 
static HRESULT WINAPI d3d_device7_GetInfo (IDirect3DDevice7 *iface, DWORD info_id, void *info, DWORD info_size)
 
struct d3d_deviceunsafe_impl_from_IDirect3DDevice7 (IDirect3DDevice7 *iface)
 
struct d3d_deviceunsafe_impl_from_IDirect3DDevice3 (IDirect3DDevice3 *iface)
 
struct d3d_deviceunsafe_impl_from_IDirect3DDevice2 (IDirect3DDevice2 *iface)
 
struct d3d_deviceunsafe_impl_from_IDirect3DDevice (IDirect3DDevice *iface)
 
enum wined3d_depth_buffer_type d3d_device_update_depth_stencil (struct d3d_device *device)
 
static HRESULT d3d_device_init (struct d3d_device *device, struct ddraw *ddraw, BOOL hw, struct ddraw_surface *target, IUnknown *rt_iface, UINT version, IUnknown *outer_unknown)
 
HRESULT d3d_device_create (struct ddraw *ddraw, const GUID *guid, struct ddraw_surface *target, IUnknown *rt_iface, UINT version, struct d3d_device **device, IUnknown *outer_unknown)
 

Variables

const GUID IID_D3DDEVICE_WineD3D
 
static const struct tss_lookup tss_lookup []
 
static const struct IDirect3DDevice7Vtbl d3d_device7_fpu_setup_vtbl
 
static const struct IDirect3DDevice7Vtbl d3d_device7_fpu_preserve_vtbl
 
static const struct IDirect3DDevice3Vtbl d3d_device3_vtbl
 
static const struct IDirect3DDevice2Vtbl d3d_device2_vtbl
 
static const struct IDirect3DDeviceVtbl d3d_device1_vtbl
 
static const struct IUnknownVtbl d3d_device_inner_vtbl
 

Function Documentation

◆ check_d3ddevicedesc_size()

static BOOL check_d3ddevicedesc_size ( DWORD  size)
inlinestatic

Definition at line 461 of file device.c.

462 {
463  if (size == FIELD_OFFSET(D3DDEVICEDESC, dwMinTextureWidth) /* 172 */
464  || size == FIELD_OFFSET(D3DDEVICEDESC, dwMaxTextureRepeat) /* 204 */
465  || size == sizeof(D3DDEVICEDESC) /* 252 */) return TRUE;
466  return FALSE;
467 }
#define TRUE
Definition: types.h:120
GLsizeiptr size
Definition: glext.h:5919
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254

Referenced by d3d_device3_GetCaps().

◆ compute_sphere_visibility()

static void compute_sphere_visibility ( struct wined3d_vec4  plane[12],
DWORD  enabled_planes,
BOOL  equality,
D3DVECTOR centers,
D3DVALUE radii,
DWORD  sphere_count,
DWORD return_values 
)
static

Definition at line 4589 of file device.c.

4591 {
4592  UINT i, j;
4593 
4594  for (i = 0; i < sphere_count; ++i)
4595  {
4596  return_values[i] = 0;
4597  for (j = 0; j < 12; ++j)
4598  if (enabled_planes & 1u << j)
4599  return_values[i] |= in_plane(j, plane[j], centers[i], radii[i], equality);
4600  }
4601 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum GLint const GLfloat GLenum GLint const GLushort GLint GLint GLsizei GLsizei GLenum GLsizei GLsizei GLenum GLenum const GLvoid GLenum plane
Definition: glfuncs.h:270
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
static DWORD in_plane(UINT idx, struct wined3d_vec4 p, D3DVECTOR center, D3DVALUE radius, BOOL equality)
Definition: device.c:4509
unsigned int UINT
Definition: ndis.h:50

Referenced by d3d_device3_ComputeSphereVisibility(), and d3d_device7_ComputeSphereVisibility().

◆ copy_mipmap_chain()

static void copy_mipmap_chain ( struct d3d_device device,
struct ddraw_surface dst,
struct ddraw_surface src,
const POINT DestPoint,
const RECT SrcRect 
)
static

Definition at line 6058 of file device.c.

6060 {
6061  struct ddraw_surface *dst_level, *src_level;
6063  DDSURFACEDESC2 ddsd;
6064  POINT point;
6065  RECT src_rect;
6066  HRESULT hr;
6067  IDirectDrawPalette *pal = NULL, *pal_src = NULL;
6068  DWORD ckeyflag;
6069  DDCOLORKEY ddckey;
6070 
6071  /* Copy palette, if possible. */
6072  IDirectDrawSurface7_GetPalette(&src->IDirectDrawSurface7_iface, &pal_src);
6073  IDirectDrawSurface7_GetPalette(&dst->IDirectDrawSurface7_iface, &pal);
6074 
6075  if (pal_src != NULL && pal != NULL)
6076  {
6077  PALETTEENTRY palent[256];
6078 
6079  IDirectDrawPalette_GetEntries(pal_src, 0, 0, 256, palent);
6080  IDirectDrawPalette_SetEntries(pal, 0, 0, 256, palent);
6081  }
6082 
6083  if (pal) IDirectDrawPalette_Release(pal);
6084  if (pal_src) IDirectDrawPalette_Release(pal_src);
6085 
6086  /* Copy colorkeys, if present. */
6087  for (ckeyflag = DDCKEY_DESTBLT; ckeyflag <= DDCKEY_SRCOVERLAY; ckeyflag <<= 1)
6088  {
6089  hr = IDirectDrawSurface7_GetColorKey(&src->IDirectDrawSurface7_iface, ckeyflag, &ddckey);
6090 
6091  if (SUCCEEDED(hr))
6092  {
6093  IDirectDrawSurface7_SetColorKey(&dst->IDirectDrawSurface7_iface, ckeyflag, &ddckey);
6094  }
6095  }
6096 
6097  src_level = src;
6098  dst_level = dst;
6099 
6100  point = *DestPoint;
6101  src_rect = *SrcRect;
6102 
6103  for (;src_level && dst_level;)
6104  {
6105  if (src_level->surface_desc.dwWidth == dst_level->surface_desc.dwWidth
6106  && src_level->surface_desc.dwHeight == dst_level->surface_desc.dwHeight)
6107  {
6108  UINT src_w = src_rect.right - src_rect.left;
6109  UINT src_h = src_rect.bottom - src_rect.top;
6110  RECT dst_rect = {point.x, point.y, point.x + src_w, point.y + src_h};
6111 
6112  if (FAILED(hr = wined3d_texture_blt(dst_level->wined3d_texture, dst_level->sub_resource_idx, &dst_rect,
6113  src_level->wined3d_texture, src_level->sub_resource_idx, &src_rect, 0, NULL, WINED3D_TEXF_POINT)))
6114  ERR("Blit failed, hr %#x.\n", hr);
6115 
6118  IDirectDrawSurface7_GetAttachedSurface(&dst_level->IDirectDrawSurface7_iface, &ddsd.ddsCaps, &temp);
6119 
6120  if (dst_level != dst)
6121  IDirectDrawSurface7_Release(&dst_level->IDirectDrawSurface7_iface);
6122 
6124  }
6125 
6128  IDirectDrawSurface7_GetAttachedSurface(&src_level->IDirectDrawSurface7_iface, &ddsd.ddsCaps, &temp);
6129 
6130  if (src_level != src) IDirectDrawSurface7_Release(&src_level->IDirectDrawSurface7_iface);
6131 
6133 
6134  point.x /= 2;
6135  point.y /= 2;
6136 
6137  src_rect.top /= 2;
6138  src_rect.left /= 2;
6139  src_rect.right = (src_rect.right + 1) / 2;
6140  src_rect.bottom = (src_rect.bottom + 1) / 2;
6141  }
6142 
6143  if (src_level && src_level != src)
6144  IDirectDrawSurface7_Release(&src_level->IDirectDrawSurface7_iface);
6145  if (dst_level && dst_level != dst)
6146  IDirectDrawSurface7_Release(&dst_level->IDirectDrawSurface7_iface);
6147 }
#define DDCKEY_DESTBLT
Definition: ddraw.h:476
HRESULT hr
Definition: shlfolder.c:183
DWORD dwCaps2
Definition: ddraw.h:733
#define DDSCAPS_TEXTURE
Definition: ddraw.h:262
LONG top
Definition: windef.h:307
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface) DECLSPEC_HIDDEN
Definition: surface.c:5641
LONG left
Definition: windef.h:306
struct wined3d_texture * wined3d_texture
LONG right
Definition: windef.h:308
POINTL point
Definition: edittest.c:50
LONG y
Definition: windef.h:330
DWORD dwWidth
Definition: ddraw.h:1155
#define DDSCAPS2_MIPMAPSUBLEVEL
Definition: ddraw.h:304
DDSCAPS2 ddsCaps
Definition: ddraw.h:1188
#define DDCKEY_SRCOVERLAY
Definition: ddraw.h:479
DWORD dwCaps
Definition: ddraw.h:732
smooth NULL
Definition: ftsmooth.c:416
DWORD IDirectDrawSurface7
Definition: vmrender.idl:20
DDSURFACEDESC2 surface_desc
LONG HRESULT
Definition: typedefs.h:78
unsigned long DWORD
Definition: ntddk_ex.h:95
LONG x
Definition: windef.h:329
unsigned int sub_resource_idx
GLenum src
Definition: glext.h:6340
DWORD dwHeight
Definition: ddraw.h:1154
#define ERR(fmt,...)
Definition: debug.h:110
IDirectDrawSurface7 IDirectDrawSurface7_iface
HRESULT CDECL wined3d_texture_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, const RECT *dst_rect, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, const RECT *src_rect, DWORD flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
Definition: texture.c:3262
static calc_node_t temp
Definition: rpn_ieee.c:38
GLenum GLenum dst
Definition: glext.h:6340
unsigned int UINT
Definition: ndis.h:50
LONG bottom
Definition: windef.h:309
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by d3d_device7_Load().

◆ d3d_device1_AddRef()

static ULONG WINAPI d3d_device1_AddRef ( IDirect3DDevice *  iface)
static

Definition at line 214 of file device.c.

215 {
217 
218  TRACE("iface %p.\n", iface);
219 
220  return IUnknown_AddRef(device->outer_unknown);
221 }
static struct d3d_device * impl_from_IDirect3DDevice(IDirect3DDevice *iface)
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d_device1_AddViewport()

static HRESULT WINAPI d3d_device1_AddViewport ( IDirect3DDevice *  iface,
IDirect3DViewport *  viewport 
)
static

Definition at line 772 of file device.c.

773 {
775  struct d3d_viewport *vp = unsafe_impl_from_IDirect3DViewport(viewport);
776 
777  TRACE("iface %p, viewport %p.\n", iface, viewport);
778 
779  return d3d_device3_AddViewport(&device->IDirect3DDevice3_iface, &vp->IDirect3DViewport3_iface);
780 }
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport(IDirect3DViewport *iface) DECLSPEC_HIDDEN
Definition: viewport.c:1138
static struct d3d_device * impl_from_IDirect3DDevice(IDirect3DDevice *iface)
static HRESULT WINAPI d3d_device3_AddViewport(IDirect3DDevice3 *iface, IDirect3DViewport3 *viewport)
Definition: device.c:740
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
IDirect3DViewport3 IDirect3DViewport3_iface

◆ d3d_device1_BeginScene()

static HRESULT WINAPI d3d_device1_BeginScene ( IDirect3DDevice *  iface)
static

Definition at line 1516 of file device.c.

1517 {
1518  struct d3d_device *device = impl_from_IDirect3DDevice(iface);
1519 
1520  TRACE("iface %p.\n", iface);
1521 
1522  return IDirect3DDevice7_BeginScene(&device->IDirect3DDevice7_iface);
1523 }
static struct d3d_device * impl_from_IDirect3DDevice(IDirect3DDevice *iface)
#define IDirect3DDevice7_BeginScene(p)
Definition: d3d.h:1348
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d_device1_CreateExecuteBuffer()

static HRESULT WINAPI d3d_device1_CreateExecuteBuffer ( IDirect3DDevice *  iface,
D3DEXECUTEBUFFERDESC buffer_desc,
IDirect3DExecuteBuffer **  ExecuteBuffer,
IUnknown outer_unknown 
)
static

Definition at line 652 of file device.c.

654 {
656  struct d3d_execute_buffer *object;
657  HRESULT hr;
658 
659  TRACE("iface %p, buffer_desc %p, buffer %p, outer_unknown %p.\n",
660  iface, buffer_desc, ExecuteBuffer, outer_unknown);
661 
662  if (outer_unknown)
663  return CLASS_E_NOAGGREGATION;
664 
665  /* Allocate the new Execute Buffer */
666  if (!(object = heap_alloc_zero(sizeof(*object))))
667  {
668  ERR("Failed to allocate execute buffer memory.\n");
669  return DDERR_OUTOFMEMORY;
670  }
671 
672  hr = d3d_execute_buffer_init(object, device, buffer_desc);
673  if (FAILED(hr))
674  {
675  WARN("Failed to initialize execute buffer, hr %#x.\n", hr);
676  heap_free(object);
677  return hr;
678  }
679 
680  *ExecuteBuffer = &object->IDirect3DExecuteBuffer_iface;
681 
682  TRACE(" Returning IDirect3DExecuteBuffer at %p, implementation is at %p\n", *ExecuteBuffer, object);
683 
684  return D3D_OK;
685 }
static struct d3d_device * impl_from_IDirect3DDevice(IDirect3DDevice *iface)
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:112
#define DDERR_OUTOFMEMORY
Definition: ddraw.h:111
Definition: devices.h:37
HRESULT d3d_execute_buffer_init(struct d3d_execute_buffer *execute_buffer, struct d3d_device *device, D3DEXECUTEBUFFERDESC *desc) DECLSPEC_HIDDEN
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define ERR(fmt,...)
Definition: debug.h:110
#define D3D_OK
Definition: d3d.h:106
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ d3d_device1_CreateMatrix()

static HRESULT WINAPI d3d_device1_CreateMatrix ( IDirect3DDevice *  iface,
D3DMATRIXHANDLE D3DMatHandle 
)
static

Definition at line 1273 of file device.c.

1274 {
1275  struct d3d_device *device = impl_from_IDirect3DDevice(iface);
1276  D3DMATRIX *matrix;
1277  DWORD h;
1278 
1279  TRACE("iface %p, matrix_handle %p.\n", iface, D3DMatHandle);
1280 
1281  if(!D3DMatHandle)
1282  return DDERR_INVALIDPARAMS;
1283 
1284  if (!(matrix = heap_alloc_zero(sizeof(*matrix))))
1285  {
1286  ERR("Out of memory when allocating a D3DMATRIX\n");
1287  return DDERR_OUTOFMEMORY;
1288  }
1289 
1291 
1293  if (h == DDRAW_INVALID_HANDLE)
1294  {
1295  ERR("Failed to allocate a matrix handle.\n");
1296  heap_free(matrix);
1298  return DDERR_OUTOFMEMORY;
1299  }
1300 
1301  *D3DMatHandle = h + 1;
1302 
1303  TRACE(" returning matrix handle %d\n", *D3DMatHandle);
1304 
1306 
1307  return D3D_OK;
1308 }
static struct d3d_device * impl_from_IDirect3DDevice(IDirect3DDevice *iface)
GLuint GLenum matrix
Definition: glext.h:9407
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define DDERR_OUTOFMEMORY
Definition: ddraw.h:111
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
DWORD ddraw_allocate_handle(struct ddraw_handle_table *t, void *object, enum ddraw_handle_type type) DECLSPEC_HIDDEN
Definition: main.c:113
#define DDRAW_INVALID_HANDLE
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ERR(fmt,...)
Definition: debug.h:110
#define D3D_OK
Definition: d3d.h:106
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ d3d_device1_DeleteMatrix()

static HRESULT WINAPI d3d_device1_DeleteMatrix ( IDirect3DDevice *  iface,
D3DMATRIXHANDLE  D3DMatHandle 
)
static

Definition at line 1428 of file device.c.

1429 {
1430  struct d3d_device *device = impl_from_IDirect3DDevice(iface);
1431  D3DMATRIX *m;
1432 
1433  TRACE("iface %p, matrix_handle %#x.\n", iface, D3DMatHandle);
1434 
1436 
1437  m = ddraw_free_handle(&device->handle_table, D3DMatHandle - 1, DDRAW_HANDLE_MATRIX);
1438  if (!m)
1439  {
1440  WARN("Invalid matrix handle.\n");
1442  return DDERR_INVALIDPARAMS;
1443  }
1444 
1446 
1447  heap_free(m);
1448 
1449  return D3D_OK;
1450 }
static struct d3d_device * impl_from_IDirect3DDevice(IDirect3DDevice *iface)
#define WARN(fmt,...)
Definition: debug.h:112
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
const GLfloat * m
Definition: glext.h:10848
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
#define D3D_OK
Definition: d3d.h:106
void * ddraw_free_handle(struct ddraw_handle_table *t, DWORD handle, enum ddraw_handle_type type) DECLSPEC_HIDDEN
Definition: main.c:156
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ d3d_device1_DeleteViewport()

static HRESULT WINAPI d3d_device1_DeleteViewport ( IDirect3DDevice *  iface,
IDirect3DViewport *  viewport 
)
static

Definition at line 848 of file device.c.

849 {
851  struct d3d_viewport *vp = unsafe_impl_from_IDirect3DViewport(viewport);
852 
853  TRACE("iface %p, viewport %p.\n", iface, viewport);
854 
855  return d3d_device3_DeleteViewport(&device->IDirect3DDevice3_iface,
856  vp ? &vp->IDirect3DViewport3_iface : NULL);
857 }
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport(IDirect3DViewport *iface) DECLSPEC_HIDDEN
Definition: viewport.c:1138
static struct d3d_device * impl_from_IDirect3DDevice(IDirect3DDevice *iface)
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT WINAPI d3d_device3_DeleteViewport(IDirect3DDevice3 *iface, IDirect3DViewport3 *viewport)
Definition: device.c:798
IDirect3DViewport3 IDirect3DViewport3_iface

◆ d3d_device1_EndScene()

static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device1_EndScene ( IDirect3DDevice *  iface)
static

Definition at line 1589 of file device.c.

1590 {
1591  struct d3d_device *device = impl_from_IDirect3DDevice(iface);
1592 
1593  TRACE("iface %p.\n", iface);
1594 
1595  return IDirect3DDevice7_EndScene(&device->IDirect3DDevice7_iface);
1596 }
static struct d3d_device * impl_from_IDirect3DDevice(IDirect3DDevice *iface)
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
#define IDirect3DDevice7_EndScene(p)
Definition: d3d.h:1349

◆ d3d_device1_EnumTextureFormats()

static HRESULT WINAPI d3d_device1_EnumTextureFormats ( IDirect3DDevice *  iface,
LPD3DENUMTEXTUREFORMATSCALLBACK  callback,
void context 
)
static

Definition at line 1247 of file device.c.

1249 {
1250  struct d3d_device *device = impl_from_IDirect3DDevice(iface);
1251 
1252  TRACE("iface %p, callback %p, context %p.\n", iface, callback, context);
1253 
1254  return d3d_device2_EnumTextureFormats(&device->IDirect3DDevice2_iface, callback, context);
1255 }
static struct d3d_device * impl_from_IDirect3DDevice(IDirect3DDevice *iface)
Definition: http.c:7094
Definition: devices.h:37
static HRESULT WINAPI d3d_device2_EnumTextureFormats(IDirect3DDevice2 *iface, LPD3DENUMTEXTUREFORMATSCALLBACK callback, void *context)
Definition: device.c:1178
MmuTrapHandler callback[0x30]
Definition: mmuobject.c:44
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d_device1_Execute()

static HRESULT WINAPI d3d_device1_Execute ( IDirect3DDevice *  iface,
IDirect3DExecuteBuffer *  ExecuteBuffer,
IDirect3DViewport *  viewport,
DWORD  flags 
)
static

Definition at line 702 of file device.c.

704 {
707  struct d3d_viewport *viewport_impl = unsafe_impl_from_IDirect3DViewport(viewport);
708  HRESULT hr;
709 
710  TRACE("iface %p, buffer %p, viewport %p, flags %#x.\n", iface, ExecuteBuffer, viewport, flags);
711 
712  if(!buffer)
713  return DDERR_INVALIDPARAMS;
714 
715  /* Execute... */
717  hr = d3d_execute_buffer_execute(buffer, device, viewport_impl);
719 
720  return hr;
721 }
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport(IDirect3DViewport *iface) DECLSPEC_HIDDEN
Definition: viewport.c:1138
static struct d3d_device * impl_from_IDirect3DDevice(IDirect3DDevice *iface)
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
GLuint buffer
Definition: glext.h:5915
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78
GLbitfield flags
Definition: glext.h:7161
HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *execute_buffer, struct d3d_device *device, struct d3d_viewport *viewport) DECLSPEC_HIDDEN
Definition: executebuffer.c:51
struct d3d_execute_buffer * unsafe_impl_from_IDirect3DExecuteBuffer(IDirect3DExecuteBuffer *iface) DECLSPEC_HIDDEN
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79

◆ d3d_device1_GetCaps()

static HRESULT WINAPI d3d_device1_GetCaps ( IDirect3DDevice *  iface,
D3DDEVICEDESC hw_desc,
D3DDEVICEDESC hel_desc 
)
static

Definition at line 519 of file device.c.

521 {
523 
524  TRACE("iface %p, hw_desc %p, hel_desc %p.\n", iface, hw_desc, hel_desc);
525 
526  return d3d_device3_GetCaps(&device->IDirect3DDevice3_iface, hw_desc, hel_desc);
527 }
static struct d3d_device * impl_from_IDirect3DDevice(IDirect3DDevice *iface)
static HRESULT WINAPI d3d_device3_GetCaps(IDirect3DDevice3 *iface, D3DDEVICEDESC *HWDesc, D3DDEVICEDESC *HelDesc)
Definition: device.c:469
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d_device1_GetDirect3D()

static HRESULT WINAPI d3d_device1_GetDirect3D ( IDirect3DDevice *  iface,
IDirect3D **  d3d 
)
static

Definition at line 1660 of file device.c.

1661 {
1662  struct d3d_device *device = impl_from_IDirect3DDevice(iface);
1663 
1664  TRACE("iface %p, d3d %p.\n", iface, d3d);
1665 
1666  if (!d3d)
1667  return DDERR_INVALIDPARAMS;
1668 
1669  *d3d = &device->ddraw->IDirect3D_iface;
1670  IDirect3D_AddRef(*d3d);
1671 
1672  TRACE("Returning interface %p.\n", *d3d);
1673  return D3D_OK;
1674 }
static struct d3d_device * impl_from_IDirect3DDevice(IDirect3DDevice *iface)
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
#define D3D_OK
Definition: d3d.h:106
#define IDirect3D_AddRef(p)
Definition: d3d.h:232
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79

◆ d3d_device1_GetMatrix()

static HRESULT WINAPI d3d_device1_GetMatrix ( IDirect3DDevice *  iface,
D3DMATRIXHANDLE  D3DMatHandle,
D3DMATRIX D3DMatrix 
)
static

Definition at line 1386 of file device.c.

1388 {
1389  struct d3d_device *device = impl_from_IDirect3DDevice(iface);
1390  D3DMATRIX *m;
1391 
1392  TRACE("iface %p, matrix_handle %#x, matrix %p.\n", iface, D3DMatHandle, D3DMatrix);
1393 
1394  if (!D3DMatrix) return DDERR_INVALIDPARAMS;
1395 
1397 
1398  m = ddraw_get_object(&device->handle_table, D3DMatHandle - 1, DDRAW_HANDLE_MATRIX);
1399  if (!m)
1400  {
1401  WARN("Invalid matrix handle.\n");
1403  return DDERR_INVALIDPARAMS;
1404  }
1405 
1406  *D3DMatrix = *m;
1407 
1409 
1410  return D3D_OK;
1411 }
static struct d3d_device * impl_from_IDirect3DDevice(IDirect3DDevice *iface)
#define WARN(fmt,...)
Definition: debug.h:112
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
const GLfloat * m
Definition: glext.h:10848
Definition: devices.h:37
void * ddraw_get_object(struct ddraw_handle_table *t, DWORD handle, enum ddraw_handle_type type) DECLSPEC_HIDDEN
Definition: main.c:182
#define TRACE(s)
Definition: solgame.cpp:4
#define D3D_OK
Definition: d3d.h:106
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79

◆ d3d_device1_GetPickRecords()

static HRESULT WINAPI d3d_device1_GetPickRecords ( IDirect3DDevice *  iface,
DWORD count,
D3DPICKRECORD records 
)
static

Definition at line 1010 of file device.c.

1012 {
1013  FIXME("iface %p, count %p, records %p stub!\n", iface, count, records);
1014 
1015  return D3D_OK;
1016 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define FIXME(fmt,...)
Definition: debug.h:111
#define D3D_OK
Definition: d3d.h:106

◆ d3d_device1_GetStats()

static HRESULT WINAPI d3d_device1_GetStats ( IDirect3DDevice *  iface,
D3DSTATS stats 
)
static

Definition at line 623 of file device.c.

624 {
626 
627  TRACE("iface %p, stats %p.\n", iface, stats);
628 
629  return d3d_device3_GetStats(&device->IDirect3DDevice3_iface, stats);
630 }
static struct d3d_device * impl_from_IDirect3DDevice(IDirect3DDevice *iface)
static HRESULT WINAPI d3d_device3_GetStats(IDirect3DDevice3 *iface, D3DSTATS *Stats)
Definition: device.c:597
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d_device1_Initialize()

static HRESULT WINAPI d3d_device1_Initialize ( IDirect3DDevice *  iface,
IDirect3D *  d3d,
GUID guid,
D3DDEVICEDESC device_desc 
)
static

Definition at line 387 of file device.c.

389 {
390  /* It shouldn't be crucial, but print a FIXME, I'm interested if
391  * any game calls it and when. */
392  FIXME("iface %p, d3d %p, guid %s, device_desc %p nop!\n",
393  iface, d3d, debugstr_guid(guid), device_desc);
394 
395  return D3D_OK;
396 }
const GUID * guid
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_guid
Definition: kernel32.h:35
#define D3D_OK
Definition: d3d.h:106

◆ d3d_device1_NextViewport()

static HRESULT WINAPI d3d_device1_NextViewport ( IDirect3DDevice *  iface,
IDirect3DViewport *  viewport,
IDirect3DViewport **  next,
DWORD  flags 
)
static

Definition at line 947 of file device.c.

949 {
951  struct d3d_viewport *vp = unsafe_impl_from_IDirect3DViewport(viewport);
952  IDirect3DViewport3 *res;
953  HRESULT hr;
954 
955  TRACE("iface %p, viewport %p, next %p, flags %#x.\n",
956  iface, viewport, next, flags);
957 
958  hr = d3d_device3_NextViewport(&device->IDirect3DDevice3_iface,
960  *next = (IDirect3DViewport *)res;
961  return hr;
962 }
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport(IDirect3DViewport *iface) DECLSPEC_HIDDEN
Definition: viewport.c:1138
static struct d3d_device * impl_from_IDirect3DDevice(IDirect3DDevice *iface)
static HRESULT WINAPI d3d_device3_NextViewport(IDirect3DDevice3 *iface, IDirect3DViewport3 *Viewport3, IDirect3DViewport3 **lplpDirect3DViewport3, DWORD flags)
Definition: device.c:877
HRESULT hr
Definition: shlfolder.c:183
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78
GLbitfield flags
Definition: glext.h:7161
IDirect3DViewport3 IDirect3DViewport3_iface
static unsigned __int64 next
Definition: rand_nt.c:6
GLuint res
Definition: glext.h:9613

◆ d3d_device1_Pick()

static HRESULT WINAPI d3d_device1_Pick ( IDirect3DDevice *  iface,
IDirect3DExecuteBuffer *  buffer,
IDirect3DViewport *  viewport,
DWORD  flags,
D3DRECT rect 
)
static

Definition at line 985 of file device.c.

987 {
988  FIXME("iface %p, buffer %p, viewport %p, flags %#x, rect %s stub!\n",
989  iface, buffer, viewport, flags, wine_dbgstr_rect((RECT *)rect));
990 
991  return D3D_OK;
992 }
GLuint buffer
Definition: glext.h:5915
& rect
Definition: startmenu.cpp:1413
#define FIXME(fmt,...)
Definition: debug.h:111
const char * wine_dbgstr_rect(const RECT *rect)
GLbitfield flags
Definition: glext.h:7161
#define D3D_OK
Definition: d3d.h:106

◆ d3d_device1_QueryInterface()

static HRESULT WINAPI d3d_device1_QueryInterface ( IDirect3DDevice *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 168 of file device.c.

169 {
171 
172  TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
173 
174  return IUnknown_QueryInterface(device->outer_unknown, riid, out);
175 }
static struct d3d_device * impl_from_IDirect3DDevice(IDirect3DDevice *iface)
REFIID riid
Definition: precomp.h:44
Definition: devices.h:37
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static FILE * out
Definition: regtests2xml.c:44

◆ d3d_device1_Release()

static ULONG WINAPI d3d_device1_Release ( IDirect3DDevice *  iface)
static

Definition at line 360 of file device.c.

361 {
363 
364  TRACE("iface %p.\n", iface);
365 
366  return IUnknown_Release(device->outer_unknown);
367 }
static struct d3d_device * impl_from_IDirect3DDevice(IDirect3DDevice *iface)
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d_device1_SetMatrix()

static HRESULT WINAPI d3d_device1_SetMatrix ( IDirect3DDevice *  iface,
D3DMATRIXHANDLE  D3DMatHandle,
D3DMATRIX D3DMatrix 
)
static

Definition at line 1328 of file device.c.

1330 {
1331  struct d3d_device *This = impl_from_IDirect3DDevice(iface);
1332  D3DMATRIX *m;
1333 
1334  TRACE("iface %p, matrix_handle %#x, matrix %p.\n", iface, D3DMatHandle, D3DMatrix);
1335 
1336  if (!D3DMatrix) return DDERR_INVALIDPARAMS;
1337 
1339 
1340  m = ddraw_get_object(&This->handle_table, D3DMatHandle - 1, DDRAW_HANDLE_MATRIX);
1341  if (!m)
1342  {
1343  WARN("Invalid matrix handle.\n");
1345  return DDERR_INVALIDPARAMS;
1346  }
1347 
1348  if (TRACE_ON(ddraw))
1349  dump_D3DMATRIX(D3DMatrix);
1350 
1351  *m = *D3DMatrix;
1352 
1353  if (D3DMatHandle == This->world)
1354  wined3d_device_set_transform(This->wined3d_device,
1355  WINED3D_TS_WORLD_MATRIX(0), (struct wined3d_matrix *)D3DMatrix);
1356 
1357  if (D3DMatHandle == This->view)
1358  wined3d_device_set_transform(This->wined3d_device,
1359  WINED3D_TS_VIEW, (struct wined3d_matrix *)D3DMatrix);
1360 
1361  if (D3DMatHandle == This->proj)
1362  wined3d_device_set_transform(This->wined3d_device,
1363  WINED3D_TS_PROJECTION, (struct wined3d_matrix *)D3DMatrix);
1364 
1366 
1367  return D3D_OK;
1368 }
#define WINED3D_TS_WORLD_MATRIX(index)
Definition: wined3d.h:664
static struct d3d_device * impl_from_IDirect3DDevice(IDirect3DDevice *iface)
#define WARN(fmt,...)
Definition: debug.h:112
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
const GLfloat * m
Definition: glext.h:10848
void * ddraw_get_object(struct ddraw_handle_table *t, DWORD handle, enum ddraw_handle_type type) DECLSPEC_HIDDEN
Definition: main.c:182
void CDECL wined3d_device_set_transform(struct wined3d_device *device, enum wined3d_transform_state d3dts, const struct wined3d_matrix *matrix)
Definition: device.c:1505
#define TRACE(s)
Definition: solgame.cpp:4
#define D3D_OK
Definition: d3d.h:106
void dump_D3DMATRIX(const D3DMATRIX *mat) DECLSPEC_HIDDEN
Definition: utils.c:914
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define TRACE_ON(x)
Definition: compat.h:65
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79

◆ d3d_device1_SwapTextureHandles()

static HRESULT WINAPI d3d_device1_SwapTextureHandles ( IDirect3DDevice *  iface,
IDirect3DTexture *  tex1,
IDirect3DTexture *  tex2 
)
static

Definition at line 565 of file device.c.

567 {
569  struct ddraw_surface *surf1 = unsafe_impl_from_IDirect3DTexture(tex1);
570  struct ddraw_surface *surf2 = unsafe_impl_from_IDirect3DTexture(tex2);
571  IDirect3DTexture2 *t1 = surf1 ? &surf1->IDirect3DTexture2_iface : NULL;
572  IDirect3DTexture2 *t2 = surf2 ? &surf2->IDirect3DTexture2_iface : NULL;
573 
574  TRACE("iface %p, tex1 %p, tex2 %p.\n", iface, tex1, tex2);
575 
576  return d3d_device2_SwapTextureHandles(&device->IDirect3DDevice2_iface, t1, t2);
577 }
static struct d3d_device * impl_from_IDirect3DDevice(IDirect3DDevice *iface)
IDirect3DTexture2 IDirect3DTexture2_iface
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
static HRESULT WINAPI d3d_device2_SwapTextureHandles(IDirect3DDevice2 *iface, IDirect3DTexture2 *tex1, IDirect3DTexture2 *tex2)
Definition: device.c:541
#define TRACE(s)
Definition: solgame.cpp:4
struct ddraw_surface * unsafe_impl_from_IDirect3DTexture(IDirect3DTexture *iface) DECLSPEC_HIDDEN
Definition: surface.c:5728

◆ d3d_device2_AddRef()

static ULONG WINAPI d3d_device2_AddRef ( IDirect3DDevice2 *  iface)
static

Definition at line 205 of file device.c.

206 {
208 
209  TRACE("iface %p.\n", iface);
210 
211  return IUnknown_AddRef(device->outer_unknown);
212 }
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)

◆ d3d_device2_AddViewport()

static HRESULT WINAPI d3d_device2_AddViewport ( IDirect3DDevice2 *  iface,
IDirect3DViewport2 *  viewport 
)
static

Definition at line 761 of file device.c.

763 {
765  struct d3d_viewport *vp = unsafe_impl_from_IDirect3DViewport2(viewport);
766 
767  TRACE("iface %p, viewport %p.\n", iface, viewport);
768 
769  return d3d_device3_AddViewport(&device->IDirect3DDevice3_iface, &vp->IDirect3DViewport3_iface);
770 }
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport2(IDirect3DViewport2 *iface) DECLSPEC_HIDDEN
Definition: viewport.c:1130
static HRESULT WINAPI d3d_device3_AddViewport(IDirect3DDevice3 *iface, IDirect3DViewport3 *viewport)
Definition: device.c:740
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
IDirect3DViewport3 IDirect3DViewport3_iface
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)

◆ d3d_device2_Begin()

static HRESULT WINAPI d3d_device2_Begin ( IDirect3DDevice2 *  iface,
D3DPRIMITIVETYPE  primitive_type,
D3DVERTEXTYPE  vertex_type,
DWORD  flags 
)
static

Definition at line 2110 of file device.c.

2112 {
2113  struct d3d_device *device = impl_from_IDirect3DDevice2(iface);
2114  DWORD fvf;
2115 
2116  TRACE("iface %p, primitive_type %#x, vertex_type %#x, flags %#x.\n",
2117  iface, primitive_type, vertex_type, flags);
2118 
2119  switch (vertex_type)
2120  {
2121  case D3DVT_VERTEX: fvf = D3DFVF_VERTEX; break;
2122  case D3DVT_LVERTEX: fvf = D3DFVF_LVERTEX; break;
2123  case D3DVT_TLVERTEX: fvf = D3DFVF_TLVERTEX; break;
2124  default:
2125  ERR("Unexpected vertex type %#x.\n", vertex_type);
2126  return DDERR_INVALIDPARAMS; /* Should never happen */
2127  };
2128 
2129  return d3d_device3_Begin(&device->IDirect3DDevice3_iface, primitive_type, fvf, flags);
2130 }
DWORD vertex_type
Definition: devices.h:37
#define D3DFVF_VERTEX
Definition: d3dtypes.h:1328
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
static HRESULT WINAPI d3d_device3_Begin(IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, DWORD flags)
Definition: device.c:2091
#define D3DFVF_TLVERTEX
Definition: d3dtypes.h:1331
#define ERR(fmt,...)
Definition: debug.h:110
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)
#define D3DFVF_LVERTEX
Definition: d3dtypes.h:1329
D3DPRIMITIVETYPE primitive_type
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79

◆ d3d_device2_BeginIndexed()

static HRESULT WINAPI d3d_device2_BeginIndexed ( IDirect3DDevice2 *  iface,
D3DPRIMITIVETYPE  primitive_type,
D3DVERTEXTYPE  vertex_type,
void vertices,
DWORD  vertex_count,
DWORD  flags 
)
static

Definition at line 2162 of file device.c.

2165 {
2166  struct d3d_device *device = impl_from_IDirect3DDevice2(iface);
2167  DWORD fvf;
2168 
2169  TRACE("iface %p, primitive_type %#x, vertex_type %#x, vertices %p, vertex_count %u, flags %#x stub!\n",
2170  iface, primitive_type, vertex_type, vertices, vertex_count, flags);
2171 
2172  switch (vertex_type)
2173  {
2174  case D3DVT_VERTEX: fvf = D3DFVF_VERTEX; break;
2175  case D3DVT_LVERTEX: fvf = D3DFVF_LVERTEX; break;
2176  case D3DVT_TLVERTEX: fvf = D3DFVF_TLVERTEX; break;
2177  default:
2178  ERR("Unexpected vertex type %#x.\n", vertex_type);
2179  return DDERR_INVALIDPARAMS; /* Should never happen */
2180  };
2181 
2182  return d3d_device3_BeginIndexed(&device->IDirect3DDevice3_iface,
2183  primitive_type, fvf, vertices, vertex_count, flags);
2184 }
static HRESULT WINAPI d3d_device3_BeginIndexed(IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, DWORD flags)
Definition: device.c:2151
DWORD vertex_type
int vertex_count
Definition: d3drm.c:3367
Definition: devices.h:37
#define D3DFVF_VERTEX
Definition: d3dtypes.h:1328
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
#define D3DFVF_TLVERTEX
Definition: d3dtypes.h:1331
#define ERR(fmt,...)
Definition: debug.h:110
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)
#define D3DFVF_LVERTEX
Definition: d3dtypes.h:1329
D3DPRIMITIVETYPE primitive_type
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79

◆ d3d_device2_BeginScene()

static HRESULT WINAPI d3d_device2_BeginScene ( IDirect3DDevice2 *  iface)
static

Definition at line 1507 of file device.c.

1508 {
1509  struct d3d_device *device = impl_from_IDirect3DDevice2(iface);
1510 
1511  TRACE("iface %p.\n", iface);
1512 
1513  return IDirect3DDevice7_BeginScene(&device->IDirect3DDevice7_iface);
1514 }
#define IDirect3DDevice7_BeginScene(p)
Definition: d3d.h:1348
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)

◆ d3d_device2_DeleteViewport()

static HRESULT WINAPI d3d_device2_DeleteViewport ( IDirect3DDevice2 *  iface,
IDirect3DViewport2 *  viewport 
)
static

Definition at line 837 of file device.c.

838 {
840  struct d3d_viewport *vp = unsafe_impl_from_IDirect3DViewport2(viewport);
841 
842  TRACE("iface %p, viewport %p.\n", iface, viewport);
843 
844  return d3d_device3_DeleteViewport(&device->IDirect3DDevice3_iface,
845  vp ? &vp->IDirect3DViewport3_iface : NULL);
846 }
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport2(IDirect3DViewport2 *iface) DECLSPEC_HIDDEN
Definition: viewport.c:1130
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT WINAPI d3d_device3_DeleteViewport(IDirect3DDevice3 *iface, IDirect3DViewport3 *viewport)
Definition: device.c:798
IDirect3DViewport3 IDirect3DViewport3_iface
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)

◆ d3d_device2_DrawIndexedPrimitive()

static HRESULT WINAPI d3d_device2_DrawIndexedPrimitive ( IDirect3DDevice2 *  iface,
D3DPRIMITIVETYPE  primitive_type,
D3DVERTEXTYPE  vertex_type,
void vertices,
DWORD  vertex_count,
WORD indices,
DWORD  index_count,
DWORD  flags 
)
static

Definition at line 3805 of file device.c.

3808 {
3809  struct d3d_device *device = impl_from_IDirect3DDevice2(iface);
3810  DWORD fvf;
3811 
3812  TRACE("iface %p, primitive_type %#x, vertex_type %#x, vertices %p, vertex_count %u, "
3813  "indices %p, index_count %u, flags %#x.\n",
3814  iface, primitive_type, vertex_type, vertices, vertex_count, indices, index_count, flags);
3815 
3816  switch (vertex_type)
3817  {
3818  case D3DVT_VERTEX: fvf = D3DFVF_VERTEX; break;
3819  case D3DVT_LVERTEX: fvf = D3DFVF_LVERTEX; break;
3820  case D3DVT_TLVERTEX: fvf = D3DFVF_TLVERTEX; break;
3821  default:
3822  ERR("Unhandled vertex type %#x.\n", vertex_type);
3823  return DDERR_INVALIDPARAMS; /* Should never happen */
3824  }
3825 
3826  return d3d_device3_DrawIndexedPrimitive(&device->IDirect3DDevice3_iface,
3827  primitive_type, fvf, vertices, vertex_count, indices, index_count, flags);
3828 }
GLuint GLuint GLsizei GLenum const GLvoid * indices
Definition: gl.h:1545
static HRESULT WINAPI d3d_device3_DrawIndexedPrimitive(IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, WORD *indices, DWORD index_count, DWORD flags)
Definition: device.c:3789
DWORD vertex_type
int vertex_count
Definition: d3drm.c:3367
Definition: devices.h:37
#define D3DFVF_VERTEX
Definition: d3dtypes.h:1328
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
#define D3DFVF_TLVERTEX
Definition: d3dtypes.h:1331
#define ERR(fmt,...)
Definition: debug.h:110
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)
#define D3DFVF_LVERTEX
Definition: d3dtypes.h:1329
D3DPRIMITIVETYPE primitive_type
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79

◆ d3d_device2_DrawPrimitive()

static HRESULT WINAPI d3d_device2_DrawPrimitive ( IDirect3DDevice2 *  iface,
D3DPRIMITIVETYPE  primitive_type,
D3DVERTEXTYPE  vertex_type,
void vertices,
DWORD  vertex_count,
DWORD  flags 
)
static

Definition at line 3603 of file device.c.

3606 {
3607  struct d3d_device *device = impl_from_IDirect3DDevice2(iface);
3608  DWORD fvf;
3609 
3610  TRACE("iface %p, primitive_type %#x, vertex_type %#x, vertices %p, vertex_count %u, flags %#x.\n",
3611  iface, primitive_type, vertex_type, vertices, vertex_count, flags);
3612 
3613  switch (vertex_type)
3614  {
3615  case D3DVT_VERTEX: fvf = D3DFVF_VERTEX; break;
3616  case D3DVT_LVERTEX: fvf = D3DFVF_LVERTEX; break;
3617  case D3DVT_TLVERTEX: fvf = D3DFVF_TLVERTEX; break;
3618  default:
3619  FIXME("Unhandled vertex type %#x.\n", vertex_type);
3620  return DDERR_INVALIDPARAMS; /* Should never happen */
3621  }
3622 
3623  return d3d_device3_DrawPrimitive(&device->IDirect3DDevice3_iface,
3624  primitive_type, fvf, vertices, vertex_count, flags);
3625 }
DWORD vertex_type
int vertex_count
Definition: d3drm.c:3367
Definition: devices.h:37
#define FIXME(fmt,...)
Definition: debug.h:111
#define D3DFVF_VERTEX
Definition: d3dtypes.h:1328
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
#define D3DFVF_TLVERTEX
Definition: d3dtypes.h:1331
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)
#define D3DFVF_LVERTEX
Definition: d3dtypes.h:1329
static HRESULT WINAPI d3d_device3_DrawPrimitive(IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, DWORD flags)
Definition: device.c:3588
D3DPRIMITIVETYPE primitive_type
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79

◆ d3d_device2_End()

static HRESULT WINAPI d3d_device2_End ( IDirect3DDevice2 *  iface,
DWORD  flags 
)
static

Definition at line 3858 of file device.c.

3859 {
3860  struct d3d_device *device = impl_from_IDirect3DDevice2(iface);
3861 
3862  TRACE("iface %p, flags %#x.\n", iface, flags);
3863 
3864  return d3d_device3_End(&device->IDirect3DDevice3_iface, flags);
3865 }
static HRESULT WINAPI d3d_device3_End(IDirect3DDevice3 *iface, DWORD flags)
Definition: device.c:3848
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
GLbitfield flags
Definition: glext.h:7161
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)

◆ d3d_device2_EndScene()

static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device2_EndScene ( IDirect3DDevice2 *  iface)
static

Definition at line 1580 of file device.c.

1581 {
1582  struct d3d_device *device = impl_from_IDirect3DDevice2(iface);
1583 
1584  TRACE("iface %p.\n", iface);
1585 
1586  return IDirect3DDevice7_EndScene(&device->IDirect3DDevice7_iface);
1587 }
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)
#define IDirect3DDevice7_EndScene(p)
Definition: d3d.h:1349

◆ d3d_device2_EnumTextureFormats()

static HRESULT WINAPI d3d_device2_EnumTextureFormats ( IDirect3DDevice2 *  iface,
LPD3DENUMTEXTUREFORMATSCALLBACK  callback,
void context 
)
static

Definition at line 1178 of file device.c.

1180 {
1181  struct d3d_device *device = impl_from_IDirect3DDevice2(iface);
1182  struct wined3d_display_mode mode;
1183  HRESULT hr;
1184  unsigned int i;
1185 
1186  static const enum wined3d_format_id FormatList[] =
1187  {
1188  /* 16 bit */
1193  /* 32 bit */
1196  /* 8 bit */
1199  /* FOURCC codes - Not in this version*/
1200  };
1201 
1202  TRACE("iface %p, callback %p, context %p.\n", iface, callback, context);
1203 
1204  if (!callback)
1205  return DDERR_INVALIDPARAMS;
1206 
1208 
1209  memset(&mode, 0, sizeof(mode));
1211  {
1213  WARN("Cannot get the current adapter format\n");
1214  return hr;
1215  }
1216 
1217  for (i = 0; i < ARRAY_SIZE(FormatList); ++i)
1218  {
1220  mode.format_id, WINED3DUSAGE_TEXTURE, WINED3D_RTYPE_TEXTURE_2D, FormatList[i]) == D3D_OK)
1221  {
1222  DDSURFACEDESC sdesc;
1223 
1224  memset(&sdesc, 0, sizeof(sdesc));
1225  sdesc.dwSize = sizeof(sdesc);
1226  sdesc.dwFlags = DDSD_PIXELFORMAT | DDSD_CAPS;
1227  sdesc.ddsCaps.dwCaps = DDSCAPS_TEXTURE;
1228  sdesc.ddpfPixelFormat.dwSize = sizeof(sdesc.ddpfPixelFormat);
1229  ddrawformat_from_wined3dformat(&sdesc.ddpfPixelFormat, FormatList[i]);
1230 
1231  TRACE("Enumerating WineD3DFormat %d\n", FormatList[i]);
1232  hr = callback(&sdesc, context);
1233  if(hr != DDENUMRET_OK)
1234  {
1235  TRACE("Format enumeration cancelled by application\n");
1237  return D3D_OK;
1238  }
1239  }
1240  }
1241  TRACE("End of enumeration\n");
1243 
1244  return D3D_OK;
1245 }
HRESULT CDECL wined3d_get_adapter_display_mode(const struct wined3d *wined3d, UINT adapter_idx, struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation)
Definition: directx.c:4767
HRESULT hr
Definition: shlfolder.c:183
Definition: http.c:7094
#define WARN(fmt,...)
Definition: debug.h:112
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define DDSCAPS_TEXTURE
Definition: ddraw.h:262
HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, enum wined3d_format_id adapter_format_id, DWORD usage, enum wined3d_resource_type resource_type, enum wined3d_format_id check_format_id)
Definition: directx.c:5334
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define DDSD_CAPS
Definition: ddraw.h:208
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
MmuTrapHandler callback[0x30]
Definition: mmuobject.c:44
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78
#define WINED3DADAPTER_DEFAULT
Definition: wined3d.h:857
#define DDENUMRET_OK
Definition: ddraw.h:189
GLenum mode
Definition: glext.h:6217
wined3d_format_id
Definition: wined3d.h:105
#define DDSD_PIXELFORMAT
Definition: ddraw.h:216
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)
#define D3D_OK
Definition: d3d.h:106
#define ARRAY_SIZE(a)
Definition: main.h:24
#define WINED3DUSAGE_TEXTURE
Definition: wined3d.h:918
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define memset(x, y, z)
Definition: compat.h:39
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79
void ddrawformat_from_wined3dformat(DDPIXELFORMAT *ddraw_format, enum wined3d_format_id wined3d_format) DECLSPEC_HIDDEN
Definition: utils.c:33

Referenced by d3d_device1_EnumTextureFormats().

◆ d3d_device2_GetCaps()

static HRESULT WINAPI d3d_device2_GetCaps ( IDirect3DDevice2 *  iface,
D3DDEVICEDESC hw_desc,
D3DDEVICEDESC hel_desc 
)
static

Definition at line 509 of file device.c.

511 {
513 
514  TRACE("iface %p, hw_desc %p, hel_desc %p.\n", iface, hw_desc, hel_desc);
515 
516  return d3d_device3_GetCaps(&device->IDirect3DDevice3_iface, hw_desc, hel_desc);
517 }
static HRESULT WINAPI d3d_device3_GetCaps(IDirect3DDevice3 *iface, D3DDEVICEDESC *HWDesc, D3DDEVICEDESC *HelDesc)
Definition: device.c:469
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)

◆ d3d_device2_GetClipStatus()

static HRESULT WINAPI d3d_device2_GetClipStatus ( IDirect3DDevice2 *  iface,
D3DCLIPSTATUS clip_status 
)
static

Definition at line 3936 of file device.c.

3937 {
3938  struct d3d_device *device = impl_from_IDirect3DDevice2(iface);
3939 
3940  TRACE("iface %p, clip_status %p.\n", iface, clip_status);
3941 
3942  return IDirect3DDevice7_GetClipStatus(&device->IDirect3DDevice7_iface, clip_status);
3943 }
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)
#define IDirect3DDevice7_GetClipStatus(p, a)
Definition: d3d.h:1371

◆ d3d_device2_GetCurrentViewport()

static HRESULT WINAPI d3d_device2_GetCurrentViewport ( IDirect3DDevice2 *  iface,
IDirect3DViewport2 **  viewport 
)
static

Definition at line 1788 of file device.c.

1789 {
1790  struct d3d_device *device = impl_from_IDirect3DDevice2(iface);
1791 
1792  TRACE("iface %p, viewport %p.\n", iface, viewport);
1793 
1794  return d3d_device3_GetCurrentViewport(&device->IDirect3DDevice3_iface,
1795  (IDirect3DViewport3 **)viewport);
1796 }
Definition: devices.h:37
static HRESULT WINAPI d3d_device3_GetCurrentViewport(IDirect3DDevice3 *iface, IDirect3DViewport3 **viewport)
Definition: device.c:1766
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)

◆ d3d_device2_GetDirect3D()

static HRESULT WINAPI d3d_device2_GetDirect3D ( IDirect3DDevice2 *  iface,
IDirect3D2 **  d3d 
)
static

Definition at line 1644 of file device.c.

1645 {
1646  struct d3d_device *device = impl_from_IDirect3DDevice2(iface);
1647 
1648  TRACE("iface %p, d3d %p.\n", iface, d3d);
1649 
1650  if (!d3d)
1651  return DDERR_INVALIDPARAMS;
1652 
1653  *d3d = &device->ddraw->IDirect3D2_iface;
1654  IDirect3D2_AddRef(*d3d);
1655 
1656  TRACE("Returning interface %p.\n", *d3d);
1657  return D3D_OK;
1658 }
#define IDirect3D2_AddRef(p)
Definition: d3d.h:279
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)
#define D3D_OK
Definition: d3d.h:106
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79

◆ d3d_device2_GetLightState()

static HRESULT WINAPI d3d_device2_GetLightState ( IDirect3DDevice2 *  iface,
D3DLIGHTSTATETYPE  state,
DWORD value 
)
static

Definition at line 3105 of file device.c.

3107 {
3108  struct d3d_device *device = impl_from_IDirect3DDevice2(iface);
3109 
3110  TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
3111 
3112  return d3d_device3_GetLightState(&device->IDirect3DDevice3_iface, state, value);
3113 }
Definition: devices.h:37
static HRESULT WINAPI d3d_device3_GetLightState(IDirect3DDevice3 *iface, D3DLIGHTSTATETYPE state, DWORD *value)
Definition: device.c:3041
#define TRACE(s)
Definition: solgame.cpp:4
static int state
Definition: maze.c:121
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)

◆ d3d_device2_GetRenderState()

static HRESULT WINAPI d3d_device2_GetRenderState ( IDirect3DDevice2 *  iface,
D3DRENDERSTATETYPE  state,
DWORD value 
)
static

Definition at line 2534 of file device.c.

2536 {
2537  struct d3d_device *device = impl_from_IDirect3DDevice2(iface);
2538 
2539  TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
2540 
2541  return IDirect3DDevice3_GetRenderState(&device->IDirect3DDevice3_iface, state, value);
2542 }
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
static int state
Definition: maze.c:121
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)
#define IDirect3DDevice3_GetRenderState(p, a, b)
Definition: d3d.h:1212

◆ d3d_device2_GetRenderTarget()

static HRESULT WINAPI d3d_device2_GetRenderTarget ( IDirect3DDevice2 *  iface,
IDirectDrawSurface **  RenderTarget 
)
static

Definition at line 2052 of file device.c.

2053 {
2054  struct d3d_device *device = impl_from_IDirect3DDevice2(iface);
2055  IDirectDrawSurface7 *RenderTarget7;
2056  struct ddraw_surface *RenderTargetImpl;
2057  HRESULT hr;
2058 
2059  TRACE("iface %p, target %p.\n", iface, RenderTarget);
2060 
2061  if(!RenderTarget)
2062  return DDERR_INVALIDPARAMS;
2063 
2064  hr = d3d_device7_GetRenderTarget(&device->IDirect3DDevice7_iface, &RenderTarget7);
2065  if(hr != D3D_OK) return hr;
2066  RenderTargetImpl = impl_from_IDirectDrawSurface7(RenderTarget7);
2067  *RenderTarget = &RenderTargetImpl->IDirectDrawSurface_iface;
2068  IDirectDrawSurface_AddRef(*RenderTarget);
2069  IDirectDrawSurface7_Release(RenderTarget7);
2070  return D3D_OK;
2071 }
HRESULT hr
Definition: shlfolder.c:183
static struct ddraw_surface * impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface)
Definition: devices.h:37
IDirectDrawSurface IDirectDrawSurface_iface
DWORD IDirectDrawSurface7
Definition: vmrender.idl:20
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)
#define D3D_OK
Definition: d3d.h:106
static HRESULT WINAPI d3d_device7_GetRenderTarget(IDirect3DDevice7 *iface, IDirectDrawSurface7 **RenderTarget)
Definition: device.c:2014
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79

◆ d3d_device2_GetStats()

static HRESULT WINAPI d3d_device2_GetStats ( IDirect3DDevice2 *  iface,
D3DSTATS stats 
)
static

Definition at line 614 of file device.c.

615 {
617 
618  TRACE("iface %p, stats %p.\n", iface, stats);
619 
620  return d3d_device3_GetStats(&device->IDirect3DDevice3_iface, stats);
621 }
static HRESULT WINAPI d3d_device3_GetStats(IDirect3DDevice3 *iface, D3DSTATS *Stats)
Definition: device.c:597
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)

◆ d3d_device2_GetTransform()

static HRESULT WINAPI d3d_device2_GetTransform ( IDirect3DDevice2 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX matrix 
)
static

Definition at line 3321 of file device.c.

3323 {
3324  struct d3d_device *device = impl_from_IDirect3DDevice2(iface);
3325 
3326  TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
3327 
3328  return IDirect3DDevice3_GetTransform(&device->IDirect3DDevice3_iface, state, matrix);
3329 }
GLuint GLenum matrix
Definition: glext.h:9407
#define IDirect3DDevice3_GetTransform(p, a, b)
Definition: d3d.h:1217
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
static int state
Definition: maze.c:121
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)

◆ d3d_device2_Index()

static HRESULT WINAPI d3d_device2_Index ( IDirect3DDevice2 *  iface,
WORD  index 
)
static

Definition at line 2262 of file device.c.

2263 {
2264  struct d3d_device *device = impl_from_IDirect3DDevice2(iface);
2265 
2266  TRACE("iface %p, index %#x.\n", iface, index);
2267 
2268  return d3d_device3_Index(&device->IDirect3DDevice3_iface, index);
2269 }
Definition: devices.h:37
GLuint index
Definition: glext.h:6031
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)
static HRESULT WINAPI d3d_device3_Index(IDirect3DDevice3 *iface, WORD index)
Definition: device.c:2255

◆ d3d_device2_MultiplyTransform()

static HRESULT WINAPI d3d_device2_MultiplyTransform ( IDirect3DDevice2 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX matrix 
)
static

Definition at line 3427 of file device.c.

3429 {
3430  struct d3d_device *device = impl_from_IDirect3DDevice2(iface);
3431 
3432  TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
3433 
3434  return IDirect3DDevice3_MultiplyTransform(&device->IDirect3DDevice3_iface, state, matrix);
3435 }
GLuint GLenum matrix
Definition: glext.h:9407
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
static int state
Definition: maze.c:121
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)
#define IDirect3DDevice3_MultiplyTransform(p, a, b)
Definition: d3d.h:1218

◆ d3d_device2_NextViewport()

static HRESULT WINAPI d3d_device2_NextViewport ( IDirect3DDevice2 *  iface,
IDirect3DViewport2 *  viewport,
IDirect3DViewport2 **  next,
DWORD  flags 
)
static

Definition at line 930 of file device.c.

932 {
934  struct d3d_viewport *vp = unsafe_impl_from_IDirect3DViewport2(viewport);
935  IDirect3DViewport3 *res;
936  HRESULT hr;
937 
938  TRACE("iface %p, viewport %p, next %p, flags %#x.\n",
939  iface, viewport, next, flags);
940 
941  hr = d3d_device3_NextViewport(&device->IDirect3DDevice3_iface,
943  *next = (IDirect3DViewport2 *)res;
944  return hr;
945 }
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport2(IDirect3DViewport2 *iface) DECLSPEC_HIDDEN
Definition: viewport.c:1130
static HRESULT WINAPI d3d_device3_NextViewport(IDirect3DDevice3 *iface, IDirect3DViewport3 *Viewport3, IDirect3DViewport3 **lplpDirect3DViewport3, DWORD flags)
Definition: device.c:877
HRESULT hr
Definition: shlfolder.c:183
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78
GLbitfield flags
Definition: glext.h:7161
IDirect3DViewport3 IDirect3DViewport3_iface
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)
static unsigned __int64 next
Definition: rand_nt.c:6
GLuint res
Definition: glext.h:9613

◆ d3d_device2_QueryInterface()

static HRESULT WINAPI d3d_device2_QueryInterface ( IDirect3DDevice2 *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 159 of file device.c.

160 {
162 
163  TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
164 
165  return IUnknown_QueryInterface(device->outer_unknown, riid, out);
166 }
REFIID riid
Definition: precomp.h:44
Definition: devices.h:37
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static FILE * out
Definition: regtests2xml.c:44
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)

◆ d3d_device2_Release()

static ULONG WINAPI d3d_device2_Release ( IDirect3DDevice2 *  iface)
static

Definition at line 351 of file device.c.

352 {
354 
355  TRACE("iface %p.\n", iface);
356 
357  return IUnknown_Release(device->outer_unknown);
358 }
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)

◆ d3d_device2_SetClipStatus()

static HRESULT WINAPI d3d_device2_SetClipStatus ( IDirect3DDevice2 *  iface,
D3DCLIPSTATUS clip_status 
)
static

Definition at line 3899 of file device.c.

3900 {
3901  struct d3d_device *device = impl_from_IDirect3DDevice2(iface);
3902 
3903  TRACE("iface %p, clip_status %p.\n", iface, clip_status);
3904 
3905  return IDirect3DDevice7_SetClipStatus(&device->IDirect3DDevice7_iface, clip_status);
3906 }
#define IDirect3DDevice7_SetClipStatus(p, a)
Definition: d3d.h:1370
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)

◆ d3d_device2_SetCurrentViewport()

static HRESULT WINAPI d3d_device2_SetCurrentViewport ( IDirect3DDevice2 *  iface,
IDirect3DViewport2 *  viewport 
)
static

Definition at line 1740 of file device.c.

1741 {
1742  struct d3d_device *device = impl_from_IDirect3DDevice2(iface);
1743  struct d3d_viewport *vp = unsafe_impl_from_IDirect3DViewport2(viewport);
1744 
1745  TRACE("iface %p, viewport %p.\n", iface, viewport);
1746 
1747  return d3d_device3_SetCurrentViewport(&device->IDirect3DDevice3_iface,
1748  vp ? &vp->IDirect3DViewport3_iface : NULL);
1749 }
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport2(IDirect3DViewport2 *iface) DECLSPEC_HIDDEN
Definition: viewport.c:1130
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
static HRESULT WINAPI d3d_device3_SetCurrentViewport(IDirect3DDevice3 *iface, IDirect3DViewport3 *Direct3DViewport3)
Definition: device.c:1692
#define TRACE(s)
Definition: solgame.cpp:4
IDirect3DViewport3 IDirect3DViewport3_iface
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)

◆ d3d_device2_SetLightState()

static HRESULT WINAPI d3d_device2_SetLightState ( IDirect3DDevice2 *  iface,
D3DLIGHTSTATETYPE  state,
DWORD  value 
)
static

Definition at line 3013 of file device.c.

3015 {
3016  struct d3d_device *device = impl_from_IDirect3DDevice2(iface);
3017 
3018  TRACE("iface %p, state %#x, value %#x.\n", iface, state, value);
3019 
3020  return d3d_device3_SetLightState(&device->IDirect3DDevice3_iface, state, value);
3021 }
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
static int state
Definition: maze.c:121
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)
static HRESULT WINAPI d3d_device3_SetLightState(IDirect3DDevice3 *iface, D3DLIGHTSTATETYPE state, DWORD value)
Definition: device.c:2925

◆ d3d_device2_SetRenderState()

static HRESULT WINAPI d3d_device2_SetRenderState ( IDirect3DDevice2 *  iface,
D3DRENDERSTATETYPE  state,
DWORD  value 
)
static

Definition at line 2897 of file device.c.

2899 {
2900  struct d3d_device *device = impl_from_IDirect3DDevice2(iface);
2901 
2902  TRACE("iface %p, state %#x, value %#x.\n", iface, state, value);
2903 
2904  return IDirect3DDevice3_SetRenderState(&device->IDirect3DDevice3_iface, state, value);
2905 }
Definition: devices.h:37
#define IDirect3DDevice3_SetRenderState(p, a, b)
Definition: d3d.h:1213
#define TRACE(s)
Definition: solgame.cpp:4
static int state
Definition: maze.c:121
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)

◆ d3d_device2_SetRenderTarget()

static HRESULT WINAPI d3d_device2_SetRenderTarget ( IDirect3DDevice2 *  iface,
IDirectDrawSurface *  target,
DWORD  flags 
)
static

Definition at line 1948 of file device.c.

1950 {
1952  struct d3d_device *device = impl_from_IDirect3DDevice2(iface);
1953  HRESULT hr;
1954 
1955  TRACE("iface %p, target %p, flags %#x.\n", iface, target, flags);
1956 
1958 
1959  if (!validate_surface_palette(target_impl))
1960  {
1961  WARN("Surface %p has an indexed pixel format, but no palette.\n", target_impl);
1963  return DDERR_INVALIDCAPS;
1964  }
1965 
1966  if (!(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_3DDEVICE))
1967  {
1968  WARN("Surface %p is not a render target.\n", target_impl);
1970  return DDERR_INVALIDCAPS;
1971  }
1972 
1973  if (target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER)
1974  {
1975  WARN("Surface %p is a depth buffer.\n", target_impl);
1976  IUnknown_Release(device->rt_iface);
1977  device->rt_iface = (IUnknown *)target;
1979  return DDERR_INVALIDPIXELFORMAT;
1980  }
1981 
1982  if (device->hw && !(target_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY))
1983  {
1984  WARN("Surface %p is not in video memory.\n", target_impl);
1985  IDirectDrawSurface_AddRef(target);
1986  IUnknown_Release(device->rt_iface);
1987  device->rt_iface = (IUnknown *)target;
1989  return D3D_OK;
1990  }
1991 
1994  return hr;
1995 }
#define DDSCAPS_3DDEVICE
Definition: ddraw.h:263
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface(IDirectDrawSurface *iface) DECLSPEC_HIDDEN
Definition: surface.c:5705
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:112
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define DDERR_INVALIDPIXELFORMAT
Definition: ddraw.h:80
Definition: devices.h:37
DDSCAPS2 ddsCaps
Definition: ddraw.h:1188
DWORD dwCaps
Definition: ddraw.h:732
#define DDSCAPS_ZBUFFER
Definition: ddraw.h:267
#define DDSCAPS_VIDEOMEMORY
Definition: ddraw.h:264
#define TRACE(s)
Definition: solgame.cpp:4
DDSURFACEDESC2 surface_desc
LONG HRESULT
Definition: typedefs.h:78
GLbitfield flags
Definition: glext.h:7161
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)
#define D3D_OK
Definition: d3d.h:106
GLenum target
Definition: glext.h:7315
#define DDERR_INVALIDCAPS
Definition: ddraw.h:75
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
static HRESULT d3d_device_set_render_target(struct d3d_device *device, struct ddraw_surface *target, IUnknown *rt_iface)
Definition: device.c:1804
static BOOL validate_surface_palette(struct ddraw_surface *surface)
Definition: device.c:1798

◆ d3d_device2_SetTransform()

static HRESULT WINAPI d3d_device2_SetTransform ( IDirect3DDevice2 *  iface,
D3DTRANSFORMSTATETYPE  state,
D3DMATRIX matrix 
)
static

Definition at line 3218 of file device.c.

3220 {
3221  struct d3d_device *device = impl_from_IDirect3DDevice2(iface);
3222 
3223  TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
3224 
3225  return IDirect3DDevice3_SetTransform(&device->IDirect3DDevice3_iface, state, matrix);
3226 }
GLuint GLenum matrix
Definition: glext.h:9407
#define IDirect3DDevice3_SetTransform(p, a, b)
Definition: d3d.h:1216
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
static int state
Definition: maze.c:121
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)

◆ d3d_device2_SwapTextureHandles()

static HRESULT WINAPI d3d_device2_SwapTextureHandles ( IDirect3DDevice2 *  iface,
IDirect3DTexture2 *  tex1,
IDirect3DTexture2 *  tex2 
)
static

Definition at line 541 of file device.c.

543 {
547  DWORD h1, h2;
548 
549  TRACE("iface %p, tex1 %p, tex2 %p.\n", iface, tex1, tex2);
550 
552 
553  h1 = surf1->Handle - 1;
554  h2 = surf2->Handle - 1;
555  device->handle_table.entries[h1].object = surf2;
556  device->handle_table.entries[h2].object = surf1;
557  surf2->Handle = h1 + 1;
558  surf1->Handle = h2 + 1;
559 
561 
562  return D3D_OK;
563 }
struct ddraw_surface * unsafe_impl_from_IDirect3DTexture2(IDirect3DTexture2 *iface) DECLSPEC_HIDDEN
Definition: surface.c:5721
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)
#define D3D_OK
Definition: d3d.h:106
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

Referenced by d3d_device1_SwapTextureHandles().

◆ d3d_device2_Vertex()

static HRESULT WINAPI d3d_device2_Vertex ( IDirect3DDevice2 *  iface,
void vertex 
)
static

Definition at line 2233 of file device.c.

2234 {
2235  struct d3d_device *device = impl_from_IDirect3DDevice2(iface);
2236 
2237  TRACE("iface %p, vertex %p.\n", iface, vertex);
2238 
2239  return d3d_device3_Vertex(&device->IDirect3DDevice3_iface, vertex);
2240 }
static HRESULT WINAPI d3d_device3_Vertex(IDirect3DDevice3 *iface, void *vertex)
Definition: device.c:2203
Definition: mesh.c:4557
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d_device * impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface)

◆ d3d_device3_AddRef()

static ULONG WINAPI d3d_device3_AddRef ( IDirect3DDevice3 *  iface)
static

Definition at line 196 of file device.c.

197 {
199 
200  TRACE("iface %p.\n", iface);
201 
202  return IUnknown_AddRef(device->outer_unknown);
203 }
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d_device3_AddViewport()

static HRESULT WINAPI d3d_device3_AddViewport ( IDirect3DDevice3 *  iface,
IDirect3DViewport3 *  viewport 
)
static

Definition at line 740 of file device.c.

741 {
743  struct d3d_viewport *vp = unsafe_impl_from_IDirect3DViewport3(viewport);
744 
745  TRACE("iface %p, viewport %p.\n", iface, viewport);
746 
747  /* Sanity check */
748  if(!vp)
749  return DDERR_INVALIDPARAMS;
750 
752  IDirect3DViewport3_AddRef(viewport);
753  list_add_head(&device->viewport_list, &vp->entry);
754  /* Viewport must be usable for Clear() after AddViewport, so set active_device here. */
755  vp->active_device = device;
757 
758  return D3D_OK;
759 }
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport3(IDirect3DViewport3 *iface) DECLSPEC_HIDDEN
Definition: viewport.c:1123
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
Definition: list.h:96
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
struct d3d_device * active_device
struct list entry
#define D3D_OK
Definition: d3d.h:106
#define IDirect3DViewport3_AddRef(p)
Definition: d3d.h:826
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79

Referenced by d3d_device1_AddViewport(), and d3d_device2_AddViewport().

◆ d3d_device3_Begin()

static HRESULT WINAPI d3d_device3_Begin ( IDirect3DDevice3 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
DWORD  flags 
)
static

Definition at line 2091 of file device.c.

2093 {
2094  struct d3d_device *device = impl_from_IDirect3DDevice3(iface);
2095 
2096  TRACE("iface %p, primitive_type %#x, fvf %#x, flags %#x.\n",
2097  iface, primitive_type, fvf, flags);
2098 
2100  device->primitive_type = primitive_type;
2101  device->vertex_type = fvf;
2102  device->render_flags = flags;
2103  device->vertex_size = get_flexible_vertex_size(device->vertex_type);
2104  device->nb_vertices = 0;
2106 
2107  return D3D_OK;
2108 }
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: devices.h:37
DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) DECLSPEC_HIDDEN
Definition: utils.c:923
#define TRACE(s)
Definition: solgame.cpp:4
GLbitfield flags
Definition: glext.h:7161
#define D3D_OK
Definition: d3d.h:106
D3DPRIMITIVETYPE primitive_type
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

Referenced by d3d_device2_Begin().

◆ d3d_device3_BeginIndexed()

static HRESULT WINAPI d3d_device3_BeginIndexed ( IDirect3DDevice3 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
void vertices,
DWORD  vertex_count,
DWORD  flags 
)
static

Definition at line 2151 of file device.c.

2154 {
2155  FIXME("iface %p, primitive_type %#x, fvf %#x, vertices %p, vertex_count %u, flags %#x stub!\n",
2156  iface, primitive_type, fvf, vertices, vertex_count, flags);
2157 
2158  return D3D_OK;
2159 }
int vertex_count
Definition: d3drm.c:3367
#define FIXME(fmt,...)
Definition: debug.h:111
GLbitfield flags
Definition: glext.h:7161
#define D3D_OK
Definition: d3d.h:106
D3DPRIMITIVETYPE primitive_type

Referenced by d3d_device2_BeginIndexed().

◆ d3d_device3_BeginScene()

static HRESULT WINAPI d3d_device3_BeginScene ( IDirect3DDevice3 *  iface)
static

Definition at line 1498 of file device.c.

1499 {
1500  struct d3d_device *device = impl_from_IDirect3DDevice3(iface);
1501 
1502  TRACE("iface %p.\n", iface);
1503 
1504  return IDirect3DDevice7_BeginScene(&device->IDirect3DDevice7_iface);
1505 }
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
#define IDirect3DDevice7_BeginScene(p)
Definition: d3d.h:1348
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d_device3_ComputeSphereVisibility()

static HRESULT WINAPI d3d_device3_ComputeSphereVisibility ( IDirect3DDevice3 *  iface,
D3DVECTOR centers,
D3DVALUE radii,
DWORD  sphere_count,
DWORD  flags,
DWORD return_values 
)
static

Definition at line 4625 of file device.c.

4627 {
4628  static const DWORD enabled_planes = 0x3f;
4629  struct wined3d_vec4 plane[6];
4630  unsigned int i, j;
4631 
4632  TRACE("iface %p, centers %p, radii %p, sphere_count %u, flags %#x, return_values %p.\n",
4633  iface, centers, radii, sphere_count, flags, return_values);
4634 
4636 
4637  compute_sphere_visibility(plane, enabled_planes, TRUE, centers, radii, sphere_count, return_values);
4638  for (i = 0; i < sphere_count; ++i)
4639  {
4640  BOOL intersect_frustum = FALSE, outside_frustum = FALSE;
4641  DWORD d3d7_result = return_values[i];
4642 
4643  return_values[i] = 0;
4644 
4645  for (j = 0; j < 6; ++j)
4646  {
4647  DWORD clip = (d3d7_result >> j) & (D3DSTATUS_CLIPUNIONLEFT | D3DSTATUS_CLIPINTERSECTIONLEFT);
4648 
4649  if (clip == D3DSTATUS_CLIPUNIONLEFT)
4650  {
4651  return_values[i] |= D3DVIS_INTERSECT_LEFT << j * 2;
4652  intersect_frustum = TRUE;
4653  }
4654  else if (clip)
4655  {
4656  return_values[i] |= D3DVIS_OUTSIDE_LEFT << j * 2;
4657  outside_frustum = TRUE;
4658  }
4659  }
4660  if (outside_frustum)
4661  return_values[i] |= D3DVIS_OUTSIDE_FRUSTUM;
4662  else if (intersect_frustum)
4663  return_values[i] |= D3DVIS_INTERSECT_FRUSTUM;
4664  }
4665  return D3D_OK;
4666 }
#define TRUE
Definition: types.h:120
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum GLint const GLfloat GLenum GLint const GLushort GLint GLint GLsizei GLsizei GLenum GLsizei GLsizei GLenum GLenum const GLvoid GLenum plane
Definition: glfuncs.h:270
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
static void prepare_clip_space_planes(struct d3d_device *device, struct wined3d_vec4 *plane)
Definition: device.c:4533
#define D3DVIS_INTERSECT_LEFT
Definition: d3dtypes.h:1354
#define D3DVIS_OUTSIDE_LEFT
Definition: d3dtypes.h:1355
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int BOOL
Definition: ntddk_ex.h:94
#define D3DVIS_OUTSIDE_FRUSTUM
Definition: d3dtypes.h:1352
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
#define D3DSTATUS_CLIPUNIONLEFT
Definition: d3dtypes.h:421
#define D3DVIS_INTERSECT_FRUSTUM
Definition: d3dtypes.h:1351
#define D3D_OK
Definition: d3d.h:106
static void compute_sphere_visibility(struct wined3d_vec4 plane[12], DWORD enabled_planes, BOOL equality, D3DVECTOR *centers, D3DVALUE *radii, DWORD sphere_count, DWORD *return_values)
Definition: device.c:4589
#define D3DSTATUS_CLIPINTERSECTIONLEFT
Definition: d3dtypes.h:434

◆ d3d_device3_DeleteViewport()

static HRESULT WINAPI d3d_device3_DeleteViewport ( IDirect3DDevice3 *  iface,
IDirect3DViewport3 *  viewport 
)
static

Definition at line 798 of file device.c.

799 {
801  struct d3d_viewport *vp = unsafe_impl_from_IDirect3DViewport3(viewport);
802 
803  TRACE("iface %p, viewport %p.\n", iface, viewport);
804 
805  if (!vp)
806  {
807  WARN("NULL viewport, returning DDERR_INVALIDPARAMS\n");
808  return DDERR_INVALIDPARAMS;
809  }
810 
812 
813  if (vp->active_device != device)
814  {
815  WARN("Viewport %p active device is %p.\n", vp, vp->active_device);
817  return DDERR_INVALIDPARAMS;
818  }
819 
820  if (device->current_viewport == vp)
821  {
822  TRACE("Deleting current viewport, unsetting and releasing\n");
823  IDirect3DViewport3_Release(viewport);
824  device->current_viewport = NULL;
825  }
826 
827  vp->active_device = NULL;
828  list_remove(&vp->entry);
829 
830  IDirect3DViewport3_Release(viewport);
831 
833 
834  return D3D_OK;
835 }
struct d3d_viewport * unsafe_impl_from_IDirect3DViewport3(IDirect3DViewport3 *iface) DECLSPEC_HIDDEN
Definition: viewport.c:1123
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
#define WARN(fmt,...)
Definition: debug.h:112
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define TRACE(s)
Definition: solgame.cpp:4
struct d3d_device * active_device
struct list entry
#define D3D_OK
Definition: d3d.h:106
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define IDirect3DViewport3_Release(p)
Definition: d3d.h:827
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79

Referenced by d3d_device1_DeleteViewport(), and d3d_device2_DeleteViewport().

◆ d3d_device3_DrawIndexedPrimitive()

static HRESULT WINAPI d3d_device3_DrawIndexedPrimitive ( IDirect3DDevice3 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
void vertices,
DWORD  vertex_count,
WORD indices,
DWORD  index_count,
DWORD  flags 
)
static

Definition at line 3789 of file device.c.

3792 {
3793  struct d3d_device *device = impl_from_IDirect3DDevice3(iface);
3794 
3795  TRACE("iface %p, primitive_type %#x, fvf %#x, vertices %p, vertex_count %u, "
3796  "indices %p, index_count %u, flags %#x.\n",
3797  iface, primitive_type, fvf, vertices, vertex_count, indices, index_count, flags);
3798 
3799  setup_lighting(device, fvf, flags);
3800 
3801  return IDirect3DDevice7_DrawIndexedPrimitive(&device->IDirect3DDevice7_iface,
3802  primitive_type, fvf, vertices, vertex_count, indices, index_count, flags);
3803 }
GLuint GLuint GLsizei GLenum const GLvoid * indices
Definition: gl.h:1545
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
int vertex_count
Definition: d3drm.c:3367
Definition: devices.h:37
static void setup_lighting(const struct d3d_device *device, DWORD fvf, DWORD flags)
Definition: device.c:3576
#define TRACE(s)
Definition: solgame.cpp:4
GLbitfield flags
Definition: glext.h:7161
#define IDirect3DDevice7_DrawIndexedPrimitive(p, a, b, c, d, e, f, g)
Definition: d3d.h:1369
D3DPRIMITIVETYPE primitive_type

Referenced by d3d_device2_DrawIndexedPrimitive().

◆ d3d_device3_DrawIndexedPrimitiveStrided()

static HRESULT WINAPI d3d_device3_DrawIndexedPrimitiveStrided ( IDirect3DDevice3 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
DWORD  VertexType,
D3DDRAWPRIMITIVESTRIDEDDATA D3DDrawPrimStrideData,
DWORD  VertexCount,
WORD Indices,
DWORD  IndexCount,
DWORD  Flags 
)
static

Definition at line 4238 of file device.c.

4242 {
4243  struct d3d_device *device = impl_from_IDirect3DDevice3(iface);
4244 
4245  TRACE("iface %p, primitive_type %#x, FVF %#x, strided_data %p, vertex_count %u, indices %p, index_count %u, flags %#x.\n",
4246  iface, PrimitiveType, VertexType, D3DDrawPrimStrideData, VertexCount, Indices, IndexCount, Flags);
4247 
4248  setup_lighting(device, VertexType, Flags);
4249 
4250  return IDirect3DDevice7_DrawIndexedPrimitiveStrided(&device->IDirect3DDevice7_iface,
4251  PrimitiveType, VertexType, D3DDrawPrimStrideData, VertexCount, Indices, IndexCount, Flags);
4252 }
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
Definition: devices.h:37
static void setup_lighting(const struct d3d_device *device, DWORD fvf, DWORD flags)
Definition: device.c:3576
#define TRACE(s)
Definition: solgame.cpp:4
#define IDirect3DDevice7_DrawIndexedPrimitiveStrided(p, a, b, c, d, e, f, g)
Definition: d3d.h:1373

◆ d3d_device3_DrawIndexedPrimitiveVB()

static HRESULT WINAPI d3d_device3_DrawIndexedPrimitiveVB ( IDirect3DDevice3 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
IDirect3DVertexBuffer *  D3DVertexBuf,
WORD Indices,
DWORD  IndexCount,
DWORD  Flags 
)
static

Definition at line 4466 of file device.c.

4469 {
4470  struct d3d_device *device = impl_from_IDirect3DDevice3(iface);
4471  struct d3d_vertex_buffer *vb = unsafe_impl_from_IDirect3DVertexBuffer7((IDirect3DVertexBuffer7 *)D3DVertexBuf);
4472 
4473  TRACE("iface %p, primitive_type %#x, vb %p, indices %p, index_count %u, flags %#x.\n",
4474  iface, PrimitiveType, D3DVertexBuf, Indices, IndexCount, Flags);
4475 
4476  setup_lighting(device, vb->fvf, Flags);
4477 
4478  return IDirect3DDevice7_DrawIndexedPrimitiveVB(&device->IDirect3DDevice7_iface, PrimitiveType,
4479  &vb->IDirect3DVertexBuffer7_iface, 0, IndexCount, Indices, IndexCount, Flags);
4480 }
IDirect3DVertexBuffer7 IDirect3DVertexBuffer7_iface
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
Definition: devices.h:37
static void setup_lighting(const struct d3d_device *device, DWORD fvf, DWORD flags)
Definition: device.c:3576
#define TRACE(s)
Definition: solgame.cpp:4
struct d3d_vertex_buffer * unsafe_impl_from_IDirect3DVertexBuffer7(IDirect3DVertexBuffer7 *iface) DECLSPEC_HIDDEN
Definition: vertexbuffer.c:486
#define IDirect3DDevice7_DrawIndexedPrimitiveVB(p, a, b, c, d, e, f, g)
Definition: d3d.h:1375

◆ d3d_device3_DrawPrimitive()

static HRESULT WINAPI d3d_device3_DrawPrimitive ( IDirect3DDevice3 *  iface,
D3DPRIMITIVETYPE  primitive_type,
DWORD  fvf,
void vertices,
DWORD  vertex_count,
DWORD  flags 
)
static

Definition at line 3588 of file device.c.

3591 {
3592  struct d3d_device *device = impl_from_IDirect3DDevice3(iface);
3593 
3594  TRACE("iface %p, primitive_type %#x, fvf %#x, vertices %p, vertex_count %u, flags %#x.\n",
3595  iface, primitive_type, fvf, vertices, vertex_count, flags);
3596 
3597  setup_lighting(device, fvf, flags);
3598 
3599  return IDirect3DDevice7_DrawPrimitive(&device->IDirect3DDevice7_iface,
3600  primitive_type, fvf, vertices, vertex_count, flags);
3601 }
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
int vertex_count
Definition: d3drm.c:3367
#define IDirect3DDevice7_DrawPrimitive(p, a, b, c, d, e)
Definition: d3d.h:1368
Definition: devices.h:37
static void setup_lighting(const struct d3d_device *device, DWORD fvf, DWORD flags)
Definition: device.c:3576
#define TRACE(s)
Definition: solgame.cpp:4
GLbitfield flags
Definition: glext.h:7161
D3DPRIMITIVETYPE primitive_type

Referenced by d3d_device2_DrawPrimitive(), and d3d_device3_End().

◆ d3d_device3_DrawPrimitiveStrided()

static HRESULT WINAPI d3d_device3_DrawPrimitiveStrided ( IDirect3DDevice3 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
DWORD  VertexType,
D3DDRAWPRIMITIVESTRIDEDDATA D3DDrawPrimStrideData,
DWORD  VertexCount,
DWORD  Flags 
)
static

Definition at line 4101 of file device.c.

4104 {
4105  struct d3d_device *device = impl_from_IDirect3DDevice3(iface);
4106 
4107  TRACE("iface %p, primitive_type %#x, FVF %#x, strided_data %p, vertex_count %u, flags %#x.\n",
4108  iface, PrimitiveType, VertexType, D3DDrawPrimStrideData, VertexCount, Flags);
4109 
4110  setup_lighting(device, VertexType, Flags);
4111 
4112  return IDirect3DDevice7_DrawPrimitiveStrided(&device->IDirect3DDevice7_iface,
4113  PrimitiveType, VertexType, D3DDrawPrimStrideData, VertexCount, Flags);
4114 }
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
Definition: devices.h:37
static void setup_lighting(const struct d3d_device *device, DWORD fvf, DWORD flags)
Definition: device.c:3576
#define TRACE(s)
Definition: solgame.cpp:4
#define IDirect3DDevice7_DrawPrimitiveStrided(p, a, b, c, d, e)
Definition: d3d.h:1372

◆ d3d_device3_DrawPrimitiveVB()

static HRESULT WINAPI d3d_device3_DrawPrimitiveVB ( IDirect3DDevice3 *  iface,
D3DPRIMITIVETYPE  PrimitiveType,
IDirect3DVertexBuffer *  D3DVertexBuf,
DWORD  StartVertex,
DWORD  NumVertices,
DWORD  Flags 
)
static

Definition at line 4330 of file device.c.

4332 {
4333  struct d3d_device *device = impl_from_IDirect3DDevice3(iface);
4334  struct d3d_vertex_buffer *vb = unsafe_impl_from_IDirect3DVertexBuffer7((IDirect3DVertexBuffer7 *)D3DVertexBuf);
4335 
4336  TRACE("iface %p, primitive_type %#x, vb %p, start_vertex %u, vertex_count %u, flags %#x.\n",
4337  iface, PrimitiveType, D3DVertexBuf, StartVertex, NumVertices, Flags);
4338 
4339  setup_lighting(device, vb->fvf, Flags);
4340 
4341  return IDirect3DDevice7_DrawPrimitiveVB(&device->IDirect3DDevice7_iface,
4342  PrimitiveType, &vb->IDirect3DVertexBuffer7_iface, StartVertex, NumVertices, Flags);
4343 }
#define IDirect3DDevice7_DrawPrimitiveVB(p, a, b, c, d, e)
Definition: d3d.h:1374
IDirect3DVertexBuffer7 IDirect3DVertexBuffer7_iface
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
Definition: devices.h:37
static void setup_lighting(const struct d3d_device *device, DWORD fvf, DWORD flags)
Definition: device.c:3576
#define TRACE(s)
Definition: solgame.cpp:4
struct d3d_vertex_buffer * unsafe_impl_from_IDirect3DVertexBuffer7(IDirect3DVertexBuffer7 *iface) DECLSPEC_HIDDEN
Definition: vertexbuffer.c:486

◆ d3d_device3_End()

static HRESULT WINAPI d3d_device3_End ( IDirect3DDevice3 *  iface,
DWORD  flags 
)
static

Definition at line 3848 of file device.c.

3849 {
3850  struct d3d_device *device = impl_from_IDirect3DDevice3(iface);
3851 
3852  TRACE("iface %p, flags %#x.\n", iface, flags);
3853 
3854  return d3d_device3_DrawPrimitive(&device->IDirect3DDevice3_iface, device->primitive_type,
3855  device->vertex_type, device->sysmem_vertex_buffer, device->nb_vertices, device->render_flags);
3856 }
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
GLbitfield flags
Definition: glext.h:7161
static HRESULT WINAPI d3d_device3_DrawPrimitive(IDirect3DDevice3 *iface, D3DPRIMITIVETYPE primitive_type, DWORD fvf, void *vertices, DWORD vertex_count, DWORD flags)
Definition: device.c:3588

Referenced by d3d_device2_End().

◆ d3d_device3_EndScene()

static HRESULT WINAPI DECLSPEC_HOTPATCH d3d_device3_EndScene ( IDirect3DDevice3 *  iface)
static

Definition at line 1571 of file device.c.

1572 {
1573  struct d3d_device *device = impl_from_IDirect3DDevice3(iface);
1574 
1575  TRACE("iface %p.\n", iface);
1576 
1577  return IDirect3DDevice7_EndScene(&device->IDirect3DDevice7_iface);
1578 }
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
#define IDirect3DDevice7_EndScene(p)
Definition: d3d.h:1349

◆ d3d_device3_EnumTextureFormats()

static HRESULT WINAPI d3d_device3_EnumTextureFormats ( IDirect3DDevice3 *  iface,
LPD3DENUMPIXELFORMATSCALLBACK  callback,
void context 
)
static

Definition at line 1158 of file device.c.

1160 {
1161  struct d3d_device *device = impl_from_IDirect3DDevice3(iface);
1162 
1163  TRACE("iface %p, callback %p, context %p.\n", iface, callback, context);
1164 
1165  return IDirect3DDevice7_EnumTextureFormats(&device->IDirect3DDevice7_iface, callback, context);
1166 }
Definition: http.c:7094
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
#define IDirect3DDevice7_EnumTextureFormats(p, a, b)
Definition: d3d.h:1347
Definition: devices.h:37
MmuTrapHandler callback[0x30]
Definition: mmuobject.c:44
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d_device3_GetCaps()

static HRESULT WINAPI d3d_device3_GetCaps ( IDirect3DDevice3 *  iface,
D3DDEVICEDESC HWDesc,
D3DDEVICEDESC HelDesc 
)
static

Definition at line 469 of file device.c.

471 {
473  D3DDEVICEDESC7 desc7;
474  D3DDEVICEDESC desc1;
475  HRESULT hr;
476 
477  TRACE("iface %p, hw_desc %p, hel_desc %p.\n", iface, HWDesc, HelDesc);
478 
479  if (!HWDesc)
480  {
481  WARN("HWDesc is NULL, returning DDERR_INVALIDPARAMS.\n");
482  return DDERR_INVALIDPARAMS;
483  }
484  if (!check_d3ddevicedesc_size(HWDesc->dwSize))
485  {
486  WARN("HWDesc->dwSize is %u, returning DDERR_INVALIDPARAMS.\n", HWDesc->dwSize);
487  return DDERR_INVALIDPARAMS;
488  }
489  if (!HelDesc)
490  {
491  WARN("HelDesc is NULL, returning DDERR_INVALIDPARAMS.\n");
492  return DDERR_INVALIDPARAMS;
493  }
494  if (!check_d3ddevicedesc_size(HelDesc->dwSize))
495  {
496  WARN("HelDesc->dwSize is %u, returning DDERR_INVALIDPARAMS.\n", HelDesc->dwSize);
497  return DDERR_INVALIDPARAMS;
498  }
499 
500  if (FAILED(hr = ddraw_get_d3dcaps(device->ddraw, &desc7)))
501  return hr;
502 
503  ddraw_d3dcaps1_from_7(&desc1, &desc7);
504  DD_STRUCT_COPY_BYSIZE(HWDesc, &desc1);
505  DD_STRUCT_COPY_BYSIZE(HelDesc, &desc1);
506  return D3D_OK;
507 }
HRESULT ddraw_get_d3dcaps(const struct ddraw *ddraw, D3DDEVICEDESC7 *caps)
Definition: ddraw.c:1248
HRESULT hr
Definition: shlfolder.c:183
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
#define WARN(fmt,...)
Definition: debug.h:112
Definition: devices.h:37
static BOOL check_d3ddevicedesc_size(DWORD size)
Definition: device.c:461
#define DD_STRUCT_COPY_BYSIZE(to, from)
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78
DWORD dwSize
Definition: d3dcaps.h:318
#define D3D_OK
Definition: d3d.h:106
void ddraw_d3dcaps1_from_7(D3DDEVICEDESC *caps1, D3DDEVICEDESC7 *caps7)
Definition: ddraw.c:1192
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79

Referenced by d3d_device1_GetCaps(), and d3d_device2_GetCaps().

◆ d3d_device3_GetClipStatus()

static HRESULT WINAPI d3d_device3_GetClipStatus ( IDirect3DDevice3 *  iface,
D3DCLIPSTATUS clip_status 
)
static

Definition at line 3927 of file device.c.

3928 {
3929  struct d3d_device *device = impl_from_IDirect3DDevice3(iface);
3930 
3931  TRACE("iface %p, clip_status %p.\n", iface, clip_status);
3932 
3933  return IDirect3DDevice7_GetClipStatus(&device->IDirect3DDevice7_iface, clip_status);
3934 }
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
#define IDirect3DDevice7_GetClipStatus(p, a)
Definition: d3d.h:1371

◆ d3d_device3_GetCurrentViewport()

static HRESULT WINAPI d3d_device3_GetCurrentViewport ( IDirect3DDevice3 *  iface,
IDirect3DViewport3 **  viewport 
)
static

Definition at line 1766 of file device.c.

1767 {
1768  struct d3d_device *device = impl_from_IDirect3DDevice3(iface);
1769 
1770  TRACE("iface %p, viewport %p.\n", iface, viewport);
1771 
1773  if (!device->current_viewport)
1774  {
1776  WARN("No current viewport, returning D3DERR_NOCURRENTVIEWPORT\n");
1777  return D3DERR_NOCURRENTVIEWPORT;
1778  }
1779 
1780  *viewport = &device->current_viewport->IDirect3DViewport3_iface;
1781  IDirect3DViewport3_AddRef(*viewport);
1782 
1783  TRACE("Returning interface %p.\n", *viewport);
1785  return D3D_OK;
1786 }
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
#define WARN(fmt,...)
Definition: debug.h:112
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
#define D3DERR_NOCURRENTVIEWPORT
Definition: d3d.h:160
#define D3D_OK
Definition: d3d.h:106
#define IDirect3DViewport3_AddRef(p)
Definition: d3d.h:826
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

Referenced by d3d_device2_GetCurrentViewport().

◆ d3d_device3_GetDirect3D()

static HRESULT WINAPI d3d_device3_GetDirect3D ( IDirect3DDevice3 *  iface,
IDirect3D3 **  d3d 
)
static

Definition at line 1628 of file device.c.

1629 {
1630  struct d3d_device *device = impl_from_IDirect3DDevice3(iface);
1631 
1632  TRACE("iface %p, d3d %p.\n", iface, d3d);
1633 
1634  if (!d3d)
1635  return DDERR_INVALIDPARAMS;
1636 
1637  *d3d = &device->ddraw->IDirect3D3_iface;
1638  IDirect3D3_AddRef(*d3d);
1639 
1640  TRACE("Returning interface %p.\n", *d3d);
1641  return D3D_OK;
1642 }
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
#define IDirect3D3_AddRef(p)
Definition: d3d.h:329
#define D3D_OK
Definition: d3d.h:106
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79

◆ d3d_device3_GetLightState()

static HRESULT WINAPI d3d_device3_GetLightState ( IDirect3DDevice3 *  iface,
D3DLIGHTSTATETYPE  state,
DWORD value 
)
static

Definition at line 3041 of file device.c.

3043 {
3044  struct d3d_device *device = impl_from_IDirect3DDevice3(iface);
3045  HRESULT hr;
3046 
3047  TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
3048 
3050  {
3051  TRACE("Unexpected Light State Type\n");
3052  return DDERR_INVALIDPARAMS;
3053  }
3054 
3055  if (!value)
3056  return DDERR_INVALIDPARAMS;
3057 
3060  {
3061  *value = device->material;
3062  }
3063  else if (state == D3DLIGHTSTATE_COLORMODEL)
3064  {
3065  *value = D3DCOLOR_RGB;
3066  }
3067  else
3068  {
3069  D3DRENDERSTATETYPE rs;
3070  switch (state)
3071  {
3072  case D3DLIGHTSTATE_AMBIENT: /* 2 */
3074  break;
3075  case D3DLIGHTSTATE_FOGMODE: /* 4 */
3077  break;
3078  case D3DLIGHTSTATE_FOGSTART: /* 5 */
3080  break;
3081  case D3DLIGHTSTATE_FOGEND: /* 6 */
3082  rs = D3DRENDERSTATE_FOGEND;
3083  break;
3084  case D3DLIGHTSTATE_FOGDENSITY: /* 7 */
3086  break;
3087  case D3DLIGHTSTATE_COLORVERTEX: /* 8 */
3089  break;
3090  default:
3091  FIXME("Unhandled D3DLIGHTSTATETYPE %#x.\n", state);
3093  return DDERR_INVALIDPARAMS;
3094  }
3095 
3096  hr = IDirect3DDevice7_GetRenderState(&device->IDirect3DDevice7_iface, rs, value);
3098  return hr;
3099  }
3101 
3102  return D3D_OK;
3103 }
#define IDirect3DDevice7_GetRenderState(p, a, b)
Definition: d3d.h:1364
HRESULT hr
Definition: shlfolder.c:183
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: devices.h:37
#define FIXME(fmt,...)
Definition: debug.h:111
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78
D3DRENDERSTATETYPE
Definition: d3dtypes.h:874
static int state
Definition: maze.c:121
#define D3DCOLOR_RGB
Definition: d3dtypes.h:627
#define D3D_OK
Definition: d3d.h:106
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79

Referenced by d3d_device2_GetLightState().

◆ d3d_device3_GetRenderState()

static HRESULT WINAPI d3d_device3_GetRenderState ( IDirect3DDevice3 *  iface,
D3DRENDERSTATETYPE  state,
DWORD value 
)
static

Definition at line 2432 of file device.c.

2434 {
2435  struct d3d_device *device = impl_from_IDirect3DDevice3(iface);
2436 
2437  TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
2438 
2439  switch (state)
2440  {
2442  {
2443  /* This state is wrapped to SetTexture in SetRenderState, so
2444  * it has to be wrapped to GetTexture here. */
2445  struct wined3d_texture *tex = NULL;
2446  *value = 0;
2447 
2449  if ((tex = wined3d_device_get_texture(device->wined3d_device, 0)))
2450  {
2451  /* The parent of the texture is the IDirectDrawSurface7
2452  * interface of the ddraw surface. */
2454  if (parent)
2455  *value = parent->root->Handle;
2456  }
2458 
2459  return D3D_OK;
2460  }
2461 
2463  {
2464  /* D3DRENDERSTATE_TEXTUREMAPBLEND is mapped to texture state stages in SetRenderState; reverse
2465  the mapping to get the value. */
2466  DWORD colorop, colorarg1, colorarg2;
2467  DWORD alphaop, alphaarg1, alphaarg2;
2468 
2470 
2471  device->legacyTextureBlending = TRUE;
2472 
2474  colorarg1 = wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_COLOR_ARG1);
2475  colorarg2 = wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_COLOR_ARG2);
2477  alphaarg1 = wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_ALPHA_ARG1);
2478  alphaarg2 = wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_ALPHA_ARG2);
2479 
2480  if (colorop == WINED3D_TOP_SELECT_ARG1 && colorarg1 == WINED3DTA_TEXTURE
2481  && alphaop == WINED3D_TOP_SELECT_ARG1 && alphaarg1 == WINED3DTA_TEXTURE)
2483  else if (colorop == WINED3D_TOP_SELECT_ARG1 && colorarg1 == WINED3DTA_TEXTURE
2484  && alphaop == WINED3D_TOP_MODULATE
2485  && alphaarg1 == WINED3DTA_TEXTURE && alphaarg2 == WINED3DTA_CURRENT)
2487  else if (colorop == WINED3D_TOP_MODULATE
2488  && colorarg1 == WINED3DTA_TEXTURE && colorarg2 == WINED3DTA_CURRENT
2489  && alphaop == WINED3D_TOP_MODULATE
2490  && alphaarg1 == WINED3DTA_TEXTURE && alphaarg2 == WINED3DTA_CURRENT)
2492  else
2493  {
2494  struct wined3d_texture *tex = NULL;
2495  BOOL tex_alpha = FALSE;
2496  DDPIXELFORMAT ddfmt;
2497 
2498  if ((tex = wined3d_device_get_texture(device->wined3d_device, 0)))
2499  {
2500  struct wined3d_resource_desc desc;
2501 
2503  ddfmt.dwSize = sizeof(ddfmt);
2504  ddrawformat_from_wined3dformat(&ddfmt, desc.format);
2505  if (ddfmt.u5.dwRGBAlphaBitMask)
2506  tex_alpha = TRUE;
2507  }
2508 
2509  if (!(colorop == WINED3D_TOP_MODULATE
2510  && colorarg1 == WINED3DTA_TEXTURE && colorarg2 == WINED3DTA_CURRENT
2511  && alphaop == (tex_alpha ? WINED3D_TOP_SELECT_ARG1 : WINED3D_TOP_SELECT_ARG2)
2512  && alphaarg1 == WINED3DTA_TEXTURE && alphaarg2 == WINED3DTA_CURRENT))
2513  ERR("Unexpected texture stage state setup, returning D3DTBLEND_MODULATE - likely erroneous.\n");
2514 
2516  }
2517 
2519 
2520  return D3D_OK;
2521  }
2522 
2526  *value = 0xffffffff;
2527  return D3D_OK;
2528 
2529  default:
2530  return IDirect3DDevice7_GetRenderState(&device->IDirect3DDevice7_iface, state, value);
2531  }
2532 }
#define TRUE
Definition: types.h:120
#define IDirect3DDevice7_GetRenderState(p, a, b)
Definition: d3d.h:1364
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
void CDECL wined3d_resource_get_desc(const struct wined3d_resource *resource, struct wined3d_resource_desc *desc)
Definition: resource.c:295
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define WINED3DTA_CURRENT
Definition: wined3d.h:868
unsigned int BOOL
Definition: ntddk_ex.h:94
Definition: devices.h:37
static const WCHAR desc[]
Definition: protectdata.c:36
smooth NULL
Definition: ftsmooth.c:416
#define WINED3DTA_TEXTURE
Definition: wined3d.h:869
#define TRACE(s)
Definition: solgame.cpp:4
r parent
Definition: btrfs.c:2944
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
unsigned long DWORD
Definition: ntddk_ex.h:95
static int state
Definition: maze.c:121
#define ERR(fmt,...)
Definition: debug.h:110
void *CDECL wined3d_texture_get_parent(const struct wined3d_texture *texture)
Definition: texture.c:1121
#define D3D_OK
Definition: d3d.h:106
DWORD CDECL wined3d_device_get_texture_stage_state(const struct wined3d_device *device, UINT stage, enum wined3d_texture_stage_state state)
Definition: device.c:3447
struct wined3d_texture *CDECL wined3d_device_get_texture(const struct wined3d_device *device, UINT stage)
Definition: device.c:3510
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
DWORD dwSize
Definition: ddraw.h:1070
void ddrawformat_from_wined3dformat(DDPIXELFORMAT *ddraw_format, enum wined3d_format_id wined3d_format) DECLSPEC_HIDDEN
Definition: utils.c:33
DWORD dwRGBAlphaBitMask
Definition: ddraw.h:1113

◆ d3d_device3_GetRenderTarget()

static HRESULT WINAPI d3d_device3_GetRenderTarget ( IDirect3DDevice3 *  iface,
IDirectDrawSurface4 **  RenderTarget 
)
static

Definition at line 2031 of file device.c.

2032 {
2033  struct d3d_device *device = impl_from_IDirect3DDevice3(iface);
2034  IDirectDrawSurface7 *RenderTarget7;
2035  struct ddraw_surface *RenderTargetImpl;
2036  HRESULT hr;
2037 
2038  TRACE("iface %p, target %p.\n", iface, RenderTarget);
2039 
2040  if(!RenderTarget)
2041  return DDERR_INVALIDPARAMS;
2042 
2043  hr = d3d_device7_GetRenderTarget(&device->IDirect3DDevice7_iface, &RenderTarget7);
2044  if(hr != D3D_OK) return hr;
2045  RenderTargetImpl = impl_from_IDirectDrawSurface7(RenderTarget7);
2046  *RenderTarget = &RenderTargetImpl->IDirectDrawSurface4_iface;
2047  IDirectDrawSurface4_AddRef(*RenderTarget);
2048  IDirectDrawSurface7_Release(RenderTarget7);
2049  return D3D_OK;
2050 }
HRESULT hr
Definition: shlfolder.c:183
static struct d3d_device * impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface)
static struct ddraw_surface * impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface)
Definition: devices.h:37
IDirectDrawSurface4 IDirectDrawSurface4_iface
DWORD IDirectDrawSurface7
Definition: vmrender.idl:20
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78
#define D3D_OK
Definition: d3d.h:106
static HRESULT WINAPI d3d_device7_GetRenderTarget(IDirect3DDevice7 *iface, IDirectDrawSurface7 **RenderTarget)
Definition: device.c:2014
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79

◆ d3d_device3_GetStats()

static HRESULT WINAPI d3d_device3_GetStats ( IDirect3DDevice3 *  iface,
D3DSTATS Stats 
)
static

Definition at line 597 of file device.c.

598 {
599  FIXME("iface %p, stats %p stub!\n", iface, Stats);
600 
601  if(!Stats)
602  return DDERR_INVALIDPARAMS;
603 
604  /* Fill the Stats with 0 */
605  Stats->dwTrianglesDrawn = 0;
606  Stats->dwLinesDrawn = 0;
607  Stats->dwPointsDrawn = 0;
608  Stats->dwSpansDrawn = 0;
609  Stats->dwVerticesProcessed = 0;
610 
611  return D3D_OK;
612 }
DWORD dwLinesDrawn
Definition: d3dtypes.h:1250
#define FIXME(fmt,...)
Definition: debug.h:111
DWORD dwSpansDrawn
Definition: d3dtypes.h:1252
DWORD dwTrianglesDrawn
Definition: d3dtypes.h:1249
#define D3D_OK
Definition: d3d.h:106
DWORD dwPointsDrawn
Definition: d3dtypes.h:1251
DWORD dwVerticesProcessed
Definition: d3dtypes.h:1253
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79

Referenced by d3d_device1_GetStats(), and d3d_device2_GetStats().

◆ d3d_device3_GetTexture()