ReactOS  0.4.13-dev-544-gede3fdd
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_object
 
struct  d3drm_texture
 
struct  d3drm_frame
 
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

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_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 3687 of file frame.c.

3688 {
3689  static const char classname[] = "Animation";
3690  struct d3drm_animation *object;
3691  HRESULT hr = D3DRM_OK;
3692 
3693  TRACE("animation %p, d3drm %p.\n", animation, d3drm);
3694 
3695  if (!(object = heap_alloc_zero(sizeof(*object))))
3696  return E_OUTOFMEMORY;
3697 
3698  object->IDirect3DRMAnimation_iface.lpVtbl = &d3drm_animation1_vtbl;
3699  object->IDirect3DRMAnimation2_iface.lpVtbl = &d3drm_animation2_vtbl;
3700  object->d3drm = d3drm;
3701  object->ref = 1;
3703 
3705 
3706  IDirect3DRM_AddRef(object->d3drm);
3707 
3708  *animation = object;
3709 
3710  return hr;
3711 }
HRESULT hr
Definition: shlfolder.c:183
WCHAR classname[128]
Definition: startup.c:15
#define D3DRMANIMATION_LINEARPOSITION
Definition: d3drmdef.h:325
#define D3DRMANIMATION_CLOSED
Definition: d3drmdef.h:324
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define IDirect3DRM_AddRef(p)
Definition: d3drm.h:110
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define D3DRM_OK
Definition: d3drm.h:486
static const struct IDirect3DRMAnimationVtbl d3drm_animation1_vtbl
Definition: frame.c:3636
Definition: d3drm.c:191
void d3drm_object_init(struct d3drm_object *object, const char *classname)
Definition: d3drm_main.c:42
IDirect3DRM * d3drm
static const struct IDirect3DRMAnimation2Vtbl d3drm_animation2_vtbl
Definition: frame.c:3659
void * object
Definition: jmemsys.h:48

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 263 of file meshbuilder.c.

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

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 288 of file d3drm_private.h.

289 {
290  if (c <= 0.0f)
291  return 0u;
292  if (c >= 1.0f)
293  return 0xffu;
294  return floor(c * 255.0f);
295 }
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
GLfloat f
Definition: glext.h:7540
const GLubyte * c
Definition: glext.h:8905
_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 1637 of file device.c.

1638 {
1639  static const char classname[] = "Device";
1640  struct d3drm_device *object;
1641 
1642  TRACE("device %p, d3drm %p.\n", device, d3drm);
1643 
1644  if (!(object = heap_alloc_zero(sizeof(*object))))
1645  return E_OUTOFMEMORY;
1646 
1647  object->IDirect3DRMDevice_iface.lpVtbl = &d3drm_device1_vtbl;
1648  object->IDirect3DRMDevice2_iface.lpVtbl = &d3drm_device2_vtbl;
1649  object->IDirect3DRMDevice3_iface.lpVtbl = &d3drm_device3_vtbl;
1650  object->IDirect3DRMWinDevice_iface.lpVtbl = &d3drm_device_win_vtbl;
1651  object->d3drm = d3drm;
1653 
1654  *device = object;
1655 
1656  return D3DRM_OK;
1657 }
WCHAR classname[128]
Definition: startup.c:15
static const struct IDirect3DRMDevice3Vtbl d3drm_device3_vtbl
Definition: device.c:1370
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
Definition: devices.h:37
static const struct IDirect3DRMDevice2Vtbl d3drm_device2_vtbl
Definition: device.c:1418
#define TRACE(s)
Definition: solgame.cpp:4
#define D3DRM_OK
Definition: d3drm.h:486
IDirect3DRM * d3drm
Definition: d3drm.c:191
static const struct IDirect3DRMWinDeviceVtbl d3drm_device_win_vtbl
Definition: device.c:1611
void d3drm_object_init(struct d3drm_object *object, const char *classname)
Definition: d3drm_main.c:42
static const struct IDirect3DRMDeviceVtbl d3drm_device1_vtbl
Definition: device.c:1461
void * object
Definition: jmemsys.h:48

Referenced by d3drm1_CreateDevice(), d3drm1_CreateDeviceFromClipper(), d3drm1_CreateDeviceFromD3D(), d3drm1_CreateDeviceFromSurface(), d3drm2_CreateDevice(), d3drm3_CreateDevice(), 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 72 of file device.c.

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

