ReactOS 0.4.15-dev-7897-g78dc504
d3drm_private.h File Reference
#include <assert.h>
#include <math.h>
#include "dxfile.h"
#include "d3drmwin.h"
#include "rmxfguid.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/list.h"
Include dependency graph for d3drm_private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  d3drm_matrix
 
struct  d3drm_object
 
struct  d3drm_texture
 
struct  d3drm_frame
 
struct  d3drm_box
 
struct  d3drm_viewport
 
struct  d3drm_device
 
struct  d3drm_face
 
struct  d3drm_mesh_builder
 
struct  mesh_group
 
struct  d3drm_mesh
 
struct  d3drm_light
 
struct  color_rgb
 
struct  d3drm_material
 
struct  d3drm_animation_key
 
struct  d3drm_animation_keys
 
struct  d3drm_animation
 
struct  d3drm_wrap
 
struct  d3drm_file_header
 

Macros

#define NONAMELESSUNION
 
#define NONAMELESSSTRUCT
 
#define COBJMACROS
 

Functions

static struct d3drm_matrixd3drm_matrix (D3DRMMATRIX4D m)
 
HRESULT d3drm_device_create (struct d3drm_device **device, IDirect3DRM *d3drm) DECLSPEC_HIDDEN
 
HRESULT d3drm_device_create_surfaces_from_clipper (struct d3drm_device *object, IDirectDraw *ddraw, IDirectDrawClipper *clipper, int width, int height, IDirectDrawSurface **surface) DECLSPEC_HIDDEN
 
void d3drm_device_destroy (struct d3drm_device *device) DECLSPEC_HIDDEN
 
HRESULT d3drm_device_init (struct d3drm_device *device, UINT version, IDirectDraw *ddraw, IDirectDrawSurface *surface, BOOL create_z_surface) DECLSPEC_HIDDEN
 
void d3drm_object_init (struct d3drm_object *object, const char *classname) DECLSPEC_HIDDEN
 
HRESULT d3drm_object_add_destroy_callback (struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx) DECLSPEC_HIDDEN
 
HRESULT d3drm_object_delete_destroy_callback (struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx) DECLSPEC_HIDDEN
 
HRESULT d3drm_object_get_class_name (struct d3drm_object *object, DWORD *size, char *name) DECLSPEC_HIDDEN
 
HRESULT d3drm_object_get_name (struct d3drm_object *object, DWORD *size, char *name) DECLSPEC_HIDDEN
 
HRESULT d3drm_object_set_name (struct d3drm_object *object, const char *name) DECLSPEC_HIDDEN
 
void d3drm_object_cleanup (IDirect3DRMObject *iface, struct d3drm_object *object) DECLSPEC_HIDDEN
 
struct d3drm_frameunsafe_impl_from_IDirect3DRMFrame (IDirect3DRMFrame *iface) DECLSPEC_HIDDEN
 
struct d3drm_frameunsafe_impl_from_IDirect3DRMFrame3 (IDirect3DRMFrame3 *iface) DECLSPEC_HIDDEN
 
struct d3drm_deviceunsafe_impl_from_IDirect3DRMDevice3 (IDirect3DRMDevice3 *iface) DECLSPEC_HIDDEN
 
HRESULT d3drm_texture_create (struct d3drm_texture **texture, IDirect3DRM *d3drm) DECLSPEC_HIDDEN
 
HRESULT d3drm_frame_create (struct d3drm_frame **frame, IUnknown *parent_frame, IDirect3DRM *d3drm) DECLSPEC_HIDDEN
 
HRESULT d3drm_face_create (struct d3drm_face **face) DECLSPEC_HIDDEN
 
HRESULT d3drm_viewport_create (struct d3drm_viewport **viewport, IDirect3DRM *d3drm) DECLSPEC_HIDDEN
 
HRESULT d3drm_mesh_builder_create (struct d3drm_mesh_builder **mesh_builder, IDirect3DRM *d3drm) DECLSPEC_HIDDEN
 
HRESULT d3drm_light_create (struct d3drm_light **light, IDirect3DRM *d3drm) DECLSPEC_HIDDEN
 
HRESULT d3drm_material_create (struct d3drm_material **material, IDirect3DRM *d3drm) DECLSPEC_HIDDEN
 
HRESULT d3drm_mesh_create (struct d3drm_mesh **mesh, IDirect3DRM *d3drm) DECLSPEC_HIDDEN
 
HRESULT d3drm_animation_create (struct d3drm_animation **animation, IDirect3DRM *d3drm) DECLSPEC_HIDDEN
 
HRESULT d3drm_wrap_create (struct d3drm_wrap **wrap, IDirect3DRM *d3drm) DECLSPEC_HIDDEN
 
HRESULT load_mesh_data (IDirect3DRMMeshBuilder3 *iface, IDirectXFileData *data, D3DRMLOADTEXTURECALLBACK load_texture_proc, void *arg) DECLSPEC_HIDDEN
 
static BYTE d3drm_color_component (float c)
 
static void d3drm_set_color (D3DCOLOR *color, float r, float g, float b, float a)
 
BOOL d3drm_array_reserve (void **elements, SIZE_T *capacity, SIZE_T element_count, SIZE_T element_size) DECLSPEC_HIDDEN
 

Variables

char templates[] DECLSPEC_HIDDEN
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 26 of file d3drm_private.h.

◆ NONAMELESSSTRUCT

#define NONAMELESSSTRUCT

Definition at line 25 of file d3drm_private.h.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 24 of file d3drm_private.h.

Function Documentation

◆ d3drm_animation_create()

HRESULT d3drm_animation_create ( struct d3drm_animation **  animation,
IDirect3DRM *  d3drm 
)

Definition at line 3881 of file frame.c.

3882{
3883 static const char classname[] = "Animation";
3884 struct d3drm_animation *object;
3886
3887 TRACE("animation %p, d3drm %p.\n", animation, d3drm);
3888
3889 if (!(object = heap_alloc_zero(sizeof(*object))))
3890 return E_OUTOFMEMORY;
3891
3892 object->IDirect3DRMAnimation_iface.lpVtbl = &d3drm_animation1_vtbl;
3893 object->IDirect3DRMAnimation2_iface.lpVtbl = &d3drm_animation2_vtbl;
3894 object->d3drm = d3drm;
3895 object->ref = 1;
3897
3899
3900 IDirect3DRM_AddRef(object->d3drm);
3901
3902 *animation = object;
3903
3904 return hr;
3905}
#define D3DRM_OK
Definition: d3drm.h:486
#define IDirect3DRM_AddRef(p)
Definition: d3drm.h:110
void d3drm_object_init(struct d3drm_object *object, const char *classname)
Definition: d3drm_main.c:39
#define D3DRMANIMATION_LINEARPOSITION
Definition: d3drmdef.h:325
#define D3DRMANIMATION_CLOSED
Definition: d3drmdef.h:324
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const struct IDirect3DRMAnimationVtbl d3drm_animation1_vtbl
Definition: frame.c:3830
static const struct IDirect3DRMAnimation2Vtbl d3drm_animation2_vtbl
Definition: frame.c:3853
WCHAR classname[128]
Definition: startup.c:15
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
IDirect3DRM * d3drm
Definition: d3drm.c:189

Referenced by d3drm1_CreateAnimation(), d3drm3_CreateAnimation(), and d3drm_create_animation_object().

◆ d3drm_array_reserve()

BOOL d3drm_array_reserve ( void **  elements,
SIZE_T capacity,
SIZE_T  element_count,
SIZE_T  element_size 
)

Definition at line 260 of file meshbuilder.c.

261{
262 SIZE_T new_capacity, max_capacity;
263 void *new_elements;
264
265 if (element_count <= *capacity)
266 return TRUE;
267
268 max_capacity = ~(SIZE_T)0 / element_size;
269 if (max_capacity < element_count)
270 return FALSE;
271
272 new_capacity = max(*capacity, 4);
273 while (new_capacity < element_count && new_capacity <= max_capacity / 2)
274 new_capacity *= 2;
275
276 if (new_capacity < element_count)
277 new_capacity = max_capacity;
278
279 if (!(new_elements = heap_realloc(*elements, new_capacity * element_size)))
280 return FALSE;
281
282 *elements = new_elements;
283 *capacity = new_capacity;
284 return TRUE;
285}
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:71
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define max(a, b)
Definition: svc.c:63
ULONG_PTR SIZE_T
Definition: typedefs.h:80

