mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 16:39:43 +00:00
(XDK) Change DrawVerticeFormat to Vertex
This commit is contained in:
parent
6c50de497f
commit
bf4dbede7a
@ -575,11 +575,7 @@ void renderchain_render_pass(void *data, Pass &pass, unsigned pass_index)
|
||||
#endif
|
||||
for (unsigned i = 0; i < 4; i++)
|
||||
{
|
||||
#ifdef _XBOX
|
||||
D3DDevice_SetStreamSources(d3dr, i, pass.vertex_buf, 0, sizeof(DrawVerticeFormats));
|
||||
#else
|
||||
D3DDevice_SetStreamSources(d3dr, i, pass.vertex_buf, 0, sizeof(Vertex));
|
||||
#endif
|
||||
}
|
||||
|
||||
renderchain_bind_orig(chain, pass);
|
||||
|
@ -27,22 +27,17 @@ bool texture_image_load(void *data, const char *path, void *image_data)
|
||||
out_img->pixels = NULL;
|
||||
out_img->vertex_buf = NULL;
|
||||
|
||||
HRESULT ret = D3DXCreateTextureFromFileExA(d3d->dev,
|
||||
if(FAILED(D3DXCreateTextureFromFileExA(d3d->dev,
|
||||
path, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, D3DFMT_A8R8G8B8,
|
||||
D3DPOOL_MANAGED, D3DX_DEFAULT, D3DX_DEFAULT, 0, &m_imageInfo, NULL,
|
||||
&out_img->pixels);
|
||||
|
||||
if(FAILED(ret))
|
||||
&out_img->pixels)))
|
||||
{
|
||||
RARCH_ERR("Error occurred during D3DXCreateTextureFromFileExA().\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
// create a vertex buffer for the quad that will display the texture
|
||||
ret = d3d->dev->CreateVertexBuffer(4 * sizeof(DrawVerticeFormats),
|
||||
D3DUSAGE_WRITEONLY, D3DFVF_CUSTOMVERTEX, D3DPOOL_MANAGED, &out_img->vertex_buf);
|
||||
|
||||
if (FAILED(ret))
|
||||
if (FAILED(D3DDevice_CreateVertexBuffers(d3d->dev, 4 * sizeof(Vertex), D3DUSAGE_WRITEONLY, D3DFVF_CUSTOMVERTEX, D3DPOOL_MANAGED, &out_img->vertex_buf, NULL)))
|
||||
{
|
||||
RARCH_ERR("Error occurred during CreateVertexBuffer().\n");
|
||||
out_img->pixels->Release();
|
||||
|
@ -266,7 +266,7 @@ static bool renderchain_create_first_pass(void *data, const video_info_t *info)
|
||||
d3d_video_t *chain = (d3d_video_t*)data;
|
||||
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)chain->dev;
|
||||
|
||||
ret = D3DDevice_CreateVertexBuffers(d3dr, 4 * sizeof(DrawVerticeFormats),
|
||||
ret = D3DDevice_CreateVertexBuffers(d3dr, 4 * sizeof(Vertex),
|
||||
D3DUSAGE_WRITEONLY, D3DFVF_CUSTOMVERTEX, D3DPOOL_MANAGED, &chain->vertex_buf, NULL);
|
||||
|
||||
if (FAILED(ret))
|
||||
@ -438,7 +438,7 @@ static bool texture_image_render(void *data, struct texture_image *out_img,
|
||||
float fY = static_cast<float>(y);
|
||||
|
||||
// create the new vertices
|
||||
DrawVerticeFormats newVerts[] =
|
||||
Vertex newVerts[] =
|
||||
{
|
||||
// x, y, z, color, u ,v
|
||||
{fX, fY, 0.0f, 0, 0, 0},
|
||||
@ -448,7 +448,7 @@ static bool texture_image_render(void *data, struct texture_image *out_img,
|
||||
};
|
||||
|
||||
// load the existing vertices
|
||||
DrawVerticeFormats *pCurVerts;
|
||||
Vertex *pCurVerts;
|
||||
|
||||
HRESULT ret = out_img->vertex_buf->Lock(0, 0, (unsigned char**)&pCurVerts, 0);
|
||||
|
||||
@ -456,7 +456,7 @@ static bool texture_image_render(void *data, struct texture_image *out_img,
|
||||
return false;
|
||||
|
||||
// copy the new verts over the old verts
|
||||
memcpy(pCurVerts, newVerts, 4 * sizeof(DrawVerticeFormats));
|
||||
memcpy(pCurVerts, newVerts, 4 * sizeof(Vertex));
|
||||
out_img->vertex_buf->Unlock();
|
||||
|
||||
d3d->dev->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
|
||||
@ -470,7 +470,7 @@ static bool texture_image_render(void *data, struct texture_image *out_img,
|
||||
|
||||
// draw the quad
|
||||
d3dr->SetTexture(0, out_img->pixels);
|
||||
D3DDevice_SetStreamSources(d3dr, 0, out_img->vertex_buf, 0, sizeof(DrawVerticeFormats));
|
||||
D3DDevice_SetStreamSources(d3dr, 0, out_img->vertex_buf, 0, sizeof(Vertex));
|
||||
d3dr->SetVertexShader(D3DFVF_CUSTOMVERTEX);
|
||||
|
||||
if (force_fullscreen)
|
||||
@ -549,7 +549,7 @@ static void set_vertices(void *data, unsigned pass, unsigned width, unsigned hei
|
||||
d3d->last_width = width;
|
||||
d3d->last_height = height;
|
||||
|
||||
DrawVerticeFormats vert[4];
|
||||
Vertex vert[4];
|
||||
float tex_w = width;
|
||||
float tex_h = height;
|
||||
#ifdef _XBOX360
|
||||
@ -668,7 +668,7 @@ static void render_pass(void *data, const void *frame, unsigned width, unsigned
|
||||
#endif
|
||||
for (unsigned i = 0; i < 4; i++)
|
||||
{
|
||||
D3DDevice_SetStreamSources(d3dr, i, d3d->vertex_buf, 0, sizeof(DrawVerticeFormats));
|
||||
D3DDevice_SetStreamSources(d3dr, i, d3d->vertex_buf, 0, sizeof(Vertex));
|
||||
}
|
||||
|
||||
D3DDevice_DrawPrimitive(d3dr, D3DPT_TRIANGLESTRIP, 0, 2);
|
||||
|
@ -52,7 +52,7 @@ typedef struct
|
||||
LPDIRECT3DVERTEXBUFFER vert_buf;
|
||||
} overlay_t;
|
||||
|
||||
typedef struct DrawVerticeFormats
|
||||
typedef struct Vertex
|
||||
{
|
||||
float x, y;
|
||||
#if defined(_XBOX1)
|
||||
@ -60,7 +60,7 @@ typedef struct DrawVerticeFormats
|
||||
float rhw;
|
||||
#endif
|
||||
float u, v;
|
||||
} DrawVerticeFormats;
|
||||
} Vertex;
|
||||
|
||||
typedef struct gl_shader_backend gl_shader_backend_t;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user