mirror of
https://github.com/libretro/RetroArch
synced 2025-03-01 07:13:35 +00:00
Get rid of some inline functions
This commit is contained in:
parent
bceb753993
commit
7c37f9c053
@ -1477,7 +1477,7 @@ bool d3d9_read_viewport(void *data, uint8_t *buffer, bool is_idle)
|
||||
}
|
||||
}
|
||||
|
||||
d3d9_surface_unlock_rect(dest);
|
||||
IDirect3DSurface9_UnlockRect(dest);
|
||||
}
|
||||
else
|
||||
ret = false;
|
||||
|
@ -105,18 +105,6 @@ typedef struct d3d9_video
|
||||
overlay_t *overlays;
|
||||
} d3d9_video_t;
|
||||
|
||||
static INLINE bool d3d9_swap(void *data, LPDIRECT3DDEVICE9 dev)
|
||||
{
|
||||
#ifdef _XBOX
|
||||
IDirect3DDevice9_Present(dev, NULL, NULL, NULL, NULL);
|
||||
#else
|
||||
if (IDirect3DDevice9_Present(dev, NULL, NULL, NULL, NULL)
|
||||
== D3DERR_DEVICELOST)
|
||||
return false;
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
void *d3d9_vertex_buffer_new(void *dev,
|
||||
unsigned length, unsigned usage, unsigned fvf,
|
||||
INT32 pool, void *handle);
|
||||
@ -127,10 +115,6 @@ static INLINE void *d3d9_vertex_buffer_lock(LPDIRECT3DVERTEXBUFFER9 vertbuf)
|
||||
if (!vertbuf)
|
||||
return NULL;
|
||||
IDirect3DVertexBuffer9_Lock(vertbuf, 0, 0, &buf, 0);
|
||||
|
||||
if (!buf)
|
||||
return NULL;
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
@ -193,17 +177,6 @@ static INLINE void d3d9_texture_free(LPDIRECT3DTEXTURE9 tex)
|
||||
IDirect3DTexture9_Release(tex);
|
||||
}
|
||||
|
||||
static INLINE void d3d9_set_transform(
|
||||
LPDIRECT3DDEVICE9 dev,
|
||||
D3DTRANSFORMSTATETYPE state,
|
||||
CONST D3DMATRIX *matrix)
|
||||
{
|
||||
/* XBox 360 D3D9 does not support fixed-function pipeline. */
|
||||
#ifndef _XBOX
|
||||
IDirect3DDevice9_SetTransform(dev, state, matrix);
|
||||
#endif
|
||||
}
|
||||
|
||||
static INLINE void d3d9_set_sampler_address_u(
|
||||
LPDIRECT3DDEVICE9 dev,
|
||||
unsigned sampler, unsigned value)
|
||||
@ -470,18 +443,14 @@ static INLINE void d3d9_set_render_state(
|
||||
|
||||
static INLINE void d3d9_enable_blend_func(LPDIRECT3DDEVICE9 dev)
|
||||
{
|
||||
if (!dev)
|
||||
return;
|
||||
|
||||
d3d9_set_render_state(dev, D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
|
||||
d3d9_set_render_state(dev, D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
|
||||
d3d9_set_render_state(dev, D3DRS_ALPHABLENDENABLE, true);
|
||||
IDirect3DDevice9_SetRenderState(dev, D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
|
||||
IDirect3DDevice9_SetRenderState(dev, D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
|
||||
IDirect3DDevice9_SetRenderState(dev, D3DRS_ALPHABLENDENABLE, true);
|
||||
}
|
||||
|
||||
static INLINE void d3d9_disable_blend_func(LPDIRECT3DDEVICE9 dev)
|
||||
{
|
||||
if (dev)
|
||||
d3d9_set_render_state(dev, D3DRS_ALPHABLENDENABLE, false);
|
||||
IDirect3DDevice9_SetRenderState(dev, D3DRS_ALPHABLENDENABLE, false);
|
||||
}
|
||||
|
||||
static INLINE void
|
||||
@ -492,30 +461,18 @@ d3d9_set_vertex_declaration(LPDIRECT3DDEVICE9 dev,
|
||||
IDirect3DDevice9_SetVertexDeclaration(dev, vertex_data);
|
||||
}
|
||||
|
||||
static INLINE void d3d9_set_texture_stage_state(
|
||||
LPDIRECT3DDEVICE9 dev,
|
||||
unsigned sampler,
|
||||
D3DTEXTURESTAGESTATETYPE type,
|
||||
unsigned value)
|
||||
{
|
||||
#ifndef _XBOX
|
||||
/* XBox 360 has no fixed-function pipeline. */
|
||||
if (IDirect3DDevice9_SetTextureStageState(dev, sampler,
|
||||
type, value) != D3D_OK)
|
||||
RARCH_ERR("SetTextureStageState call failed, sampler"
|
||||
": %d, value: %d, type: %d\n", sampler, value, type);
|
||||
#endif
|
||||
}
|
||||
|
||||
static INLINE void d3d9_enable_alpha_blend_texture_func(LPDIRECT3DDEVICE9 dev)
|
||||
{
|
||||
if (!dev)
|
||||
return;
|
||||
|
||||
/* Also blend the texture with the set alpha value. */
|
||||
d3d9_set_texture_stage_state(dev, 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
|
||||
d3d9_set_texture_stage_state(dev, 0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE);
|
||||
d3d9_set_texture_stage_state(dev, 0, D3DTSS_ALPHAARG2, D3DTA_TEXTURE);
|
||||
#ifndef _XBOX
|
||||
/* XBox 360 has no fixed-function pipeline. */
|
||||
IDirect3DDevice9_SetTextureStageState(dev, 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
|
||||
IDirect3DDevice9_SetTextureStageState(dev, 0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE);
|
||||
IDirect3DDevice9_SetTextureStageState(dev, 0, D3DTSS_ALPHAARG2, D3DTA_TEXTURE);
|
||||
#endif
|
||||
}
|
||||
|
||||
void d3d9_frame_postprocess(void *data);
|
||||
@ -613,12 +570,6 @@ static INLINE bool d3d9_surface_lock_rect(LPDIRECT3DSURFACE9 surf,
|
||||
return true;
|
||||
}
|
||||
|
||||
static INLINE void d3d9_surface_unlock_rect(LPDIRECT3DSURFACE9 surf)
|
||||
{
|
||||
if (surf)
|
||||
IDirect3DSurface9_UnlockRect(surf);
|
||||
}
|
||||
|
||||
static INLINE bool d3d9_get_adapter_display_mode(
|
||||
LPDIRECT3D9 d3d,
|
||||
unsigned idx,
|
||||
|
@ -741,7 +741,14 @@ static bool d3d9_frame(void *data, const void *frame,
|
||||
unsigned n;
|
||||
for (n = 0; n < video_info->black_frame_insertion; ++n)
|
||||
{
|
||||
if (!d3d9_swap(d3d, d3d->dev) || d3d->needs_restore)
|
||||
#ifdef _XBOX
|
||||
bool ret = true;
|
||||
IDirect3DDevice9_Present(d3d->dev, NULL, NULL, NULL, NULL);
|
||||
#else
|
||||
bool ret = (IDirect3DDevice9_Present(d3d->dev,
|
||||
NULL, NULL, NULL, NULL) != D3DERR_DEVICELOST);
|
||||
#endif
|
||||
if (!ret || d3d->needs_restore)
|
||||
return true;
|
||||
d3d9_clear(d3d->dev, 0, 0, D3DCLEAR_TARGET, 0, 1, 0);
|
||||
}
|
||||
@ -807,7 +814,7 @@ static bool d3d9_frame(void *data, const void *frame,
|
||||
}
|
||||
|
||||
win32_update_title();
|
||||
d3d9_swap(d3d, d3d->dev);
|
||||
IDirect3DDevice9_Present(d3d->dev, NULL, NULL, NULL, NULL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -721,8 +721,8 @@ static bool d3d9_cg_renderchain_create_first_pass(
|
||||
|
||||
d3d_matrix_identity(&ident);
|
||||
|
||||
d3d9_set_transform(dev, D3DTS_WORLD, (D3DMATRIX*)&ident);
|
||||
d3d9_set_transform(dev, D3DTS_VIEW, (D3DMATRIX*)&ident);
|
||||
IDirect3DDevice9_SetTransform(dev, D3DTS_WORLD, (D3DMATRIX*)&ident);
|
||||
IDirect3DDevice9_SetTransform(dev, D3DTS_VIEW, (D3DMATRIX*)&ident);
|
||||
|
||||
pass.info = *info;
|
||||
pass.last_width = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user