ReactOS 0.4.15-dev-8207-gd73a838
texture.c File Reference
#include "d3drm_private.h"
Include dependency graph for texture.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (d3drm)
 
static struct d3drm_textureimpl_from_IDirect3DRMTexture (IDirect3DRMTexture *iface)
 
static struct d3drm_textureimpl_from_IDirect3DRMTexture2 (IDirect3DRMTexture2 *iface)
 
static struct d3drm_textureimpl_from_IDirect3DRMTexture3 (IDirect3DRMTexture3 *iface)
 
static void d3drm_texture_destroy (struct d3drm_texture *texture)
 
static BOOL d3drm_validate_image (D3DRMIMAGE *image)
 
static BOOL d3drm_image_palettise (D3DRMIMAGE *image, unsigned char *src_data, SIZE_T w, SIZE_T h, BOOL flip)
 
static HRESULT d3drm_image_load_32 (D3DRMIMAGE *image, unsigned char *src_data, LONGLONG src_data_size, SIZE_T w, SIZE_T h, BOOL flip)
 
static HRESULT d3drm_image_load_8 (D3DRMIMAGE *image, const RGBQUAD *palette, unsigned char *src_data, LONGLONG src_data_size, SIZE_T w, SIZE_T h, BOOL flip)
 
static void CDECL destroy_image_callback (IDirect3DRMObject *obj, void *arg)
 
static HRESULT d3drm_texture_load (struct d3drm_texture *texture, const char *path, BOOL flip, D3DRMIMAGE **image_out)
 
static HRESULT WINAPI d3drm_texture1_QueryInterface (IDirect3DRMTexture *iface, REFIID riid, void **out)
 
static ULONG WINAPI d3drm_texture1_AddRef (IDirect3DRMTexture *iface)
 
static ULONG WINAPI d3drm_texture1_Release (IDirect3DRMTexture *iface)
 
static HRESULT WINAPI d3drm_texture1_Clone (IDirect3DRMTexture *iface, IUnknown *outer, REFIID iid, void **out)
 
static HRESULT WINAPI d3drm_texture1_AddDestroyCallback (IDirect3DRMTexture *iface, D3DRMOBJECTCALLBACK cb, void *ctx)
 
static HRESULT WINAPI d3drm_texture1_DeleteDestroyCallback (IDirect3DRMTexture *iface, D3DRMOBJECTCALLBACK cb, void *ctx)
 
static HRESULT WINAPI d3drm_texture1_SetAppData (IDirect3DRMTexture *iface, DWORD data)
 
static DWORD WINAPI d3drm_texture1_GetAppData (IDirect3DRMTexture *iface)
 
static HRESULT WINAPI d3drm_texture1_SetName (IDirect3DRMTexture *iface, const char *name)
 
static HRESULT WINAPI d3drm_texture1_GetName (IDirect3DRMTexture *iface, DWORD *size, char *name)
 
static HRESULT WINAPI d3drm_texture1_GetClassName (IDirect3DRMTexture *iface, DWORD *size, char *name)
 
static HRESULT WINAPI d3drm_texture1_InitFromFile (IDirect3DRMTexture *iface, const char *filename)
 
static HRESULT WINAPI d3drm_texture1_InitFromSurface (IDirect3DRMTexture *iface, IDirectDrawSurface *surface)
 
static HRESULT WINAPI d3drm_texture1_InitFromResource (IDirect3DRMTexture *iface, HRSRC resource)
 
static HRESULT WINAPI d3drm_texture1_Changed (IDirect3DRMTexture *iface, BOOL pixels, BOOL palette)
 
static HRESULT WINAPI d3drm_texture1_SetColors (IDirect3DRMTexture *iface, DWORD max_colors)
 
static HRESULT WINAPI d3drm_texture1_SetShades (IDirect3DRMTexture *iface, DWORD max_shades)
 
static HRESULT WINAPI d3drm_texture1_SetDecalSize (IDirect3DRMTexture *iface, D3DVALUE width, D3DVALUE height)
 
static HRESULT WINAPI d3drm_texture1_SetDecalOrigin (IDirect3DRMTexture *iface, LONG x, LONG y)
 
static HRESULT WINAPI d3drm_texture1_SetDecalScale (IDirect3DRMTexture *iface, DWORD scale)
 
static HRESULT WINAPI d3drm_texture1_SetDecalTransparency (IDirect3DRMTexture *iface, BOOL transparency)
 
static HRESULT WINAPI d3drm_texture1_SetDecalTransparentColor (IDirect3DRMTexture *iface, D3DCOLOR color)
 
static HRESULT WINAPI d3drm_texture1_GetDecalSize (IDirect3DRMTexture *iface, D3DVALUE *width, D3DVALUE *height)
 
static HRESULT WINAPI d3drm_texture1_GetDecalOrigin (IDirect3DRMTexture *iface, LONG *x, LONG *y)
 
static D3DRMIMAGE *WINAPI d3drm_texture1_GetImage (IDirect3DRMTexture *iface)
 
static DWORD WINAPI d3drm_texture1_GetShades (IDirect3DRMTexture *iface)
 
static DWORD WINAPI d3drm_texture1_GetColors (IDirect3DRMTexture *iface)
 
static DWORD WINAPI d3drm_texture1_GetDecalScale (IDirect3DRMTexture *iface)
 
static BOOL WINAPI d3drm_texture1_GetDecalTransparency (IDirect3DRMTexture *iface)
 
static D3DCOLOR WINAPI d3drm_texture1_GetDecalTransparentColor (IDirect3DRMTexture *iface)
 
static HRESULT WINAPI d3drm_texture2_QueryInterface (IDirect3DRMTexture2 *iface, REFIID riid, void **out)
 
static ULONG WINAPI d3drm_texture2_AddRef (IDirect3DRMTexture2 *iface)
 
static ULONG WINAPI d3drm_texture2_Release (IDirect3DRMTexture2 *iface)
 
static HRESULT WINAPI d3drm_texture2_Clone (IDirect3DRMTexture2 *iface, IUnknown *outer, REFIID iid, void **out)
 
static HRESULT WINAPI d3drm_texture2_AddDestroyCallback (IDirect3DRMTexture2 *iface, D3DRMOBJECTCALLBACK cb, void *ctx)
 
static HRESULT WINAPI d3drm_texture2_DeleteDestroyCallback (IDirect3DRMTexture2 *iface, D3DRMOBJECTCALLBACK cb, void *ctx)
 
static HRESULT WINAPI d3drm_texture2_SetAppData (IDirect3DRMTexture2 *iface, DWORD data)
 
static DWORD WINAPI d3drm_texture2_GetAppData (IDirect3DRMTexture2 *iface)
 
static HRESULT WINAPI d3drm_texture2_SetName (IDirect3DRMTexture2 *iface, const char *name)
 
static HRESULT WINAPI d3drm_texture2_GetName (IDirect3DRMTexture2 *iface, DWORD *size, char *name)
 
static HRESULT WINAPI d3drm_texture2_GetClassName (IDirect3DRMTexture2 *iface, DWORD *size, char *name)
 
static HRESULT WINAPI d3drm_texture2_InitFromFile (IDirect3DRMTexture2 *iface, const char *filename)
 
static HRESULT WINAPI d3drm_texture2_InitFromSurface (IDirect3DRMTexture2 *iface, IDirectDrawSurface *surface)
 
static HRESULT WINAPI d3drm_texture2_InitFromResource (IDirect3DRMTexture2 *iface, HRSRC resource)
 
static HRESULT WINAPI d3drm_texture2_Changed (IDirect3DRMTexture2 *iface, BOOL pixels, BOOL palette)
 
static HRESULT WINAPI d3drm_texture2_SetColors (IDirect3DRMTexture2 *iface, DWORD max_colors)
 
static HRESULT WINAPI d3drm_texture2_SetShades (IDirect3DRMTexture2 *iface, DWORD max_shades)
 
static HRESULT WINAPI d3drm_texture2_SetDecalSize (IDirect3DRMTexture2 *iface, D3DVALUE width, D3DVALUE height)
 
static HRESULT WINAPI d3drm_texture2_SetDecalOrigin (IDirect3DRMTexture2 *iface, LONG x, LONG y)
 
static HRESULT WINAPI d3drm_texture2_SetDecalScale (IDirect3DRMTexture2 *iface, DWORD scale)
 
static HRESULT WINAPI d3drm_texture2_SetDecalTransparency (IDirect3DRMTexture2 *iface, BOOL transparency)
 
static HRESULT WINAPI d3drm_texture2_SetDecalTransparentColor (IDirect3DRMTexture2 *iface, D3DCOLOR color)
 
static HRESULT WINAPI d3drm_texture2_GetDecalSize (IDirect3DRMTexture2 *iface, D3DVALUE *width, D3DVALUE *height)
 
static HRESULT WINAPI d3drm_texture2_GetDecalOrigin (IDirect3DRMTexture2 *iface, LONG *x, LONG *y)
 
static D3DRMIMAGE *WINAPI d3drm_texture2_GetImage (IDirect3DRMTexture2 *iface)
 
static DWORD WINAPI d3drm_texture2_GetShades (IDirect3DRMTexture2 *iface)
 
static DWORD WINAPI d3drm_texture2_GetColors (IDirect3DRMTexture2 *iface)
 
static DWORD WINAPI d3drm_texture2_GetDecalScale (IDirect3DRMTexture2 *iface)
 
static BOOL WINAPI d3drm_texture2_GetDecalTransparency (IDirect3DRMTexture2 *iface)
 
static D3DCOLOR WINAPI d3drm_texture2_GetDecalTransparentColor (IDirect3DRMTexture2 *iface)
 
static HRESULT WINAPI d3drm_texture2_InitFromImage (IDirect3DRMTexture2 *iface, D3DRMIMAGE *image)
 
static HRESULT WINAPI d3drm_texture2_InitFromResource2 (IDirect3DRMTexture2 *iface, HMODULE module, const char *name, const char *type)
 
