From 6a9b39da3f3d62f91039d7d4b5d3c0b7bd44a5b5 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 14 May 2018 03:57:27 +0200 Subject: [PATCH] Get rid of d3d.h and xdk_defines.h --- defines/xdk_defines.h | 21 ------- gfx/common/d3d8_common.h | 3 +- gfx/common/d3d9_common.h | 4 +- gfx/common/d3d_common.h | 28 ++++++++++ gfx/common/win32_common.h | 4 +- gfx/drivers/d3d.h | 56 ------------------- gfx/drivers/d3d8.c | 4 +- gfx/drivers/d3d9.c | 4 +- gfx/drivers_font/d3d_w32_font.c | 1 - gfx/drivers_font/xdk1_xfonts.c | 1 - gfx/drivers_font/xdk360_fonts.cpp | 1 - gfx/drivers_renderchain/d3d9_cg_renderchain.c | 1 - .../d3d9_hlsl_renderchain.c | 1 - gfx/drivers_shader/shader_hlsl.c | 1 - menu/drivers/xui.cpp | 1 - menu/drivers_display/menu_display_d3d8.c | 1 - menu/drivers_display/menu_display_d3d9.c | 1 - 17 files changed, 36 insertions(+), 97 deletions(-) delete mode 100644 defines/xdk_defines.h delete mode 100644 gfx/drivers/d3d.h diff --git a/defines/xdk_defines.h b/defines/xdk_defines.h deleted file mode 100644 index 4af736bed0..0000000000 --- a/defines/xdk_defines.h +++ /dev/null @@ -1,21 +0,0 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2011-2017 - Daniel De Matteis - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . - */ - -#ifndef _XDK_DEFINES_H -#define _XDK_DEFINES_H - -typedef HANDLE WNDCLASSEX; - -#endif diff --git a/gfx/common/d3d8_common.h b/gfx/common/d3d8_common.h index ff8206a46b..78f5e12af9 100644 --- a/gfx/common/d3d8_common.h +++ b/gfx/common/d3d8_common.h @@ -22,7 +22,6 @@ #include -#include "../drivers/d3d.h" #include "../video_driver.h" #include "../../verbosity.h" @@ -53,7 +52,9 @@ typedef struct d3d8_video struct video_viewport vp; struct video_shader shader; video_info_t video_info; +#ifdef HAVE_WINDOW WNDCLASSEX windowClass; +#endif LPDIRECT3DDEVICE8 dev; D3DVIEWPORT8 final_viewport; diff --git a/gfx/common/d3d9_common.h b/gfx/common/d3d9_common.h index c71c582705..0e66e985e7 100644 --- a/gfx/common/d3d9_common.h +++ b/gfx/common/d3d9_common.h @@ -23,7 +23,7 @@ #include -#include "../drivers/d3d.h" +#include "d3d_common.h" #include "../video_driver.h" #include "../../verbosity.h" @@ -89,7 +89,9 @@ typedef struct d3d9_video struct video_viewport vp; struct video_shader shader; video_info_t video_info; +#ifdef HAVE_WINDOW WNDCLASSEX windowClass; +#endif LPDIRECT3DDEVICE9 dev; D3DVIEWPORT9 final_viewport; diff --git a/gfx/common/d3d_common.h b/gfx/common/d3d_common.h index b951881ae2..ee991de4ec 100644 --- a/gfx/common/d3d_common.h +++ b/gfx/common/d3d_common.h @@ -16,9 +16,18 @@ #ifndef _D3D_COMMON_H #define _D3D_COMMON_H +#ifdef HAVE_CONFIG_H +#include "../../config.h" +#endif + +#ifndef _XBOX +#define HAVE_WINDOW +#endif + #include #include +#include "../font_driver.h" #include "../video_driver.h" RETRO_BEGIN_DECLS @@ -29,6 +38,25 @@ typedef struct d3d_texture INT32 pool; } d3d_texture_t; +typedef struct +{ + bool fullscreen; + bool enabled; + unsigned tex_w, tex_h; + float tex_coords[4]; + float vert_coords[4]; + float alpha_mod; + void *tex; + void *vert_buf; +} overlay_t; + +typedef struct Vertex +{ + float x, y, z; + uint32_t color; + float u, v; +} Vertex; + #ifndef BYTE_CLAMP #define BYTE_CLAMP(i) (int) ((((i) > 255) ? 255 : (((i) < 0) ? 0 : (i)))) #endif diff --git a/gfx/common/win32_common.h b/gfx/common/win32_common.h index 82d682be9f..7afe7d0dd3 100644 --- a/gfx/common/win32_common.h +++ b/gfx/common/win32_common.h @@ -36,9 +36,7 @@ #include "../../driver.h" #include "../video_driver.h" -#ifdef _XBOX -#include "../../defines/xdk_defines.h" -#else +#ifndef _XBOX #include "../../ui/drivers/ui_win32_resource.h" #include "../../ui/drivers/ui_win32.h" #endif diff --git a/gfx/drivers/d3d.h b/gfx/drivers/d3d.h deleted file mode 100644 index 116b1e5020..0000000000 --- a/gfx/drivers/d3d.h +++ /dev/null @@ -1,56 +0,0 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * Copyright (C) 2011-2017 - Daniel De Matteis - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . - */ - -#ifndef __D3DVIDEO_INTF_H__ -#define __D3DVIDEO_INTF_H__ - -#ifdef HAVE_CONFIG_H -#include "../../config.h" -#endif - -#ifndef _XBOX -#define HAVE_WINDOW -#endif - -#include "../../driver.h" - -#include "../font_driver.h" -#include "../video_driver.h" -#ifdef _XBOX -#include "../../defines/xdk_defines.h" -#endif - -typedef struct -{ - bool fullscreen; - bool enabled; - unsigned tex_w, tex_h; - float tex_coords[4]; - float vert_coords[4]; - float alpha_mod; - void *tex; - void *vert_buf; -} overlay_t; - -typedef struct Vertex -{ - float x, y, z; - uint32_t color; - float u, v; -} Vertex; - -#endif - diff --git a/gfx/drivers/d3d8.c b/gfx/drivers/d3d8.c index b440a235ec..290c242308 100644 --- a/gfx/drivers/d3d8.c +++ b/gfx/drivers/d3d8.c @@ -31,7 +31,6 @@ #include -#include "d3d.h" #include "../../defines/d3d_defines.h" #include "../common/d3d8_common.h" #include "../common/d3d_common.h" @@ -1198,9 +1197,8 @@ static bool d3d8_init_internal(d3d8_video_t *d3d, d3d->menu->vert_coords[2] = 1; d3d->menu->vert_coords[3] = -1; - memset(&d3d->windowClass, 0, sizeof(d3d->windowClass)); - #ifdef HAVE_WINDOW + memset(&d3d->windowClass, 0, sizeof(d3d->windowClass)); d3d->windowClass.lpfnWndProc = WndProcD3D; win32_window_init(&d3d->windowClass, true, NULL); #endif diff --git a/gfx/drivers/d3d9.c b/gfx/drivers/d3d9.c index 91e296428e..0a44c84539 100644 --- a/gfx/drivers/d3d9.c +++ b/gfx/drivers/d3d9.c @@ -31,7 +31,6 @@ #include -#include "d3d.h" #include "../../defines/d3d_defines.h" #include "../common/d3d_common.h" #include "../common/d3d9_common.h" @@ -1210,9 +1209,8 @@ static bool d3d9_init_internal(d3d9_video_t *d3d, d3d->menu->vert_coords[2] = 1; d3d->menu->vert_coords[3] = -1; - memset(&d3d->windowClass, 0, sizeof(d3d->windowClass)); - #ifdef HAVE_WINDOW + memset(&d3d->windowClass, 0, sizeof(d3d->windowClass)); d3d->windowClass.lpfnWndProc = WndProcD3D; win32_window_init(&d3d->windowClass, true, NULL); #endif diff --git a/gfx/drivers_font/d3d_w32_font.c b/gfx/drivers_font/d3d_w32_font.c index 3f368fb3b5..bd176b9762 100644 --- a/gfx/drivers_font/d3d_w32_font.c +++ b/gfx/drivers_font/d3d_w32_font.c @@ -24,7 +24,6 @@ #include "../../config.h" #endif -#include "../drivers/d3d.h" #include "../common/d3d_common.h" #include "../common/d3d9_common.h" #include "../font_driver.h" diff --git a/gfx/drivers_font/xdk1_xfonts.c b/gfx/drivers_font/xdk1_xfonts.c index e05769faaf..dc4d9b6711 100644 --- a/gfx/drivers_font/xdk1_xfonts.c +++ b/gfx/drivers_font/xdk1_xfonts.c @@ -21,7 +21,6 @@ #include "../../config.h" #endif -#include "../drivers/d3d.h" #include "../common/d3d_common.h" #include "../common/d3d8_common.h" diff --git a/gfx/drivers_font/xdk360_fonts.cpp b/gfx/drivers_font/xdk360_fonts.cpp index 4d07414538..bc67a064f5 100644 --- a/gfx/drivers_font/xdk360_fonts.cpp +++ b/gfx/drivers_font/xdk360_fonts.cpp @@ -21,7 +21,6 @@ #include -#include "../drivers/d3d.h" #include "../common/d3d_common.h" #include "../common/d3d9_common.h" #include "../font_driver.h" diff --git a/gfx/drivers_renderchain/d3d9_cg_renderchain.c b/gfx/drivers_renderchain/d3d9_cg_renderchain.c index 1984cb88ff..1b91acb686 100644 --- a/gfx/drivers_renderchain/d3d9_cg_renderchain.c +++ b/gfx/drivers_renderchain/d3d9_cg_renderchain.c @@ -33,7 +33,6 @@ #include "../common/d3d_common.h" #include "../common/d3d9_common.h" -#include "../drivers/d3d.h" #include "../drivers/d3d_shaders/opaque.cg.d3d9.h" #include "../video_driver.h" diff --git a/gfx/drivers_renderchain/d3d9_hlsl_renderchain.c b/gfx/drivers_renderchain/d3d9_hlsl_renderchain.c index a9e1256f5c..b73989ce67 100644 --- a/gfx/drivers_renderchain/d3d9_hlsl_renderchain.c +++ b/gfx/drivers_renderchain/d3d9_hlsl_renderchain.c @@ -22,7 +22,6 @@ #include -#include "../drivers/d3d.h" #include "../../defines/d3d_defines.h" #include "../common/d3d_common.h" #include "../common/d3d9_common.h" diff --git a/gfx/drivers_shader/shader_hlsl.c b/gfx/drivers_shader/shader_hlsl.c index 34481d6b3f..611ee808e9 100644 --- a/gfx/drivers_shader/shader_hlsl.c +++ b/gfx/drivers_shader/shader_hlsl.c @@ -32,7 +32,6 @@ #endif #include "../video_shader_parse.h" -#include "../drivers/d3d.h" #include "../../managers/state_manager.h" #include "../../verbosity.h" diff --git a/menu/drivers/xui.cpp b/menu/drivers/xui.cpp index 3f8adff87d..537b32a3d5 100644 --- a/menu/drivers/xui.cpp +++ b/menu/drivers/xui.cpp @@ -47,7 +47,6 @@ #include "../../retroarch.h" #include "../../verbosity.h" -#include "../../gfx/drivers/d3d.h" #include "../../gfx/common/d3d_common.h" #include "../../gfx/common/d3d9_common.h" diff --git a/menu/drivers_display/menu_display_d3d8.c b/menu/drivers_display/menu_display_d3d8.c index df9f5b7768..518c6fd9e1 100644 --- a/menu/drivers_display/menu_display_d3d8.c +++ b/menu/drivers_display/menu_display_d3d8.c @@ -26,7 +26,6 @@ #include "../menu_driver.h" #include "../../gfx/video_driver.h" -#include "../../gfx/drivers/d3d.h" #include "../../gfx/common/d3d_common.h" #include "../../gfx/common/d3d8_common.h" diff --git a/menu/drivers_display/menu_display_d3d9.c b/menu/drivers_display/menu_display_d3d9.c index 7123455c5d..40a96903d5 100644 --- a/menu/drivers_display/menu_display_d3d9.c +++ b/menu/drivers_display/menu_display_d3d9.c @@ -26,7 +26,6 @@ #include "../menu_driver.h" #include "../../gfx/video_driver.h" -#include "../../gfx/drivers/d3d.h" #include "../../gfx/common/d3d_common.h" #include "../../gfx/common/d3d9_common.h"