(D3D) Split up D3DVideo-specific code to separate file

This commit is contained in:
twinaphex 2013-12-31 23:19:51 +01:00
parent e5bedc343a
commit d4850b3cd4
7 changed files with 1346 additions and 1328 deletions

File diff suppressed because it is too large Load Diff

View File

@ -55,7 +55,8 @@ typedef struct
class D3DVideo
{
public:
D3DVideo(const video_info_t* info);
D3DVideo(const video_info_t* info, const input_driver_t **input,
void **input_data);
bool frame(const void* frame,
unsigned width, unsigned height, unsigned pitch,
const char *msg);
@ -76,6 +77,8 @@ class D3DVideo
void overlay_render(overlay_t &overlay);
void show_cursor(bool show);
#ifdef HAVE_OVERLAY
bool overlay_load(const texture_image *images, unsigned num_images);
void overlay_tex_geom(unsigned index, float x, float y, float w, float h);
@ -118,13 +121,13 @@ class D3DVideo
struct gfx_shader shader;
void process();
void process(void);
void init(const video_info_t &info);
void init_base(const video_info_t &info);
void make_d3dpp(const video_info_t &info, D3DPRESENT_PARAMETERS &d3dpp);
void deinit();
RECT monitor_rect();
void init(const video_info_t *info);
void init_base(const video_info_t *info);
void make_d3dpp(const video_info_t *info, D3DPRESENT_PARAMETERS *d3dpp);
void deinit(void);
RECT monitor_rect(void);
video_info_t video_info;
@ -136,21 +139,21 @@ class D3DVideo
void deinit_cg();
#endif
void init_imports();
void init_luts();
void init_singlepass();
void init_multipass();
bool init_chain(const video_info_t &video_info);
void init_imports(void);
void init_luts(void);
void init_singlepass(void);
void init_multipass(void);
bool init_chain(const video_info_t *video_info);
std::unique_ptr<RenderChain> chain;
void deinit_chain();
void deinit_chain(void);
bool init_font();
void deinit_font();
bool init_font(void);
void deinit_font(void);
RECT font_rect;
RECT font_rect_shifted;
uint32_t font_color;
void update_title();
void update_title(void);
#ifdef HAVE_OVERLAY
bool overlays_enabled;

1303
gfx/d3d9/d3d9_pc.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -59,12 +59,12 @@ RenderChain::~RenderChain()
cgDestroyProgram(vStock);
}
RenderChain::RenderChain(const video_info_t &video_info,
RenderChain::RenderChain(const video_info_t *video_info,
IDirect3DDevice9 *dev_,
CGcontext cgCtx_,
const LinkInfo &info, PixelFormat fmt,
const D3DVIEWPORT9 &final_viewport_)
: dev(dev_), cgCtx(cgCtx_), video_info(video_info), final_viewport(final_viewport_), frame_count(0)
: dev(dev_), cgCtx(cgCtx_), video_info(*video_info), final_viewport(final_viewport_), frame_count(0)
{
pixel_size = fmt == RGB565 ? 2 : 4;
create_first_pass(info, fmt);

View File

@ -42,7 +42,7 @@ class RenderChain
public:
enum PixelFormat { RGB565, ARGB };
RenderChain(const video_info_t &video_info,
RenderChain(const video_info_t *video_info,
IDirect3DDevice9 *dev,
#ifdef HAVE_CG
CGcontext cgCtx,

View File

@ -208,6 +208,7 @@
<ClCompile Include="..\..\frontend\menu\menu_settings.c" />
<ClCompile Include="..\..\frontend\menu\menu_context.c" />
<ClCompile Include="..\..\gfx\d3d9\d3d9.cpp" />
<ClCompile Include="..\..\gfx\d3d9\d3d9_pc.cpp" />
<ClCompile Include="..\..\gfx\d3d9\render_chain.cpp" />
<ClCompile Include="..\..\gfx\fonts\bitmapfont.c" />
<ClCompile Include="..\..\gfx\fonts\fonts.c" />
@ -313,4 +314,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -171,6 +171,9 @@
<ClCompile Include="..\..\deps\miniz\miniz.c">
<Filter>deps\miniz</Filter>
</ClCompile>
<ClCompile Include="..\..\gfx\d3d9\d3d9_pc.cpp">
<Filter>gfx\d3d9</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource.h" />