static HRESULT WINAPI d3drm_texture2_GenerateMIPMap (IDirect3DRMTexture2 *iface, DWORD flags)
 
static HRESULT WINAPI d3drm_texture3_QueryInterface (IDirect3DRMTexture3 *iface, REFIID riid, void **out)
 
static ULONG WINAPI d3drm_texture3_AddRef (IDirect3DRMTexture3 *iface)
 
static ULONG WINAPI d3drm_texture3_Release (IDirect3DRMTexture3 *iface)
 
static HRESULT WINAPI d3drm_texture3_Clone (IDirect3DRMTexture3 *iface, IUnknown *outer, REFIID iid, void **out)
 
static HRESULT WINAPI d3drm_texture3_AddDestroyCallback (IDirect3DRMTexture3 *iface, D3DRMOBJECTCALLBACK cb, void *ctx)
 
static HRESULT WINAPI d3drm_texture3_DeleteDestroyCallback (IDirect3DRMTexture3 *iface, D3DRMOBJECTCALLBACK cb, void *ctx)
 
static HRESULT WINAPI d3drm_texture3_SetAppData (IDirect3DRMTexture3 *iface, DWORD data)
 
static DWORD WINAPI d3drm_texture3_GetAppData (IDirect3DRMTexture3 *iface)
 
static HRESULT WINAPI d3drm_texture3_SetName (IDirect3DRMTexture3 *iface, const char *name)
 
static HRESULT WINAPI d3drm_texture3_GetName (IDirect3DRMTexture3 *iface, DWORD *size, char *name)
 
static HRESULT WINAPI d3drm_texture3_GetClassName (IDirect3DRMTexture3 *iface, DWORD *size, char *name)
 
static HRESULT WINAPI d3drm_texture3_InitFromFile (IDirect3DRMTexture3 *iface, const char *filename)
 
static HRESULT WINAPI d3drm_texture3_InitFromSurface (IDirect3DRMTexture3 *iface, IDirectDrawSurface *surface)
 
static HRESULT WINAPI d3drm_texture3_InitFromResource (IDirect3DRMTexture3 *iface, HRSRC resource)
 
static HRESULT WINAPI d3drm_texture3_Changed (IDirect3DRMTexture3 *iface, DWORD flags, DWORD rect_count, RECT *rects)
 
static HRESULT WINAPI d3drm_texture3_SetColors (IDirect3DRMTexture3 *iface, DWORD max_colors)
 
static HRESULT WINAPI d3drm_texture3_SetShades (IDirect3DRMTexture3 *iface, DWORD max_shades)
 
static HRESULT WINAPI d3drm_texture3_SetDecalSize (IDirect3DRMTexture3 *iface, D3DVALUE width, D3DVALUE height)
 
static HRESULT WINAPI d3drm_texture3_SetDecalOrigin (IDirect3DRMTexture3 *iface, LONG x, LONG y)
 
static HRESULT WINAPI d3drm_texture3_SetDecalScale (IDirect3DRMTexture3 *iface, DWORD scale)
 
static HRESULT WINAPI d3drm_texture3_SetDecalTransparency (IDirect3DRMTexture3 *iface, BOOL transparency)
 
static HRESULT WINAPI d3drm_texture3_SetDecalTransparentColor (IDirect3DRMTexture3 *iface, D3DCOLOR color)
 
static HRESULT WINAPI d3drm_texture3_GetDecalSize (IDirect3DRMTexture3 *iface, D3DVALUE *width, D3DVALUE *height)
 
static HRESULT WINAPI d3drm_texture3_GetDecalOrigin (IDirect3DRMTexture3 *iface, LONG *x, LONG *y)
 
static D3DRMIMAGE *WINAPI d3drm_texture3_GetImage (IDirect3DRMTexture3 *iface)
 
static DWORD WINAPI d3drm_texture3_GetShades (IDirect3DRMTexture3 *iface)
 
static DWORD WINAPI d3drm_texture3_GetColors (IDirect3DRMTexture3 *iface)
 
static DWORD WINAPI d3drm_texture3_GetDecalScale (IDirect3DRMTexture3 *iface)
 
static BOOL WINAPI d3drm_texture3_GetDecalTransparency (IDirect3DRMTexture3 *iface)
 
static D3DCOLOR WINAPI d3drm_texture3_GetDecalTransparentColor (IDirect3DRMTexture3 *iface)
 
static HRESULT WINAPI d3drm_texture3_InitFromImage (IDirect3DRMTexture3 *iface, D3DRMIMAGE *image)
 
static HRESULT WINAPI d3drm_texture3_InitFromResource2 (IDirect3DRMTexture3 *iface, HMODULE module, const char *name, const char *type)
 
static HRESULT WINAPI d3drm_texture3_GenerateMIPMap (IDirect3DRMTexture3 *iface, DWORD flags)
 
static HRESULT WINAPI d3drm_texture3_GetSurface (IDirect3DRMTexture3 *iface, DWORD flags, IDirectDrawSurface **surface)
 
static HRESULT WINAPI d3drm_texture3_SetCacheOptions (IDirect3DRMTexture3 *iface, LONG importance, DWORD flags)
 
static HRESULT WINAPI d3drm_texture3_GetCacheOptions (IDirect3DRMTexture3 *iface, LONG *importance, DWORD *flags)
 
static HRESULT WINAPI d3drm_texture3_SetDownsampleCallback (IDirect3DRMTexture3 *iface, D3DRMDOWNSAMPLECALLBACK cb, void *ctx)
 
static HRESULT WINAPI d3drm_texture3_SetValidationCallback (IDirect3DRMTexture3 *iface, D3DRMVALIDATIONCALLBACK cb, void *ctx)
 
HRESULT d3drm_texture_create (struct d3drm_texture **texture, IDirect3DRM *d3drm)
 

Variables

static const struct IDirect3DRMTextureVtbl d3drm_texture1_vtbl
 
static const struct IDirect3DRMTexture2Vtbl d3drm_texture2_vtbl
 
static const struct IDirect3DRMTexture3Vtbl d3drm_texture3_vtbl
 

Function Documentation

◆ d3drm_image_load_32()

static HRESULT d3drm_image_load_32 ( D3DRMIMAGE image,
unsigned char src_data,
LONGLONG  src_data_size,
SIZE_T  w,
SIZE_T  h,
BOOL  flip 
)
static

Definition at line 149 of file texture.c.

151{
152 unsigned char *dst_data, *src_ptr, *dst_ptr;
153 SIZE_T src_pitch, dst_pitch, x, y;
154
155 if (d3drm_image_palettise(image, src_data, w, h, flip))
156 return D3DRM_OK;
157
158 if (w > (~(SIZE_T)0 / 4) / h)
159 return D3DRMERR_BADALLOC;
160
161 src_pitch = flip ? -w * 3 : w * 3;
162 dst_pitch = w * 4;
163
164 if (!(dst_data = heap_alloc(dst_pitch * h)))
165 {
166 WARN("Failed to allocate image buffer.\n");
167 return D3DRMERR_BADALLOC;
168 }
169
170 src_ptr = flip ? &src_data[(h - 1) * w * 3] : src_data;
171 dst_ptr = dst_data;
172
173 for (y = 0; y < h; ++y)
174 {
175 for (x = 0; x < w; ++x)
176 {
177 dst_ptr[x * 4 + 0] = src_ptr[x * 3 + 0];
178 dst_ptr[x * 4 + 1] = src_ptr[x * 3 + 1];
179 dst_ptr[x * 4 + 2] = src_ptr[x * 3 + 2];
180 dst_ptr[x * 4 + 3] = 0xff;
181 }
182
183 src_ptr += src_pitch;
184 dst_ptr += dst_pitch;
185 }
186
187 image->depth = 32;
188 image->rgb = 1;
189 image->bytes_per_line = dst_pitch;
190 image->buffer1 = dst_data;
191 image->red_mask = 0xff0000;
192 image->green_mask = 0x00ff00;
193 image->blue_mask = 0x0000ff;
194 image->palette_size = 0;
195 image->palette = NULL;
196
197 return D3DRM_OK;
198}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
#define WARN(fmt,...)
Definition: debug.h:115
#define D3DRM_OK
Definition: d3drm.h:486
#define D3DRMERR_BADALLOC
Definition: d3drm.h:489
#define NULL
Definition: types.h:112
static BOOL d3drm_image_palettise(D3DRMIMAGE *image, unsigned char *src_data, SIZE_T w, SIZE_T h, BOOL flip)
Definition: texture.c:68
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
ULONG_PTR SIZE_T
Definition: typedefs.h:80

Referenced by d3drm_texture_load().

◆ d3drm_image_load_8()

static HRESULT d3drm_image_load_8 ( D3DRMIMAGE image,
const RGBQUAD palette,
unsigned char src_data,
LONGLONG  src_data_size,
SIZE_T  w,
SIZE_T  h,
BOOL  flip 
)
static

Definition at line 200 of file texture.c.

202{
203 unsigned char *dst_data;
204 SIZE_T i;
205
206 if (w > ~(SIZE_T)0 / h)
207 return D3DRMERR_BADALLOC;
208
209 if (!(dst_data = heap_alloc(w * h)))
210 {
211 WARN("Failed to allocate image buffer.\n");
212 return D3DRMERR_BADALLOC;
213 }
214
215 if (!(image->palette = heap_alloc(256 * sizeof(*image->palette))))
216 {
217 WARN("Failed to allocate palette.\n");
218 heap_free(dst_data);
219 return D3DRMERR_BADALLOC;
220 }
221
222 memcpy(image->palette, palette, 256 * sizeof(*image->palette));
223 for (i = 0; i < 256; ++i)
224 {
225 image->palette[i].flags = D3DRMPALETTE_READONLY;
226 }
227
228 if (flip)
229 {
230 for (i = 0; i < h; ++i)
231 {
232 memcpy(&dst_data[i * w], &src_data[(h - 1 - i) * w], w);
233 }
234 }
235 else
236 {
237 memcpy(dst_data, src_data, w * h);
238 }
239
240 image->depth = 8;
241 image->rgb = 0;
242 image->bytes_per_line = w;
243 image->buffer1 = dst_data;
244 image->red_mask = 0xff;
245 image->green_mask = 0xff;
246 image->blue_mask = 0xff;
247 image->palette_size = 256;
248
249 return D3DRM_OK;
250}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
@ D3DRMPALETTE_READONLY
Definition: d3drmdef.h:135
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static HPALETTE palette
Definition: clipboard.c:1345