Referenced by d3drm1_CreateDeviceFromClipper(), and d3drm3_CreateDeviceFromClipper().

◆ d3drm_device_destroy()

void d3drm_device_destroy ( struct d3drm_device device)

Definition at line 43 of file device.c.

44 {
45  d3drm_object_cleanup((IDirect3DRMObject *)&device->IDirect3DRMDevice_iface, &device->obj);
46  if (device->device)
47  {
48  TRACE("Releasing attached ddraw interfaces.\n");
50  }
51  if (device->render_target)
52  IDirectDrawSurface_Release(device->render_target);
53  if (device->primary_surface)
54  {
55  TRACE("Releasing primary surface and attached clipper.\n");
56  IDirectDrawSurface_Release(device->primary_surface);
57  IDirectDrawClipper_Release(device->clipper);
58  }
59  if (device->ddraw)
60  {
61  IDirectDraw_Release(device->ddraw);
63  }
65 }
void d3drm_object_cleanup(IDirect3DRMObject *iface, struct d3drm_object *object)
Definition: d3drm_main.c:156
#define IDirect3DDevice_Release(p)
Definition: d3d.h:966
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
#define IDirect3DRM_Release(p)
Definition: d3drm.h:111
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

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 123 of file device.c.

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

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 623 of file face.c.

624 {
625  static const char classname[] = "Face";
626  struct d3drm_face *object;
627 
628  TRACE("face %p.\n", face);
629 
630  if (!(object = heap_alloc_zero(sizeof(*object))))
631  return E_OUTOFMEMORY;
632 
633  object->IDirect3DRMFace_iface.lpVtbl = &d3drm_face1_vtbl;
634  object->IDirect3DRMFace2_iface.lpVtbl = &d3drm_face2_vtbl;
635  object->ref = 1;
636 
638 
639  *face = object;
640 
641  return S_OK;
642 }
WCHAR classname[128]
Definition: startup.c:15
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define TRACE(s)
Definition: solgame.cpp:4
static const struct IDirect3DRMFace2Vtbl d3drm_face2_vtbl
Definition: face.c:589
#define S_OK
Definition: intsafe.h:59
void d3drm_object_init(struct d3drm_object *object, const char *classname)
Definition: d3drm_main.c:42
static const struct IDirect3DRMFaceVtbl d3drm_face1_vtbl
Definition: face.c:379
void * object
Definition: jmemsys.h:48
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

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 2935 of file frame.c.

2936 {
2937  static const char classname[] = "Frame";
2938  struct d3drm_frame *object;
2939  HRESULT hr = D3DRM_OK;
2940 
2941  TRACE("frame %p, parent_frame %p, d3drm %p.\n", frame, parent_frame, d3drm);
2942 
2943  if (!(object = heap_alloc_zero(sizeof(*object))))
2944  return E_OUTOFMEMORY;
2945 
2946  object->IDirect3DRMFrame_iface.lpVtbl = &d3drm_frame1_vtbl;
2947  object->IDirect3DRMFrame2_iface.lpVtbl = &d3drm_frame2_vtbl;
2948  object->IDirect3DRMFrame3_iface.lpVtbl = &d3drm_frame3_vtbl;
2949  object->d3drm = d3drm;
2950  object->ref = 1;
2951  d3drm_set_color(&object->scenebackground, 0.0f, 0.0f, 0.0f, 1.0f);
2952  object->traversal_options = D3DRMFRAME_RENDERENABLE | D3DRMFRAME_PICKENABLE;
2953 
2955 
2956  memcpy(object->transform, identity, sizeof(D3DRMMATRIX4D));
2957 
2958  if (parent_frame)
2959  {
2960  IDirect3DRMFrame3 *p;
2961 
2962  if (FAILED(hr = IDirect3DRMFrame_QueryInterface(parent_frame, &IID_IDirect3DRMFrame3, (void **)&p)))
2963  {
2964  heap_free(object);
2965  return hr;
2966  }
2967  IDirect3DRMFrame_Release(parent_frame);
2968  IDirect3DRMFrame3_AddChild(p, &object->IDirect3DRMFrame3_iface);
2969  }
2970 
2971  IDirect3DRM_AddRef(object->d3drm);
2972 
2973  *frame = object;
2974 
2975  return hr;
2976 }
#define IDirect3DRMFrame3_AddChild(p, a)
Definition: d3drmobj.h:1719
HRESULT hr
Definition: shlfolder.c:183
WCHAR classname[128]
Definition: startup.c:15
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define IDirect3DRM_AddRef(p)
Definition: d3drm.h:110
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define D3DRM_OK
Definition: d3drm.h:486
#define D3DRMFRAME_RENDERENABLE
Definition: d3drmdef.h:319
static const struct IDirect3DRMFrame2Vtbl d3drm_frame2_vtbl
Definition: frame.c:2764
D3DVALUE D3DRMMATRIX4D[4][4]
Definition: d3drmdef.h:39
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
Definition: d3drm.c:191
#define IDirect3DRMFrame_QueryInterface(p, a, b)
Definition: d3drmobj.h:1166
static const struct IDirect3DRMFrameVtbl d3drm_frame1_vtbl
Definition: frame.c:2844
#define D3DRMFRAME_PICKENABLE
Definition: d3drmdef.h:320
static void d3drm_set_color(D3DCOLOR *color, float r, float g, float b, float a)
void d3drm_object_init(struct d3drm_object *object, const char *classname)
Definition: d3drm_main.c:42
IDirect3DRM * d3drm
Definition: d3drm_private.h:62
static const struct IDirect3DRMFrame3Vtbl d3drm_frame3_vtbl
Definition: frame.c:2671
#define IDirect3DRMFrame_Release(p)
Definition: d3drmobj.h:1168
GLfloat GLfloat p
Definition: glext.h:8902
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.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 374 of file light.c.

