From 52bb930cc79ace241a20e4177b3be09fda4b99a4 Mon Sep 17 00:00:00 2001 From: libretroadmin Date: Sun, 15 May 2022 21:04:53 +0200 Subject: [PATCH] (D3D9) Cleanup --- gfx/common/d3d9_common.c | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/gfx/common/d3d9_common.c b/gfx/common/d3d9_common.c index 1a0d1a018b..b3bbec1986 100644 --- a/gfx/common/d3d9_common.c +++ b/gfx/common/d3d9_common.c @@ -254,26 +254,6 @@ void d3d9_deinitialize_symbols(void) #endif } -#ifdef HAVE_D3DX -static void *d3d9_texture_new_from_file( - void *dev, - const char *path, unsigned width, unsigned height, - unsigned miplevels, unsigned usage, D3DFORMAT format, - INT32 pool, unsigned filter, unsigned mipfilter, - INT32 color_key, void *src_info_data, - PALETTEENTRY *palette) -{ - void *buf = NULL; - if (FAILED(D3D9CreateTextureFromFile((LPDIRECT3DDEVICE9)dev, - path, width, height, miplevels, usage, format, - (D3DPOOL)pool, filter, mipfilter, color_key, - (D3DXIMAGE_INFO*)src_info_data, - palette, (struct IDirect3DTexture9**)&buf))) - return NULL; - return buf; -} -#endif - void *d3d9_texture_new(void *_dev, const char *path, unsigned width, unsigned height, unsigned miplevels, unsigned usage, INT32 format, @@ -287,14 +267,15 @@ void *d3d9_texture_new(void *_dev, if (path) { #ifdef HAVE_D3DX - return d3d9_texture_new_from_file(_dev, - path, width, height, miplevels, - usage, (D3DFORMAT)format, - (D3DPOOL)pool, filter, mipfilter, - color_key, src_info_data, palette); -#else - return NULL; + void *buf = NULL; + if (SUCCEEDED(D3D9CreateTextureFromFile((LPDIRECT3DDEVICE9)dev, + path, width, height, miplevels, usage, format, + (D3DPOOL)pool, filter, mipfilter, color_key, + (D3DXIMAGE_INFO*)src_info_data, + palette, (struct IDirect3DTexture9**)&buf))) + return buf; #endif + return NULL; } #ifndef _XBOX