Introduced Xbox version of X_POINT and X_RECT (for now, aliassed to Windows types)

This commit is contained in:
PatrickvL 2021-06-16 17:27:10 +02:00
parent 824c840102
commit 8e3651cb70
5 changed files with 46 additions and 42 deletions

View File

@ -426,7 +426,7 @@ g_EmuCDPD;
XB_MACRO(xbox::hresult_xt, WINAPI, Direct3D_CreateDevice_16__LTCG_eax_BehaviorFlags_ebx_ppReturnedDeviceInterface, (xbox::uint_xt, xbox::X_D3DDEVTYPE, xbox::X_HWND, xbox::X_D3DPRESENT_PARAMETERS*) ); \
XB_MACRO(xbox::hresult_xt, WINAPI, Direct3D_CreateDevice_16__LTCG_eax_BehaviorFlags_ecx_ppReturnedDeviceInterface, (xbox::uint_xt, xbox::X_D3DDEVTYPE, xbox::X_HWND, xbox::X_D3DPRESENT_PARAMETERS*) ); \
XB_MACRO(xbox::hresult_xt, WINAPI, Direct3D_CreateDevice_4, (xbox::X_D3DPRESENT_PARAMETERS*) ); \
XB_MACRO(xbox::void_xt, WINAPI, Lock2DSurface, (xbox::X_D3DPixelContainer*, xbox::X_D3DCUBEMAP_FACES, xbox::uint_xt, D3DLOCKED_RECT*, RECT*, xbox::dword_xt) ); \
XB_MACRO(xbox::void_xt, WINAPI, Lock2DSurface, (xbox::X_D3DPixelContainer*, xbox::X_D3DCUBEMAP_FACES, xbox::uint_xt, D3DLOCKED_RECT*, xbox::X_RECT*, xbox::dword_xt) ); \
XB_MACRO(xbox::void_xt, WINAPI, Lock3DSurface, (xbox::X_D3DPixelContainer*, xbox::uint_xt, D3DLOCKED_BOX*, D3DBOX*, xbox::dword_xt) ); \
XB_MACRO(xbox::void_xt, WINAPI, D3D_CommonSetRenderTarget, (xbox::X_D3DSurface*, xbox::X_D3DSurface*, void*) ); \
@ -5107,11 +5107,11 @@ xbox::void_xt WINAPI xbox::EMUPATCH(D3DDevice_Clear)
// ******************************************************************
xbox::void_xt WINAPI xbox::EMUPATCH(D3DDevice_CopyRects)
(
X_D3DSurface* pSourceSurface,
CONST RECT* pSourceRectsArray,
uint_xt cRects,
X_D3DSurface* pDestinationSurface,
CONST POINT* pDestPointsArray
X_D3DSurface* pSourceSurface,
CONST X_RECT* pSourceRectsArray,
uint_xt cRects,
X_D3DSurface* pDestinationSurface,
CONST X_POINT* pDestPointsArray
)
{
LOG_FUNC_BEGIN
@ -5164,7 +5164,10 @@ xbox::void_xt WINAPI xbox::EMUPATCH(D3DDevice_CopyRects)
RECT SourceRect, DestRect;
if (pSourceRectsArray != nullptr) {
SourceRect = pSourceRectsArray[i];
SourceRect.left = pSourceRectsArray[i].left;
SourceRect.right = pSourceRectsArray[i].right;
SourceRect.top = pSourceRectsArray[i].top;
SourceRect.bottom = pSourceRectsArray[i].bottom;
} else {
SourceRect.left = 0;
SourceRect.right = xboxSourceWidth;
@ -5221,10 +5224,10 @@ xbox::void_xt WINAPI xbox::EMUPATCH(D3DDevice_CopyRects)
// ******************************************************************
xbox::void_xt WINAPI xbox::EMUPATCH(D3DDevice_Present)
(
CONST RECT* pSourceRect,
CONST RECT* pDestRect,
PVOID pDummy1,
PVOID pDummy2
CONST X_RECT* pSourceRect,
CONST X_RECT* pDestRect,
PVOID pDummy1,
PVOID pDummy2
)
{
// LOG_FORWARD("D3DDevice_Swap");
@ -6759,9 +6762,9 @@ xbox::void_xt WINAPI xbox::EMUPATCH(D3DDevice_EnableOverlay)
xbox::void_xt WINAPI xbox::EMUPATCH(D3DDevice_UpdateOverlay)
(
X_D3DSurface *pSurface,
CONST RECT *SrcRect,
CONST RECT *DstRect,
bool_xt EnableColorKey,
CONST X_RECT *SrcRect,
CONST X_RECT *DstRect,
bool_xt EnableColorKey,
D3DCOLOR ColorKey
)
{
@ -6971,7 +6974,7 @@ xbox::void_xt WINAPI xbox::EMUPATCH(Lock2DSurface)
X_D3DCUBEMAP_FACES FaceType,
uint_xt Level,
D3DLOCKED_RECT *pLockedRect,
RECT *pRect,
X_RECT *pRect,
dword_xt Flags
)
{

View File

@ -271,10 +271,10 @@ xbox::hresult_xt WINAPI EMUPATCH(D3DDevice_EndStateBlock)(dword_xt *pToken);
xbox::void_xt WINAPI EMUPATCH(D3DDevice_CopyRects)
(
X_D3DSurface *pSourceSurface,
CONST RECT *pSourceRectsArray,
uint_xt cRects,
CONST X_RECT *pSourceRectsArray,
uint_xt cRects,
X_D3DSurface *pDestinationSurface,
CONST POINT *pDestPointsArray
CONST X_POINT *pDestPointsArray
);
// ******************************************************************
@ -756,10 +756,10 @@ xbox::void_xt WINAPI EMUPATCH(D3DDevice_Clear)
// ******************************************************************
xbox::void_xt WINAPI EMUPATCH(D3DDevice_Present)
(
CONST RECT* pSourceRect,
CONST RECT* pDestRect,
PVOID pDummy1,
PVOID pDummy2
CONST X_RECT* pSourceRect,
CONST X_RECT* pDestRect,
PVOID pDummy1,
PVOID pDummy2
);
// ******************************************************************
@ -824,7 +824,7 @@ xbox::void_xt WINAPI EMUPATCH(Lock2DSurface)
X_D3DCUBEMAP_FACES FaceType,
uint_xt Level,
D3DLOCKED_RECT *pLockedRect,
RECT *pRect,
X_RECT *pRect,
dword_xt Flags
);
@ -867,8 +867,8 @@ xbox::void_xt WINAPI EMUPATCH(D3DSurface_LockRect)
(
X_D3DResource *pThis,
D3DLOCKED_RECT *pLockedRect,
CONST RECT *pRect,
dword_xt Flags
CONST X_RECT *pRect,
dword_xt Flags
);
// ******************************************************************
@ -894,10 +894,10 @@ X_D3DSurface * WINAPI EMUPATCH(D3DTexture_GetSurfaceLevel2)
xbox::void_xt WINAPI EMUPATCH(D3DTexture_LockRect)
(
X_D3DTexture *pThis,
uint_xt Level,
uint_xt Level,
D3DLOCKED_RECT *pLockedRect,
CONST RECT *pRect,
dword_xt Flags
CONST X_RECT *pRect,
dword_xt Flags
);
// ******************************************************************
@ -931,7 +931,7 @@ xbox::void_xt WINAPI EMUPATCH(D3DCubeTexture_LockRect)
X_D3DCUBEMAP_FACES FaceType,
uint_xt Level,
D3DLOCKED_RECT *pLockedBox,
CONST RECT *pRect,
CONST X_RECT *pRect,
dword_xt Flags
);
@ -972,9 +972,9 @@ xbox::void_xt WINAPI EMUPATCH(D3DDevice_EnableOverlay)
xbox::void_xt WINAPI EMUPATCH(D3DDevice_UpdateOverlay)
(
X_D3DSurface *pSurface,
CONST RECT *SrcRect,
CONST RECT *DstRect,
bool_xt EnableColorKey,
CONST X_RECT *SrcRect,
CONST X_RECT *DstRect,
bool_xt EnableColorKey,
D3DCOLOR ColorKey
);

View File

@ -537,7 +537,14 @@ LOGRENDER(D3DLOCKED_RECT)
LOGRENDER_MEMBER(pBits);
}
LOGRENDER(RECT)
// prevent name collisions
namespace xbox {
//
// Cxbx D3D LOGRENDER(Type) implementations
//
LOGRENDER(X_RECT)
{
return os
LOGRENDER_MEMBER(left)
@ -546,14 +553,6 @@ LOGRENDER(RECT)
LOGRENDER_MEMBER(bottom);
}
// prevent name collisions
namespace xbox {
//
// Cxbx D3D LOGRENDER(Type) implementations
//
ENUM2STR_START(X_D3DCUBEMAP_FACES)
ENUM2STR_CASE(X_D3DCUBEMAP_FACE_POSITIVE_X)
ENUM2STR_CASE(X_D3DCUBEMAP_FACE_NEGATIVE_X)

View File

@ -115,7 +115,6 @@ LOGRENDER_HEADER(D3DPSHADERCAPS2_0)
LOGRENDER_HEADER(D3DCAPS)
LOGRENDER_HEADER(D3DLOCKED_RECT)
LOGRENDER_HEADER(RECT)
namespace xbox {
@ -137,6 +136,7 @@ ENUM2STR_HEADER(X_D3DCULL)
//ENUM2STR_HEADER(X_D3DDEVTYPE)
ENUM2STR_HEADER(X_D3DFORMAT)
ENUM2STR_HEADER(X_D3DPRIMITIVETYPE)
LOGRENDER_HEADER(X_RECT)
ENUM2STR_HEADER(X_D3DRESOURCETYPE)
ENUM2STR_HEADER(X_D3DSET_DEPTH_CLIP_PLANES_FLAGS)
FLAGS2STR_HEADER(X_D3DUSAGE) // Not really an enum

View File

@ -103,6 +103,8 @@ namespace xbox {
// Xbox D3D types, probably just copies of the Windows Direct3D 9 counterparts :
typedef ::HWND X_HWND;
typedef ::RECT X_RECT;
typedef ::POINT X_POINT;
/* CubeMap Face identifiers */
typedef enum _X_D3DCUBEMAP_FACES