375 {
376  static const char classname[] = "Light";
377  struct d3drm_light *object;
378 
379  TRACE("light %p.\n", light);
380 
381  if (!(object = heap_alloc_zero(sizeof(*object))))
382  return E_OUTOFMEMORY;
383 
384  object->IDirect3DRMLight_iface.lpVtbl = &d3drm_light_vtbl;
385  object->ref = 1;
386  object->d3drm = d3drm;
387  IDirect3DRM_AddRef(object->d3drm);
388 
390 
391  *light = object;
392 
393  return S_OK;
394 }
WCHAR classname[128]
Definition: startup.c:15
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
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define IDirect3DRM_AddRef(p)
Definition: d3drm.h:110
#define TRACE(s)
Definition: solgame.cpp:4
static const struct IDirect3DRMLightVtbl d3drm_light_vtbl
Definition: light.c:340
#define S_OK
Definition: intsafe.h:59
IDirect3DRM * d3drm
void d3drm_object_init(struct d3drm_object *object, const char *classname)
Definition: d3drm_main.c:42
void * object
Definition: jmemsys.h:48

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 282 of file material.c.

283 {
284  static const char classname[] = "Material";
285  struct d3drm_material *object;
286 
287  TRACE("material %p, d3drm %p.\n", material, d3drm);
288 
289  if (!(object = heap_alloc_zero(sizeof(*object))))
290  return E_OUTOFMEMORY;
291 
292  object->IDirect3DRMMaterial2_iface.lpVtbl = &d3drm_material_vtbl;
293  object->ref = 1;
294  object->d3drm = d3drm;
295  IDirect3DRM_AddRef(object->d3drm);
296 
297  object->specular.r = 1.0f;
298  object->specular.g = 1.0f;
299  object->specular.b = 1.0f;
300 
302 
303  *material = object;
304 
305  return S_OK;
306 }
IDirect3DRM * d3drm
WCHAR classname[128]
Definition: startup.c:15
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define IDirect3DRM_AddRef(p)
Definition: d3drm.h:110
static const struct IDirect3DRMMaterial2Vtbl d3drm_material_vtbl
Definition: material.c:259
#define TRACE(s)
Definition: solgame.cpp:4
Definition: d3drm.c:191
#define S_OK
Definition: intsafe.h:59
void d3drm_object_init(struct d3drm_object *object, const char *classname)
Definition: d3drm_main.c:42
void * object
Definition: jmemsys.h:48

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

◆ d3drm_mesh_builder_create()

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

Definition at line 2337 of file meshbuilder.c.