Referenced by d3drm_animation2_AddKey(), d3drm_frame3_AddChild(), d3drm_frame3_AddLight(), d3drm_frame3_AddVisual(), d3drm_mesh_AddGroup(), d3drm_mesh_builder3_AddNormal(), d3drm_mesh_builder3_AddVertex(), and load_mesh_data().

◆ d3drm_color_component()

static BYTE d3drm_color_component ( float  c)
inlinestatic

Definition at line 311 of file d3drm_private.h.

312{
313 if (c <= 0.0f)
314 return 0u;
315 if (c >= 1.0f)
316 return 0xffu;
317 return floor(c * 255.0f);
318}
const GLubyte * c
Definition: glext.h:8905
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
_Check_return_ _CRTIMP double __cdecl floor(_In_ double x)

Referenced by d3drm_set_color().

◆ d3drm_device_create()

HRESULT d3drm_device_create ( struct d3drm_device **  device,
IDirect3DRM *  d3drm 
)

Definition at line 1634 of file device.c.

1635{
1636 static const char classname[] = "Device";
1637 struct d3drm_device *object;
1638
1639 TRACE("device %p, d3drm %p.\n", device, d3drm);
1640
1641 if (!(object = heap_alloc_zero(sizeof(*object))))
1642 return E_OUTOFMEMORY;
1643
1644 object->IDirect3DRMDevice_iface.lpVtbl = &d3drm_device1_vtbl;
1645 object->IDirect3DRMDevice2_iface.lpVtbl = &d3drm_device2_vtbl;
1646 object->IDirect3DRMDevice3_iface.lpVtbl = &d3drm_device3_vtbl;
1647 object->IDirect3DRMWinDevice_iface.lpVtbl = &d3drm_device_win_vtbl;
1648 object->d3drm = d3drm;
1650
1651 *device = object;
1652
1653 return D3DRM_OK;
1654}
static const struct IDirect3DRMDevice2Vtbl d3drm_device2_vtbl
Definition: device.c:1415
static const struct IDirect3DRMDevice3Vtbl d3drm_device3_vtbl
Definition: device.c:1367
static const struct IDirect3DRMWinDeviceVtbl d3drm_device_win_vtbl
Definition: device.c:1608
static const struct IDirect3DRMDeviceVtbl d3drm_device1_vtbl
Definition: device.c:1458
IDirect3DRM * d3drm
Definition: devices.h:37

Referenced by d3drm1_CreateDeviceFromClipper(), d3drm1_CreateDeviceFromD3D(), d3drm1_CreateDeviceFromSurface(), d3drm3_CreateDeviceFromClipper(), d3drm3_CreateDeviceFromD3D(), d3drm3_CreateDeviceFromSurface(), and d3drm_create_device_object().

◆ d3drm_device_create_surfaces_from_clipper()

HRESULT d3drm_device_create_surfaces_from_clipper ( struct d3drm_device object,
IDirectDraw *  ddraw,
IDirectDrawClipper *  clipper,
int  width,
int  height,
IDirectDrawSurface **  surface 
)

Definition at line 69 of file device.c.

70{
71 DDSURFACEDESC surface_desc;
72 IDirectDrawSurface *primary_surface, *render_target;
74 HRESULT hr;
75
76 hr = IDirectDrawClipper_GetHWnd(clipper, &window);
77 if (FAILED(hr))
78 return hr;
79
80 hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL);
81 if (FAILED(hr))
82 return hr;
83
84 memset(&surface_desc, 0, sizeof(surface_desc));
85 surface_desc.dwSize = sizeof(surface_desc);
86 surface_desc.dwFlags = DDSD_CAPS;
87 surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
88 hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &primary_surface, NULL);
89 if (FAILED(hr))
90 return hr;
91 hr = IDirectDrawSurface_SetClipper(primary_surface, clipper);
92 if (FAILED(hr))
93 {
94 IDirectDrawSurface_Release(primary_surface);
95 return hr;
96 }
97
98 memset(&surface_desc, 0, sizeof(surface_desc));
99 surface_desc.dwSize = sizeof(surface_desc);
100 surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
101 surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE;
102 surface_desc.dwWidth = width;
103 surface_desc.dwHeight = height;
104
105 hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &render_target, NULL);
106 if (FAILED(hr))
107 {
108 IDirectDrawSurface_Release(primary_surface);
109 return hr;
110 }
111
112 object->primary_surface = primary_surface;
113 object->clipper = clipper;
114 IDirectDrawClipper_AddRef(clipper);
115 *surface = render_target;
116
117 return D3DRM_OK;
118}
#define NULL
Definition: types.h:112
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
#define FAILED(hr)
Definition: intsafe.h:51
static IHTMLWindow2 * window
Definition: events.c:77
#define DDSD_WIDTH
Definition: ddraw.h:210
#define DDSCL_NORMAL
Definition: ddraw.h:535
#define DDSD_HEIGHT
Definition: ddraw.h:209
#define DDSCAPS_PRIMARYSURFACE
Definition: ddraw.h:258
#define DDSCAPS_OFFSCREENPLAIN
Definition: ddraw.h:255
#define DDSCAPS_3DDEVICE
Definition: ddraw.h:263
#define DDSD_CAPS
Definition: ddraw.h:208
#define memset(x, y, z)
Definition: compat.h:39

Referenced by d3drm1_CreateDeviceFromClipper(), and d3drm3_CreateDeviceFromClipper().

◆ d3drm_device_destroy()

void d3drm_device_destroy ( struct d3drm_device device)

Definition at line 40 of file device.c.

41{
42 d3drm_object_cleanup((IDirect3DRMObject *)&device->IDirect3DRMDevice_iface, &device->obj);
43 if (device->device)
44 {
45 TRACE("Releasing attached ddraw interfaces.\n");
47 }
48 if (device->render_target)
49 IDirectDrawSurface_Release(device->render_target);
50 if (device->primary_surface)
51 {
52 TRACE("Releasing primary surface and attached clipper.\n");
53 IDirectDrawSurface_Release(device->primary_surface);
54 IDirectDrawClipper_Release(device->clipper);
55 }
56 if (device->ddraw)
57 {
58 IDirectDraw_Release(device->ddraw);
60 }
62}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define IDirect3DDevice_Release(p)
Definition: d3d.h:966
#define IDirect3DRM_Release(p)
Definition: d3drm.h:111
void d3drm_object_cleanup(IDirect3DRMObject *iface, struct d3drm_object *object)
Definition: d3drm_main.c:153

Referenced by d3drm1_CreateDeviceFromClipper(), d3drm1_CreateDeviceFromD3D(), d3drm1_CreateDeviceFromSurface(), d3drm3_CreateDeviceFromClipper(), d3drm3_CreateDeviceFromD3D(), d3drm3_CreateDeviceFromSurface(), and d3drm_device3_Release().

◆ d3drm_device_init()

HRESULT d3drm_device_init ( struct d3drm_device device,
UINT  version,
IDirectDraw *  ddraw,
IDirectDrawSurface *  surface,
BOOL  create_z_surface 
)

Definition at line 120 of file device.c.