Referenced by d3drm_texture_load().

◆ d3drm_image_palettise()

static BOOL d3drm_image_palettise ( D3DRMIMAGE image,
unsigned char src_data,
SIZE_T  w,
SIZE_T  h,
BOOL  flip 
)
static

Definition at line 68 of file texture.c.

70{
71 unsigned char *dst_data, *src_ptr, *dst_ptr;
72 SIZE_T src_pitch, dst_pitch, i, x, y;
74 unsigned int colour_count = 0;
75
76 if (w > (~(SIZE_T)0 - 3) / h)
77 return FALSE;
78
79 src_pitch = flip ? -w * 3 : w * 3;
80 dst_pitch = (w + 3) & ~3;
81
82 if (!(dst_data = heap_alloc(dst_pitch * h)))
83 {
84 WARN("Failed to allocate image buffer.\n");
85 return FALSE;
86 }
87 memset(dst_data, 0xff, dst_pitch * h);
88
89 if (!(palette = heap_alloc(256 * sizeof(*palette))))
90 {
91 WARN("Failed to allocate palette.\n");
92 heap_free(dst_data);
93 return FALSE;
94 }
95
96 src_ptr = flip ? &src_data[(h - 1) * w * 3] : src_data;
97 dst_ptr = dst_data;
98
99 for (y = 0; y < h; ++y)
100 {
101 for (x = 0; x < w; ++x)
102 {
103 for (i = 0; i < colour_count; ++i)
104 {
105 entry = &palette[i];
106 if (entry->red == src_ptr[x * 3 + 0]
107 && entry->green == src_ptr[x * 3 + 1]
108 && entry->blue == src_ptr[x * 3 + 2])
109 break;
110 }
111
112 if (i == colour_count)
113 {
114 if (colour_count == 256)
115 {
116 heap_free(dst_data);
118 return FALSE;
119 }
120
121 entry = &palette[colour_count++];
122 entry->red = src_ptr[x * 3 + 0];
123 entry->green = src_ptr[x * 3 + 1];
124 entry->blue = src_ptr[x * 3 + 2];
126 }
127
128 dst_ptr[x] = i;
129 }
130
131 src_ptr += src_pitch;
132 dst_ptr += dst_pitch;
133 }
134
135 image->depth = 8;
136 image->rgb = 0;
137 image->bytes_per_line = dst_pitch;
138 image->buffer1 = dst_data;
139 image->red_mask = 0xff;
140 image->green_mask = 0xff;
141 image->blue_mask = 0xff;
142 image->palette_size = colour_count;
143 if (!(image->palette = heap_realloc(palette, colour_count * sizeof(*palette))))
144 image->palette = palette;
145
146 return TRUE;
147}
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
uint32_t entry
Definition: isohybrid.c:63
#define memset(x, y, z)
Definition: compat.h:39

Referenced by d3drm_image_load_32().

◆ d3drm_texture1_AddDestroyCallback()

static HRESULT WINAPI d3drm_texture1_AddDestroyCallback ( IDirect3DRMTexture *  iface,
D3DRMOBJECTCALLBACK  cb,
void ctx 
)
static

Definition at line 388 of file texture.c.

390{
392
393 TRACE("iface %p, cb %p, ctx %p\n", iface, cb, ctx);
394
395 return IDirect3DRMTexture3_AddDestroyCallback(&texture->IDirect3DRMTexture3_iface, cb, ctx);
396}
#define IDirect3DRMTexture3_AddDestroyCallback(p, a, b)
Definition: d3drmobj.h:3479
static struct d3drm_texture * impl_from_IDirect3DRMTexture(IDirect3DRMTexture *iface)
Definition: texture.c:26
GLenum GLuint texture
Definition: glext.h:6295
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3drm_texture1_AddRef()

static ULONG WINAPI d3drm_texture1_AddRef ( IDirect3DRMTexture *  iface)
static

Definition at line 360 of file texture.c.

361{
363
364 TRACE("iface %p.\n", iface);
365
366 return IDirect3DRMTexture3_AddRef(&texture->IDirect3DRMTexture3_iface);
367}
#define IDirect3DRMTexture3_AddRef(p)
Definition: d3drmobj.h:3475

◆ d3drm_texture1_Changed()

static HRESULT WINAPI d3drm_texture1_Changed ( IDirect3DRMTexture *  iface,
BOOL  pixels,
BOOL  palette 
)
static

Definition at line 484 of file texture.c.

485{
486 FIXME("iface %p, pixels %#x, palette %#x stub!\n", iface, pixels, palette);
487
488 return E_NOTIMPL;
489}
#define FIXME(fmt,...)
Definition: debug.h:114
#define E_NOTIMPL
Definition: ddrawi.h:99
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
Definition: gl.h:1546

◆ d3drm_texture1_Clone()

static HRESULT WINAPI d3drm_texture1_Clone ( IDirect3DRMTexture *  iface,
IUnknown outer,
REFIID  iid,
void **  out 
)
static

Definition at line 378 of file texture.c.

380{
382
383 TRACE("iface %p, outer %p, iid %s, out %p.\n", iface, outer, debugstr_guid(iid), out);
384
385 return IDirect3DRMTexture3_Clone(&texture->IDirect3DRMTexture3_iface, outer, iid, out);
386}
#define IDirect3DRMTexture3_Clone(p, a, b, c)
Definition: d3drmobj.h:3478
#define debugstr_guid
Definition: kernel32.h:35
static FILE * out
Definition: regtests2xml.c:44

◆ d3drm_texture1_DeleteDestroyCallback()

static HRESULT WINAPI d3drm_texture1_DeleteDestroyCallback ( IDirect3DRMTexture *  iface,
D3DRMOBJECTCALLBACK  cb,
void ctx 
)
static

Definition at line 398 of file texture.c.

400{
402
403 TRACE("iface %p, cb %p, ctx %p\n", iface, cb, ctx);
404
405 return IDirect3DRMTexture3_DeleteDestroyCallback(&texture->IDirect3DRMTexture3_iface, cb, ctx);
406}
#define IDirect3DRMTexture3_DeleteDestroyCallback(p, a, b)
Definition: d3drmobj.h:3480

◆ d3drm_texture1_GetAppData()

static DWORD WINAPI d3drm_texture1_GetAppData ( IDirect3DRMTexture *  iface)
static

Definition at line 417 of file texture.c.

418{
420
421 TRACE("iface %p.\n", iface);
422
423 return IDirect3DRMTexture3_GetAppData(&texture->IDirect3DRMTexture3_iface);
424}
#define IDirect3DRMTexture3_GetAppData(p)
Definition: d3drmobj.h:3482

◆ d3drm_texture1_GetClassName()

static HRESULT WINAPI d3drm_texture1_GetClassName ( IDirect3DRMTexture *  iface,
DWORD size,
char name 
)
static

Definition at line 444 of file texture.c.

445{
447
448 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
449
450 return IDirect3DRMTexture3_GetClassName(&texture->IDirect3DRMTexture3_iface, size, name);
451}
#define IDirect3DRMTexture3_GetClassName(p, a, b)
Definition: d3drmobj.h:3485
GLsizeiptr size
Definition: glext.h:5919
Definition: name.c:39

◆ d3drm_texture1_GetColors()

static DWORD WINAPI d3drm_texture1_GetColors ( IDirect3DRMTexture *  iface)
static

Definition at line 590 of file texture.c.

591{
593
594 TRACE("iface %p.\n", iface);
595
596 return IDirect3DRMTexture3_GetColors(&texture->IDirect3DRMTexture3_iface);
597}
#define IDirect3DRMTexture3_GetColors(p)
Definition: d3drmobj.h:3502

◆ d3drm_texture1_GetDecalOrigin()

static HRESULT WINAPI d3drm_texture1_GetDecalOrigin ( IDirect3DRMTexture *  iface,
LONG x,
LONG y 
)
static

Definition at line 563 of file texture.c.

564{
566
567 TRACE("iface %p, x %p, y %p.\n", iface, x, y);
568
569 return IDirect3DRMTexture3_GetDecalOrigin(&texture->IDirect3DRMTexture3_iface, x, y);
570}
#define IDirect3DRMTexture3_GetDecalOrigin(p, a, b)
Definition: d3drmobj.h:3499

◆ d3drm_texture1_GetDecalScale()

static DWORD WINAPI d3drm_texture1_GetDecalScale ( IDirect3DRMTexture *  iface)
static

Definition at line 599 of file texture.c.

600{
602
603 TRACE("iface %p.\n", iface);
604
605 return IDirect3DRMTexture3_GetDecalScale(&texture->IDirect3DRMTexture3_iface);
606}
#define IDirect3DRMTexture3_GetDecalScale(p)
Definition: d3drmobj.h:3503

◆ d3drm_texture1_GetDecalSize()

static HRESULT WINAPI d3drm_texture1_GetDecalSize ( IDirect3DRMTexture *  iface,
D3DVALUE width,
D3DVALUE height 
)
static

Definition at line 554 of file texture.c.

555{
557
558 TRACE("iface %p, width %p, height %p.\n", iface, width, height);
559
560 return IDirect3DRMTexture3_GetDecalSize(&texture->IDirect3DRMTexture3_iface, width, height);
561}
#define IDirect3DRMTexture3_GetDecalSize(p, a, b)
Definition: d3drmobj.h:3498
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546

