mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-16 15:27:41 +00:00
Create d3d9_video_t and d3d8_video_t
This commit is contained in:
parent
c4a03b6b45
commit
82ebb9576f
@ -22,11 +22,56 @@
|
||||
|
||||
#include <d3d8.h>
|
||||
|
||||
#include "../drivers/d3d.h"
|
||||
#include "../video_driver.h"
|
||||
#include "../../verbosity.h"
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
typedef struct d3d8_video
|
||||
{
|
||||
bool keep_aspect;
|
||||
bool should_resize;
|
||||
bool quitting;
|
||||
bool needs_restore;
|
||||
bool overlays_enabled;
|
||||
/* TODO - refactor this away properly. */
|
||||
bool resolution_hd_enable;
|
||||
|
||||
unsigned cur_mon_id;
|
||||
unsigned dev_rotation;
|
||||
|
||||
overlay_t *menu;
|
||||
const d3d_renderchain_driver_t *renderchain_driver;
|
||||
void *renderchain_data;
|
||||
|
||||
RECT font_rect;
|
||||
RECT font_rect_shifted;
|
||||
math_matrix_4x4 mvp;
|
||||
math_matrix_4x4 mvp_rotate;
|
||||
math_matrix_4x4 mvp_transposed;
|
||||
|
||||
struct video_viewport vp;
|
||||
struct video_shader shader;
|
||||
video_info_t video_info;
|
||||
WNDCLASSEX windowClass;
|
||||
LPDIRECT3DDEVICE8 dev;
|
||||
d3d_video_viewport_t final_viewport;
|
||||
|
||||
char *shader_path;
|
||||
|
||||
struct
|
||||
{
|
||||
int size;
|
||||
int offset;
|
||||
void *buffer;
|
||||
void *decl;
|
||||
}menu_display;
|
||||
|
||||
size_t overlays_size;
|
||||
overlay_t *overlays;
|
||||
} d3d8_video_t;
|
||||
|
||||
static INLINE bool d3d8_swap(void *data, LPDIRECT3DDEVICE8 dev)
|
||||
{
|
||||
if (IDirect3DDevice8_Present(dev, NULL, NULL, NULL, NULL)
|
||||
|
@ -19,14 +19,60 @@
|
||||
#include <boolean.h>
|
||||
#include <retro_common_api.h>
|
||||
#include <retro_inline.h>
|
||||
#include <gfx/math/matrix_4x4.h>
|
||||
|
||||
#include <d3d9.h>
|
||||
|
||||
#include "../drivers/d3d.h"
|
||||
#include "../video_driver.h"
|
||||
#include "../../verbosity.h"
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
typedef struct d3d9_video
|
||||
{
|
||||
bool keep_aspect;
|
||||
bool should_resize;
|
||||
bool quitting;
|
||||
bool needs_restore;
|
||||
bool overlays_enabled;
|
||||
/* TODO - refactor this away properly. */
|
||||
bool resolution_hd_enable;
|
||||
|
||||
unsigned cur_mon_id;
|
||||
unsigned dev_rotation;
|
||||
|
||||
overlay_t *menu;
|
||||
const d3d_renderchain_driver_t *renderchain_driver;
|
||||
void *renderchain_data;
|
||||
|
||||
RECT font_rect;
|
||||
RECT font_rect_shifted;
|
||||
math_matrix_4x4 mvp;
|
||||
math_matrix_4x4 mvp_rotate;
|
||||
math_matrix_4x4 mvp_transposed;
|
||||
|
||||
struct video_viewport vp;
|
||||
struct video_shader shader;
|
||||
video_info_t video_info;
|
||||
WNDCLASSEX windowClass;
|
||||
LPDIRECT3DDEVICE9 dev;
|
||||
d3d_video_viewport_t final_viewport;
|
||||
|
||||
char *shader_path;
|
||||
|
||||
struct
|
||||
{
|
||||
int size;
|
||||
int offset;
|
||||
void *buffer;
|
||||
void *decl;
|
||||
}menu_display;
|
||||
|
||||
size_t overlays_size;
|
||||
overlay_t *overlays;
|
||||
} d3d9_video_t;
|
||||
|
||||
static INLINE bool d3d9_swap(void *data, LPDIRECT3DDEVICE9 dev)
|
||||
{
|
||||
#ifdef _XBOX
|
||||
|
@ -17,8 +17,6 @@
|
||||
#ifndef __D3DVIDEO_INTF_H__
|
||||
#define __D3DVIDEO_INTF_H__
|
||||
|
||||
#include <gfx/math/matrix_4x4.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../../config.h"
|
||||
#endif
|
||||
@ -64,49 +62,5 @@ typedef struct d3d_video_viewport
|
||||
float max_z;
|
||||
} d3d_video_viewport_t;
|
||||
|
||||
typedef struct d3d_video
|
||||
{
|
||||
bool keep_aspect;
|
||||
bool should_resize;
|
||||
bool quitting;
|
||||
bool needs_restore;
|
||||
bool overlays_enabled;
|
||||
/* TODO - refactor this away properly. */
|
||||
bool resolution_hd_enable;
|
||||
|
||||
unsigned cur_mon_id;
|
||||
unsigned dev_rotation;
|
||||
|
||||
overlay_t *menu;
|
||||
const d3d_renderchain_driver_t *renderchain_driver;
|
||||
void *renderchain_data;
|
||||
|
||||
RECT font_rect;
|
||||
RECT font_rect_shifted;
|
||||
math_matrix_4x4 mvp;
|
||||
math_matrix_4x4 mvp_rotate;
|
||||
math_matrix_4x4 mvp_transposed;
|
||||
|
||||
struct video_viewport vp;
|
||||
struct video_shader shader;
|
||||
video_info_t video_info;
|
||||
WNDCLASSEX windowClass;
|
||||
void *dev;
|
||||
d3d_video_viewport_t final_viewport;
|
||||
|
||||
char *shader_path;
|
||||
|
||||
struct
|
||||
{
|
||||
int size;
|
||||
int offset;
|
||||
void *buffer;
|
||||
void *decl;
|
||||
}menu_display;
|
||||
|
||||
size_t overlays_size;
|
||||
overlay_t *overlays;
|
||||
} d3d_video_t;
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -92,7 +92,7 @@ static void d3d8_renderchain_set_mvp(
|
||||
const void *mat_data)
|
||||
{
|
||||
D3DMATRIX matrix;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
|
||||
d3d_matrix_identity(&matrix);
|
||||
|
||||
@ -108,7 +108,7 @@ static void d3d8_renderchain_set_mvp(
|
||||
static bool d3d8_renderchain_create_first_pass(void *data,
|
||||
const video_info_t *info)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
LPDIRECT3DDEVICE8 d3dr = (LPDIRECT3DDEVICE8)d3d->dev;
|
||||
d3d8_renderchain_t *chain = (d3d8_renderchain_t*)d3d->renderchain_data;
|
||||
|
||||
@ -145,7 +145,7 @@ static void d3d8_renderchain_set_vertices(void *data, unsigned pass,
|
||||
unsigned vert_width, unsigned vert_height, uint64_t frame_count)
|
||||
{
|
||||
unsigned width, height;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
d3d8_renderchain_t *chain = d3d ? (d3d8_renderchain_t*)d3d->renderchain_data : NULL;
|
||||
|
||||
video_driver_get_size(&width, &height);
|
||||
@ -254,7 +254,7 @@ static void d3d8_renderchain_viewport_info(void *data,
|
||||
struct video_viewport *vp)
|
||||
{
|
||||
unsigned width, height;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
|
||||
if (!d3d || !vp)
|
||||
return;
|
||||
@ -271,7 +271,7 @@ static void d3d8_renderchain_viewport_info(void *data,
|
||||
}
|
||||
|
||||
static void d3d8_renderchain_render_pass(
|
||||
d3d_video_t *d3d, LPDIRECT3DDEVICE8 d3dr,
|
||||
d3d8_video_t *d3d, LPDIRECT3DDEVICE8 d3dr,
|
||||
d3d8_renderchain_t *chain,
|
||||
unsigned pass_index,
|
||||
unsigned rotation)
|
||||
@ -298,7 +298,7 @@ static bool d3d8_renderchain_render(void *data, const void *frame,
|
||||
unsigned frame_width, unsigned frame_height,
|
||||
unsigned pitch, unsigned rotation)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
LPDIRECT3DDEVICE8 d3dr = (LPDIRECT3DDEVICE8)d3d->dev;
|
||||
d3d8_renderchain_t *chain = (d3d8_renderchain_t*)d3d->renderchain_data;
|
||||
|
||||
@ -320,7 +320,7 @@ static bool d3d8_renderchain_init(void *data,
|
||||
)
|
||||
{
|
||||
unsigned width, height;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
LPDIRECT3DDEVICE8 d3dr = (LPDIRECT3DDEVICE8)d3d->dev;
|
||||
const video_info_t *video_info = (const video_info_t*)_video_info;
|
||||
const struct LinkInfo *link_info = (const struct LinkInfo*)info_data;
|
||||
@ -357,7 +357,7 @@ static void *d3d8_renderchain_new(void)
|
||||
return renderchain;
|
||||
}
|
||||
|
||||
static bool d3d8_init_chain(d3d_video_t *d3d, const video_info_t *video_info)
|
||||
static bool d3d8_init_chain(d3d8_video_t *d3d, const video_info_t *video_info)
|
||||
{
|
||||
struct LinkInfo link_info;
|
||||
unsigned current_width, current_height, out_width, out_height;
|
||||
@ -394,7 +394,7 @@ static bool d3d8_init_chain(d3d_video_t *d3d, const video_info_t *video_info)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool d3d8_init_singlepass(d3d_video_t *d3d)
|
||||
static bool d3d8_init_singlepass(d3d8_video_t *d3d)
|
||||
{
|
||||
struct video_shader_pass *pass = NULL;
|
||||
|
||||
@ -422,7 +422,7 @@ static bool d3d8_init_singlepass(d3d_video_t *d3d)
|
||||
|
||||
static void d3d8_viewport_info(void *data, struct video_viewport *vp)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
|
||||
if (d3d)
|
||||
d3d8_renderchain_viewport_info(d3d, vp);
|
||||
@ -432,12 +432,12 @@ static void d3d8_set_mvp(void *data,
|
||||
void *shader_data,
|
||||
const void *mat_data)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
if (d3d)
|
||||
d3d8_renderchain_set_mvp(d3d, d3d->renderchain_data, shader_data, mat_data);
|
||||
}
|
||||
|
||||
static void d3d8_overlay_render(d3d_video_t *d3d,
|
||||
static void d3d8_overlay_render(d3d8_video_t *d3d,
|
||||
video_frame_info_t *video_info,
|
||||
overlay_t *overlay, bool force_linear)
|
||||
{
|
||||
@ -535,7 +535,7 @@ static void d3d8_overlay_render(d3d_video_t *d3d,
|
||||
d3d8_set_viewports(d3d->dev, &d3d->final_viewport);
|
||||
}
|
||||
|
||||
static void d3d8_free_overlay(d3d_video_t *d3d, overlay_t *overlay)
|
||||
static void d3d8_free_overlay(d3d8_video_t *d3d, overlay_t *overlay)
|
||||
{
|
||||
if (!d3d)
|
||||
return;
|
||||
@ -544,14 +544,14 @@ static void d3d8_free_overlay(d3d_video_t *d3d, overlay_t *overlay)
|
||||
d3d8_vertex_buffer_free(overlay->vert_buf, NULL);
|
||||
}
|
||||
|
||||
static void d3d8_deinit_chain(d3d_video_t *d3d)
|
||||
static void d3d8_deinit_chain(d3d8_video_t *d3d)
|
||||
{
|
||||
d3d8_renderchain_free(d3d->renderchain_data);
|
||||
|
||||
d3d->renderchain_data = NULL;
|
||||
}
|
||||
|
||||
static void d3d8_deinitialize(d3d_video_t *d3d)
|
||||
static void d3d8_deinitialize(d3d8_video_t *d3d)
|
||||
{
|
||||
if (!d3d)
|
||||
return;
|
||||
@ -596,7 +596,7 @@ static bool d3d8_is_windowed_enable(bool info_fullscreen)
|
||||
}
|
||||
|
||||
#ifdef _XBOX
|
||||
static void d3d8_get_video_size(d3d_video_t *d3d,
|
||||
static void d3d8_get_video_size(d3d8_video_t *d3d,
|
||||
unsigned *width, unsigned *height)
|
||||
{
|
||||
DWORD video_mode = XGetVideoFlags();
|
||||
@ -662,7 +662,7 @@ static void d3d8_get_video_size(d3d_video_t *d3d,
|
||||
static void d3d8_make_d3dpp(void *data,
|
||||
const video_info_t *info, void *_d3dpp)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
D3DPRESENT_PARAMETERS *d3dpp = (D3DPRESENT_PARAMETERS*)_d3dpp;
|
||||
bool windowed_enable = d3d8_is_windowed_enable(info->fullscreen);
|
||||
|
||||
@ -762,7 +762,7 @@ static bool d3d8_init_base(void *data, const video_info_t *info)
|
||||
{
|
||||
D3DPRESENT_PARAMETERS d3dpp;
|
||||
HWND focus_window = NULL;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
|
||||
#ifndef _XBOX
|
||||
focus_window = win32_get_window();
|
||||
@ -801,7 +801,7 @@ static void d3d8_calculate_rect(void *data,
|
||||
bool allow_rotate)
|
||||
{
|
||||
float device_aspect = (float)*width / *height;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
video_driver_get_size(width, height);
|
||||
@ -881,7 +881,7 @@ static void d3d8_set_viewport(void *data,
|
||||
D3DMATRIX proj, ortho, rot, matrix;
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
|
||||
d3d8_calculate_rect(data, &width, &height, &x, &y,
|
||||
force_full, allow_rotate);
|
||||
@ -907,7 +907,7 @@ static void d3d8_set_viewport(void *data,
|
||||
d3d_matrix_transpose(&d3d->mvp_rotate, &matrix);
|
||||
}
|
||||
|
||||
static bool d3d8_initialize(d3d_video_t *d3d, const video_info_t *info)
|
||||
static bool d3d8_initialize(d3d8_video_t *d3d, const video_info_t *info)
|
||||
{
|
||||
unsigned width, height;
|
||||
bool ret = true;
|
||||
@ -982,7 +982,7 @@ static bool d3d8_initialize(d3d_video_t *d3d, const video_info_t *info)
|
||||
|
||||
static bool d3d8_restore(void *data)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
|
||||
if (!d3d)
|
||||
return false;
|
||||
@ -1004,7 +1004,7 @@ static bool d3d8_restore(void *data)
|
||||
static void d3d8_set_nonblock_state(void *data, bool state)
|
||||
{
|
||||
unsigned interval = state ? 0 : 1;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
|
||||
if (!d3d)
|
||||
return;
|
||||
@ -1022,7 +1022,7 @@ static void d3d8_set_nonblock_state(void *data, bool state)
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool d3d8_set_resize(d3d_video_t *d3d,
|
||||
static bool d3d8_set_resize(d3d8_video_t *d3d,
|
||||
unsigned new_width, unsigned new_height)
|
||||
{
|
||||
/* No changes? */
|
||||
@ -1043,7 +1043,7 @@ static bool d3d8_alive(void *data)
|
||||
unsigned temp_width = 0;
|
||||
unsigned temp_height = 0;
|
||||
bool ret = false;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
bool quit = false;
|
||||
bool resize = false;
|
||||
|
||||
@ -1083,7 +1083,7 @@ static bool d3d8_suppress_screensaver(void *data, bool enable)
|
||||
|
||||
static void d3d8_set_aspect_ratio(void *data, unsigned aspect_ratio_idx)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
|
||||
switch (aspect_ratio_idx)
|
||||
{
|
||||
@ -1115,7 +1115,7 @@ static void d3d8_set_aspect_ratio(void *data, unsigned aspect_ratio_idx)
|
||||
|
||||
static void d3d8_apply_state_changes(void *data)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
if (d3d)
|
||||
d3d->should_resize = true;
|
||||
}
|
||||
@ -1125,7 +1125,7 @@ static void d3d8_set_osd_msg(void *data,
|
||||
const char *msg,
|
||||
const void *params, void *font)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
|
||||
d3d8_begin_scene(d3d->dev);
|
||||
font_driver_render_msg(video_info, font, msg, params);
|
||||
@ -1163,7 +1163,7 @@ static void d3d8_input_driver(
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool d3d8_init_internal(d3d_video_t *d3d,
|
||||
static bool d3d8_init_internal(d3d8_video_t *d3d,
|
||||
const video_info_t *info, const input_driver_t **input,
|
||||
void **input_data)
|
||||
{
|
||||
@ -1259,7 +1259,7 @@ static bool d3d8_init_internal(d3d_video_t *d3d,
|
||||
|
||||
static void d3d8_set_rotation(void *data, unsigned rot)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
|
||||
if (!d3d)
|
||||
return;
|
||||
@ -1278,7 +1278,7 @@ static void d3d8_show_mouse(void *data, bool state)
|
||||
static void *d3d8_init(const video_info_t *info,
|
||||
const input_driver_t **input, void **input_data)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)calloc(1, sizeof(*d3d));
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)calloc(1, sizeof(*d3d));
|
||||
|
||||
if (!d3d)
|
||||
return NULL;
|
||||
@ -1317,7 +1317,7 @@ static void *d3d8_init(const video_info_t *info,
|
||||
}
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
static void d3d8_free_overlays(d3d_video_t *d3d)
|
||||
static void d3d8_free_overlays(d3d8_video_t *d3d)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
@ -1334,7 +1334,7 @@ static void d3d8_free_overlays(d3d_video_t *d3d)
|
||||
|
||||
static void d3d8_free(void *data)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
|
||||
if (!d3d)
|
||||
return;
|
||||
@ -1378,7 +1378,7 @@ static void d3d8_overlay_tex_geom(
|
||||
float x, float y,
|
||||
float w, float h)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
if (!d3d)
|
||||
return;
|
||||
|
||||
@ -1400,7 +1400,7 @@ static void d3d8_overlay_vertex_geom(
|
||||
float x, float y,
|
||||
float w, float h)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
if (!d3d)
|
||||
return;
|
||||
|
||||
@ -1417,7 +1417,7 @@ static bool d3d8_overlay_load(void *data,
|
||||
{
|
||||
unsigned i, y;
|
||||
overlay_t *new_overlays = NULL;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
const struct texture_image *images = (const struct texture_image*)
|
||||
image_data;
|
||||
|
||||
@ -1474,7 +1474,7 @@ static bool d3d8_overlay_load(void *data,
|
||||
static void d3d8_overlay_enable(void *data, bool state)
|
||||
{
|
||||
unsigned i;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
|
||||
if (!d3d)
|
||||
return;
|
||||
@ -1488,7 +1488,7 @@ static void d3d8_overlay_enable(void *data, bool state)
|
||||
static void d3d8_overlay_full_screen(void *data, bool enable)
|
||||
{
|
||||
unsigned i;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
|
||||
for (i = 0; i < d3d->overlays_size; i++)
|
||||
d3d->overlays[i].fullscreen = enable;
|
||||
@ -1496,7 +1496,7 @@ static void d3d8_overlay_full_screen(void *data, bool enable)
|
||||
|
||||
static void d3d8_overlay_set_alpha(void *data, unsigned index, float mod)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
if (d3d)
|
||||
d3d->overlays[index].alpha_mod = mod;
|
||||
}
|
||||
@ -1559,7 +1559,7 @@ static bool d3d8_frame(void *data, const void *frame,
|
||||
{
|
||||
D3DVIEWPORT8 screen_vp;
|
||||
unsigned i = 0;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
unsigned width = video_info->width;
|
||||
unsigned height = video_info->height;
|
||||
(void)i;
|
||||
@ -1683,7 +1683,7 @@ static void d3d8_set_menu_texture_frame(void *data,
|
||||
float alpha)
|
||||
{
|
||||
D3DLOCKED_RECT d3dlr;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
|
||||
(void)d3dlr;
|
||||
(void)frame;
|
||||
@ -1768,7 +1768,7 @@ static void d3d8_set_menu_texture_frame(void *data,
|
||||
static void d3d8_set_menu_texture_enable(void *data,
|
||||
bool state, bool full_screen)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
|
||||
if (!d3d || !d3d->menu)
|
||||
return;
|
||||
@ -1790,7 +1790,7 @@ static void d3d8_video_texture_load_d3d(
|
||||
{
|
||||
D3DLOCKED_RECT d3dlr;
|
||||
unsigned usage = 0;
|
||||
d3d_video_t *d3d = (d3d_video_t*)info->userdata;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)info->userdata;
|
||||
struct texture_image *ti = (struct texture_image*)info->data;
|
||||
LPDIRECT3DTEXTURE8 tex = (LPDIRECT3DTEXTURE8)d3d8_texture_new(d3d->dev, NULL,
|
||||
ti->width, ti->height, 0,
|
||||
|
@ -74,7 +74,7 @@ void *dinput;
|
||||
static bool d3d9_widescreen_mode = false;
|
||||
#endif
|
||||
|
||||
static bool d3d9_set_resize(d3d_video_t *d3d,
|
||||
static bool d3d9_set_resize(d3d9_video_t *d3d,
|
||||
unsigned new_width, unsigned new_height)
|
||||
{
|
||||
/* No changes? */
|
||||
@ -90,7 +90,7 @@ static bool d3d9_set_resize(d3d_video_t *d3d,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool d3d9_init_imports(d3d_video_t *d3d)
|
||||
static bool d3d9_init_imports(d3d9_video_t *d3d)
|
||||
{
|
||||
retro_ctx_memory_info_t mem_info;
|
||||
state_tracker_t *state_tracker = NULL;
|
||||
@ -182,7 +182,7 @@ static bool renderchain_d3d_init_first(
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool d3d9_init_chain(d3d_video_t *d3d, const video_info_t *video_info)
|
||||
static bool d3d9_init_chain(d3d9_video_t *d3d, const video_info_t *video_info)
|
||||
{
|
||||
struct LinkInfo link_info;
|
||||
unsigned current_width, current_height, out_width, out_height;
|
||||
@ -289,7 +289,7 @@ static bool d3d9_init_chain(d3d_video_t *d3d, const video_info_t *video_info)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool d3d9_init_singlepass(d3d_video_t *d3d)
|
||||
static bool d3d9_init_singlepass(d3d9_video_t *d3d)
|
||||
{
|
||||
struct video_shader_pass *pass = NULL;
|
||||
|
||||
@ -315,7 +315,7 @@ static bool d3d9_init_singlepass(d3d_video_t *d3d)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool d3d9_init_multipass(d3d_video_t *d3d, const char *shader_path)
|
||||
static bool d3d9_init_multipass(d3d9_video_t *d3d, const char *shader_path)
|
||||
{
|
||||
unsigned i;
|
||||
bool use_extra_pass = false;
|
||||
@ -383,7 +383,7 @@ static bool d3d9_init_multipass(d3d_video_t *d3d, const char *shader_path)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool d3d9_process_shader(d3d_video_t *d3d)
|
||||
static bool d3d9_process_shader(d3d9_video_t *d3d)
|
||||
{
|
||||
const char *shader_path = d3d->shader_path;
|
||||
if (d3d && !string_is_empty(shader_path) &&
|
||||
@ -395,7 +395,7 @@ static bool d3d9_process_shader(d3d_video_t *d3d)
|
||||
|
||||
static void d3d9_viewport_info(void *data, struct video_viewport *vp)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
|
||||
if ( d3d &&
|
||||
d3d->renderchain_driver &&
|
||||
@ -407,11 +407,11 @@ static void d3d9_set_mvp(void *data,
|
||||
void *shader_data,
|
||||
const void *mat_data)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
d3d9_set_vertex_shader_constantf((LPDIRECT3DDEVICE9)d3d->dev, 0, (const float*)mat_data, 4);
|
||||
}
|
||||
|
||||
static void d3d9_overlay_render(d3d_video_t *d3d,
|
||||
static void d3d9_overlay_render(d3d9_video_t *d3d,
|
||||
video_frame_info_t *video_info,
|
||||
overlay_t *overlay, bool force_linear)
|
||||
{
|
||||
@ -529,7 +529,7 @@ static void d3d9_overlay_render(d3d_video_t *d3d,
|
||||
d3d9_set_viewports(dev, &d3d->final_viewport);
|
||||
}
|
||||
|
||||
static void d3d9_free_overlay(d3d_video_t *d3d, overlay_t *overlay)
|
||||
static void d3d9_free_overlay(d3d9_video_t *d3d, overlay_t *overlay)
|
||||
{
|
||||
if (!d3d)
|
||||
return;
|
||||
@ -538,7 +538,7 @@ static void d3d9_free_overlay(d3d_video_t *d3d, overlay_t *overlay)
|
||||
d3d9_vertex_buffer_free(overlay->vert_buf, NULL);
|
||||
}
|
||||
|
||||
static void d3d9_deinit_chain(d3d_video_t *d3d)
|
||||
static void d3d9_deinit_chain(d3d9_video_t *d3d)
|
||||
{
|
||||
if (!d3d || !d3d->renderchain_driver)
|
||||
return;
|
||||
@ -550,7 +550,7 @@ static void d3d9_deinit_chain(d3d_video_t *d3d)
|
||||
d3d->renderchain_data = NULL;
|
||||
}
|
||||
|
||||
static void d3d9_deinitialize(d3d_video_t *d3d)
|
||||
static void d3d9_deinitialize(d3d9_video_t *d3d)
|
||||
{
|
||||
if (!d3d)
|
||||
return;
|
||||
@ -600,7 +600,7 @@ static bool d3d9_is_windowed_enable(bool info_fullscreen)
|
||||
}
|
||||
|
||||
#ifdef _XBOX
|
||||
static void d3d9_get_video_size(d3d_video_t *d3d,
|
||||
static void d3d9_get_video_size(d3d9_video_t *d3d,
|
||||
unsigned *width, unsigned *height)
|
||||
{
|
||||
XVIDEO_MODE video_mode;
|
||||
@ -631,7 +631,7 @@ static void d3d9_get_video_size(d3d_video_t *d3d,
|
||||
void d3d9_make_d3dpp(void *data,
|
||||
const video_info_t *info, void *_d3dpp)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
D3DPRESENT_PARAMETERS *d3dpp = (D3DPRESENT_PARAMETERS*)_d3dpp;
|
||||
#ifdef _XBOX
|
||||
/* TODO/FIXME - get rid of global state dependencies. */
|
||||
@ -711,11 +711,11 @@ void d3d9_make_d3dpp(void *data,
|
||||
static bool d3d9_init_base(void *data, const video_info_t *info)
|
||||
{
|
||||
D3DPRESENT_PARAMETERS d3dpp;
|
||||
HWND focus_window = NULL;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
HWND focus_window = NULL;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
|
||||
#ifndef _XBOX
|
||||
focus_window = win32_get_window();
|
||||
focus_window = win32_get_window();
|
||||
#endif
|
||||
|
||||
memset(&d3dpp, 0, sizeof(d3dpp));
|
||||
@ -750,9 +750,9 @@ static void d3d9_calculate_rect(void *data,
|
||||
bool force_full,
|
||||
bool allow_rotate)
|
||||
{
|
||||
float device_aspect = (float)*width / *height;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
settings_t *settings = config_get_ptr();
|
||||
float device_aspect = (float)*width / *height;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
video_driver_get_size(width, height);
|
||||
|
||||
@ -830,7 +830,7 @@ static void d3d9_set_viewport(void *data,
|
||||
{
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
|
||||
d3d9_calculate_rect(data, &width, &height, &x, &y,
|
||||
force_full, allow_rotate);
|
||||
@ -852,7 +852,7 @@ static void d3d9_set_viewport(void *data,
|
||||
d3d->renderchain_driver->set_font_rect(d3d, NULL);
|
||||
}
|
||||
|
||||
static bool d3d9_initialize(d3d_video_t *d3d, const video_info_t *info)
|
||||
static bool d3d9_initialize(d3d9_video_t *d3d, const video_info_t *info)
|
||||
{
|
||||
unsigned width, height;
|
||||
bool ret = true;
|
||||
@ -950,7 +950,7 @@ static bool d3d9_initialize(d3d_video_t *d3d, const video_info_t *info)
|
||||
|
||||
static bool d3d9_restore(void *data)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
|
||||
if (!d3d)
|
||||
return false;
|
||||
@ -972,7 +972,7 @@ static bool d3d9_restore(void *data)
|
||||
static void d3d9_set_nonblock_state(void *data, bool state)
|
||||
{
|
||||
unsigned interval = state ? 0 : 1;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
|
||||
if (!d3d)
|
||||
return;
|
||||
@ -993,12 +993,12 @@ static void d3d9_set_nonblock_state(void *data, bool state)
|
||||
|
||||
static bool d3d9_alive(void *data)
|
||||
{
|
||||
unsigned temp_width = 0;
|
||||
unsigned temp_height = 0;
|
||||
bool ret = false;
|
||||
bool quit = false;
|
||||
bool resize = false;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
unsigned temp_width = 0;
|
||||
unsigned temp_height = 0;
|
||||
bool ret = false;
|
||||
bool quit = false;
|
||||
bool resize = false;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
|
||||
/* Needed because some context drivers don't track their sizes */
|
||||
video_driver_get_size(&temp_width, &temp_height);
|
||||
@ -1037,7 +1037,7 @@ static bool d3d9_suppress_screensaver(void *data, bool enable)
|
||||
|
||||
static void d3d9_set_aspect_ratio(void *data, unsigned aspect_ratio_idx)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
|
||||
switch (aspect_ratio_idx)
|
||||
{
|
||||
@ -1069,7 +1069,7 @@ static void d3d9_set_aspect_ratio(void *data, unsigned aspect_ratio_idx)
|
||||
|
||||
static void d3d9_apply_state_changes(void *data)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
if (d3d)
|
||||
d3d->should_resize = true;
|
||||
}
|
||||
@ -1079,8 +1079,8 @@ static void d3d9_set_osd_msg(void *data,
|
||||
const char *msg,
|
||||
const void *params, void *font)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
LPDIRECT3DDEVICE9 dev = (LPDIRECT3DDEVICE9)d3d->dev;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
LPDIRECT3DDEVICE9 dev = (LPDIRECT3DDEVICE9)d3d->dev;
|
||||
|
||||
if (d3d->renderchain_driver->set_font_rect && params)
|
||||
d3d->renderchain_driver->set_font_rect(d3d, params);
|
||||
@ -1122,7 +1122,7 @@ static void d3d9_input_driver(
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool d3d9_init_internal(d3d_video_t *d3d,
|
||||
static bool d3d9_init_internal(d3d9_video_t *d3d,
|
||||
const video_info_t *info, const input_driver_t **input,
|
||||
void **input_data)
|
||||
{
|
||||
@ -1242,7 +1242,7 @@ static bool d3d9_init_internal(d3d_video_t *d3d,
|
||||
|
||||
static void d3d9_set_rotation(void *data, unsigned rot)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
struct video_ortho ortho = {0, 1, 0, 1, -1, 1};
|
||||
|
||||
if (!d3d)
|
||||
@ -1261,7 +1261,7 @@ static void d3d9_show_mouse(void *data, bool state)
|
||||
static void *d3d9_init(const video_info_t *info,
|
||||
const input_driver_t **input, void **input_data)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)calloc(1, sizeof(*d3d));
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)calloc(1, sizeof(*d3d));
|
||||
|
||||
if (!d3d)
|
||||
return NULL;
|
||||
@ -1300,7 +1300,7 @@ static void *d3d9_init(const video_info_t *info,
|
||||
}
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
static void d3d9_free_overlays(d3d_video_t *d3d)
|
||||
static void d3d9_free_overlays(d3d9_video_t *d3d)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
@ -1317,7 +1317,7 @@ static void d3d9_free_overlays(d3d_video_t *d3d)
|
||||
|
||||
static void d3d9_free(void *data)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
|
||||
if (!d3d)
|
||||
return;
|
||||
@ -1361,7 +1361,8 @@ static void d3d9_overlay_tex_geom(
|
||||
float x, float y,
|
||||
float w, float h)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
|
||||
if (!d3d)
|
||||
return;
|
||||
|
||||
@ -1377,7 +1378,8 @@ static void d3d9_overlay_vertex_geom(
|
||||
float x, float y,
|
||||
float w, float h)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
|
||||
if (!d3d)
|
||||
return;
|
||||
|
||||
@ -1394,7 +1396,7 @@ static bool d3d9_overlay_load(void *data,
|
||||
{
|
||||
unsigned i, y;
|
||||
overlay_t *new_overlays = NULL;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
const struct texture_image *images = (const struct texture_image*)
|
||||
image_data;
|
||||
|
||||
@ -1451,7 +1453,7 @@ static bool d3d9_overlay_load(void *data,
|
||||
static void d3d9_overlay_enable(void *data, bool state)
|
||||
{
|
||||
unsigned i;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
|
||||
if (!d3d)
|
||||
return;
|
||||
@ -1465,7 +1467,7 @@ static void d3d9_overlay_enable(void *data, bool state)
|
||||
static void d3d9_overlay_full_screen(void *data, bool enable)
|
||||
{
|
||||
unsigned i;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
|
||||
for (i = 0; i < d3d->overlays_size; i++)
|
||||
d3d->overlays[i].fullscreen = enable;
|
||||
@ -1473,7 +1475,7 @@ static void d3d9_overlay_full_screen(void *data, bool enable)
|
||||
|
||||
static void d3d9_overlay_set_alpha(void *data, unsigned index, float mod)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
if (d3d)
|
||||
d3d->overlays[index].alpha_mod = mod;
|
||||
}
|
||||
@ -1538,7 +1540,7 @@ static bool d3d9_frame(void *data, const void *frame,
|
||||
{
|
||||
D3DVIEWPORT9 screen_vp;
|
||||
unsigned i = 0;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
unsigned width = video_info->width;
|
||||
unsigned height = video_info->height;
|
||||
(void)i;
|
||||
@ -1656,7 +1658,7 @@ static bool d3d9_frame(void *data, const void *frame,
|
||||
|
||||
static bool d3d9_read_viewport(void *data, uint8_t *buffer, bool is_idle)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
|
||||
if ( !d3d ||
|
||||
!d3d->renderchain_driver ||
|
||||
@ -1669,7 +1671,7 @@ static bool d3d9_read_viewport(void *data, uint8_t *buffer, bool is_idle)
|
||||
static bool d3d9_set_shader(void *data,
|
||||
enum rarch_shader_type type, const char *path)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
char *old_shader = (d3d && !string_is_empty(d3d->shader_path)) ? strdup(d3d->shader_path) : NULL;
|
||||
|
||||
if (!string_is_empty(d3d->shader_path))
|
||||
@ -1708,7 +1710,7 @@ static void d3d9_set_menu_texture_frame(void *data,
|
||||
float alpha)
|
||||
{
|
||||
D3DLOCKED_RECT d3dlr;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
|
||||
(void)d3dlr;
|
||||
(void)frame;
|
||||
@ -1789,7 +1791,7 @@ static void d3d9_set_menu_texture_frame(void *data,
|
||||
static void d3d9_set_menu_texture_enable(void *data,
|
||||
bool state, bool full_screen)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
|
||||
if (!d3d || !d3d->menu)
|
||||
return;
|
||||
@ -1813,7 +1815,7 @@ static void d3d9_video_texture_load_d3d(
|
||||
LPDIRECT3DTEXTURE9 tex = NULL;
|
||||
unsigned usage = 0;
|
||||
bool want_mipmap = false;
|
||||
d3d_video_t *d3d = (d3d_video_t*)info->userdata;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)info->userdata;
|
||||
struct texture_image *ti = (struct texture_image*)info->data;
|
||||
|
||||
if (!ti)
|
||||
|
@ -48,7 +48,7 @@ typedef struct d3dx_font_desc
|
||||
|
||||
typedef struct
|
||||
{
|
||||
d3d_video_t *d3d;
|
||||
d3d9_video_t *d3d;
|
||||
void *font;
|
||||
uint32_t font_size;
|
||||
uint32_t ascent;
|
||||
@ -80,7 +80,7 @@ static void *d3dfonts_w32_init_font(void *video_data,
|
||||
#endif
|
||||
|
||||
d3dfonts->font_size = font_size * 1.2; /* to match the other font drivers */
|
||||
d3dfonts->d3d = (d3d_video_t*)video_data;
|
||||
d3dfonts->d3d = (d3d9_video_t*)video_data;
|
||||
|
||||
desc.Height = d3dfonts->font_size;
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
d3d_video_t *d3d;
|
||||
d3d8_video_t *d3d;
|
||||
XFONT *debug_font;
|
||||
D3DSurface *surf;
|
||||
} xfonts_t;
|
||||
@ -46,7 +46,7 @@ static void *xfonts_init_font(void *video_data,
|
||||
(void)font_path;
|
||||
(void)font_size;
|
||||
|
||||
xfont->d3d = (d3d_video_t*)video_data;
|
||||
xfont->d3d = (d3d8_video_t*)video_data;
|
||||
|
||||
XFONT_OpenDefaultFont(&xfont->debug_font);
|
||||
|
||||
|
@ -255,7 +255,7 @@ typedef struct
|
||||
typedef struct
|
||||
{
|
||||
Font_Locals_t s_FontLocals;
|
||||
d3d_video_t *d3d;
|
||||
d3d9_video_t *d3d;
|
||||
uint32_t m_dwSavedState;
|
||||
uint32_t m_cMaxGlyph; /* Number of entries in the translator table. */
|
||||
uint32_t m_dwNumGlyphs; /* Number of valid glyphs. */
|
||||
@ -360,7 +360,7 @@ static void *xdk360_init_font(void *video_data,
|
||||
|
||||
(void)font_size;
|
||||
|
||||
font->d3d = (d3d_video_t*)video_data;
|
||||
font->d3d = (d3d9_video_t*)video_data;
|
||||
|
||||
font->m_pFontTexture = NULL;
|
||||
font->m_dwNumGlyphs = 0L;
|
||||
|
@ -776,7 +776,7 @@ static void *d3d9_cg_renderchain_new(void)
|
||||
static bool d3d9_cg_renderchain_init_shader(void *data,
|
||||
void *renderchain_data)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
cg_renderchain_t *renderchain = (cg_renderchain_t*)renderchain_data;
|
||||
|
||||
if (!d3d || !renderchain)
|
||||
@ -913,7 +913,7 @@ static bool d3d9_cg_renderchain_init(void *data,
|
||||
const void *info_data, bool rgb32)
|
||||
{
|
||||
const struct LinkInfo *info = (const struct LinkInfo*)info_data;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
cg_renderchain_t *chain = (cg_renderchain_t*)d3d->renderchain_data;
|
||||
const video_info_t *video_info = (const video_info_t*)_video_info;
|
||||
unsigned fmt = (rgb32) ? RETRO_PIXEL_FORMAT_XRGB8888 : RETRO_PIXEL_FORMAT_RGB565;
|
||||
@ -1027,7 +1027,7 @@ static void d3d9_cg_renderchain_convert_geometry(
|
||||
}
|
||||
|
||||
static void d3d_recompute_pass_sizes(cg_renderchain_t *chain,
|
||||
d3d_video_t *d3d)
|
||||
d3d9_video_t *d3d)
|
||||
{
|
||||
unsigned i;
|
||||
struct LinkInfo link_info;
|
||||
@ -1076,7 +1076,7 @@ static void d3d9_cg_renderchain_set_final_viewport(
|
||||
void *renderchain_data,
|
||||
const void *viewport_data)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
cg_renderchain_t *chain = (cg_renderchain_t*)renderchain_data;
|
||||
const D3DVIEWPORT9 *final_viewport = (const D3DVIEWPORT9*)viewport_data;
|
||||
|
||||
@ -1493,7 +1493,7 @@ static bool d3d9_cg_renderchain_render(
|
||||
LPDIRECT3DSURFACE9 back_buffer, target;
|
||||
unsigned i, current_width, current_height, out_width = 0, out_height = 0;
|
||||
struct Pass *last_pass = NULL;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
cg_renderchain_t *chain = d3d ? (cg_renderchain_t*)d3d->renderchain_data : NULL;
|
||||
|
||||
d3d9_cg_renderchain_start_render(chain);
|
||||
@ -1596,7 +1596,7 @@ static void d3d9_cg_renderchain_set_font_rect(
|
||||
const void *font_data)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
float pos_x = settings->floats.video_msg_pos_x;
|
||||
float pos_y = settings->floats.video_msg_pos_y;
|
||||
float font_size = settings->floats.video_font_size;
|
||||
@ -1632,7 +1632,7 @@ static bool d3d9_cg_renderchain_read_viewport(
|
||||
LPDIRECT3DSURFACE9 target = NULL;
|
||||
LPDIRECT3DSURFACE9 dest = NULL;
|
||||
bool ret = true;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
LPDIRECT3DDEVICE9 d3dr = (LPDIRECT3DDEVICE9)d3d->dev;
|
||||
|
||||
video_driver_get_size(&width, &height);
|
||||
@ -1690,7 +1690,7 @@ static void d3d9_cg_renderchain_viewport_info(
|
||||
void *data, struct video_viewport *vp)
|
||||
{
|
||||
unsigned width, height;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
|
||||
if (!d3d || !vp)
|
||||
return;
|
||||
|
@ -63,8 +63,8 @@ static bool hlsl_d3d9_renderchain_init_shader_fvf(void *data, void *pass_data)
|
||||
{ 0, 2 * sizeof(float), D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 },
|
||||
D3DDECL_END()
|
||||
};
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d_video_t *pass = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
d3d9_video_t *pass = (d3d9_video_t*)data;
|
||||
hlsl_d3d9_renderchain_t *chain = (hlsl_d3d9_renderchain_t*)
|
||||
d3d->renderchain_data;
|
||||
|
||||
@ -77,7 +77,7 @@ static bool hlsl_d3d9_renderchain_init_shader_fvf(void *data, void *pass_data)
|
||||
static bool hlsl_d3d9_renderchain_create_first_pass(void *data,
|
||||
const video_info_t *info)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
hlsl_d3d9_renderchain_t *chain = (hlsl_d3d9_renderchain_t*)
|
||||
d3d->renderchain_data;
|
||||
|
||||
@ -122,7 +122,7 @@ static void hlsl_d3d9_renderchain_set_vertices(
|
||||
video_shader_ctx_params_t params;
|
||||
video_shader_ctx_info_t shader_info;
|
||||
unsigned width, height;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
hlsl_d3d9_renderchain_t *chain = d3d ?
|
||||
(hlsl_d3d9_renderchain_t*)d3d->renderchain_data : NULL;
|
||||
|
||||
@ -242,7 +242,7 @@ static void hlsl_d3d9_renderchain_deinit_shader(void *data)
|
||||
|
||||
static void hlsl_d3d9_renderchain_free(void *data)
|
||||
{
|
||||
d3d_video_t *chain = (d3d_video_t*)data;
|
||||
d3d9_video_t *chain = (d3d9_video_t*)data;
|
||||
|
||||
if (!chain)
|
||||
return;
|
||||
@ -266,7 +266,7 @@ static bool hlsl_d3d9_renderchain_init_shader(void *data,
|
||||
void *renderchain_data)
|
||||
{
|
||||
video_shader_ctx_init_t init;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
settings_t *settings = config_get_ptr();
|
||||
(void)renderchain_data;
|
||||
|
||||
@ -292,7 +292,7 @@ static bool hlsl_d3d9_renderchain_init(void *data,
|
||||
)
|
||||
{
|
||||
unsigned width, height;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
const video_info_t *video_info = (const video_info_t*)_video_info;
|
||||
const struct LinkInfo *link_info = (const struct LinkInfo*)info_data;
|
||||
hlsl_d3d9_renderchain_t *chain = (hlsl_d3d9_renderchain_t*)
|
||||
@ -342,7 +342,7 @@ static bool hlsl_d3d9_renderchain_render(void *data, const void *frame,
|
||||
{
|
||||
unsigned i;
|
||||
unsigned width, height;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
settings_t *settings = config_get_ptr();
|
||||
hlsl_d3d9_renderchain_t *chain = (hlsl_d3d9_renderchain_t*)d3d->renderchain_data;
|
||||
bool video_smooth = settings->bools.video_smooth;
|
||||
@ -411,7 +411,7 @@ static void hlsl_d3d9_renderchain_viewport_info(
|
||||
void *data, struct video_viewport *vp)
|
||||
{
|
||||
unsigned width, height;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
|
||||
if (!d3d || !vp)
|
||||
return;
|
||||
|
@ -454,8 +454,8 @@ error:
|
||||
static void *hlsl_init(void *data, const char *path)
|
||||
{
|
||||
unsigned i;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
hlsl_shader_data_t *hlsl = (hlsl_shader_data_t*)
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
hlsl_shader_data_t *hlsl = (hlsl_shader_data_t*)
|
||||
calloc(1, sizeof(hlsl_shader_data_t));
|
||||
|
||||
if (!hlsl || !d3d)
|
||||
|
@ -279,7 +279,7 @@ void d3d9_make_d3dpp(void *data, const video_info_t *info, void *_d3dpp);
|
||||
static void* xui_init(void **userdata, bool video_is_threaded)
|
||||
{
|
||||
HRESULT hr;
|
||||
d3d_video_t *d3d = NULL;
|
||||
d3d9_video_t *d3d = NULL;
|
||||
D3DPRESENT_PARAMETERS d3dpp = {0};
|
||||
video_info_t video_info = {0};
|
||||
TypefaceDescriptor typeface = {0};
|
||||
@ -289,7 +289,7 @@ static void* xui_init(void **userdata, bool video_is_threaded)
|
||||
if (!menu)
|
||||
return NULL;
|
||||
|
||||
d3d = (d3d_video_t*)video_driver_get_ptr(false);
|
||||
d3d = (d3d9_video_t*)video_driver_get_ptr(false);
|
||||
|
||||
if (d3d->resolution_hd_enable)
|
||||
RARCH_LOG("HD menus enabled.\n");
|
||||
@ -379,7 +379,7 @@ static void xui_render_message(const char *msg)
|
||||
size_t i = 0;
|
||||
size_t j = 0;
|
||||
struct string_list *list = NULL;
|
||||
d3d_video_t *d3d = (d3d_video_t*)video_driver_get_ptr(false);
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)video_driver_get_ptr(false);
|
||||
|
||||
if (!d3d)
|
||||
return;
|
||||
@ -418,7 +418,7 @@ static void xui_frame(void *data, video_frame_info_t *video_info)
|
||||
D3DXMATRIX matOrigView;
|
||||
const char *message = NULL;
|
||||
D3DVIEWPORT9 vp_full = {0};
|
||||
d3d_video_t *d3d = (d3d_video_t*)video_driver_get_ptr(false);
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)video_driver_get_ptr(false);
|
||||
|
||||
if (!d3d)
|
||||
return;
|
||||
|
@ -81,8 +81,8 @@ static INT32 menu_display_prim_to_d3d8_enum(
|
||||
|
||||
static void menu_display_d3d8_blend_begin(video_frame_info_t *video_info)
|
||||
{
|
||||
d3d_video_t *d3d = video_info ?
|
||||
(d3d_video_t*)video_info->userdata : NULL;
|
||||
d3d8_video_t *d3d = video_info ?
|
||||
(d3d8_video_t*)video_info->userdata : NULL;
|
||||
|
||||
if (!d3d)
|
||||
return;
|
||||
@ -92,8 +92,8 @@ static void menu_display_d3d8_blend_begin(video_frame_info_t *video_info)
|
||||
|
||||
static void menu_display_d3d8_blend_end(video_frame_info_t *video_info)
|
||||
{
|
||||
d3d_video_t *d3d = video_info ?
|
||||
(d3d_video_t*)video_info->userdata : NULL;
|
||||
d3d8_video_t *d3d = video_info ?
|
||||
(d3d8_video_t*)video_info->userdata : NULL;
|
||||
|
||||
if (!d3d)
|
||||
return;
|
||||
@ -105,7 +105,7 @@ static void menu_display_d3d8_viewport(void *data, video_frame_info_t *video_inf
|
||||
{
|
||||
}
|
||||
|
||||
static void menu_display_d3d8_bind_texture(void *data, d3d_video_t *d3d)
|
||||
static void menu_display_d3d8_bind_texture(void *data, d3d8_video_t *d3d)
|
||||
{
|
||||
menu_display_ctx_draw_t *draw = (menu_display_ctx_draw_t*)data;
|
||||
|
||||
@ -125,7 +125,7 @@ static void menu_display_d3d8_draw(void *data, video_frame_info_t *video_info)
|
||||
video_shader_ctx_mvp_t mvp;
|
||||
math_matrix_4x4 mop, m1, m2;
|
||||
unsigned width, height;
|
||||
d3d_video_t *d3d = video_info ? (d3d_video_t*)video_info->userdata : NULL;
|
||||
d3d8_video_t *d3d = video_info ? (d3d8_video_t*)video_info->userdata : NULL;
|
||||
menu_display_ctx_draw_t *draw = (menu_display_ctx_draw_t*)data;
|
||||
Vertex * pv = NULL;
|
||||
const float *vertex = NULL;
|
||||
@ -216,7 +216,7 @@ static void menu_display_d3d8_draw(void *data, video_frame_info_t *video_info)
|
||||
mvp.data = d3d;
|
||||
mvp.matrix = &m1;
|
||||
video_driver_set_mvp(&mvp);
|
||||
menu_display_d3d8_bind_texture(draw, (d3d_video_t*)video_info->userdata);
|
||||
menu_display_d3d8_bind_texture(draw, (d3d8_video_t*)video_info->userdata);
|
||||
d3d8_draw_primitive(d3d->dev,
|
||||
menu_display_prim_to_d3d8_enum(draw->prim_type),
|
||||
d3d->menu_display.offset,
|
||||
@ -241,8 +241,8 @@ static void menu_display_d3d8_clear_color(
|
||||
menu_display_ctx_clearcolor_t *clearcolor, video_frame_info_t *video_info)
|
||||
{
|
||||
DWORD clear_color = 0;
|
||||
d3d_video_t *d3d = video_info ?
|
||||
(d3d_video_t*)video_info->userdata : NULL;
|
||||
d3d8_video_t *d3d = video_info ?
|
||||
(d3d8_video_t*)video_info->userdata : NULL;
|
||||
|
||||
if (!d3d || !clearcolor)
|
||||
return;
|
||||
|
@ -81,8 +81,8 @@ static INT32 menu_display_prim_to_d3d9_enum(
|
||||
|
||||
static void menu_display_d3d9_blend_begin(video_frame_info_t *video_info)
|
||||
{
|
||||
d3d_video_t *d3d = video_info ?
|
||||
(d3d_video_t*)video_info->userdata : NULL;
|
||||
d3d9_video_t *d3d = video_info ?
|
||||
(d3d9_video_t*)video_info->userdata : NULL;
|
||||
|
||||
if (!d3d)
|
||||
return;
|
||||
@ -92,8 +92,8 @@ static void menu_display_d3d9_blend_begin(video_frame_info_t *video_info)
|
||||
|
||||
static void menu_display_d3d9_blend_end(video_frame_info_t *video_info)
|
||||
{
|
||||
d3d_video_t *d3d = video_info ?
|
||||
(d3d_video_t*)video_info->userdata : NULL;
|
||||
d3d9_video_t *d3d = video_info ?
|
||||
(d3d9_video_t*)video_info->userdata : NULL;
|
||||
|
||||
if (!d3d)
|
||||
return;
|
||||
@ -105,7 +105,7 @@ static void menu_display_d3d9_viewport(void *data, video_frame_info_t *video_inf
|
||||
{
|
||||
}
|
||||
|
||||
static void menu_display_d3d9_bind_texture(void *data, d3d_video_t *d3d)
|
||||
static void menu_display_d3d9_bind_texture(void *data, d3d9_video_t *d3d)
|
||||
{
|
||||
menu_display_ctx_draw_t *draw = (menu_display_ctx_draw_t*)data;
|
||||
LPDIRECT3DDEVICE9 dev;
|
||||
@ -130,7 +130,7 @@ static void menu_display_d3d9_draw(void *data, video_frame_info_t *video_info)
|
||||
math_matrix_4x4 mop, m1, m2;
|
||||
unsigned width, height;
|
||||
LPDIRECT3DDEVICE9 dev;
|
||||
d3d_video_t *d3d = video_info ? (d3d_video_t*)video_info->userdata : NULL;
|
||||
d3d9_video_t *d3d = video_info ? (d3d9_video_t*)video_info->userdata : NULL;
|
||||
menu_display_ctx_draw_t *draw = (menu_display_ctx_draw_t*)data;
|
||||
Vertex * pv = NULL;
|
||||
const float *vertex = NULL;
|
||||
@ -212,7 +212,7 @@ static void menu_display_d3d9_draw(void *data, video_frame_info_t *video_info)
|
||||
mvp.data = d3d;
|
||||
mvp.matrix = &m1;
|
||||
video_driver_set_mvp(&mvp);
|
||||
menu_display_d3d9_bind_texture(draw, (d3d_video_t*)video_info->userdata);
|
||||
menu_display_d3d9_bind_texture(draw, (d3d9_video_t*)video_info->userdata);
|
||||
d3d9_draw_primitive(dev,
|
||||
(D3DPRIMITIVETYPE)menu_display_prim_to_d3d9_enum(draw->prim_type),
|
||||
d3d->menu_display.offset,
|
||||
@ -279,8 +279,8 @@ static void menu_display_d3d9_clear_color(
|
||||
{
|
||||
LPDIRECT3DDEVICE9 dev;
|
||||
DWORD clear_color = 0;
|
||||
d3d_video_t *d3d = video_info ?
|
||||
(d3d_video_t*)video_info->userdata : NULL;
|
||||
d3d9_video_t *d3d = video_info ?
|
||||
(d3d9_video_t*)video_info->userdata : NULL;
|
||||
|
||||
if (!d3d || !clearcolor)
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user