2338 {
2339  static const char classname[] = "Builder";
2340  struct d3drm_mesh_builder *object;
2341 
2342  TRACE("mesh_builder %p.\n", mesh_builder);
2343 
2344  if (!(object = heap_alloc_zero(sizeof(*object))))
2345  return E_OUTOFMEMORY;
2346 
2347  object->IDirect3DRMMeshBuilder2_iface.lpVtbl = &d3drm_mesh_builder2_vtbl;
2348  object->IDirect3DRMMeshBuilder3_iface.lpVtbl = &d3drm_mesh_builder3_vtbl;
2349  object->ref = 1;
2350  object->d3drm = d3drm;
2351  IDirect3DRM_AddRef(object->d3drm);
2352 
2354 
2355  *mesh_builder = object;
2356 
2357  return S_OK;
2358 }
WCHAR classname[128]
Definition: startup.c:15
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define IDirect3DRM_AddRef(p)
Definition: d3drm.h:110
IDirect3DRM * d3drm
#define TRACE(s)
Definition: solgame.cpp:4
IDirect3DRMMeshBuilder * mesh_builder
Definition: d3drm.c:2770
#define S_OK
Definition: intsafe.h:59
static const struct IDirect3DRMMeshBuilder3Vtbl d3drm_mesh_builder3_vtbl
Definition: meshbuilder.c:2263
static const struct IDirect3DRMMeshBuilder2Vtbl d3drm_mesh_builder2_vtbl
Definition: meshbuilder.c:883
void d3drm_object_init(struct d3drm_object *object, const char *classname)
Definition: d3drm_main.c:42
void * object
Definition: jmemsys.h:48

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 2836 of file meshbuilder.c.

2837 {
2838  static const char classname[] = "Mesh";
2839  struct d3drm_mesh *object;
2840 
2841  TRACE("mesh %p, d3drm %p.\n", mesh, d3drm);
2842 
2843  if (!(object = heap_alloc_zero(sizeof(*object))))
2844  return E_OUTOFMEMORY;
2845 
2846  object->IDirect3DRMMesh_iface.lpVtbl = &d3drm_mesh_vtbl;
2847  object->ref = 1;
2848  object->d3drm = d3drm;
2849  IDirect3DRM_AddRef(object->d3drm);
2850 
2852 
2853  *mesh = object;
2854 
2855  return S_OK;
2856 }
IDirect3DRM * d3drm
WCHAR classname[128]
Definition: startup.c:15
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define IDirect3DRM_AddRef(p)
Definition: d3drm.h:110
#define TRACE(s)
Definition: solgame.cpp:4
Definition: d3drm.c:191
#define S_OK
Definition: intsafe.h:59
void d3drm_object_init(struct d3drm_object *object, const char *classname)
Definition: d3drm_main.c:42
static const struct IDirect3DRMMeshVtbl d3drm_mesh_vtbl
Definition: meshbuilder.c:2802
void * object
Definition: jmemsys.h:48

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 58 of file d3drm_main.c.

59 {
60  struct destroy_callback *callback;
61 
62  if (!cb)
63  return D3DRMERR_BADVALUE;
64 
65  if (!(callback = heap_alloc(sizeof(*callback))))
66  return E_OUTOFMEMORY;
67 
68  callback->cb = cb;
69  callback->ctx = ctx;
70 
71  list_add_head(&object->destroy_callbacks, &callback->entry);
72  return D3DRM_OK;
73 }
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
Definition: list.h:96
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
MmuTrapHandler callback[0x30]
Definition: mmuobject.c:44
#define D3DRM_OK
Definition: d3drm.h:486
static DWORD cb
Definition: integrity.c:41
#define D3DRMERR_BADVALUE
Definition: d3drm.h:496

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 156 of file d3drm_main.c.

157 {
158  struct destroy_callback *callback, *callback2;
159 
160  LIST_FOR_EACH_ENTRY_SAFE(callback, callback2, &object->destroy_callbacks, struct destroy_callback, entry)
161  {
162  callback->cb(iface, callback->ctx);
163  list_remove(&callback->entry);
165  }
166 
167  heap_free(object->name);
168  object->name = NULL;
169 }
smooth NULL
Definition: ftsmooth.c:416
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
MmuTrapHandler callback[0x30]
Definition: mmuobject.c:44
uint32_t entry
Definition: isohybrid.c:63
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

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()

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

Definition at line 75 of file d3drm_main.c.