◆ d3drm_texture1_GetDecalTransparency()

static BOOL WINAPI d3drm_texture1_GetDecalTransparency ( IDirect3DRMTexture *  iface)
static

Definition at line 608 of file texture.c.

609{
611
612 TRACE("iface %p.\n", iface);
613
614 return IDirect3DRMTexture3_GetDecalTransparency(&texture->IDirect3DRMTexture3_iface);
615}
#define IDirect3DRMTexture3_GetDecalTransparency(p)
Definition: d3drmobj.h:3504

◆ d3drm_texture1_GetDecalTransparentColor()

static D3DCOLOR WINAPI d3drm_texture1_GetDecalTransparentColor ( IDirect3DRMTexture *  iface)
static

Definition at line 617 of file texture.c.

618{
620
621 TRACE("iface %p.\n", iface);
622
623 return IDirect3DRMTexture3_GetDecalTransparentColor(&texture->IDirect3DRMTexture3_iface);
624}
#define IDirect3DRMTexture3_GetDecalTransparentColor(p)
Definition: d3drmobj.h:3505

◆ d3drm_texture1_GetImage()

static D3DRMIMAGE *WINAPI d3drm_texture1_GetImage ( IDirect3DRMTexture *  iface)
static

Definition at line 572 of file texture.c.

573{
575
576 TRACE("iface %p.\n", iface);
577
578 return IDirect3DRMTexture3_GetImage(&texture->IDirect3DRMTexture3_iface);
579}
#define IDirect3DRMTexture3_GetImage(p)
Definition: d3drmobj.h:3500

◆ d3drm_texture1_GetName()

static HRESULT WINAPI d3drm_texture1_GetName ( IDirect3DRMTexture *  iface,
DWORD size,
char name 
)
static

Definition at line 435 of file texture.c.

436{
438
439 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
440
441 return IDirect3DRMTexture3_GetName(&texture->IDirect3DRMTexture3_iface, size, name);
442}
#define IDirect3DRMTexture3_GetName(p, a, b)
Definition: d3drmobj.h:3484

◆ d3drm_texture1_GetShades()

static DWORD WINAPI d3drm_texture1_GetShades ( IDirect3DRMTexture *  iface)
static

Definition at line 581 of file texture.c.

582{
584
585 TRACE("iface %p.\n", iface);
586
587 return IDirect3DRMTexture3_GetShades(&texture->IDirect3DRMTexture3_iface);
588}
#define IDirect3DRMTexture3_GetShades(p)
Definition: d3drmobj.h:3501

◆ d3drm_texture1_InitFromFile()

static HRESULT WINAPI d3drm_texture1_InitFromFile ( IDirect3DRMTexture *  iface,
const char filename 
)
static

Definition at line 453 of file texture.c.

454{
457 HRESULT hr;
458
459 TRACE("iface %p, filename %s.\n", iface, debugstr_a(filename));
460
462 return hr;
463
464 return IDirect3DRMTexture3_InitFromImage(&texture->IDirect3DRMTexture3_iface, image);
465}
#define IDirect3DRMTexture3_InitFromImage(p, a)
Definition: d3drmobj.h:3506
static HRESULT d3drm_texture_load(struct d3drm_texture *texture, const char *path, BOOL flip, D3DRMIMAGE **image_out)
Definition: texture.c:262
GLeglImageOES image
Definition: gl.h:2204
#define FAILED(hr)
Definition: intsafe.h:51
const char * filename
Definition: ioapi.h:137
#define debugstr_a
Definition: kernel32.h:31
HRESULT hr
Definition: shlfolder.c:183

◆ d3drm_texture1_InitFromResource()

static HRESULT WINAPI d3drm_texture1_InitFromResource ( IDirect3DRMTexture *  iface,
HRSRC  resource 
)
static

Definition at line 477 of file texture.c.

478{
479 FIXME("iface %p, resource %p stub!\n", iface, resource);
480
481 return E_NOTIMPL;
482}

◆ d3drm_texture1_InitFromSurface()

static HRESULT WINAPI d3drm_texture1_InitFromSurface ( IDirect3DRMTexture *  iface,
IDirectDrawSurface *  surface 
)
static

Definition at line 467 of file texture.c.

469{
471
472 TRACE("iface %p, surface %p.\n", iface, surface);
473
474 return IDirect3DRMTexture3_InitFromSurface(&texture->IDirect3DRMTexture3_iface, surface);
475}
#define IDirect3DRMTexture3_InitFromSurface(p, a)
Definition: d3drmobj.h:3488
IDirectDrawSurface * surface
Definition: d3drm_private.h:66

◆ d3drm_texture1_QueryInterface()

