1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-08 12:15:49 +00:00

(D3D) Add d3d_set_transform

This commit is contained in:
twinaphex 2014-09-13 21:50:07 +02:00
parent a14e836a55
commit 78492f238a
6 changed files with 18 additions and 31 deletions

View File

@ -40,6 +40,16 @@ void d3d_swap(void *data, LPDIRECT3DDEVICE dev)
#endif
}
void d3d_set_transform(LPDIRECT3DDEVICE dev,
D3DTRANSFORMSTATETYPE state, CONST D3DMATRIX *matrix)
{
#ifdef _XBOX1
D3DDevice_SetTransform(state, matrix);
#else
dev->SetTransform(state, matrix);
#endif
}
LPDIRECT3DTEXTURE d3d_texture_new(LPDIRECT3DDEVICE dev,
const char *path, unsigned width, unsigned height,
unsigned miplevels, unsigned usage, D3DFORMAT format,

View File

@ -44,6 +44,9 @@ void d3d_set_stream_source(LPDIRECT3DDEVICE dev, unsigned stream_no,
void d3d_texture_free(LPDIRECT3DTEXTURE tex);
void d3d_set_transform(LPDIRECT3DDEVICE dev,
D3DTRANSFORMSTATETYPE state, CONST D3DMATRIX *matrix);
void d3d_set_sampler_address_u(LPDIRECT3DDEVICE dev,
unsigned sampler, unsigned value);

View File

@ -346,8 +346,8 @@ bool renderchain_create_first_pass(void *data, const LinkInfo *info,
D3DXMATRIX ident;
D3DXMatrixIdentity(&ident);
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)chain->dev;
d3dr->SetTransform(D3DTS_WORLD, &ident);
d3dr->SetTransform(D3DTS_VIEW, &ident);
d3d_set_transform(d3dr, D3DTS_WORLD, &ident);
d3d_set_transform(d3dr, D3DTS_VIEW, &ident);
Pass pass;
pass.info = *info;

View File

@ -239,9 +239,9 @@ static void renderchain_set_mvp(void *data, unsigned vp_width, unsigned vp_heigh
D3DXMatrixIdentity(&p_out);
D3DXMatrixRotationZ(&p_rotate, rotation * (M_PI / 2.0));
RD3DDevice_SetTransform(d3dr, D3DTS_WORLD, &p_rotate);
RD3DDevice_SetTransform(d3dr, D3DTS_VIEW, &p_out);
RD3DDevice_SetTransform(d3dr, D3DTS_PROJECTION, &p_out);
d3d_set_transform(d3dr, D3DTS_WORLD, &p_rotate);
d3d_set_transform(d3dr, D3DTS_VIEW, &p_out);
d3d_set_transform(d3dr, D3DTS_PROJECTION, &p_out);
#endif
}

View File

@ -1,24 +0,0 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2014 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _XDK_DEFINES_H
#define _XDK_DEFINES_H
#if defined(_XBOX1)
#define RD3DDevice_SetTransform(device, State, pMatrix) D3DDevice_SetTransform(State, pMatrix)
#endif
#endif

View File

@ -17,8 +17,6 @@
#ifndef RARCH_XDK_RESOURCE_H
#define RARCH_XDK_RESOURCE_H
#include "../gfx/d3d9/xdk_defines.h"
DWORD XBResource_SizeOf( LPDIRECT3DRESOURCE pResource );
//structure member offsets matter