76 {
77  struct destroy_callback *callback;
78 
79  if (!cb)
80  return D3DRMERR_BADVALUE;
81 
82  LIST_FOR_EACH_ENTRY(callback, &object->destroy_callbacks, struct destroy_callback, entry)
83  {
84  if (callback->cb == cb && callback->ctx == ctx)
85  {
86  list_remove(&callback->entry);
88  break;
89  }
90  }
91 
92  return D3DRM_OK;
93 }
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
MmuTrapHandler callback[0x30]
Definition: mmuobject.c:44
#define D3DRM_OK
Definition: d3drm.h:486
static DWORD cb
Definition: integrity.c:41
#define D3DRMERR_BADVALUE
Definition: d3drm.h:496
uint32_t entry
Definition: isohybrid.c:63
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by d3drm_animation2_DeleteDestroyCallback(), d3drm_device3_DeleteDestroyCallback(), d3drm_face2_DeleteDestroyCallback(), d3drm_frame3_DeleteDestroyCallback(), d3drm_light_DeleteDestroyCallback(), d3drm_material_DeleteDestroyCallback(), d3drm_mesh_builder3_DeleteDestroyCallback(), d3drm_mesh_DeleteDestroyCallback(), d3drm_texture3_DeleteDestroyCallback(), d3drm_viewport2_DeleteDestroyCallback(), and d3drm_wrap_DeleteDestroyCallback().

◆ d3drm_object_get_class_name()

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

Definition at line 95 of file d3drm_main.c.

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

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 114 of file d3drm_main.c.

115 {
116  DWORD req_size;
117 
118  if (!size)
119  return E_INVALIDARG;
120 
121  req_size = object->name ? strlen(object->name) + 1 : 0;
122  if (name && *size < req_size)
123  return E_INVALIDARG;
124 
125  if (name)
126  {
127  if (object->name)
128  memcpy(name, object->name, req_size);
129  else if (*size)
130  *name = 0;
131  }
132 
133  *size = req_size;
134 
135  return D3DRM_OK;
136 }
char * name
Definition: wpp.c:36
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define E_INVALIDARG
Definition: ddrawi.h:101
GLsizeiptr size
Definition: glext.h:5919
#define D3DRM_OK
Definition: d3drm.h:486
unsigned long DWORD
Definition: ntddk_ex.h:95
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
Definition: name.c:36

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 42 of file d3drm_main.c.

43 {
44  object->ref = 1;
45  object->appdata = 0;
46  list_init(&object->destroy_callbacks);
47  object->classname = classname;
48  object->name = NULL;
49 }
WCHAR classname[128]
Definition: startup.c:15
smooth NULL
Definition: ftsmooth.c:416
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149

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 138 of file d3drm_main.c.