static HRESULT WINAPI d3drm_texture1_QueryInterface ( IDirect3DRMTexture *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 351 of file texture.c.

352{
354
355 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
356
357 return IDirect3DRMTexture3_QueryInterface(&texture->IDirect3DRMTexture3_iface, riid, out);
358}
#define IDirect3DRMTexture3_QueryInterface(p, a, b)
Definition: d3drmobj.h:3474
REFIID riid
Definition: atlbase.h:39

◆ d3drm_texture1_Release()

static ULONG WINAPI d3drm_texture1_Release ( IDirect3DRMTexture *  iface)
static

Definition at line 369 of file texture.c.

370{
372
373 TRACE("iface %p.\n", iface);
374
375 return IDirect3DRMTexture3_Release(&texture->IDirect3DRMTexture3_iface);
376}
#define IDirect3DRMTexture3_Release(p)
Definition: d3drmobj.h:3476

◆ d3drm_texture1_SetAppData()

static HRESULT WINAPI d3drm_texture1_SetAppData ( IDirect3DRMTexture *  iface,
DWORD  data 
)
static

Definition at line 408 of file texture.c.

409{
411
412 TRACE("iface %p, data %#x.\n", iface, data);
413
414 return IDirect3DRMTexture3_SetAppData(&texture->IDirect3DRMTexture3_iface, data);
415}
#define IDirect3DRMTexture3_SetAppData(p, a)
Definition: d3drmobj.h:3481
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

◆ d3drm_texture1_SetColors()

static HRESULT WINAPI d3drm_texture1_SetColors ( IDirect3DRMTexture *  iface,
DWORD  max_colors 
)
static

Definition at line 491 of file texture.c.

492{
494
495 TRACE("iface %p, max_colors %u.\n", iface, max_colors);
496
497 return IDirect3DRMTexture3_SetColors(&texture->IDirect3DRMTexture3_iface, max_colors);
498}
#define IDirect3DRMTexture3_SetColors(p, a)
Definition: d3drmobj.h:3491

◆ d3drm_texture1_SetDecalOrigin()

static HRESULT WINAPI d3drm_texture1_SetDecalOrigin ( IDirect3DRMTexture *  iface,
LONG  x,
LONG  y 
)
static

Definition at line 518 of file texture.c.

519{
521
522 TRACE("iface %p, x %d, y %d.\n", iface, x, y);
523
524 return IDirect3DRMTexture3_SetDecalOrigin(&texture->IDirect3DRMTexture3_iface, x, y);
525}
#define IDirect3DRMTexture3_SetDecalOrigin(p, a, b)
Definition: d3drmobj.h:3494

◆ d3drm_texture1_SetDecalScale()

static HRESULT WINAPI d3drm_texture1_SetDecalScale ( IDirect3DRMTexture *  iface,
DWORD  scale 
)
static

Definition at line 527 of file texture.c.

528{
530
531 TRACE("iface %p, scale %u.\n", iface, scale);
532
533 return IDirect3DRMTexture3_SetDecalScale(&texture->IDirect3DRMTexture3_iface, scale);
534}
#define IDirect3DRMTexture3_SetDecalScale(p, a)
Definition: d3drmobj.h:3495
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032

◆ d3drm_texture1_SetDecalSize()

static HRESULT WINAPI d3drm_texture1_SetDecalSize ( IDirect3DRMTexture *  iface,
D3DVALUE  width,
D3DVALUE  height 
)
static

Definition at line 509 of file texture.c.

510{
512
513 TRACE("iface %p, width %.8e, height %.8e.\n", iface, width, height);
514
515 return IDirect3DRMTexture3_SetDecalSize(&texture->IDirect3DRMTexture3_iface, width, height);
516}
#define IDirect3DRMTexture3_SetDecalSize(p, a, b)
Definition: d3drmobj.h:3493

◆ d3drm_texture1_SetDecalTransparency()

static HRESULT WINAPI d3drm_texture1_SetDecalTransparency ( IDirect3DRMTexture *  iface,
BOOL  transparency 
)
static

Definition at line 536 of file texture.c.

537{
539
540 TRACE("iface %p, transparency %#x.\n", iface, transparency);
541
542 return IDirect3DRMTexture3_SetDecalTransparency(&texture->IDirect3DRMTexture3_iface, transparency);
543}
#define IDirect3DRMTexture3_SetDecalTransparency(p, a)
Definition: d3drmobj.h:3496

◆ d3drm_texture1_SetDecalTransparentColor()

static HRESULT WINAPI d3drm_texture1_SetDecalTransparentColor ( IDirect3DRMTexture *  iface,
D3DCOLOR  color 
)
static

Definition at line 545 of file texture.c.

546{
548
549 TRACE("iface %p, color 0x%08x.\n", iface, color);
550
551 return IDirect3DRMTexture3_SetDecalTransparentColor(&texture->IDirect3DRMTexture3_iface, color);
552}
#define IDirect3DRMTexture3_SetDecalTransparentColor(p, a)
Definition: d3drmobj.h:3497
GLuint color
Definition: glext.h:6243

◆ d3drm_texture1_SetName()

static HRESULT WINAPI d3drm_texture1_SetName ( IDirect3DRMTexture *  iface,
const char name 
)
static

Definition at line 426 of file texture.c.

427{
429
430 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
431
432 return IDirect3DRMTexture3_SetName(&texture->IDirect3DRMTexture3_iface, name);
433}
#define IDirect3DRMTexture3_SetName(p, a)
Definition: d3drmobj.h:3483

◆ d3drm_texture1_SetShades()

static HRESULT WINAPI d3drm_texture1_SetShades ( IDirect3DRMTexture *  iface,
DWORD  max_shades 
)
static

Definition at line 500 of file texture.c.

501{
503
504 TRACE("iface %p, max_shades %u.\n", iface, max_shades);
505
506 return IDirect3DRMTexture3_SetShades(&texture->IDirect3DRMTexture3_iface, max_shades);
507}
#define IDirect3DRMTexture3_SetShades(p, a)
Definition: d3drmobj.h:3492

◆ d3drm_texture2_AddDestroyCallback()

static HRESULT WINAPI d3drm_texture2_AddDestroyCallback ( IDirect3DRMTexture2 *  iface,
D3DRMOBJECTCALLBACK  cb,
void ctx 
)
static

Definition at line 697 of file texture.c.

699{
701
702 TRACE("iface %p, cb %p, ctx %p\n", iface, cb, ctx);
703
704 return IDirect3DRMTexture3_AddDestroyCallback(&texture->IDirect3DRMTexture3_iface, cb, ctx);
705}
static struct d3drm_texture * impl_from_IDirect3DRMTexture2(IDirect3DRMTexture2 *iface)
Definition: texture.c:31

◆ d3drm_texture2_AddRef()

static ULONG WINAPI d3drm_texture2_AddRef ( IDirect3DRMTexture2 *  iface)
static

Definition at line 669 of file texture.c.

670{
672
673 TRACE("iface %p.\n", iface);
674
675 return IDirect3DRMTexture3_AddRef(&texture->IDirect3DRMTexture3_iface);
676}

◆ d3drm_texture2_Changed()

static HRESULT WINAPI d3drm_texture2_Changed ( IDirect3DRMTexture2 *  iface,
BOOL  pixels,
BOOL  palette 
)
static

Definition at line 788 of file texture.c.

789{
790 FIXME("iface %p, pixels %#x, palette %#x stub!\n", iface, pixels, palette);
791
792 return E_NOTIMPL;
793}

◆ d3drm_texture2_Clone()

static HRESULT WINAPI d3drm_texture2_Clone ( IDirect3DRMTexture2 *  iface,
IUnknown outer,
REFIID  iid,
void **  out 
)
static

Definition at line 687 of file texture.c.

689{
691
692 TRACE("iface %p, outer %p, iid %s, out %p.\n", iface, outer, debugstr_guid(iid), out);
693
694 return IDirect3DRMTexture3_Clone(&texture->IDirect3DRMTexture3_iface, outer, iid, out);
695}

◆ d3drm_texture2_DeleteDestroyCallback()

static HRESULT WINAPI d3drm_texture2_DeleteDestroyCallback ( IDirect3DRMTexture2 *  iface,
D3DRMOBJECTCALLBACK  cb,
void ctx 
)
static

Definition at line 707 of file texture.c.

709{
711
712 TRACE("iface %p, cb %p, ctx %p\n", iface, cb, ctx);
713
714 return IDirect3DRMTexture3_DeleteDestroyCallback(&texture->IDirect3DRMTexture3_iface, cb, ctx);
715}

◆ d3drm_texture2_GenerateMIPMap()

static HRESULT WINAPI d3drm_texture2_GenerateMIPMap ( IDirect3DRMTexture2 *  iface,
DWORD  flags 
)
static

Definition at line 948 of file texture.c.

949{
951
952 TRACE("iface %p, flags %#x.\n", iface, flags);
953
954 return IDirect3DRMTexture3_GenerateMIPMap(&texture->IDirect3DRMTexture3_iface, flags);
955}
#define IDirect3DRMTexture3_GenerateMIPMap(p, a)
Definition: d3drmobj.h:3508
GLbitfield flags
Definition: glext.h:7161

◆ d3drm_texture2_GetAppData()

static DWORD WINAPI d3drm_texture2_GetAppData ( IDirect3DRMTexture2 *  iface)
static

Definition at line 726 of file texture.c.

727{
729
730 TRACE("iface %p.\n", iface);
731
732 return IDirect3DRMTexture3_GetAppData(&texture->IDirect3DRMTexture3_iface);
733}

◆ d3drm_texture2_GetClassName()

static HRESULT WINAPI d3drm_texture2_GetClassName ( IDirect3DRMTexture2 *  iface,
DWORD size,
char name 
)
static

Definition at line 753 of file texture.c.

754{
756
757 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
758
759 return IDirect3DRMTexture3_GetClassName(&texture->IDirect3DRMTexture3_iface, size, name);
760}

◆ d3drm_texture2_GetColors()

static DWORD WINAPI d3drm_texture2_GetColors ( IDirect3DRMTexture2 *  iface)
static

Definition at line 894 of file texture.c.

895{
897
898 TRACE("iface %p.\n", iface);
899
900 return IDirect3DRMTexture3_GetColors(&texture->IDirect3DRMTexture3_iface);
901}

◆ d3drm_texture2_GetDecalOrigin()

static HRESULT WINAPI d3drm_texture2_GetDecalOrigin ( IDirect3DRMTexture2 *  iface,
LONG x,
LONG y 
)
static

Definition at line 867 of file texture.c.

868{
870
871 TRACE("iface %p, x %p, y %p.\n", iface, x, y);
872
873 return IDirect3DRMTexture3_GetDecalOrigin(&texture->IDirect3DRMTexture3_iface, x, y);
874}

◆ d3drm_texture2_GetDecalScale()

static DWORD WINAPI d3drm_texture2_GetDecalScale ( IDirect3DRMTexture2 *  iface)
static

Definition at line 903 of file texture.c.

904{
906
907 TRACE("iface %p.\n", iface);
908
909 return IDirect3DRMTexture3_GetDecalScale(&texture->IDirect3DRMTexture3_iface);
910}

◆ d3drm_texture2_GetDecalSize()

static HRESULT WINAPI d3drm_texture2_GetDecalSize ( IDirect3DRMTexture2 *  iface,
D3DVALUE width,
D3DVALUE height 
)
static

Definition at line 858 of file texture.c.

859{
861
862 TRACE("iface %p, width %p, height %p.\n", iface, width, height);
863
864 return IDirect3DRMTexture3_GetDecalSize(&texture->IDirect3DRMTexture3_iface, width, height);
865}

◆ d3drm_texture2_GetDecalTransparency()

static BOOL WINAPI d3drm_texture2_GetDecalTransparency ( IDirect3DRMTexture2 *  iface)
static

Definition at line 912 of file texture.c.

913{
915
916 TRACE("iface %p.\n", iface);
917
918 return IDirect3DRMTexture3_GetDecalTransparency(&texture->IDirect3DRMTexture3_iface);
919}

◆ d3drm_texture2_GetDecalTransparentColor()

static D3DCOLOR WINAPI d3drm_texture2_GetDecalTransparentColor ( IDirect3DRMTexture2 *  iface)
static

Definition at line 921 of file texture.c.

922{
924
925 TRACE("iface %p.\n", iface);
926
927 return IDirect3DRMTexture3_GetDecalTransparentColor(&texture->IDirect3DRMTexture3_iface);
928}

◆ d3drm_texture2_GetImage()

static D3DRMIMAGE *WINAPI d3drm_texture2_GetImage ( IDirect3DRMTexture2 *  iface)
static

Definition at line 876 of file texture.c.

877{
879
880 TRACE("iface %p.\n", iface);
881
882 return IDirect3DRMTexture3_GetImage(&texture->IDirect3DRMTexture3_iface);
883}

◆ d3drm_texture2_GetName()

static HRESULT WINAPI d3drm_texture2_GetName ( IDirect3DRMTexture2 *  iface,
DWORD size,
char name 
)
static

Definition at line 744 of file texture.c.

745{
747
748 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
749
750 return IDirect3DRMTexture3_GetName(&texture->IDirect3DRMTexture3_iface, size, name);
751}

◆ d3drm_texture2_GetShades()

static DWORD WINAPI d3drm_texture2_GetShades ( IDirect3DRMTexture2 *  iface)
static

Definition at line 885 of file texture.c.

886{
888
889 TRACE("iface %p.\n", iface);
890
891 return IDirect3DRMTexture3_GetShades(&texture->IDirect3DRMTexture3_iface);
892}

◆ d3drm_texture2_InitFromFile()

static HRESULT WINAPI d3drm_texture2_InitFromFile ( IDirect3DRMTexture2 *  iface,
const char filename 
)
static

Definition at line 762 of file texture.c.

763{
765
766 TRACE("iface %p, filename %s.\n", iface, debugstr_a(filename));
767
768 return IDirect3DRMTexture3_InitFromFile(&texture->IDirect3DRMTexture3_iface, filename);
769}
#define IDirect3DRMTexture3_InitFromFile(p, a)
Definition: d3drmobj.h:3487

◆ d3drm_texture2_InitFromImage()

static HRESULT WINAPI d3drm_texture2_InitFromImage ( IDirect3DRMTexture2 *  iface,
D3DRMIMAGE image 
)
static

Definition at line 930 of file texture.c.

931{
933
934 TRACE("iface %p, image %p.\n", iface, image);
935
936 return IDirect3DRMTexture3_InitFromImage(&texture->IDirect3DRMTexture3_iface, image);
937}

◆ d3drm_texture2_InitFromResource()

static HRESULT WINAPI d3drm_texture2_InitFromResource ( IDirect3DRMTexture2 *  iface,
HRSRC  resource 
)
static

Definition at line 781 of file texture.c.

782{
783 FIXME("iface %p, resource %p stub!\n", iface, resource);
784
785 return E_NOTIMPL;
786}

◆ d3drm_texture2_InitFromResource2()

static HRESULT WINAPI d3drm_texture2_InitFromResource2 ( IDirect3DRMTexture2 *  iface,
HMODULE  module,
const char name,
const char type 
)
static

Definition at line 939 of file texture.c.

941{
942 FIXME("iface %p, module %p, name %s, type %s stub!\n",
944
945 return E_NOTIMPL;
946}
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

◆ d3drm_texture2_InitFromSurface()

static HRESULT WINAPI d3drm_texture2_InitFromSurface ( IDirect3DRMTexture2 *  iface,
IDirectDrawSurface *  surface 
)
static

Definition at line 771 of file texture.c.

773{
775
776 TRACE("iface %p, surface %p.\n", iface, surface);
777
778 return IDirect3DRMTexture3_InitFromSurface(&texture->IDirect3DRMTexture3_iface, surface);
779}

◆ d3drm_texture2_QueryInterface()

static HRESULT WINAPI d3drm_texture2_QueryInterface ( IDirect3DRMTexture2 *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 660 of file texture.c.

661{
663
664 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
665
666 return IDirect3DRMTexture3_QueryInterface(&texture->IDirect3DRMTexture3_iface, riid, out);
667}

◆ d3drm_texture2_Release()

static ULONG WINAPI d3drm_texture2_Release ( IDirect3DRMTexture2 *  iface)
static

Definition at line 678 of file texture.c.

679{
681
682 TRACE("iface %p.\n", iface);
683
684 return IDirect3DRMTexture3_Release(&texture->IDirect3DRMTexture3_iface);
685}

◆ d3drm_texture2_SetAppData()

static HRESULT WINAPI d3drm_texture2_SetAppData ( IDirect3DRMTexture2 *  iface,
DWORD  data 
)
static

Definition at line 717 of file texture.c.

718{
720
721 TRACE("iface %p, data %#x.\n", iface, data);
722
723 return IDirect3DRMTexture3_SetAppData(&texture->IDirect3DRMTexture3_iface, data);
724}

◆ d3drm_texture2_SetColors()

static HRESULT WINAPI d3drm_texture2_SetColors ( IDirect3DRMTexture2 *  iface,
DWORD  max_colors 
)
static

Definition at line 795 of file texture.c.

796{
798
799 TRACE("iface %p, max_colors %u.\n", iface, max_colors);
800
801 return IDirect3DRMTexture3_SetColors(&texture->IDirect3DRMTexture3_iface, max_colors);
802}

◆ d3drm_texture2_SetDecalOrigin()

static HRESULT WINAPI d3drm_texture2_SetDecalOrigin ( IDirect3DRMTexture2 *  iface,
LONG  x,
LONG  y 
)
static

Definition at line 822 of file texture.c.

823{
825
826 TRACE("iface %p, x %d, y %d.\n", iface, x, y);
827
828 return IDirect3DRMTexture3_SetDecalOrigin(&texture->IDirect3DRMTexture3_iface, x, y);
829}

◆ d3drm_texture2_SetDecalScale()

static HRESULT WINAPI d3drm_texture2_SetDecalScale ( IDirect3DRMTexture2 *  iface,
DWORD  scale 
)
static

Definition at line 831 of file texture.c.

832{
834
835 TRACE("iface %p, scale %u.\n", iface, scale);
836
837 return IDirect3DRMTexture3_SetDecalScale(&texture->IDirect3DRMTexture3_iface, scale);
838}

◆ d3drm_texture2_SetDecalSize()

static HRESULT WINAPI d3drm_texture2_SetDecalSize ( IDirect3DRMTexture2 *  iface,
D3DVALUE  width,
D3DVALUE  height 
)
static

Definition at line 813 of file texture.c.

814{
816
817 TRACE("iface %p, width %.8e, height %.8e.\n", iface, width, height);
818
819 return IDirect3DRMTexture3_SetDecalSize(&texture->IDirect3DRMTexture3_iface, width, height);
820}

◆ d3drm_texture2_SetDecalTransparency()

static HRESULT WINAPI d3drm_texture2_SetDecalTransparency ( IDirect3DRMTexture2 *  iface,
BOOL  transparency 
)
static

Definition at line 840 of file texture.c.

841{
843
844 TRACE("iface %p, transparency %#x.\n", iface, transparency);
845
846 return IDirect3DRMTexture3_SetDecalTransparency(&texture->IDirect3DRMTexture3_iface, transparency);
847}

◆ d3drm_texture2_SetDecalTransparentColor()

static HRESULT WINAPI d3drm_texture2_SetDecalTransparentColor ( IDirect3DRMTexture2 *  iface,
D3DCOLOR  color 
)
static

Definition at line 849 of file texture.c.

850{
852
853 TRACE("iface %p, color 0x%08x.\n", iface, color);
854
855 return IDirect3DRMTexture3_SetDecalTransparentColor(&texture->IDirect3DRMTexture3_iface, color);
856}

◆ d3drm_texture2_SetName()

static HRESULT WINAPI d3drm_texture2_SetName ( IDirect3DRMTexture2 *  iface,
const char name 
)
static

Definition at line 735 of file texture.c.

736{
738
739 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
740
741 return IDirect3DRMTexture3_SetName(&texture->IDirect3DRMTexture3_iface, name);
742}

◆ d3drm_texture2_SetShades()

static HRESULT WINAPI d3drm_texture2_SetShades ( IDirect3DRMTexture2 *  iface,
DWORD  max_shades 
)
static

Definition at line 804 of file texture.c.

805{
807
808 TRACE("iface %p, max_shades %u.\n", iface, max_shades);
809
810 return IDirect3DRMTexture3_SetShades(&texture->IDirect3DRMTexture3_iface, max_shades);
811}

◆ d3drm_texture3_AddDestroyCallback()

static HRESULT WINAPI d3drm_texture3_AddDestroyCallback ( IDirect3DRMTexture3 *  iface,
D3DRMOBJECTCALLBACK  cb,
void ctx 
)
static

Definition at line 1057 of file texture.c.

1059{
1061
1062 TRACE("iface %p, cb %p, ctx %p\n", iface, cb, ctx);
1063
1065}
HRESULT d3drm_object_add_destroy_callback(struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx)
Definition: d3drm_main.c:55
static struct d3drm_texture * impl_from_IDirect3DRMTexture3(IDirect3DRMTexture3 *iface)
Definition: texture.c:36

◆ d3drm_texture3_AddRef()

static ULONG WINAPI d3drm_texture3_AddRef ( IDirect3DRMTexture3 *  iface)
static

Definition at line 1026 of file texture.c.

1027{
1029 ULONG refcount = InterlockedIncrement(&texture->obj.ref);
1030
1031 TRACE("%p increasing refcount to %u.\n", iface, refcount);
1032
1033 return refcount;
1034}
#define InterlockedIncrement
Definition: armddk.h:53
uint32_t ULONG
Definition: typedefs.h:59

◆ d3drm_texture3_Changed()

static HRESULT WINAPI d3drm_texture3_Changed ( IDirect3DRMTexture3 *  iface,
DWORD  flags,
DWORD  rect_count,
RECT rects 
)
static

Definition at line 1166 of file texture.c.

1168{
1169 FIXME("iface %p, flags %#x, rect_count %u, rects %p stub!\n", iface, flags, rect_count, rects);
1170
1171 return E_NOTIMPL;
1172}

◆ d3drm_texture3_Clone()

static HRESULT WINAPI d3drm_texture3_Clone ( IDirect3DRMTexture3 *  iface,
IUnknown outer,
REFIID  iid,
void **  out 
)
static

Definition at line 1049 of file texture.c.

1051{
1052 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
1053
1054 return E_NOTIMPL;
1055}

◆ d3drm_texture3_DeleteDestroyCallback()

static HRESULT WINAPI d3drm_texture3_DeleteDestroyCallback ( IDirect3DRMTexture3 *  iface,
D3DRMOBJECTCALLBACK  cb,
void ctx 
)
static

Definition at line 1067 of file texture.c.

1069{
1071
1072 TRACE("iface %p, cb %p, ctx %p\n", iface, cb, ctx);
1073
1075}
HRESULT d3drm_object_delete_destroy_callback(struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx)
Definition: d3drm_main.c:72

◆ d3drm_texture3_GenerateMIPMap()

static HRESULT WINAPI d3drm_texture3_GenerateMIPMap ( IDirect3DRMTexture3 *  iface,
DWORD  flags 
)
static

Definition at line 1310 of file texture.c.

1311{
1312 FIXME("iface %p, flags %#x stub!\n", iface, flags);
1313
1314 return E_NOTIMPL;
1315}

◆ d3drm_texture3_GetAppData()

static DWORD WINAPI d3drm_texture3_GetAppData ( IDirect3DRMTexture3 *  iface)
static

Definition at line 1088 of file texture.c.

1089{
1091
1092 TRACE("iface %p.\n", iface);
1093
1094 return texture->obj.appdata;
1095}

◆ d3drm_texture3_GetCacheOptions()

static HRESULT WINAPI d3drm_texture3_GetCacheOptions ( IDirect3DRMTexture3 *  iface,
LONG importance,
DWORD flags 
)
static

Definition at line 1346 of file texture.c.

1348{
1349 FIXME("iface %p, importance %p, flags %p stub!\n", iface, importance, flags);
1350
1351 return E_NOTIMPL;
1352}

◆ d3drm_texture3_GetClassName()

static HRESULT WINAPI d3drm_texture3_GetClassName ( IDirect3DRMTexture3 *  iface,
DWORD size,
char name 
)
static

Definition at line 1115 of file texture.c.

1116{
1118
1119 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
1120
1122}
HRESULT d3drm_object_get_class_name(struct d3drm_object *object, DWORD *size, char *name)
Definition: d3drm_main.c:92

◆ d3drm_texture3_GetColors()

static DWORD WINAPI d3drm_texture3_GetColors ( IDirect3DRMTexture3 *  iface)
static

Definition at line 1253 of file texture.c.

1254{
1255 FIXME("iface %p stub!\n", iface);
1256
1257 return 0;
1258}

◆ d3drm_texture3_GetDecalOrigin()

static HRESULT WINAPI d3drm_texture3_GetDecalOrigin ( IDirect3DRMTexture3 *  iface,
LONG x,
LONG y 
)
static

Definition at line 1230 of file texture.c.

1231{
1232 FIXME("iface %p, x %p, y %p stub!\n", iface, x, y);
1233
1234 return E_NOTIMPL;
1235}

◆ d3drm_texture3_GetDecalScale()

static DWORD WINAPI d3drm_texture3_GetDecalScale ( IDirect3DRMTexture3 *  iface)
static

Definition at line 1260 of file texture.c.

1261{
1262 FIXME("iface %p stub!\n", iface);
1263
1264 return 0;
1265}

◆ d3drm_texture3_GetDecalSize()

static HRESULT WINAPI d3drm_texture3_GetDecalSize ( IDirect3DRMTexture3 *  iface,
D3DVALUE width,
D3DVALUE height 
)
static

Definition at line 1223 of file texture.c.

1224{
1225 FIXME("iface %p, width %p, height %p stub!\n", iface, width, height);
1226
1227 return E_NOTIMPL;
1228}

◆ d3drm_texture3_GetDecalTransparency()

static BOOL WINAPI d3drm_texture3_GetDecalTransparency ( IDirect3DRMTexture3 *  iface)
static

Definition at line 1267 of file texture.c.

1268{
1269 FIXME("iface %p stub!\n", iface);
1270
1271 return FALSE;
1272}

◆ d3drm_texture3_GetDecalTransparentColor()

static D3DCOLOR WINAPI d3drm_texture3_GetDecalTransparentColor ( IDirect3DRMTexture3 *  iface)
static

Definition at line 1274 of file texture.c.

1275{
1276 FIXME("iface %p stub!\n", iface);
1277
1278 return 0;
1279}

◆ d3drm_texture3_GetImage()

static D3DRMIMAGE *WINAPI d3drm_texture3_GetImage ( IDirect3DRMTexture3 *  iface)
static

Definition at line 1237 of file texture.c.

1238{
1240
1241 TRACE("iface %p.\n", iface);
1242
1243 return texture->image;
1244}

◆ d3drm_texture3_GetName()

static HRESULT WINAPI d3drm_texture3_GetName ( IDirect3DRMTexture3 *  iface,
DWORD size,
char name 
)
static

Definition at line 1106 of file texture.c.

1107{
1109
1110 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
1111
1112 return d3drm_object_get_name(&texture->obj, size, name);
1113}
HRESULT d3drm_object_get_name(struct d3drm_object *object, DWORD *size, char *name)
Definition: d3drm_main.c:111

◆ d3drm_texture3_GetShades()

static DWORD WINAPI d3drm_texture3_GetShades ( IDirect3DRMTexture3 *  iface)
static

Definition at line 1246 of file texture.c.

1247{
1248 FIXME("iface %p stub!\n", iface);
1249
1250 return 0;
1251}

◆ d3drm_texture3_GetSurface()

static HRESULT WINAPI d3drm_texture3_GetSurface ( IDirect3DRMTexture3 *  iface,
DWORD  flags,
IDirectDrawSurface **  surface 
)
static

Definition at line 1317 of file texture.c.

1319{
1321
1322 TRACE("iface %p, flags %#x, surface %p.\n", iface, flags, surface);
1323
1324 if (flags)
1325 FIXME("unexpected flags %#x.\n", flags);
1326
1327 if (!surface)
1328 return D3DRMERR_BADVALUE;
1329
1330 if (texture->image)
1332
1333 *surface = texture->surface;
1334 IDirectDrawSurface_AddRef(*surface);
1335
1336 return D3DRM_OK;
1337}
#define D3DRMERR_NOTCREATEDFROMDDS
Definition: d3drm.h:513
#define D3DRMERR_BADVALUE
Definition: d3drm.h:496

◆ d3drm_texture3_InitFromFile()

static HRESULT WINAPI d3drm_texture3_InitFromFile ( IDirect3DRMTexture3 *  iface,
const char filename 
)
static

Definition at line 1124 of file texture.c.

1125{
1128 HRESULT hr;
1129
1130 TRACE("iface %p, filename %s.\n", iface, debugstr_a(filename));
1131
1133 return hr;
1134
1136}

◆ d3drm_texture3_InitFromImage()

static HRESULT WINAPI d3drm_texture3_InitFromImage ( IDirect3DRMTexture3 *  iface,
D3DRMIMAGE image 
)
static

Definition at line 1281 of file texture.c.

1282{
1284
1285 TRACE("iface %p, image %p.\n", iface, image);
1286
1288 return D3DRMERR_BADOBJECT;
1289
1290 /* d3drm intentionally leaks a reference to IDirect3DRM here if texture has already been initialized. */
1292
1293 if (texture->image || texture->surface)
1294 return D3DRMERR_BADOBJECT;
1295
1296 texture->image = image;
1297
1298 return D3DRM_OK;
1299}
#define D3DRMERR_BADOBJECT
Definition: d3drm.h:487
#define IDirect3DRM_AddRef(p)
Definition: d3drm.h:110
static BOOL d3drm_validate_image(D3DRMIMAGE *image)
Definition: texture.c:53

◆ d3drm_texture3_InitFromResource()

static HRESULT WINAPI d3drm_texture3_InitFromResource ( IDirect3DRMTexture3 *  iface,
HRSRC  resource 
)
static

Definition at line 1159 of file texture.c.

1160{
1161 FIXME("iface %p, resource %p stub!\n", iface, resource);
1162
1163 return E_NOTIMPL;
1164}

◆ d3drm_texture3_InitFromResource2()

static HRESULT WINAPI d3drm_texture3_InitFromResource2 ( IDirect3DRMTexture3 *  iface,
HMODULE  module,
const char name,
const char type 
)
static

Definition at line 1301 of file texture.c.

1303{
1304 FIXME("iface %p, module %p, name %s, type %s stub!\n",
1305 iface, module, debugstr_a(name), debugstr_a(type));
1306
1307 return E_NOTIMPL;
1308}

◆ d3drm_texture3_InitFromSurface()

static HRESULT WINAPI d3drm_texture3_InitFromSurface ( IDirect3DRMTexture3 *  iface,
IDirectDrawSurface *  surface 
)
static

Definition at line 1138 of file texture.c.

1140{
1142
1143 TRACE("iface %p, surface %p.\n", iface, surface);
1144
1145 if (!surface)
1146 return D3DRMERR_BADOBJECT;
1147
1148 /* d3drm intentionally leaks a reference to IDirect3DRM here if texture has already been initialized. */
1150
1151 if (texture->image || texture->surface)
1152 return D3DRMERR_BADOBJECT;
1153
1154 texture->surface = surface;
1155 IDirectDrawSurface_AddRef(texture->surface);
1156 return D3DRM_OK;
1157}

◆ d3drm_texture3_QueryInterface()

static HRESULT WINAPI d3drm_texture3_QueryInterface ( IDirect3DRMTexture3 *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 994 of file texture.c.

995{
997
998 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
999
1000 if (IsEqualGUID(riid, &IID_IDirect3DRMTexture)
1001 || IsEqualGUID(riid, &IID_IDirect3DRMVisual)
1002 || IsEqualGUID(riid, &IID_IDirect3DRMObject)
1004 {
1005 *out = &texture->IDirect3DRMTexture_iface;
1006 }
1007 else if (IsEqualGUID(riid, &IID_IDirect3DRMTexture2))
1008 {
1009 *out = &texture->IDirect3DRMTexture2_iface;
1010 }
1011 else if (IsEqualGUID(riid, &IID_IDirect3DRMTexture3))
1012 {
1013 *out = &texture->IDirect3DRMTexture3_iface;
1014 }
1015 else
1016 {
1017 *out = NULL;
1018 WARN("%s not implemented, returning CLASS_E_CLASSNOTAVAILABLE.\n", debugstr_guid(riid));
1020 }
1021
1022 IUnknown_AddRef((IUnknown *)*out);
1023 return S_OK;
1024}
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:52
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663

◆ d3drm_texture3_Release()

static ULONG WINAPI d3drm_texture3_Release ( IDirect3DRMTexture3 *  iface)
static

Definition at line 1036 of file texture.c.

1037{
1039 ULONG refcount = InterlockedDecrement(&texture->obj.ref);
1040
1041 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
1042
1043 if (!refcount)
1045
1046 return refcount;
1047}
#define InterlockedDecrement
Definition: armddk.h:52
static void d3drm_texture_destroy(struct d3drm_texture *texture)
Definition: texture.c:41

◆ d3drm_texture3_SetAppData()

static HRESULT WINAPI d3drm_texture3_SetAppData ( IDirect3DRMTexture3 *  iface,
DWORD  data 
)
static

Definition at line 1077 of file texture.c.

1078{
1080
1081 TRACE("iface %p, data %#x.\n", iface, data);
1082
1083 texture->obj.appdata = data;
1084
1085 return D3DRM_OK;
1086}

◆ d3drm_texture3_SetCacheOptions()

static HRESULT WINAPI d3drm_texture3_SetCacheOptions ( IDirect3DRMTexture3 *  iface,
LONG  importance,
DWORD  flags 
)
static

Definition at line 1339 of file texture.c.

1340{
1341 FIXME("iface %p, importance %d, flags %#x stub!\n", iface, importance, flags);
1342
1343 return E_NOTIMPL;
1344}

◆ d3drm_texture3_SetColors()

static HRESULT WINAPI d3drm_texture3_SetColors ( IDirect3DRMTexture3 *  iface,
DWORD  max_colors 
)
static

Definition at line 1174 of file texture.c.

1175{
1176 FIXME("iface %p, max_colors %u stub!\n", iface, max_colors);
1177
1178 return E_NOTIMPL;
1179}

◆ d3drm_texture3_SetDecalOrigin()

static HRESULT WINAPI d3drm_texture3_SetDecalOrigin ( IDirect3DRMTexture3 *  iface,
LONG  x,
LONG  y 
)
static

Definition at line 1195 of file texture.c.

1196{
1197 FIXME("iface %p, x %d, y %d stub!\n", iface, x, y);
1198
1199 return E_NOTIMPL;
1200}

◆ d3drm_texture3_SetDecalScale()

static HRESULT WINAPI d3drm_texture3_SetDecalScale ( IDirect3DRMTexture3 *  iface,
DWORD  scale 
)
static

Definition at line 1202 of file texture.c.

1203{
1204 FIXME("iface %p, scale %u stub!\n", iface, scale);
1205
1206 return E_NOTIMPL;
1207}

◆ d3drm_texture3_SetDecalSize()

static HRESULT WINAPI d3drm_texture3_SetDecalSize ( IDirect3DRMTexture3 *  iface,
D3DVALUE  width,
D3DVALUE  height 
)
static

Definition at line 1188 of file texture.c.

1189{
1190 FIXME("iface %p, width %.8e, height %.8e stub!\n", iface, width, height);
1191
1192 return E_NOTIMPL;
1193}

◆ d3drm_texture3_SetDecalTransparency()

static HRESULT WINAPI d3drm_texture3_SetDecalTransparency ( IDirect3DRMTexture3 *  iface,
BOOL  transparency 
)
static

Definition at line 1209 of file texture.c.

1210{
1211 FIXME("iface %p, transparency %#x stub!\n", iface, transparency);
1212
1213 return E_NOTIMPL;
1214}

◆ d3drm_texture3_SetDecalTransparentColor()

static HRESULT WINAPI d3drm_texture3_SetDecalTransparentColor ( IDirect3DRMTexture3 *  iface,
D3DCOLOR  color 
)
static

Definition at line 1216 of file texture.c.

1217{
1218 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
1219
1220 return E_NOTIMPL;
1221}

◆ d3drm_texture3_SetDownsampleCallback()

static HRESULT WINAPI d3drm_texture3_SetDownsampleCallback ( IDirect3DRMTexture3 *  iface,
D3DRMDOWNSAMPLECALLBACK  cb,
void ctx 
)
static

Definition at line 1354 of file texture.c.

1356{
1357 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1358
1359 return E_NOTIMPL;
1360}

◆ d3drm_texture3_SetName()

static HRESULT WINAPI d3drm_texture3_SetName ( IDirect3DRMTexture3 *  iface,
const char name 
)
static

Definition at line 1097 of file texture.c.

1098{
1100
1101 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
1102
1103 return d3drm_object_set_name(&texture->obj, name);
1104}
HRESULT d3drm_object_set_name(struct d3drm_object *object, const char *name)
Definition: d3drm_main.c:135

◆ d3drm_texture3_SetShades()

static HRESULT WINAPI d3drm_texture3_SetShades ( IDirect3DRMTexture3 *  iface,
DWORD  max_shades 
)
static

Definition at line 1181 of file texture.c.

1182{
1183 FIXME("iface %p, max_shades %u stub!\n", iface, max_shades);
1184
1185 return E_NOTIMPL;
1186}

◆ d3drm_texture3_SetValidationCallback()

static HRESULT WINAPI d3drm_texture3_SetValidationCallback ( IDirect3DRMTexture3 *  iface,
D3DRMVALIDATIONCALLBACK  cb,
void ctx 
)
static

Definition at line 1362 of file texture.c.

1364{
1365 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1366
1367 return E_NOTIMPL;
1368}

◆ 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}
void d3drm_object_init(struct d3drm_object *object, const char *classname)
Definition: d3drm_main.c:39
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
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
WCHAR classname[128]
Definition: startup.c:15
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_texture_destroy()

static void d3drm_texture_destroy ( struct d3drm_texture texture)
static

Definition at line 41 of file texture.c.

42{
43 TRACE("texture %p is being destroyed.\n", texture);
44
45 d3drm_object_cleanup((IDirect3DRMObject*)&texture->IDirect3DRMTexture_iface, &texture->obj);
46 if (texture->image || texture->surface)
48 if (texture->surface)
49 IDirectDrawSurface_Release(texture->surface);
51}
#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 d3drm_texture3_Release().

◆ d3drm_texture_load()

static HRESULT d3drm_texture_load ( struct d3drm_texture texture,
const char path,
BOOL  flip,
D3DRMIMAGE **  image_out 
)
static

Definition at line 262 of file texture.c.

264{
266 unsigned int w, h, bpp;
271 LONGLONG rem;
272 HRESULT hr;
273
275 return D3DRMERR_BADOBJECT;
276
280 return D3DRMERR_BADVALUE;
281
282 if (!GetFileSizeEx(mapping, &size))
283 {
285 return D3DRMERR_BADVALUE;
286 }
287 rem = size.QuadPart;
288
291 if (!header)
292 return D3DRMERR_BADVALUE;
293
295 if (!(image = heap_alloc_zero(sizeof(*image))))
296 goto fail;
297
299 if (rem < sizeof(*header) || header->bfType != 0x4d42 /* BM */)
300 goto fail;
301 rem -= sizeof(*header);
302
303 info = (BITMAPINFO *)&header[1];
304 /* Only allow version 1 DIB's (BITMAPINFOHEADER) to be loaded. */
305 if (rem < sizeof(info->bmiHeader) || info->bmiHeader.biSize != sizeof(info->bmiHeader))
306 goto fail;
307 rem -= sizeof(info->bmiHeader);
308
309 w = info->bmiHeader.biWidth;
310 h = abs(info->bmiHeader.biHeight);
311 bpp = info->bmiHeader.biBitCount == 24 ? 32 : info->bmiHeader.biBitCount;
312 if (bpp != 8 && bpp != 32)
313 goto fail;
314
315 image->width = w;
316 image->height = h;
317 image->aspectx = 1;
318 image->aspecty = 1;
319 if (bpp == 8)
320 {
321 rem -= 256 * sizeof(*info->bmiColors);
322 if (w > rem / h)
323 goto fail;
324 hr = d3drm_image_load_8(image, info->bmiColors, (unsigned char *)&info->bmiColors[256], rem, w, h, flip);
325 }
326 else
327 {
328 if (w > (rem / 3) / h)
329 goto fail;
330 hr = d3drm_image_load_32(image, (unsigned char *)&info->bmiColors, rem, w, h, flip);
331 }
332 if (FAILED(hr))
333 goto fail;
334
335 /* Use an internal destroy callback to destroy the image struct. */
337
338 *image_out = image;
339
341
342 return hr;
343
344fail:
347
348 return hr;
349}
#define D3DRMERR_BADFILE
Definition: d3drm.h:494
#define IDirect3DRMObject_AddDestroyCallback(p, a, b)
Definition: d3drmobj.h:223
static HRESULT d3drm_image_load_8(D3DRMIMAGE *image, const RGBQUAD *palette, unsigned char *src_data, LONGLONG src_data_size, SIZE_T w, SIZE_T h, BOOL flip)
Definition: texture.c:200
static HRESULT d3drm_image_load_32(D3DRMIMAGE *image, unsigned char *src_data, LONGLONG src_data_size, SIZE_T w, SIZE_T h, BOOL flip)
Definition: texture.c:149
static void CDECL destroy_image_callback(IDirect3DRMObject *obj, void *arg)
Definition: texture.c:252
DWORD bpp
Definition: surface.c:185
#define CloseHandle
Definition: compat.h:739
#define PAGE_READONLY
Definition: compat.h:138
#define UnmapViewOfFile
Definition: compat.h:746
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:744
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:740
#define GENERIC_READ
Definition: compat.h:135
#define FILE_MAP_READ
Definition: compat.h:776
#define GetFileSizeEx
Definition: compat.h:757
#define MapViewOfFile
Definition: compat.h:745
#define FILE_SHARE_READ
Definition: compat.h:136
#define abs(i)
Definition: fconv.c:206
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
Definition: fci.c:127
int64_t LONGLONG
Definition: typedefs.h:68

Referenced by d3drm_texture1_InitFromFile(), and d3drm_texture3_InitFromFile().

◆ d3drm_validate_image()

static BOOL d3drm_validate_image ( D3DRMIMAGE image)
static

Definition at line 53 of file texture.c.

54{
55 if (!image
56 || !image->red_mask
57 || !image->green_mask
58 || !image->blue_mask
59 || !image->buffer1
60 || !(image->rgb || (image->palette && image->palette_size)))
61 {
62 return FALSE;
63 }
64
65 return TRUE;
66}

Referenced by d3drm_texture3_InitFromImage().

◆ destroy_image_callback()

static void CDECL destroy_image_callback ( IDirect3DRMObject *  obj,
void arg 
)
static

Definition at line 252 of file texture.c.

253{
255
256 TRACE("texture object %p, image %p.\n", obj, image);
257
258 heap_free(image->buffer1);
260}
void * arg
Definition: msvc.h:10

Referenced by d3drm_texture_load().

◆ impl_from_IDirect3DRMTexture()

◆ impl_from_IDirect3DRMTexture2()

◆ impl_from_IDirect3DRMTexture3()

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( d3drm  )

Variable Documentation

◆ d3drm_texture1_vtbl

const struct IDirect3DRMTextureVtbl d3drm_texture1_vtbl
static

Definition at line 626 of file texture.c.

Referenced by d3drm_texture_create().

◆ d3drm_texture2_vtbl

const struct IDirect3DRMTexture2Vtbl d3drm_texture2_vtbl
static

Definition at line 957 of file texture.c.

Referenced by d3drm_texture_create().

◆ d3drm_texture3_vtbl

const struct IDirect3DRMTexture3Vtbl d3drm_texture3_vtbl
static

Definition at line 1370 of file texture.c.

Referenced by d3drm_texture_create().