122{
123 DDSCAPS caps = { DDSCAPS_ZBUFFER };
124 IDirectDrawSurface *ds = NULL;
125 IDirect3DDevice *device1 = NULL;
126 IDirect3DDevice2 *device2 = NULL;
127 IDirect3D2 *d3d2 = NULL;
128 DDSURFACEDESC desc, surface_desc;
129 HRESULT hr;
130
131 device->ddraw = ddraw;
132 IDirectDraw_AddRef(ddraw);
134 device->render_target = surface;
135 IDirectDrawSurface_AddRef(surface);
136
137 desc.dwSize = sizeof(desc);
138 hr = IDirectDrawSurface_GetSurfaceDesc(surface, &desc);
139 if (FAILED(hr))
140 return hr;
141
142 if (!(desc.ddsCaps.dwCaps & DDSCAPS_3DDEVICE))
143 return DDERR_INVALIDCAPS;
144
145 hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &ds);
146 if (SUCCEEDED(hr))
147 {
148 create_z_surface = FALSE;
149 IDirectDrawSurface_Release(ds);
150 ds = NULL;
151 }
152
153 if (create_z_surface)
154 {
155 memset(&surface_desc, 0, sizeof(surface_desc));
156 surface_desc.dwSize = sizeof(surface_desc);
157 surface_desc.dwFlags = DDSD_CAPS | DDSD_ZBUFFERBITDEPTH | DDSD_WIDTH | DDSD_HEIGHT;
158 surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
159 surface_desc.u2.dwZBufferBitDepth = 16;
160 surface_desc.dwWidth = desc.dwWidth;
161 surface_desc.dwHeight = desc.dwHeight;
162 hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &ds, NULL);
163 if (FAILED(hr))
164 return hr;
165
166 hr = IDirectDrawSurface_AddAttachedSurface(surface, ds);
167 IDirectDrawSurface_Release(ds);
168 if (FAILED(hr))
169 return hr;
170 }
171
172 if (version == 1)
173 hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DRGBDevice, (void **)&device1);
174 else
175 {
176 IDirectDraw_QueryInterface(ddraw, &IID_IDirect3D2, (void**)&d3d2);
177 hr = IDirect3D2_CreateDevice(d3d2, &IID_IDirect3DRGBDevice, surface, &device2);
178 IDirect3D2_Release(d3d2);
179 }
180 if (FAILED(hr))
181 {
182 IDirectDrawSurface_DeleteAttachedSurface(surface, 0, ds);
183 return hr;
184 }
185
186 if (version != 1)
187 {
188 hr = IDirect3DDevice2_QueryInterface(device2, &IID_IDirect3DDevice, (void**)&device1);
190 if (FAILED(hr))
191 {
192 IDirectDrawSurface_DeleteAttachedSurface(surface, 0, ds);
193 return hr;
194 }
195 }
196 device->device = device1;
197 device->width = desc.dwWidth;
198 device->height = desc.dwHeight;
199
200 return hr;
201}
#define IDirect3D2_CreateDevice(p, a, b, c)
Definition: d3d.h:287
#define IDirect3DDevice2_QueryInterface(p, a, b)
Definition: d3d.h:1062
#define IDirect3D2_Release(p)
Definition: d3d.h:280
#define IDirect3DDevice2_Release(p)
Definition: d3d.h:1064
static const WCHAR version[]
Definition: asmname.c:66
#define ds
Definition: i386-dis.c:443
#define SUCCEEDED(hr)
Definition: intsafe.h:50
static const WCHAR desc[]
Definition: protectdata.c:36
#define DDSCAPS_ZBUFFER
Definition: ddraw.h:267
#define DDSD_ZBUFFERBITDEPTH
Definition: ddraw.h:213
#define DDERR_INVALIDCAPS
Definition: ddraw.h:75

Referenced by d3drm1_CreateDeviceFromClipper(), d3drm1_CreateDeviceFromSurface(), d3drm3_CreateDeviceFromClipper(), and d3drm3_CreateDeviceFromSurface().

◆ d3drm_face_create()

HRESULT d3drm_face_create ( struct d3drm_face **  face)

Definition at line 620 of file face.c.

621{
622 static const char classname[] = "Face";
623 struct d3drm_face *object;
624
625 TRACE("face %p.\n", face);
626
627 if (!(object = heap_alloc_zero(sizeof(*object))))
628 return E_OUTOFMEMORY;
629
630 object->IDirect3DRMFace_iface.lpVtbl = &d3drm_face1_vtbl;
631 object->IDirect3DRMFace2_iface.lpVtbl = &d3drm_face2_vtbl;
632 object->ref = 1;
633
635
636 *face = object;
637
638 return S_OK;
639}
static const struct IDirect3DRMFace2Vtbl d3drm_face2_vtbl
Definition: face.c:586
static const struct IDirect3DRMFaceVtbl d3drm_face1_vtbl
Definition: face.c:376
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
#define S_OK
Definition: intsafe.h:52

Referenced by d3drm1_CreateFace(), d3drm_create_face_object(), d3drm_mesh_builder2_CreateFace(), and d3drm_mesh_builder3_CreateFace().

◆ d3drm_frame_create()

HRESULT d3drm_frame_create ( struct d3drm_frame **  frame,
IUnknown parent_frame,
IDirect3DRM *  d3drm 
)

Definition at line 3129 of file frame.c.

3130{
3131 static const char classname[] = "Frame";
3132 struct d3drm_frame *object;
3134
3135 TRACE("frame %p, parent_frame %p, d3drm %p.\n", frame, parent_frame, d3drm);
3136
3137 if (!(object = heap_alloc_zero(sizeof(*object))))
3138 return E_OUTOFMEMORY;
3139
3140 object->IDirect3DRMFrame_iface.lpVtbl = &d3drm_frame1_vtbl;
3141 object->IDirect3DRMFrame2_iface.lpVtbl = &d3drm_frame2_vtbl;
3142 object->IDirect3DRMFrame3_iface.lpVtbl = &d3drm_frame3_vtbl;
3143 object->d3drm = d3drm;
3144 object->ref = 1;
3145 d3drm_set_color(&object->scenebackground, 0.0f, 0.0f, 0.0f, 1.0f);
3146 object->traversal_options = D3DRMFRAME_RENDERENABLE | D3DRMFRAME_PICKENABLE;
3147
3149
3150 object->transform = identity;
3151
3152 if (parent_frame)
3153 {
3154 IDirect3DRMFrame3 *p;
3155
3156 if (FAILED(hr = IDirect3DRMFrame_QueryInterface(parent_frame, &IID_IDirect3DRMFrame3, (void **)&p)))
3157 {
3158 heap_free(object);
3159 return hr;
3160 }
3161 IDirect3DRMFrame_Release(parent_frame);
3162 IDirect3DRMFrame3_AddChild(p, &object->IDirect3DRMFrame3_iface);
3163 }
3164
3165 IDirect3DRM_AddRef(object->d3drm);
3166
3167 *frame = object;
3168
3169 return hr;
3170}
static void d3drm_set_color(D3DCOLOR *color, float r, float g, float b, float a)
#define D3DRMFRAME_PICKENABLE
Definition: d3drmdef.h:320
#define D3DRMFRAME_RENDERENABLE
Definition: d3drmdef.h:319
#define IDirect3DRMFrame_Release(p)
Definition: d3drmobj.h:1168
#define IDirect3DRMFrame3_AddChild(p, a)
Definition: d3drmobj.h:1719
#define IDirect3DRMFrame_QueryInterface(p, a, b)
Definition: d3drmobj.h:1166
static const struct IDirect3DRMFrame2Vtbl d3drm_frame2_vtbl
Definition: frame.c:2958
static const struct d3drm_matrix identity
Definition: frame.c:26
static const struct IDirect3DRMFrame3Vtbl d3drm_frame3_vtbl
Definition: frame.c:2865
static const struct IDirect3DRMFrameVtbl d3drm_frame1_vtbl
Definition: frame.c:3038
GLfloat GLfloat p
Definition: glext.h:8902
IDirect3DRM * d3drm
Definition: d3drm_private.h:75

Referenced by d3drm1_CreateFrame(), d3drm2_CreateFrame(), d3drm3_CreateFrame(), and d3drm_create_frame_object().

◆ d3drm_light_create()

HRESULT d3drm_light_create ( struct d3drm_light **  light,
IDirect3DRM *  d3drm 
)

Definition at line 371 of file light.c.

