23 #include "wine/port.h" 41 if (
num >= 0x80000000)
60 ERR(
"Unexpected texture type\n");
92 IDirect3DSurface9 *topsurf, *mipsurf;
115 for (
i = 0;
i < numfaces;
i++)
117 level = srclevel + 1;
146 int level, level_count;
147 IDirect3DVolume9 *top_volume, *mip_volume;
148 IDirect3DVolumeTexture9 *volume_texture = (IDirect3DVolumeTexture9*)
texture;
170 top_volume = mip_volume;
194 } luminance_replacements[] =
204 if (
format == luminance_replacements[
i].luminance_format)
205 return luminance_replacements[
i].replacement_format;
216 IDirect3D9 *d3d =
NULL;
222 TRACE(
"(%p, %p, %p, %p, %u, %p, %u)\n",
device,
width,
height, miplevels,
usage,
format,
pool);
273 TRACE(
"Requested format is not supported, looking for a fallback.\n");
277 FIXME(
"Pixel format %x not handled\n", usedformat);
282 allow_24bits =
fmt->bytes_per_pixel == 3;
288 unsigned int curchannels = !!curfmt->
bits[0] + !!curfmt->
bits[1]
289 + !!curfmt->
bits[2] + !!curfmt->
bits[3];
306 score = 512 * (curfmt->
type ==
fmt->type);
307 score -= 32 * (curchannels -
channels);
309 for (
j = 0;
j < 4;
j++)
312 score -= (diff < 0 ? -diff * 8 : diff) * (
j == 0 ? 1 : 2);
315 if (score > bestscore)
318 usedformat = curfmt->
format;
336 if (
fmt->block_width != 1 ||
fmt->block_height != 1)
338 if (
w %
fmt->block_width)
339 w +=
fmt->block_width -
w %
fmt->block_width;
340 if (
h %
fmt->block_height)
341 h +=
fmt->block_height -
h %
fmt->block_height;
377 UINT max_mipmaps = 1;
385 while (max_dimen > 1)
392 if (*miplevels == 0 || *miplevels > max_mipmaps)
393 *miplevels = max_mipmaps;
406 WARN(
"Couldn't find a suitable pixel format\n");
410 TRACE(
"Format chosen: %x\n", usedformat);
424 TRACE(
"(%p, %p, %p, %u, %p, %u)\n",
device,
size, miplevels,
usage,
format,
pool);
462 TRACE(
"(%p, %p, %p, %p, %p, %u, %p, %u)\n",
device,
width,
height,
depth, miplevels,
502 UINT max_mipmaps = 1;
505 while (max_dimen > 1)
511 if (*miplevels == 0 || *miplevels > max_mipmaps)
512 *miplevels = max_mipmaps;
531 TRACE(
"device %p, width %u, height %u, miplevels %u, usage %#x, format %#x, pool %#x, texture %p.\n",
550 replacement_formats[] =
561 if (replacement_formats[
i].orig_format ==
format)
562 return replacement_formats[
i].replacement_format;
571 IDirect3DTexture9 **texptr;
572 IDirect3DTexture9 *buftex;
573 IDirect3DSurface9 *surface;
574 BOOL dynamic_texture, format_specified =
FALSE;
576 UINT loaded_miplevels, skip_levels;
580 TRACE(
"device %p, srcdata %p, srcdatasize %u, width %u, height %u, miplevels %u," 581 " usage %#x, format %#x, pool %#x, filter %#x, mipfilter %#x, colorkey %#x," 582 " srcinfo %p, palette %p, texture %p.\n",
593 FIXME(
"Unrecognized file format, returning failure.\n");
614 format_specified =
TRUE;
637 if (skip_levels && imginfo.
MipLevels > skip_levels)
639 TRACE(
"Skipping the first %u (of %u) levels of a DDS mipmapped texture.\n",
641 TRACE(
"Texture level 0 dimensions are %ux%u.\n", imginfo.
Width, imginfo.
Height);
642 width >>= skip_levels;
644 miplevels -= skip_levels;
655 FIXME(
"Couldn't find suitable texture parameters.\n");
660 if (colorkey && !format_specified)
665 FIXME(
"Generation of mipmaps for compressed pixel formats is not implemented yet.\n");
671 FIXME(
"Generation of mipmaps for compressed pixel formats is not implemented yet.\n");
693 FIXME(
"Texture creation failed.\n");
698 TRACE(
"Texture created correctly. Now loading the texture data into it.\n");
714 FIXME(
"Texture loading failed.\n");
723 FIXME(
"Texture filtering failed.\n");
730 if (texptr == &buftex)
752 const void *srcdata,
UINT srcdatasize,
struct IDirect3DTexture9 **
texture)
769 TRACE(
"device %p, srcfile %s, width %u, height %u, miplevels %u, usage %#x, format %#x, " 770 "pool %#x, filter %#x, mipfilter %#x, colorkey 0x%08x, srcinfo %p, palette %p, texture %p.\n",
798 TRACE(
"device %p, srcfile %s, width %u, height %u, miplevels %u, usage %#x, format %#x, " 799 "pool %#x, filter %#x, mipfilter %#x, colorkey 0x%08x, srcinfo %p, palette %p, texture %p.\n",
819 const char *srcfile,
struct IDirect3DTexture9 **
texture)
828 const WCHAR *srcfile,
struct IDirect3DTexture9 **
texture)
864 TRACE(
"device %p, srcmodule %p, resource %s, width %u, height %u, miplevels %u, usage %#x, format %#x, " 865 "pool %#x, filter %#x, mipfilter %#x, colorkey 0x%08x, srcinfo %p, palette %p, texture %p.\n",
893 TRACE(
"device %p, srcmodule %p, resource %s, width %u, height %u, miplevels %u, usage %#x, format %#x, " 894 "pool %#x, filter %#x, mipfilter %#x, colorkey 0x%08x, srcinfo %p, palette %p, texture %p.\n",
918 TRACE(
"(%p, %u, %u, %#x, %#x, %#x, %p)\n",
device,
size, miplevels,
usage,
format,
928 TRACE(
"D3DXCheckCubeTextureRequirements failed\n");
949 TRACE(
"(%p, %u, %u, %u, %u, %#x, %#x, %#x, %p)\n",
device,
width,
height,
depth,
960 TRACE(
"D3DXCheckVolumeTextureRequirements failed\n");
970 IDirect3DVolumeTexture9 **volume_texture)
978 TRACE(
"(%p, %s, %p): relay\n",
1001 IDirect3DVolumeTexture9 **volume_texture)
1007 TRACE(
"(%p, %s, %p): relay\n",
1036 IDirect3DVolumeTexture9 **volume_texture)
1044 TRACE(
"(%p, %s, %u, %u, %u, %u, %#x, %#x, %#x, %#x, %#x, %#x, %p, %p, %p): relay\n",
1082 IDirect3DVolumeTexture9 **volume_texture)
1088 TRACE(
"(%p, %s, %u, %u, %u, %u, %#x, %#x, %#x, %#x, %#x, %#x, %p, %p, %p): relay\n",
1109 IDirect3DVolumeTexture9 **volume_texture)
1111 TRACE(
"(%p, %p, %u, %p): relay\n",
device,
data, data_size, volume_texture);
1133 IDirect3DVolumeTexture9 **volume_texture)
1138 BOOL dynamic_texture;
1144 IDirect3DVolumeTexture9 *tex, *buftex;
1146 TRACE(
"(%p, %p, %u, %u, %u, %u, %u, %#x, %#x, %#x, %#x, %#x, %#x, %p, %p, %p)\n",
1147 device,
data, data_size,
width,
height,
depth, mip_levels,
usage,
format,
pool,
1150 if (!
device || !
data || !data_size || !volume_texture)
1203 file_mip_levels =
TRUE;
1210 if ((file_width &&
width != image_info.
Width)
1214 || (file_mip_levels && mip_levels != image_info.
MipLevels))
1223 FIXME(
"Generation of mipmaps for volume textures is not implemented yet.\n");
1264 *volume_texture = tex;
1272 for (
c = 0;
c <
format->bytes_per_pixel;
c++)
1275 for (
c = 0;
c < 4;
c++)
1303 FIXME(
"Unhandled format type %#x\n",
format->type);
1326 IDirect3DSurface9 *surface, *temp_surface;
1337 TRACE(
"texture %p, function %p, funcdata %p.\n",
texture,
function, funcdata);
1344 for (
m = 0;
m < miplevels;
m++)
1352 FIXME(
"Unsupported texture format %#x.\n",
desc.Format);
1369 for (
y = 0;
y <
desc.Height;
y++)
1397 FIXME(
"texture %p, texture_shader %p stub.\n",
texture, texture_shader);
1402 const void *src_data,
1414 IDirect3DCubeTexture9 **cube_texture)
1418 UINT loaded_miplevels;
1420 BOOL dynamic_texture;
1424 IDirect3DCubeTexture9 *tex, *buftex;
1426 TRACE(
"(%p, %p, %u, %u, %u, %#x, %#x, %#x, %#x, %#x, %#x, %p, %p, %p)\n",
device,
1430 if (!
device || !cube_texture || !src_data || !src_data_size)
1465 file_mip_levels =
TRUE;
1475 || (file_mip_levels && mip_levels != img_info.
MipLevels))
1484 FIXME(
"Generation of mipmaps for compressed pixel formats is not supported yet.\n");
1531 *src_info = img_info;
1533 *cube_texture = tex;
1539 const char *src_filename,
1540 IDirect3DCubeTexture9 **cube_texture)
1573 const WCHAR *src_filename,
1574 IDirect3DCubeTexture9 **cube_texture)
1593 const char *src_filename,
1604 IDirect3DCubeTexture9 **cube_texture)
1612 TRACE(
"(%p, %s, %u, %u, %#x, %#x, %#x, %#x, %#x, %#x, %p, %p, %p): relay\n",
1639 const WCHAR *src_filename,
1650 IDirect3DCubeTexture9 **cube_texture)
1656 TRACE(
"(%p, %s, %u, %u, %#x, %#x, %#x, %#x, %#x, %#x, %p, %p, %p): relay\n",
1687 return size -
x - 0.5f;
1691 return size -
y - 0.5f;
1697 ERR(
"Unexpected coordinate value\n");
1712 static const enum cube_coord coordmap[6][3] =
1727 for (
m = 0;
m < miplevels;
m++)
1735 FIXME(
"Unsupported texture format %#x\n",
desc.Format);
1739 for (
f = 0;
f < 6;
f++)
1744 size.x = (
f == 0) || (
f == 1) ? 0.0f : 2.0f /
desc.Width;
1745 size.y = (
f == 2) || (
f == 3) ? 0.0f : 2.0f /
desc.Width;
1746 size.z = (
f == 4) || (
f == 5) ? 0.0f : 2.0f /
desc.Width;
1750 for (
y = 0;
y <
desc.Height;
y++)
1752 for (
x = 0;
x <
desc.Width;
x++)
1772 FIXME(
"texture %p, texture_shader %p stub.\n",
texture, texture_shader);
1792 for (
m = 0;
m < miplevels;
m++)
1800 FIXME(
"Unsupported texture format %#x\n",
desc.Format);
1813 for (
z = 0;
z <
desc.Depth;
z++)
1842 FIXME(
"texture %p, texture_shader %p stub.\n",
texture, texture_shader);
1847 IDirect3DBaseTexture9 *src_texture,
const PALETTEENTRY *src_palette)
1854 TRACE(
"(%s, %#x, %p, %p): relay\n",
1855 wine_dbgstr_a(dst_filename), file_format, src_texture, src_palette);
1876 IDirect3DBaseTexture9 *src_texture,
const PALETTEENTRY *src_palette)
1881 TRACE(
"(%s, %#x, %p, %p): relay\n",
1882 wine_dbgstr_w(dst_filename), file_format, src_texture, src_palette);
1897 IDirect3DBaseTexture9 *src_texture,
const PALETTEENTRY *src_palette)
1901 IDirect3DSurface9 *surface;
1903 TRACE(
"(%p, %#x, %p, %p)\n",
1904 dst_buffer, file_format, src_texture, src_palette);
1919 FIXME(
"Volume textures aren't supported yet\n");
1937 FIXME(
"texture %p, src_texture %p, src_palette %p, flags %#x, channel %u, amplitude %.8e stub.\n",
1938 texture, src_texture, src_palette,
flags, channel, amplitude);
void(WINAPI * LPD3DXFILL2D)(D3DXVECTOR4 *out, const D3DXVECTOR2 *texcoord, const D3DXVECTOR2 *texelsize, void *data)
#define IDirect3DSurface9_Release(p)
HRESULT WINAPI D3DXCheckCubeTextureRequirements(struct IDirect3DDevice9 *device, UINT *size, UINT *miplevels, DWORD usage, D3DFORMAT *format, D3DPOOL pool)
#define IDirect3D9_CheckDeviceFormat(p, a, b, c, d, e, f)
GLint GLint GLsizei width
#define D3DPTEXTURECAPS_POW2
#define IDirect3DDevice9_CreateVolumeTexture(p, a, b, c, d, e, f, g, h, i)
HRESULT WINAPI D3DXCreateCubeTextureFromFileInMemory(struct IDirect3DDevice9 *device, const void *data, UINT datasize, struct IDirect3DCubeTexture9 **texture)
GLubyte GLubyte GLubyte GLubyte w
#define IDirect3DVolumeTexture9_GetLevelDesc(p, a, b)
#define IDirect3DCubeTexture9_GetLevelDesc(p, a, b)
const char int int int static __inline const char * wine_dbgstr_a(const char *s)
#define IDirect3DDevice9_GetCreationParameters(p, a)
HRESULT WINAPI D3DXLoadSurfaceFromSurface(IDirect3DSurface9 *dst_surface, const PALETTEENTRY *dst_palette, const RECT *dst_rect, IDirect3DSurface9 *src_surface, const PALETTEENTRY *src_palette, const RECT *src_rect, DWORD filter, D3DCOLOR color_key)
HRESULT WINAPI D3DXCreateCubeTextureFromFileExW(IDirect3DDevice9 *device, const WCHAR *src_filename, UINT size, UINT mip_levels, DWORD usage, D3DFORMAT format, D3DPOOL pool, DWORD filter, DWORD mip_filter, D3DCOLOR color_key, D3DXIMAGE_INFO *image_info, PALETTEENTRY *palette, IDirect3DCubeTexture9 **cube_texture)
#define IDirect3DCubeTexture9_GetLevelCount(p)
#define IDirect3DTexture9_GetSurfaceLevel(p, a, b)
char * wine_dbgstr_w(const wchar_t *wstr)
HRESULT WINAPI D3DXCreateTexture(struct IDirect3DDevice9 *device, UINT width, UINT height, UINT miplevels, DWORD usage, D3DFORMAT format, D3DPOOL pool, struct IDirect3DTexture9 **texture)
#define D3DUSAGE_AUTOGENMIPMAP
static float get_cube_coord(enum cube_coord coord, unsigned int x, unsigned int y, unsigned int size)
#define IDirect3DVolumeTexture9_GetLevelCount(p)
#define D3DPTEXTURECAPS_CUBEMAP_POW2
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
#define IDirect3DTexture9_Release(p)
HRESULT WINAPI D3DXCreateTextureFromFileInMemoryEx(struct IDirect3DDevice9 *device, const void *srcdata, UINT srcdatasize, UINT width, UINT height, UINT miplevels, DWORD usage, D3DFORMAT format, D3DPOOL pool, DWORD filter, DWORD mipfilter, D3DCOLOR colorkey, D3DXIMAGE_INFO *srcinfo, PALETTEENTRY *palette, struct IDirect3DTexture9 **texture)
#define D3DUSAGE_DONOTCLIP
#define D3DERR_INVALIDCALL
GLint GLint GLint GLint GLint x
#define IDirect3DVolumeTexture9_Release(p)
#define IDirect3DTexture9_GetLevelCount(p)
#define D3DUSAGE_WRITEONLY
#define D3DPTEXTURECAPS_MIPVOLUMEMAP
#define IDirect3DCubeTexture9_Release(p)
enum _D3DXIMAGE_FILEFORMAT D3DXIMAGE_FILEFORMAT
static UINT make_pow2(UINT num)
HRESULT WINAPI D3DXCreateTextureFromFileW(struct IDirect3DDevice9 *device, const WCHAR *srcfile, struct IDirect3DTexture9 **texture)
static D3DFORMAT get_alpha_replacement_format(D3DFORMAT format)
HRESULT load_cube_texture_from_dds(IDirect3DCubeTexture9 *cube_texture, const void *src_data, const PALETTEENTRY *palette, DWORD filter, D3DCOLOR color_key, const D3DXIMAGE_INFO *src_info) DECLSPEC_HIDDEN
HRESULT WINAPI D3DXFillVolumeTextureTX(struct IDirect3DVolumeTexture9 *texture, ID3DXTextureShader *texture_shader)
D3DRESOURCETYPE ResourceType
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
GLfloat GLfloat GLfloat GLfloat h
#define IDirect3DTexture9_GetLevelDesc(p, a, b)
#define IDirect3DVolumeTexture9_UnlockBox(p, a)
static const WCHAR filenameW[]
#define IDirect3D9_Release(p)
HRESULT WINAPI D3DXCreateTextureFromResourceExA(struct IDirect3DDevice9 *device, HMODULE srcmodule, const char *resource, UINT width, UINT height, UINT miplevels, DWORD usage, D3DFORMAT format, D3DPOOL pool, DWORD filter, DWORD mipfilter, D3DCOLOR colorkey, D3DXIMAGE_INFO *srcinfo, PALETTEENTRY *palette, struct IDirect3DTexture9 **texture)
GLenum const GLfloat * params
#define IDirect3DCubeTexture9_LockRect(p, a, b, c, d, e)
HRESULT WINAPI D3DXSaveTextureToFileW(const WCHAR *dst_filename, D3DXIMAGE_FILEFORMAT file_format, IDirect3DBaseTexture9 *src_texture, const PALETTEENTRY *src_palette)
static const WCHAR desc[]
HRESULT WINAPI D3DXLoadVolumeFromVolume(IDirect3DVolume9 *dst_volume, const PALETTEENTRY *dst_palette, const D3DBOX *dst_box, IDirect3DVolume9 *src_volume, const PALETTEENTRY *src_palette, const D3DBOX *src_box, DWORD filter, D3DCOLOR color_key)
#define IDirect3DDevice9_UpdateTexture(p, a, b)
HRESULT load_resource_into_memory(HMODULE module, HRSRC resinfo, void **buffer, DWORD *length) DECLSPEC_HIDDEN
#define D3DERR_NOTAVAILABLE
#define D3DPTEXTURECAPS_SQUAREONLY
const struct pixel_format_desc * get_format_info_idx(int idx) DECLSPEC_HIDDEN
HRESULT write_buffer_to_file(const WCHAR *filename, ID3DXBuffer *buffer) DECLSPEC_HIDDEN
HRESULT WINAPI D3DXSaveTextureToFileA(const char *dst_filename, D3DXIMAGE_FILEFORMAT file_format, IDirect3DBaseTexture9 *src_texture, const PALETTEENTRY *src_palette)
HRESULT WINAPI D3DXFilterTexture(IDirect3DBaseTexture9 *texture, const PALETTEENTRY *palette, UINT srclevel, DWORD filter)
struct ID3DXBuffer ID3DXBuffer
HRESULT WINAPI D3DXCreateTextureFromFileExW(struct IDirect3DDevice9 *device, const WCHAR *srcfile, UINT width, UINT height, UINT miplevels, DWORD usage, D3DFORMAT format, D3DPOOL pool, DWORD filter, DWORD mipfilter, D3DCOLOR colorkey, D3DXIMAGE_INFO *srcinfo, PALETTEENTRY *palette, struct IDirect3DTexture9 **texture)
enum _D3DFORMAT D3DFORMAT
#define IDirect3DDevice9_GetDisplayMode(p, a, b)
#define D3DUSAGE_NPATCHES
#define IDirect3DBaseTexture9_GetType(p)
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
#define D3DPTEXTURECAPS_CUBEMAP
#define IDirect3DDevice9_GetDirect3D(p, a)
HRESULT save_dds_texture_to_memory(ID3DXBuffer **dst_buffer, IDirect3DBaseTexture9 *src_texture, const PALETTEENTRY *src_palette) DECLSPEC_HIDDEN
#define D3DX_SKIP_DDS_MIP_LEVELS_SHIFT
D3DXIMAGE_FILEFORMAT ImageFileFormat
HRESULT WINAPI D3DXFillCubeTextureTX(struct IDirect3DCubeTexture9 *texture, ID3DXTextureShader *texture_shader)
HRESULT WINAPI D3DXCreateCubeTextureFromFileExA(IDirect3DDevice9 *device, const char *src_filename, UINT size, UINT mip_levels, DWORD usage, D3DFORMAT format, D3DPOOL pool, DWORD filter, DWORD mip_filter, D3DCOLOR color_key, D3DXIMAGE_INFO *image_info, PALETTEENTRY *palette, IDirect3DCubeTexture9 **cube_texture)
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HRESULT WINAPI D3DXFillTextureTX(struct IDirect3DTexture9 *texture, ID3DXTextureShader *texture_shader)
WINE_DEFAULT_DEBUG_CHANNEL(d3d8)
HRESULT WINAPI D3DXCreateVolumeTextureFromFileW(IDirect3DDevice9 *device, const WCHAR *filename, IDirect3DVolumeTexture9 **volume_texture)
HRESULT WINAPI D3DXCreateTextureFromResourceW(struct IDirect3DDevice9 *device, HMODULE srcmodule, const WCHAR *resource, struct IDirect3DTexture9 **texture)
HRESULT WINAPI D3DXCreateTextureFromFileInMemory(struct IDirect3DDevice9 *device, const void *srcdata, UINT srcdatasize, struct IDirect3DTexture9 **texture)
#define D3DX_DEFAULT_NONPOW2
HRESULT WINAPI D3DXCreateTextureFromFileExA(struct IDirect3DDevice9 *device, const char *srcfile, UINT width, UINT height, UINT miplevels, DWORD usage, D3DFORMAT format, D3DPOOL pool, DWORD filter, DWORD mipfilter, D3DCOLOR colorkey, D3DXIMAGE_INFO *srcinfo, PALETTEENTRY *palette, struct IDirect3DTexture9 **texture)
HRESULT WINAPI D3DXCreateCubeTextureFromFileW(IDirect3DDevice9 *device, const WCHAR *src_filename, IDirect3DCubeTexture9 **cube_texture)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
HRESULT unlock_surface(IDirect3DSurface9 *surface, D3DLOCKED_RECT *lock, IDirect3DSurface9 *temp_surface, BOOL update) DECLSPEC_HIDDEN
HRESULT map_view_of_file(const WCHAR *filename, void **buffer, DWORD *length) DECLSPEC_HIDDEN
GLint GLint GLsizei GLsizei GLsizei depth
HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE_FILEFORMAT file_format, IDirect3DSurface9 *src_surface, const PALETTEENTRY *src_palette, const RECT *src_rect)
#define D3DUSAGE_RTPATCHES
HRESULT WINAPI D3DXCreateCubeTexture(struct IDirect3DDevice9 *device, UINT size, UINT miplevels, DWORD usage, D3DFORMAT format, D3DPOOL pool, struct IDirect3DCubeTexture9 **texture)
HRESULT WINAPI D3DXCreateVolumeTexture(struct IDirect3DDevice9 *device, UINT width, UINT height, UINT depth, UINT miplevels, DWORD usage, D3DFORMAT format, D3DPOOL pool, struct IDirect3DVolumeTexture9 **texture)
#define IDirect3DCubeTexture9_GetCubeMapSurface(p, a, b, c)
#define IDirect3DVolume9_Release(p)
GLsizeiptr const GLvoid GLenum usage
HRESULT load_volume_texture_from_dds(IDirect3DVolumeTexture9 *volume_texture, const void *src_data, const PALETTEENTRY *palette, DWORD filter, DWORD color_key, const D3DXIMAGE_INFO *src_info) DECLSPEC_HIDDEN
GLsizei const GLfloat * value
HRESULT WINAPI D3DXCheckVolumeTextureRequirements(struct IDirect3DDevice9 *device, UINT *width, UINT *height, UINT *depth, UINT *miplevels, DWORD usage, D3DFORMAT *format, D3DPOOL pool)
void(WINAPI * LPD3DXFILL3D)(D3DXVECTOR4 *out, const D3DXVECTOR3 *texcoord, const D3DXVECTOR3 *texelsize, void *data)
static HRESULT get_surface(D3DRESOURCETYPE type, struct IDirect3DBaseTexture9 *tex, int face, UINT level, struct IDirect3DSurface9 **surf)
GLint GLint GLsizei GLsizei height
HRESULT WINAPI D3DXCreateVolumeTextureFromFileExW(IDirect3DDevice9 *device, const WCHAR *filename, UINT width, UINT height, UINT depth, UINT mip_levels, DWORD usage, D3DFORMAT format, D3DPOOL pool, DWORD filter, DWORD mip_filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info, PALETTEENTRY *palette, IDirect3DVolumeTexture9 **volume_texture)
HRESULT WINAPI D3DXCreateTextureFromResourceA(struct IDirect3DDevice9 *device, HMODULE srcmodule, const char *resource, struct IDirect3DTexture9 **texture)
#define IDirect3DVolumeTexture9_LockBox(p, a, b, c, d)
#define D3DX_FILTER_DITHER
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
#define IDirect3DDevice9_CreateTexture(p, a, b, c, d, e, f, g, h)
HRESULT WINAPI D3DXCreateVolumeTextureFromFileA(IDirect3DDevice9 *device, const char *filename, IDirect3DVolumeTexture9 **volume_texture)
#define ID3DXBuffer_Release(p)
#define IDirect3DDevice9_GetDeviceCaps(p, a)
HRESULT WINAPI D3DXFillVolumeTexture(struct IDirect3DVolumeTexture9 *texture, LPD3DXFILL3D function, void *funcdata)
static D3DFORMAT get_luminance_replacement_format(D3DFORMAT format)
HRESULT WINAPI D3DXCreateVolumeTextureFromFileInMemoryEx(IDirect3DDevice9 *device, const void *data, UINT data_size, UINT width, UINT height, UINT depth, UINT mip_levels, DWORD usage, D3DFORMAT format, D3DPOOL pool, DWORD filter, DWORD mip_filter, D3DCOLOR color_key, D3DXIMAGE_INFO *info, PALETTEENTRY *palette, IDirect3DVolumeTexture9 **volume_texture)
HRESULT WINAPI D3DXCreateVolumeTextureFromFileInMemory(IDirect3DDevice9 *device, const void *data, UINT data_size, IDirect3DVolumeTexture9 **volume_texture)
GLint GLint GLint GLint GLint GLint y
#define MultiByteToWideChar
#define IDirect3DCubeTexture9_UnlockRect(p, a, b)
static void fill_texture(const struct pixel_format_desc *format, BYTE *pos, const D3DXVECTOR4 *value)
HRESULT WINAPI D3DXCheckTextureRequirements(struct IDirect3DDevice9 *device, UINT *width, UINT *height, UINT *miplevels, DWORD usage, D3DFORMAT *format, D3DPOOL pool)
#define D3DPTEXTURECAPS_MIPCUBEMAP
#define IDirect3DVolumeTexture9_GetVolumeLevel(p, a, b)
HRESULT WINAPI D3DXCreateTextureFromFileA(struct IDirect3DDevice9 *device, const char *srcfile, struct IDirect3DTexture9 **texture)
HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(const void *data, UINT datasize, D3DXIMAGE_INFO *info)
char * cleanup(char *str)
#define D3DPTEXTURECAPS_VOLUMEMAP_POW2
const struct pixel_format_desc * get_format_info(D3DFORMAT format) DECLSPEC_HIDDEN
HRESULT WINAPI D3DXFillCubeTexture(struct IDirect3DCubeTexture9 *texture, LPD3DXFILL3D function, void *funcdata)
HRESULT lock_surface(IDirect3DSurface9 *surface, D3DLOCKED_RECT *lock, IDirect3DSurface9 **temp_surface, BOOL write) DECLSPEC_HIDDEN
GLuint GLuint GLsizei GLenum type
HRESULT WINAPI D3DXCreateCubeTextureFromFileInMemoryEx(IDirect3DDevice9 *device, const void *src_data, UINT src_data_size, UINT size, UINT mip_levels, DWORD usage, D3DFORMAT format, D3DPOOL pool, DWORD filter, DWORD mip_filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info, PALETTEENTRY *palette, IDirect3DCubeTexture9 **cube_texture)
HRESULT WINAPI D3DXCreateVolumeTextureFromFileExA(IDirect3DDevice9 *device, const char *filename, UINT width, UINT height, UINT depth, UINT mip_levels, DWORD usage, D3DFORMAT format, D3DPOOL pool, DWORD filter, DWORD mip_filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info, PALETTEENTRY *palette, IDirect3DVolumeTexture9 **volume_texture)
static BOOL is_pow2(UINT num)
#define IDirect3DBaseTexture9_GetLevelCount(p)
#define D3DPTEXTURECAPS_VOLUMEMAP
unsigned short float_32_to_16(const float in) DECLSPEC_HIDDEN
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
HRESULT WINAPI D3DXCreateCubeTextureFromFileA(IDirect3DDevice9 *device, const char *src_filename, IDirect3DCubeTexture9 **cube_texture)
#define IDirect3DDevice9_CreateCubeTexture(p, a, b, c, d, e, f, g)
#define HeapFree(x, y, z)
enum _D3DRESOURCETYPE D3DRESOURCETYPE
GLenum GLuint GLint GLenum face
HRESULT WINAPI D3DXCreateTextureFromResourceExW(struct IDirect3DDevice9 *device, HMODULE srcmodule, const WCHAR *resource, UINT width, UINT height, UINT miplevels, DWORD usage, D3DFORMAT format, D3DPOOL pool, DWORD filter, DWORD mipfilter, D3DCOLOR colorkey, D3DXIMAGE_INFO *srcinfo, PALETTEENTRY *palette, struct IDirect3DTexture9 **texture)
HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(IDirect3DSurface9 *pDestSurface, const PALETTEENTRY *pDestPalette, const RECT *pDestRect, const void *pSrcData, UINT SrcDataSize, const RECT *pSrcRect, DWORD dwFilter, D3DCOLOR Colorkey, D3DXIMAGE_INFO *pSrcInfo)
HRESULT load_texture_from_dds(IDirect3DTexture9 *texture, const void *src_data, const PALETTEENTRY *palette, DWORD filter, D3DCOLOR color_key, const D3DXIMAGE_INFO *src_info, unsigned int skip_levels, unsigned int *loaded_miplevels) DECLSPEC_HIDDEN
#define D3DCAPS2_DYNAMICTEXTURES
HRESULT WINAPI D3DXComputeNormalMap(IDirect3DTexture9 *texture, IDirect3DTexture9 *src_texture, const PALETTEENTRY *src_palette, DWORD flags, DWORD channel, float amplitude)
HRESULT WINAPI D3DXFillTexture(struct IDirect3DTexture9 *texture, LPD3DXFILL2D function, void *funcdata)
static int comp_value(const WCHAR *ptr, int dpc)
HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE_FILEFORMAT file_format, IDirect3DBaseTexture9 *src_texture, const PALETTEENTRY *src_palette)