mirror of
https://github.com/libretro/RetroArch
synced 2025-03-25 16:44:01 +00:00
(d3d_common.cpp) Cleanups
This commit is contained in:
parent
e1c139dda6
commit
fd14986368
@ -102,7 +102,7 @@ void d3d_texture_free(LPDIRECT3DTEXTURE tex)
|
|||||||
bool d3d_vertex_declaration_new(LPDIRECT3DDEVICE dev,
|
bool d3d_vertex_declaration_new(LPDIRECT3DDEVICE dev,
|
||||||
const void *vertex_data, void **decl_data)
|
const void *vertex_data, void **decl_data)
|
||||||
{
|
{
|
||||||
#ifndef _XBOX1
|
#ifdef HAVE_D3D9
|
||||||
const D3DVERTEXELEMENT *vertex_elements = (const D3DVERTEXELEMENT*)vertex_data;
|
const D3DVERTEXELEMENT *vertex_elements = (const D3DVERTEXELEMENT*)vertex_data;
|
||||||
LPDIRECT3DVERTEXDECLARATION **vertex_decl = (LPDIRECT3DVERTEXDECLARATION**)decl_data;
|
LPDIRECT3DVERTEXDECLARATION **vertex_decl = (LPDIRECT3DVERTEXDECLARATION**)decl_data;
|
||||||
|
|
||||||
@ -146,20 +146,14 @@ LPDIRECT3DVERTEXBUFFER d3d_vertex_buffer_new(LPDIRECT3DDEVICE dev,
|
|||||||
void d3d_vertex_buffer_unlock(void *vertbuf_ptr)
|
void d3d_vertex_buffer_unlock(void *vertbuf_ptr)
|
||||||
{
|
{
|
||||||
LPDIRECT3DVERTEXBUFFER vertbuf = (LPDIRECT3DVERTEXBUFFER)vertbuf_ptr;
|
LPDIRECT3DVERTEXBUFFER vertbuf = (LPDIRECT3DVERTEXBUFFER)vertbuf_ptr;
|
||||||
/* This is a stub on Xbox 1, see docs. */
|
|
||||||
#ifndef _XBOX1
|
|
||||||
|
|
||||||
#ifdef _XBOX360
|
#ifdef _XBOX360
|
||||||
D3DVertexBuffer_Unlock(vertbuf);
|
D3DVertexBuffer_Unlock(vertbuf);
|
||||||
#if defined(HAVE_D3D9) && !defined(__cplusplus)
|
#elif defined(HAVE_D3D9) && !defined(__cplusplus)
|
||||||
IDirect3DVertexBuffer9_Unlock(vertbuf);
|
IDirect3DVertexBuffer9_Unlock(vertbuf);
|
||||||
#else
|
#elif defined(HAVE_D3D9)
|
||||||
vertbuf->Unlock();
|
vertbuf->Unlock();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void *d3d_vertex_buffer_lock(void *vertbuf_ptr)
|
void *d3d_vertex_buffer_lock(void *vertbuf_ptr)
|
||||||
@ -171,7 +165,7 @@ void *d3d_vertex_buffer_lock(void *vertbuf_ptr)
|
|||||||
buf = (void*)D3DVertexBuffer_Lock2(vertbuf, 0);
|
buf = (void*)D3DVertexBuffer_Lock2(vertbuf, 0);
|
||||||
#elif defined(_XBOX360)
|
#elif defined(_XBOX360)
|
||||||
buf = D3DVertexBuffer_Lock(vertbuf, 0, 0, 0);
|
buf = D3DVertexBuffer_Lock(vertbuf, 0, 0, 0);
|
||||||
#else
|
#elif defined(HAVE_D3D9)
|
||||||
vertbuf->Lock(0, sizeof(buf), &buf, 0);
|
vertbuf->Lock(0, sizeof(buf), &buf, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -335,13 +329,11 @@ void d3d_unlock_rectangle(LPDIRECT3DTEXTURE tex)
|
|||||||
{
|
{
|
||||||
#ifdef _XBOX
|
#ifdef _XBOX
|
||||||
D3DTexture_UnlockRect(tex, 0);
|
D3DTexture_UnlockRect(tex, 0);
|
||||||
#else
|
#elif defined(HAVE_D3D9) && !defined(__cplusplus)
|
||||||
#if defined(HAVE_D3D9) && !defined(__cplusplus)
|
|
||||||
IDirect3DSurface9_UnlockRect(tex);
|
IDirect3DSurface9_UnlockRect(tex);
|
||||||
#else
|
#else
|
||||||
tex->UnlockRect(0);
|
tex->UnlockRect(0);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void d3d_lock_rectangle_clear(LPDIRECT3DTEXTURE tex,
|
void d3d_lock_rectangle_clear(LPDIRECT3DTEXTURE tex,
|
||||||
@ -411,7 +403,7 @@ void d3d_texture_blit(unsigned pixel_size,
|
|||||||
{
|
{
|
||||||
if (d3d_lock_rectangle(tex, 0, lr, NULL, 0, 0))
|
if (d3d_lock_rectangle(tex, 0, lr, NULL, 0, 0))
|
||||||
{
|
{
|
||||||
#if defined(_XBOX360) && defined(_XBOX360)
|
#if defined(_XBOX360)
|
||||||
D3DSURFACE_DESC desc;
|
D3DSURFACE_DESC desc;
|
||||||
tex->GetLevelDesc(0, &desc);
|
tex->GetLevelDesc(0, &desc);
|
||||||
XGCopySurface(lr->pBits, lr->Pitch, width, height, desc.Format, NULL,
|
XGCopySurface(lr->pBits, lr->Pitch, width, height, desc.Format, NULL,
|
||||||
@ -506,6 +498,7 @@ void d3d_set_vertex_declaration(void *data, void *vertex_data)
|
|||||||
#endif
|
#endif
|
||||||
if (!dev)
|
if (!dev)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef _XBOX1
|
#ifdef _XBOX1
|
||||||
d3d_set_vertex_shader(dev, D3DFVF_XYZ | D3DFVF_TEX1, NULL);
|
d3d_set_vertex_shader(dev, D3DFVF_XYZ | D3DFVF_TEX1, NULL);
|
||||||
#elif defined(HAVE_D3D9) && !defined(__cplusplus)
|
#elif defined(HAVE_D3D9) && !defined(__cplusplus)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user