372{
373 static const char classname[] = "Light";
374 struct d3drm_light *object;
375
376 TRACE("light %p.\n", light);
377
378 if (!(object = heap_alloc_zero(sizeof(*object))))
379 return E_OUTOFMEMORY;
380
381 object->IDirect3DRMLight_iface.lpVtbl = &d3drm_light_vtbl;
382 object->ref = 1;
383 object->d3drm = d3drm;
385
387
388 *light = object;
389
390 return S_OK;
391}
static const struct IDirect3DRMLightVtbl d3drm_light_vtbl
Definition: light.c:337
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 light
Definition: glfuncs.h:170
IDirect3DRM * d3drm

Referenced by d3drm3_CreateLight(), d3drm3_CreateLightRGB(), and d3drm_create_light_object().

◆ d3drm_material_create()

HRESULT d3drm_material_create ( struct d3drm_material **  material,
IDirect3DRM *  d3drm 
)

Definition at line 279 of file material.c.

280{
281 static const char classname[] = "Material";
282 struct d3drm_material *object;
283
284 TRACE("material %p, d3drm %p.\n", material, d3drm);
285
286 if (!(object = heap_alloc_zero(sizeof(*object))))
287 return E_OUTOFMEMORY;
288
289 object->IDirect3DRMMaterial2_iface.lpVtbl = &d3drm_material_vtbl;
290 object->ref = 1;
291 object->d3drm = d3drm;
293
294 object->specular.r = 1.0f;
295 object->specular.g = 1.0f;
296 object->specular.b = 1.0f;
297
299
300 *material = object;
301
302 return S_OK;
303}
static const struct IDirect3DRMMaterial2Vtbl d3drm_material_vtbl
Definition: material.c:256
IDirect3DRM * d3drm

Referenced by d3drm3_CreateMaterial(), d3drm_create_material_object(), and load_mesh_data().

◆ d3drm_matrix()

static struct d3drm_matrix * d3drm_matrix ( D3DRMMATRIX4D  m)
inlinestatic

Definition at line 44 of file d3drm_private.h.

45{
46 return (struct d3drm_matrix *)m;
47}
const GLfloat * m
Definition: glext.h:10848

◆ d3drm_mesh_builder_create()

HRESULT d3drm_mesh_builder_create ( struct d3drm_mesh_builder **  mesh_builder,
IDirect3DRM *  d3drm 
)

Definition at line 2334 of file meshbuilder.c.

2335{
2336 static const char classname[] = "Builder";
2337 struct d3drm_mesh_builder *object;
2338
2339 TRACE("mesh_builder %p.\n", mesh_builder);
2340
2341 if (!(object = heap_alloc_zero(sizeof(*object))))
2342 return E_OUTOFMEMORY;
2343
2344 object->IDirect3DRMMeshBuilder2_iface.lpVtbl = &d3drm_mesh_builder2_vtbl;
2345 object->IDirect3DRMMeshBuilder3_iface.lpVtbl = &d3drm_mesh_builder3_vtbl;
2346 object->ref = 1;
2347 object->d3drm = d3drm;
2348 IDirect3DRM_AddRef(object->d3drm);
2349
2351
2353
2354 return S_OK;
2355}
static const struct IDirect3DRMMeshBuilder3Vtbl d3drm_mesh_builder3_vtbl
Definition: meshbuilder.c:2260
static const struct IDirect3DRMMeshBuilder2Vtbl d3drm_mesh_builder2_vtbl
Definition: meshbuilder.c:880
IDirect3DRMMeshBuilder * mesh_builder
Definition: d3drm.c:3330
IDirect3DRM * d3drm

Referenced by d3drm2_CreateMeshBuilder(), d3drm3_CreateMeshBuilder(), and d3drm_create_mesh_builder_object().

◆ d3drm_mesh_create()

HRESULT d3drm_mesh_create ( struct d3drm_mesh **  mesh,
IDirect3DRM *  d3drm 
)

Definition at line 2833 of file meshbuilder.c.

2834{
2835 static const char classname[] = "Mesh";
2836 struct d3drm_mesh *object;
2837
2838 TRACE("mesh %p, d3drm %p.\n", mesh, d3drm);
2839
2840 if (!(object = heap_alloc_zero(sizeof(*object))))
2841 return E_OUTOFMEMORY;
2842
2843 object->IDirect3DRMMesh_iface.lpVtbl = &d3drm_mesh_vtbl;
2844 object->ref = 1;
2845 object->d3drm = d3drm;
2846 IDirect3DRM_AddRef(object->d3drm);
2847
2849
2850 *mesh = object;
2851
2852 return S_OK;
2853}
static const struct IDirect3DRMMeshVtbl d3drm_mesh_vtbl
Definition: meshbuilder.c:2799
IDirect3DRM * d3drm
Definition: mesh.c:198

Referenced by d3drm3_CreateMesh(), and d3drm_create_mesh_object().

◆ d3drm_object_add_destroy_callback()

HRESULT d3drm_object_add_destroy_callback ( struct d3drm_object object,
D3DRMOBJECTCALLBACK  cb,
void ctx 
)

Definition at line 55 of file d3drm_main.c.

56{
58
59 if (!cb)
60 return D3DRMERR_BADVALUE;
61
62 if (!(callback = heap_alloc(sizeof(*callback))))
63 return E_OUTOFMEMORY;
64
65 callback->cb = cb;
66 callback->ctx = ctx;
67
68 list_add_head(&object->destroy_callbacks, &callback->entry);
69 return D3DRM_OK;
70}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
#define D3DRMERR_BADVALUE
Definition: d3drm.h:496
static IPrintDialogCallback callback
Definition: printdlg.c:326
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33

Referenced by d3drm_animation2_AddDestroyCallback(), d3drm_device3_AddDestroyCallback(), d3drm_face2_AddDestroyCallback(), d3drm_frame3_AddDestroyCallback(), d3drm_light_AddDestroyCallback(), d3drm_material_AddDestroyCallback(), d3drm_mesh_AddDestroyCallback(), d3drm_mesh_builder3_AddDestroyCallback(), d3drm_texture3_AddDestroyCallback(), d3drm_viewport2_AddDestroyCallback(), and d3drm_wrap_AddDestroyCallback().

◆ d3drm_object_cleanup()

void d3drm_object_cleanup ( IDirect3DRMObject *  iface,
struct d3drm_object object 
)

Definition at line 153 of file d3drm_main.c.

154{
155 struct destroy_callback *callback, *callback2;
156
157 LIST_FOR_EACH_ENTRY_SAFE(callback, callback2, &object->destroy_callbacks, struct destroy_callback, entry)
158 {
159 callback->cb(iface, callback->ctx);
160 list_remove(&callback->entry);
162 }
163
164 heap_free(object->name);
165 object->name = NULL;
166}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
uint32_t entry
Definition: isohybrid.c:63
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204

Referenced by d3drm_animation2_Release(), d3drm_device_destroy(), d3drm_face1_Release(), d3drm_frame3_Release(), d3drm_light_Release(), d3drm_material_Release(), d3drm_mesh_builder2_Release(), d3drm_mesh_Release(), d3drm_texture_destroy(), d3drm_viewport_destroy(), and d3drm_wrap_Release().

◆ d3drm_object_delete_destroy_callback()

◆ d3drm_object_get_class_name()

HRESULT d3drm_object_get_class_name ( struct d3drm_object object,
DWORD size,
char name 
)

Definition at line 92 of file d3drm_main.c.

93{
94 DWORD req_size;
95
96 if (!size)
97 return E_INVALIDARG;
98
99 req_size = strlen(object->classname) + 1;
100 if (name && *size < req_size)
101 return E_INVALIDARG;
102
103 *size = req_size;
104
105 if (name)
106 memcpy(name, object->classname, req_size);
107
108 return D3DRM_OK;
109}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define E_INVALIDARG
Definition: ddrawi.h:101
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizeiptr size
Definition: glext.h:5919
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
Definition: name.c:39

Referenced by d3drm_animation2_GetClassName(), d3drm_device3_GetClassName(), d3drm_face2_GetClassName(), d3drm_frame3_GetClassName(), d3drm_light_GetClassName(), d3drm_material_GetClassName(), d3drm_mesh_builder3_GetClassName(), d3drm_mesh_GetClassName(), d3drm_texture3_GetClassName(), d3drm_viewport2_GetClassName(), and d3drm_wrap_GetClassName().