139 {
140  DWORD req_size;
141 
142  heap_free(object->name);
143  object->name = NULL;
144 
145  if (name)
146  {
147  req_size = strlen(name) + 1;
148  if (!(object->name = heap_alloc(req_size)))
149  return E_OUTOFMEMORY;
150  memcpy(object->name, name, req_size);
151  }
152 
153  return D3DRM_OK;
154 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
#define D3DRM_OK
Definition: d3drm.h:486
unsigned long DWORD
Definition: ntddk_ex.h:95
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
Definition: name.c:36
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

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 297 of file d3drm_private.h.

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

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 1415 of file texture.c.

1416 {
1417  static const char classname[] = "Texture";
1418  struct d3drm_texture *object;
1419 
1420  TRACE("texture %p.\n", texture);
1421 
1422  if (!(object = heap_alloc_zero(sizeof(*object))))
1423  return E_OUTOFMEMORY;
1424 
1425  object->IDirect3DRMTexture_iface.lpVtbl = &d3drm_texture1_vtbl;
1426  object->IDirect3DRMTexture2_iface.lpVtbl = &d3drm_texture2_vtbl;
1427  object->IDirect3DRMTexture3_iface.lpVtbl = &d3drm_texture3_vtbl;
1428  object->d3drm = d3drm;
1429 
1431 
1432  *texture = object;
1433 
1434  return D3DRM_OK;
1435 }
static const struct IDirect3DRMTexture2Vtbl d3drm_texture2_vtbl
Definition: texture.c:960
WCHAR classname[128]
Definition: startup.c:15
static const struct IDirect3DRMTextureVtbl d3drm_texture1_vtbl
Definition: texture.c:629
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
#define D3DRM_OK
Definition: d3drm.h:486
static const struct IDirect3DRMTexture3Vtbl d3drm_texture3_vtbl
Definition: texture.c:1373
IDirect3DRM * d3drm
Definition: d3drm_private.h:51
void d3drm_object_init(struct d3drm_object *object, const char *classname)
Definition: d3drm_main.c:42
void * object
Definition: jmemsys.h:48

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 1018 of file viewport.c.

1019 {
1020  static const char classname[] = "Viewport";
1021  struct d3drm_viewport *object;
1022 
1023  TRACE("viewport %p, d3drm %p.\n", viewport, d3drm);
1024 
1025  if (!(object = heap_alloc_zero(sizeof(*object))))
1026  return E_OUTOFMEMORY;
1027 
1028  object->IDirect3DRMViewport_iface.lpVtbl = &d3drm_viewport1_vtbl;
1029  object->IDirect3DRMViewport2_iface.lpVtbl = &d3drm_viewport2_vtbl;
1030  object->d3drm = d3drm;
1032 
1033  *viewport = object;
1034 
1035  return S_OK;
1036 }
static const struct IDirect3DRMViewport2Vtbl d3drm_viewport2_vtbl
Definition: viewport.c:930
WCHAR classname[128]
Definition: startup.c:15
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define TRACE(s)
Definition: solgame.cpp:4
Definition: d3drm.c:191
#define S_OK
Definition: intsafe.h:59
IDirect3DRM * d3drm
Definition: d3drm_private.h:88
void d3drm_object_init(struct d3drm_object *object, const char *classname)
Definition: d3drm_main.c:42
static const struct IDirect3DRMViewportVtbl d3drm_viewport1_vtbl
Definition: viewport.c:975
void * object
Definition: jmemsys.h:48

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 3022 of file meshbuilder.c.

3023 {
3024  static const char classname[] = "";
3025  struct d3drm_wrap *object;
3026 
3027  TRACE("wrap %p, d3drm %p.\n", wrap, d3drm);
3028 
3029  if (!(object = heap_alloc_zero(sizeof(*object))))
3030  return E_OUTOFMEMORY;
3031 
3032  object->IDirect3DRMWrap_iface.lpVtbl = &d3drm_wrap_vtbl;
3033  object->ref = 1;
3034 
3036 
3037  *wrap = object;
3038 
3039  return S_OK;
3040 }
WCHAR classname[128]
Definition: startup.c:15
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define TRACE(s)
Definition: solgame.cpp:4
static const struct IDirect3DRMWrapVtbl d3drm_wrap_vtbl
Definition: meshbuilder.c:3004
Definition: d3drm.c:191
#define S_OK
Definition: intsafe.h:59
void d3drm_object_init(struct d3drm_object *object, const char *classname)
Definition: d3drm_main.c:42
#define wrap(journal, var)
Definition: recovery.c:207
void * object
Definition: jmemsys.h:48

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 1022 of file meshbuilder.c.

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

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 1628 of file device.c.

1629 {
1630  if (!iface)
1631  return NULL;
1632  assert(iface->lpVtbl == &d3drm_device3_vtbl);
1633 
1634  return impl_from_IDirect3DRMDevice3(iface);
1635 }
static struct d3drm_device * impl_from_IDirect3DRMDevice3(IDirect3DRMDevice3 *iface)
Definition: device.c:38
#define assert(x)
Definition: debug.h:53
static const struct IDirect3DRMDevice3Vtbl d3drm_device3_vtbl
Definition: device.c:1370
smooth NULL
Definition: ftsmooth.c:416

Referenced by d3drm_viewport2_Init().

◆ unsafe_impl_from_IDirect3DRMFrame()

struct d3drm_frame* unsafe_impl_from_IDirect3DRMFrame ( IDirect3DRMFrame *  iface)

Definition at line 2926 of file frame.c.

2927 {
2928  if (!iface)
2929  return NULL;
2930  assert(iface->lpVtbl == &d3drm_frame1_vtbl);
2931 
2932  return impl_from_IDirect3DRMFrame(iface);
2933 }
#define assert(x)
Definition: debug.h:53
smooth NULL
Definition: ftsmooth.c:416
static struct d3drm_frame * impl_from_IDirect3DRMFrame(IDirect3DRMFrame *iface)
Definition: frame.c:60
static const struct IDirect3DRMFrameVtbl d3drm_frame1_vtbl
Definition: frame.c:2844

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

Variable Documentation

◆ DECLSPEC_HIDDEN

char templates [] DECLSPEC_HIDDEN

Definition at line 155 of file crypt32_private.h.