◆ d3drm_object_get_name()

HRESULT d3drm_object_get_name ( struct d3drm_object object,
DWORD size,
char name 
)

Definition at line 111 of file d3drm_main.c.

112{
113 DWORD req_size;
114
115 if (!size)
116 return E_INVALIDARG;
117
118 req_size = object->name ? strlen(object->name) + 1 : 0;
119 if (name && *size < req_size)
120 return E_INVALIDARG;
121
122 if (name)
123 {
124 if (object->name)
125 memcpy(name, object->name, req_size);
126 else if (*size)
127 *name = 0;
128 }
129
130 *size = req_size;
131
132 return D3DRM_OK;
133}
char * name
Definition: compiler.c:66

Referenced by d3drm_animation2_GetName(), d3drm_device3_GetName(), d3drm_face2_GetName(), d3drm_frame3_GetName(), d3drm_light_GetName(), d3drm_material_GetName(), d3drm_mesh_builder3_GetName(), d3drm_mesh_GetName(), d3drm_texture3_GetName(), d3drm_viewport2_GetName(), and d3drm_wrap_GetName().

◆ d3drm_object_init()

void d3drm_object_init ( struct d3drm_object object,
const char classname 
)

Definition at line 39 of file d3drm_main.c.

40{
41 object->ref = 1;
42 object->appdata = 0;
43 list_init(&object->destroy_callbacks);
44 object->classname = classname;
45 object->name = NULL;
46}
static void list_init(struct list_entry *head)
Definition: list.h:51

Referenced by d3drm_animation_create(), d3drm_device_create(), d3drm_face_create(), d3drm_frame_create(), d3drm_light_create(), d3drm_material_create(), d3drm_mesh_builder_create(), d3drm_mesh_create(), d3drm_texture_create(), d3drm_viewport_create(), and d3drm_wrap_create().

◆ d3drm_object_set_name()

HRESULT d3drm_object_set_name ( struct d3drm_object object,
const char name 
)

Definition at line 135 of file d3drm_main.c.

136{
137 DWORD req_size;
138
139 heap_free(object->name);
140 object->name = NULL;
141
142 if (name)
143 {
144 req_size = strlen(name) + 1;
145 if (!(object->name = heap_alloc(req_size)))
146 return E_OUTOFMEMORY;
147 memcpy(object->name, name, req_size);
148 }
149
150 return D3DRM_OK;
151}

Referenced by d3drm_animation2_SetName(), d3drm_device3_SetName(), d3drm_face2_SetName(), d3drm_frame3_SetName(), d3drm_light_SetName(), d3drm_material_SetName(), d3drm_mesh_builder3_SetName(), d3drm_mesh_SetName(), d3drm_texture3_SetName(), d3drm_viewport2_SetName(), and d3drm_wrap_SetName().

◆ d3drm_set_color()

static void d3drm_set_color ( D3DCOLOR color,
float  r,
float  g,
float  b,
float  a 
)
inlinestatic

Definition at line 320 of file d3drm_private.h.

321{
324}
static BYTE d3drm_color_component(float c)
#define RGBA_MAKE
Definition: dx7todx8.h:6
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint color
Definition: glext.h:6243
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean g
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Referenced by d3drm_face2_SetColorRGB(), d3drm_frame3_SetSceneBackgroundRGB(), d3drm_frame_create(), d3drm_light_SetColorRGB(), d3drm_mesh_builder3_SetColorRGB(), d3drm_mesh_SetGroupColorRGB(), D3DRMCreateColorRGBA(), and load_mesh_data().

◆ d3drm_texture_create()

HRESULT d3drm_texture_create ( struct d3drm_texture **  texture,
IDirect3DRM *  d3drm 
)

Definition at line 1412 of file texture.c.

1413{
1414 static const char classname[] = "Texture";
1415 struct d3drm_texture *object;
1416
1417 TRACE("texture %p.\n", texture);
1418
1419 if (!(object = heap_alloc_zero(sizeof(*object))))
1420 return E_OUTOFMEMORY;
1421
1422 object->IDirect3DRMTexture_iface.lpVtbl = &d3drm_texture1_vtbl;
1423 object->IDirect3DRMTexture2_iface.lpVtbl = &d3drm_texture2_vtbl;
1424 object->IDirect3DRMTexture3_iface.lpVtbl = &d3drm_texture3_vtbl;
1425 object->d3drm = d3drm;
1426
1428
1429 *texture = object;
1430
1431 return D3DRM_OK;
1432}
static const struct IDirect3DRMTexture2Vtbl d3drm_texture2_vtbl
Definition: texture.c:957
static const struct IDirect3DRMTextureVtbl d3drm_texture1_vtbl
Definition: texture.c:626
static const struct IDirect3DRMTexture3Vtbl d3drm_texture3_vtbl
Definition: texture.c:1370
GLenum GLuint texture
Definition: glext.h:6295
IDirect3DRM * d3drm
Definition: d3drm_private.h:64

Referenced by d3drm1_LoadTexture(), d3drm1_LoadTextureFromResource(), d3drm2_LoadTextureFromResource(), d3drm3_CreateTexture(), d3drm3_CreateTextureFromSurface(), d3drm3_LoadTexture(), d3drm3_LoadTextureFromResource(), d3drm_create_texture_object(), and load_mesh_data().

◆ d3drm_viewport_create()

HRESULT d3drm_viewport_create ( struct d3drm_viewport **  viewport,
IDirect3DRM *  d3drm 
)

Definition at line 1123 of file viewport.c.

1124{
1125 static const char classname[] = "Viewport";
1126 struct d3drm_viewport *object;
1127
1128 TRACE("viewport %p, d3drm %p.\n", viewport, d3drm);
1129
1130 if (!(object = heap_alloc_zero(sizeof(*object))))
1131 return E_OUTOFMEMORY;
1132
1133 object->IDirect3DRMViewport_iface.lpVtbl = &d3drm_viewport1_vtbl;
1134 object->IDirect3DRMViewport2_iface.lpVtbl = &d3drm_viewport2_vtbl;
1135 object->d3drm = d3drm;
1137
1138 *viewport = object;
1139
1140 return S_OK;
1141}
static const struct IDirect3DRMViewportVtbl d3drm_viewport1_vtbl
Definition: viewport.c:1080
static const struct IDirect3DRMViewport2Vtbl d3drm_viewport2_vtbl
Definition: viewport.c:1035
IDirect3DRM * d3drm

Referenced by d3drm3_CreateViewport(), and d3drm_create_viewport_object().

◆ d3drm_wrap_create()

HRESULT d3drm_wrap_create ( struct d3drm_wrap **  wrap,
IDirect3DRM *  d3drm 
)

Definition at line 3019 of file meshbuilder.c.

3020{
3021 static const char classname[] = "";
3022 struct d3drm_wrap *object;
3023
3024 TRACE("wrap %p, d3drm %p.\n", wrap, d3drm);
3025
3026 if (!(object = heap_alloc_zero(sizeof(*object))))
3027 return E_OUTOFMEMORY;
3028
3029 object->IDirect3DRMWrap_iface.lpVtbl = &d3drm_wrap_vtbl;
3030 object->ref = 1;
3031
3033
3034 *wrap = object;
3035
3036 return S_OK;
3037}
#define wrap(journal, var)
Definition: recovery.c:207
static const struct IDirect3DRMWrapVtbl d3drm_wrap_vtbl
Definition: meshbuilder.c:3001

Referenced by d3drm1_CreateWrap(), d3drm3_CreateWrap(), and d3drm_create_wrap_object().

◆ load_mesh_data()

HRESULT load_mesh_data ( IDirect3DRMMeshBuilder3 *  iface,
IDirectXFileData *  data,
D3DRMLOADTEXTURECALLBACK  load_texture_proc,
void arg 
)

Definition at line 1019 of file meshbuilder.c.

1021{
1023 IDirectXFileData *pData2 = NULL;
1024 const GUID* guid;
1025 DWORD size;
1026 BYTE *ptr;
1027 HRESULT hr;
1029 DWORD* faces_vertex_idx_data = NULL;
1030 DWORD* faces_vertex_idx_ptr;
1031 DWORD faces_vertex_idx_size;
1032 DWORD* faces_normal_idx_data = NULL;
1033 DWORD* faces_normal_idx_ptr = NULL;
1034 DWORD* faces_data_ptr;
1035 DWORD faces_data_size = 0;
1036 DWORD i;
1037
1038 TRACE("(%p)->(%p)\n", mesh_builder, pData);
1039
1041 if (hr != DXFILE_OK)
1042 return hr;
1043 if (size)
1044 {
1045 char *name;
1046
1047 if (!(name = heap_alloc(size)))
1048 return E_OUTOFMEMORY;
1049
1052 heap_free(name);
1053 if (hr != DXFILE_OK)
1054 return hr;
1055 }
1056
1057 TRACE("Mesh name is %s\n", debugstr_a(mesh_builder->obj.name));
1058
1059 mesh_builder->nb_normals = 0;
1060
1061 hr = IDirectXFileData_GetData(pData, NULL, &size, (void**)&ptr);
1062 if (hr != DXFILE_OK)
1063 goto end;
1064
1065 mesh_builder->nb_vertices = *(DWORD*)ptr;
1066 mesh_builder->nb_faces = *(DWORD*)(ptr + sizeof(DWORD) + mesh_builder->nb_vertices * sizeof(D3DVECTOR));
1067 faces_vertex_idx_size = size - sizeof(DWORD) - mesh_builder->nb_vertices * sizeof(D3DVECTOR) - sizeof(DWORD);
1068
1069 TRACE("Mesh: nb_vertices = %lu, nb_faces = %d, faces_vertex_idx_size = %d\n", mesh_builder->nb_vertices,
1070 mesh_builder->nb_faces, faces_vertex_idx_size);
1071
1072 if (!d3drm_array_reserve((void **)&mesh_builder->vertices, &mesh_builder->vertices_size, mesh_builder->nb_vertices,
1073 sizeof(*mesh_builder->vertices)))
1074 {
1075 hr = E_OUTOFMEMORY;
1076 goto end;
1077 }
1078 memcpy(mesh_builder->vertices, ptr + sizeof(DWORD), mesh_builder->nb_vertices * sizeof(D3DVECTOR));
1079
1080 faces_vertex_idx_ptr = faces_vertex_idx_data = heap_alloc(faces_vertex_idx_size);
1081 memcpy(faces_vertex_idx_data, ptr + sizeof(DWORD) + mesh_builder->nb_vertices * sizeof(D3DVECTOR) + sizeof(DWORD),
1082 faces_vertex_idx_size);
1083
1084 /* Each vertex index will have its normal index counterpart so just allocate twice the size */
1085 mesh_builder->pFaceData = heap_alloc(faces_vertex_idx_size * 2);
1086 faces_data_ptr = (DWORD*)mesh_builder->pFaceData;
1087
1088 while (1)
1089 {
1090 IDirectXFileObject *object;
1091
1094 {
1095 TRACE("No more object\n");
1096 break;
1097 }
1098 if (hr != DXFILE_OK)
1099 goto end;
1100
1101 hr = IDirectXFileObject_QueryInterface(object, &IID_IDirectXFileData, (void**)&pData2);
1103 if (hr != DXFILE_OK)
1104 goto end;
1105
1106 hr = IDirectXFileData_GetType(pData2, &guid);
1107 if (hr != DXFILE_OK)
1108 goto end;
1109
1110 TRACE("Found object type whose GUID = %s\n", debugstr_guid(guid));
1111
1112 if (IsEqualGUID(guid, &TID_D3DRMMeshNormals))
1113 {
1114 DWORD nb_faces_normals;
1115 DWORD faces_normal_idx_size;
1116
1117 hr = IDirectXFileData_GetData(pData2, NULL, &size, (void**)&ptr);
1118 if (hr != DXFILE_OK)
1119 goto end;
1120
1121 mesh_builder->nb_normals = *(DWORD*)ptr;
1122 nb_faces_normals = *(DWORD*)(ptr + sizeof(DWORD) + mesh_builder->nb_normals * sizeof(D3DVECTOR));
1123
1124 TRACE("MeshNormals: nb_normals = %lu, nb_faces_normals = %d\n", mesh_builder->nb_normals, nb_faces_normals);
1125 if (nb_faces_normals != mesh_builder->nb_faces)
1126 WARN("nb_face_normals (%d) != nb_faces (%d)\n", nb_faces_normals, mesh_builder->nb_faces);
1127
1128 if (!d3drm_array_reserve((void **)&mesh_builder->normals, &mesh_builder->normals_size,
1129 mesh_builder->nb_normals, sizeof(*mesh_builder->normals)))
1130 {
1131 hr = E_OUTOFMEMORY;
1132 goto end;
1133 }
1134 memcpy(mesh_builder->normals, ptr + sizeof(DWORD), mesh_builder->nb_normals * sizeof(D3DVECTOR));
1135
1136 faces_normal_idx_size = size - (2 * sizeof(DWORD) + mesh_builder->nb_normals * sizeof(D3DVECTOR));
1137 faces_normal_idx_ptr = faces_normal_idx_data = heap_alloc(faces_normal_idx_size);
1138 memcpy(faces_normal_idx_data, ptr + sizeof(DWORD) + mesh_builder->nb_normals * sizeof(D3DVECTOR)
1139 + sizeof(DWORD), faces_normal_idx_size);
1140 }
1141 else if (IsEqualGUID(guid, &TID_D3DRMMeshTextureCoords))
1142 {
1143 hr = IDirectXFileData_GetData(pData2, NULL, &size, (void**)&ptr);
1144 if (hr != DXFILE_OK)
1145 goto end;
1146
1147 mesh_builder->nb_coords2d = *(DWORD*)ptr;
1148
1149 TRACE("MeshTextureCoords: nb_coords2d = %d\n", mesh_builder->nb_coords2d);
1150
1151 mesh_builder->pCoords2d = heap_calloc(mesh_builder->nb_coords2d, sizeof(*mesh_builder->pCoords2d));
1152 memcpy(mesh_builder->pCoords2d, ptr + sizeof(DWORD), mesh_builder->nb_coords2d * sizeof(*mesh_builder->pCoords2d));
1153 }
1154 else if (IsEqualGUID(guid, &TID_D3DRMMeshMaterialList))
1155 {
1157 DWORD nb_face_indices;
1158 DWORD data_size;
1159 IDirectXFileObject *child;
1160 DWORD i = 0;
1161 float* values;
1162 struct d3drm_texture *texture_object;
1163
1164 TRACE("Process MeshMaterialList\n");
1165
1166 hr = IDirectXFileData_GetData(pData2, NULL, &size, (void**)&ptr);
1167 if (hr != DXFILE_OK)
1168 goto end;
1169
1170 nb_materials = *(DWORD*)ptr;
1171 nb_face_indices = *(DWORD*)(ptr + sizeof(DWORD));
1172 data_size = 2 * sizeof(DWORD) + nb_face_indices * sizeof(DWORD);
1173
1174 TRACE("nMaterials = %u, nFaceIndexes = %u\n", nb_materials, nb_face_indices);
1175
1176 if (size != data_size)
1177 WARN("Returned size %u does not match expected one %u\n", size, data_size);
1178
1179 if (!(mesh_builder->material_indices = heap_calloc(nb_face_indices,
1180 sizeof(*mesh_builder->material_indices))))
1181 goto end;
1182 memcpy(mesh_builder->material_indices, ptr + 2 * sizeof(DWORD),
1183 nb_face_indices * sizeof(*mesh_builder->material_indices));
1184
1185 if (!(mesh_builder->materials = heap_calloc(nb_materials, sizeof(*mesh_builder->materials))))
1186 {
1187 heap_free(mesh_builder->material_indices);
1188 goto end;
1189 }
1190 mesh_builder->nb_materials = nb_materials;
1191
1192 while (SUCCEEDED(hr = IDirectXFileData_GetNextObject(pData2, &child)) && (i < nb_materials))
1193 {
1194 IDirectXFileData *data;
1195 IDirectXFileDataReference *reference;
1196 IDirectXFileObject *material_child;
1197 struct d3drm_material *object;
1198
1199 hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileData, (void **)&data);
1200 if (FAILED(hr))
1201 {
1202 hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileDataReference, (void **)&reference);
1204 if (FAILED(hr))
1205 goto end;
1206
1209 if (FAILED(hr))
1210 goto end;
1211 }
1212 else
1213 {
1215 }
1216
1217 hr = d3drm_material_create(&object, mesh_builder->d3drm);
1218 if (FAILED(hr))
1219 {
1221 goto end;
1222 }
1223 mesh_builder->materials[i].material = &object->IDirect3DRMMaterial2_iface;
1224
1225 hr = IDirectXFileData_GetData(data, NULL, &size, (void**)&ptr);
1226 if (hr != DXFILE_OK)
1227 {
1229 goto end;
1230 }
1231
1232 if (size != 44)
1233 WARN("Material size %u does not match expected one %u\n", size, 44);
1234
1235 values = (float*)ptr;
1236
1237 d3drm_set_color(&mesh_builder->materials[i].color, values[0], values[1], values[2], values[3]);
1238
1239 IDirect3DRMMaterial2_SetAmbient(mesh_builder->materials[i].material, values[0], values [1], values[2]); /* Alpha ignored */
1240 IDirect3DRMMaterial2_SetPower(mesh_builder->materials[i].material, values[4]);
1241 IDirect3DRMMaterial2_SetSpecular(mesh_builder->materials[i].material, values[5], values[6], values[7]);
1242 IDirect3DRMMaterial2_SetEmissive(mesh_builder->materials[i].material, values[8], values[9], values[10]);
1243
1244 mesh_builder->materials[i].texture = NULL;
1245
1246 hr = IDirectXFileData_GetNextObject(data, &material_child);
1247 if (hr == S_OK)
1248 {
1249 IDirectXFileData *data;
1250 char **filename;
1251
1252 if (FAILED(hr = IDirectXFileObject_QueryInterface(material_child,
1253 &IID_IDirectXFileData, (void **)&data)))
1254 {
1255 IDirectXFileDataReference *reference;
1256
1258 &IID_IDirectXFileDataReference, (void **)&reference)))
1259 {
1262 }
1263 }
1264 IDirectXFileObject_Release(material_child);
1265 if (FAILED(hr))
1266 goto end;
1267
1269 if (hr != DXFILE_OK)
1270 goto end;
1271 if (!IsEqualGUID(guid, &TID_D3DRMTextureFilename))
1272 {
1273 WARN("Not a texture filename\n");
1274 goto end;
1275 }
1276
1277 size = 4;
1279 if (SUCCEEDED(hr))
1280 {
1281 if (load_texture_proc)
1282 {
1283 IDirect3DRMTexture *texture;
1284
1285 hr = load_texture_proc(*filename, arg, &texture);
1286 if (SUCCEEDED(hr))
1287 {
1288 hr = IDirect3DTexture_QueryInterface(texture, &IID_IDirect3DRMTexture3,
1289 (void **)&mesh_builder->materials[i].texture);
1291 }
1292 }
1293 else
1294 {
1295 HANDLE file;
1296
1297 /* If the texture file is not found, no texture is associated with the material */
1300 {
1302 if (FAILED(hr = d3drm_texture_create(&texture_object, NULL)))
1303 {
1305 goto end;
1306 }
1307 mesh_builder->materials[i].texture = &texture_object->IDirect3DRMTexture3_iface;
1308 }
1309 }
1310 }
1312 }
1313 else if (hr != DXFILEERR_NOMOREOBJECTS)
1314 {
1315 goto end;
1316 }
1317 hr = S_OK;
1318
1320 i++;
1321 }
1322 if (hr == S_OK)
1323 {
1325 WARN("Found more sub-objects than expected\n");
1326 }
1327 else if (hr != DXFILEERR_NOMOREOBJECTS)
1328 {
1329 goto end;
1330 }
1331 hr = S_OK;
1332 }
1333 else
1334 {
1335 FIXME("Unknown GUID %s, ignoring...\n", debugstr_guid(guid));
1336 }
1337
1339 pData2 = NULL;
1340 }
1341
1342 if (!mesh_builder->nb_normals)
1343 {
1344 /* Allocate normals, one per vertex */
1345 if (!d3drm_array_reserve((void **)&mesh_builder->normals, &mesh_builder->normals_size,
1346 mesh_builder->nb_vertices, sizeof(*mesh_builder->normals)))
1347 goto end;
1348 memset(mesh_builder->normals, 0, mesh_builder->nb_vertices * sizeof(*mesh_builder->normals));
1349 }
1350
1351 for (i = 0; i < mesh_builder->nb_faces; i++)
1352 {
1353 DWORD j;
1354 DWORD nb_face_indexes;
1355 D3DVECTOR face_normal;
1356
1357 if (faces_vertex_idx_size < sizeof(DWORD))
1358 WARN("Not enough data to read number of indices of face %d\n", i);
1359
1360 nb_face_indexes = *(faces_data_ptr + faces_data_size++) = *(faces_vertex_idx_ptr++);
1361 faces_vertex_idx_size--;
1362 if (faces_normal_idx_data && (*(faces_normal_idx_ptr++) != nb_face_indexes))
1363 WARN("Faces indices number mismatch\n");
1364
1365 if (faces_vertex_idx_size < (nb_face_indexes * sizeof(DWORD)))
1366 WARN("Not enough data to read all indices of face %d\n", i);
1367
1368 if (!mesh_builder->nb_normals)
1369 {
1370 /* Compute face normal */
1371 if (nb_face_indexes > 2
1372 && faces_vertex_idx_ptr[0] < mesh_builder->nb_vertices
1373 && faces_vertex_idx_ptr[1] < mesh_builder->nb_vertices
1374 && faces_vertex_idx_ptr[2] < mesh_builder->nb_vertices)
1375 {
1376 D3DVECTOR a, b;
1377
1378 D3DRMVectorSubtract(&a, &mesh_builder->vertices[faces_vertex_idx_ptr[2]], &mesh_builder->vertices[faces_vertex_idx_ptr[1]]);
1379 D3DRMVectorSubtract(&b, &mesh_builder->vertices[faces_vertex_idx_ptr[0]], &mesh_builder->vertices[faces_vertex_idx_ptr[1]]);
1380 D3DRMVectorCrossProduct(&face_normal, &a, &b);
1381 D3DRMVectorNormalize(&face_normal);
1382 }
1383 else
1384 {
1385 face_normal.u1.x = 0.0f;
1386 face_normal.u2.y = 0.0f;
1387 face_normal.u3.z = 0.0f;
1388 }
1389 }
1390
1391 for (j = 0; j < nb_face_indexes; j++)
1392 {
1393 /* Copy vertex index */
1394 *(faces_data_ptr + faces_data_size++) = *faces_vertex_idx_ptr;
1395 /* Copy normal index */
1396 if (mesh_builder->nb_normals)
1397 {
1398 /* Read from x file */
1399 *(faces_data_ptr + faces_data_size++) = *(faces_normal_idx_ptr++);
1400 }
1401 else
1402 {
1403 DWORD vertex_idx = *faces_vertex_idx_ptr;
1404 if (vertex_idx >= mesh_builder->nb_vertices)
1405 {
1406 WARN("Found vertex index %u but only %lu vertices available => use index 0\n", vertex_idx,
1407 mesh_builder->nb_vertices);
1408 vertex_idx = 0;
1409 }
1410 *(faces_data_ptr + faces_data_size++) = vertex_idx;
1411 /* Add face normal to vertex normal */
1412 D3DRMVectorAdd(&mesh_builder->normals[vertex_idx], &mesh_builder->normals[vertex_idx], &face_normal);
1413 }
1414 faces_vertex_idx_ptr++;
1415 }
1416 faces_vertex_idx_size -= nb_face_indexes;
1417 }
1418
1419 /* Last DWORD must be 0 */
1420 *(faces_data_ptr + faces_data_size++) = 0;
1421
1422 /* Set size (in number of DWORD) of all faces data */
1423 mesh_builder->face_data_size = faces_data_size;
1424
1425 if (!mesh_builder->nb_normals)
1426 {
1427 /* Normalize all normals */
1428 for (i = 0; i < mesh_builder->nb_vertices; i++)
1429 {
1431 }
1432 mesh_builder->nb_normals = mesh_builder->nb_vertices;
1433 }
1434
1435 /* If there is no texture coordinates, generate default texture coordinates (0.0f, 0.0f) for each vertex */
1436 if (!mesh_builder->pCoords2d)
1437 {
1438 mesh_builder->nb_coords2d = mesh_builder->nb_vertices;
1439 mesh_builder->pCoords2d = heap_calloc(mesh_builder->nb_coords2d, sizeof(*mesh_builder->pCoords2d));
1440 for (i = 0; i < mesh_builder->nb_coords2d; ++i)
1441 {
1442 mesh_builder->pCoords2d[i].u = 0.0f;
1443 mesh_builder->pCoords2d[i].v = 0.0f;
1444 }
1445 }
1446
1447 TRACE("Mesh data loaded successfully\n");
1448
1449 ret = D3DRM_OK;
1450
1451end:
1452
1453 heap_free(faces_normal_idx_data);
1454 heap_free(faces_vertex_idx_data);
1455
1456 return ret;
1457}
#define FIXME(fmt,...)
Definition: debug.h:111
#define WARN(fmt,...)
Definition: debug.h:112
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
struct _D3DVECTOR D3DVECTOR
#define IDirect3DTexture_QueryInterface(p, a, b)
Definition: d3d.h:584
#define IDirect3DTexture_Release(p)
Definition: d3d.h:586
#define D3DRMERR_BADOBJECT
Definition: d3drm.h:487
HRESULT d3drm_material_create(struct d3drm_material **material, IDirect3DRM *d3drm) DECLSPEC_HIDDEN
Definition: material.c:279
HRESULT d3drm_texture_create(struct d3drm_texture **texture, IDirect3DRM *d3drm) DECLSPEC_HIDDEN
Definition: texture.c:1412
#define IDirect3DRMMeshBuilder3_SetName(p, a)
Definition: d3drmobj.h:2933
#define IDirect3DRMMaterial2_SetPower(p, a)
Definition: d3drmobj.h:3743
#define IDirect3DRMMaterial2_SetAmbient(p, a, b, c)
Definition: d3drmobj.h:3749
#define IDirect3DRMMaterial2_SetEmissive(p, a, b, c)
Definition: d3drmobj.h:3745
#define IDirect3DRMMaterial2_SetSpecular(p, a, b, c)
Definition: d3drmobj.h:3744
D3DVECTOR *WINAPI D3DRMVectorNormalize(D3DVECTOR *u)
Definition: math.c:196
D3DVECTOR *WINAPI D3DRMVectorAdd(D3DVECTOR *d, D3DVECTOR *s1, D3DVECTOR *s2)
Definition: math.c:141
D3DVECTOR *WINAPI D3DRMVectorCrossProduct(D3DVECTOR *d, D3DVECTOR *s1, D3DVECTOR *s2)
Definition: math.c:167
D3DVECTOR *WINAPI D3DRMVectorSubtract(D3DVECTOR *d, D3DVECTOR *s1, D3DVECTOR *s2)
Definition: math.c:154
#define CloseHandle
Definition: compat.h:739
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:740
#define GENERIC_READ
Definition: compat.h:135
#define FILE_SHARE_READ
Definition: compat.h:136
#define IDirectXFileObject_Release(p)
Definition: dxfile.h:160
#define IDirectXFileDataReference_Release(p)
Definition: dxfile.h:212
#define IDirectXFileData_GetType(p, a)
Definition: dxfile.h:191
#define DXFILE_OK
Definition: dxfile.h:268
#define IDirectXFileData_GetName(p, a, b)
Definition: dxfile.h:187
#define IDirectXFileData_GetData(p, a, b, c)
Definition: dxfile.h:190
#define IDirectXFileObject_QueryInterface(p, a, b)
Definition: dxfile.h:158
#define DXFILEERR_NOMOREOBJECTS
Definition: dxfile.h:291
#define IDirectXFileDataReference_Resolve(p, a)
Definition: dxfile.h:217
#define IDirectXFileData_GetNextObject(p, a)
Definition: dxfile.h:192
#define IDirectXFileData_Release(p)
Definition: dxfile.h:185
GLuint GLuint end
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLint reference
Definition: glext.h:11729
GLboolean GLenum GLenum GLvoid * values
Definition: glext.h:5666
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
const char * filename
Definition: ioapi.h:137
#define a
Definition: ke_i.h:78
#define b
Definition: ke_i.h:79
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_a
Definition: kernel32.h:31
BOOL d3drm_array_reserve(void **elements, SIZE_T *capacity, SIZE_T element_count, SIZE_T element_size)
Definition: meshbuilder.c:260
static struct d3drm_mesh_builder * impl_from_IDirect3DRMMeshBuilder3(IDirect3DRMMeshBuilder3 *iface)
Definition: meshbuilder.c:297
const GUID * guid
static PVOID ptr
Definition: dispmode.c:27
static HWND child
Definition: cursoricon.c:298
#define DWORD
Definition: nt_native.h:44
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
static void * heap_calloc(SIZE_T count, SIZE_T size)
Definition: heap.h:49
IDirect3DRMTexture3 IDirect3DRMTexture3_iface
Definition: d3drm_private.h:63
Definition: fci.c:127
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
int ret
unsigned char BYTE
Definition: xxhash.c:193

Referenced by d3drm_mesh_builder3_Load(), and load_data().

◆ unsafe_impl_from_IDirect3DRMDevice3()

struct d3drm_device * unsafe_impl_from_IDirect3DRMDevice3 ( IDirect3DRMDevice3 *  iface)

Definition at line 1625 of file device.c.

1626{
1627 if (!iface)
1628 return NULL;
1629 assert(iface->lpVtbl == &d3drm_device3_vtbl);
1630
1631 return impl_from_IDirect3DRMDevice3(iface);
1632}
static struct d3drm_device * impl_from_IDirect3DRMDevice3(IDirect3DRMDevice3 *iface)
Definition: device.c:35
#define assert(x)
Definition: debug.h:53

Referenced by d3drm_viewport2_Init().

◆ unsafe_impl_from_IDirect3DRMFrame()

struct d3drm_frame * unsafe_impl_from_IDirect3DRMFrame ( IDirect3DRMFrame *  iface)

Definition at line 3120 of file frame.c.

3121{
3122 if (!iface)
3123 return NULL;
3124 assert(iface->lpVtbl == &d3drm_frame1_vtbl);
3125
3126 return impl_from_IDirect3DRMFrame(iface);
3127}
static struct d3drm_frame * impl_from_IDirect3DRMFrame(IDirect3DRMFrame *iface)
Definition: frame.c:58

Referenced by d3drm_frame1_AddChild(), d3drm_frame1_DeleteChild(), d3drm_viewport1_Init(), and d3drm_viewport1_SetCamera().

◆ unsafe_impl_from_IDirect3DRMFrame3()

struct d3drm_frame * unsafe_impl_from_IDirect3DRMFrame3 ( IDirect3DRMFrame3 *  iface)

Definition at line 3111 of file frame.c.

3112{
3113 if (!iface)
3114 return NULL;
3115 assert(iface->lpVtbl == &d3drm_frame3_vtbl);
3116
3117 return impl_from_IDirect3DRMFrame3(iface);
3118}
static struct d3drm_frame * impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface)
Definition: frame.c:68

Referenced by d3drm_frame3_AddChild(), d3drm_frame3_DeleteChild(), d3drm_viewport1_GetCamera(), and d3drm_viewport2_SetCamera().

Variable Documentation

◆ DECLSPEC_HIDDEN

char templates [] DECLSPEC_HIDDEN
extern

Definition at line 289 of file d3dcompiler_private.h.