Change EmuD3DActiveTexture into X_D3DPixelContainer's
This commit is contained in:
parent
de02c0146e
commit
f3a41a1596
|
@ -151,7 +151,7 @@ static XTL::X_VERTEXSHADERCONSTANTMODE g_VertexShaderConstantMode = X_VSCM_192;
|
||||||
XTL::X_D3DTILE XTL::EmuD3DTileCache[0x08] = {0};
|
XTL::X_D3DTILE XTL::EmuD3DTileCache[0x08] = {0};
|
||||||
|
|
||||||
// cached active texture
|
// cached active texture
|
||||||
XTL::X_D3DResource *XTL::EmuD3DActiveTexture[4] = {0,0,0,0};
|
XTL::X_D3DPixelContainer *XTL::EmuD3DActiveTexture[4] = {0,0,0,0};
|
||||||
|
|
||||||
// information passed to the create device proxy thread
|
// information passed to the create device proxy thread
|
||||||
struct EmuD3D8CreateDeviceProxyData
|
struct EmuD3D8CreateDeviceProxyData
|
||||||
|
@ -1285,7 +1285,7 @@ static void EmuUnswizzleTextureStages()
|
||||||
for( int i = 0; i < 4; i++ )
|
for( int i = 0; i < 4; i++ )
|
||||||
{
|
{
|
||||||
// for current usages, we're always on stage 0
|
// for current usages, we're always on stage 0
|
||||||
XTL::X_D3DPixelContainer *pPixelContainer = (XTL::X_D3DPixelContainer*)XTL::EmuD3DActiveTexture[i];
|
XTL::X_D3DPixelContainer *pPixelContainer = XTL::EmuD3DActiveTexture[i];
|
||||||
|
|
||||||
if(pPixelContainer == NULL || !(pPixelContainer->Common & X_D3DCOMMON_ISLOCKED))
|
if(pPixelContainer == NULL || !(pPixelContainer->Common & X_D3DCOMMON_ISLOCKED))
|
||||||
return;
|
return;
|
||||||
|
@ -3581,10 +3581,9 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_SetTexture)
|
||||||
");\n",
|
");\n",
|
||||||
Stage, pTexture);
|
Stage, pTexture);
|
||||||
|
|
||||||
IDirect3DBaseTexture8 *pBaseTexture8 = NULL;
|
IDirect3DBaseTexture8 *pBaseTexture8 = nullptr;
|
||||||
|
|
||||||
EmuD3DActiveTexture[Stage] = pTexture;
|
|
||||||
|
|
||||||
|
EmuD3DActiveTexture[Stage] = (X_D3DPixelContainer*)pTexture;
|
||||||
if(pTexture != NULL)
|
if(pTexture != NULL)
|
||||||
{
|
{
|
||||||
EmuVerifyResourceIsRegistered(pTexture);
|
EmuVerifyResourceIsRegistered(pTexture);
|
||||||
|
@ -9587,7 +9586,7 @@ XTL::X_D3DResource* WINAPI XTL::EMUPATCH(D3DDevice_GetTexture2)(DWORD Stage)
|
||||||
Stage);
|
Stage);
|
||||||
|
|
||||||
// Get the active texture from this stage
|
// Get the active texture from this stage
|
||||||
X_D3DResource* pRet = EmuD3DActiveTexture[Stage];
|
X_D3DPixelContainer* pRet = EmuD3DActiveTexture[Stage];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ extern VOID EmuD3DCleanup();
|
||||||
extern X_D3DTILE EmuD3DTileCache[0x08];
|
extern X_D3DTILE EmuD3DTileCache[0x08];
|
||||||
|
|
||||||
// EmuD3DActiveTexture
|
// EmuD3DActiveTexture
|
||||||
extern X_D3DResource *EmuD3DActiveTexture[4];
|
extern X_D3DPixelContainer *EmuD3DActiveTexture[4];
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
// * patch: Direct3D_CreateDevice
|
// * patch: Direct3D_CreateDevice
|
||||||
|
|
|
@ -74,7 +74,7 @@ void XTL::EmuExecutePushBuffer
|
||||||
static void EmuUnswizzleActiveTexture()
|
static void EmuUnswizzleActiveTexture()
|
||||||
{
|
{
|
||||||
// for current usages, we're always on stage 0
|
// for current usages, we're always on stage 0
|
||||||
XTL::X_D3DPixelContainer *pPixelContainer = (XTL::X_D3DPixelContainer*)XTL::EmuD3DActiveTexture[0];
|
XTL::X_D3DPixelContainer *pPixelContainer = XTL::EmuD3DActiveTexture[0];
|
||||||
|
|
||||||
if(pPixelContainer == NULL || !(pPixelContainer->Common & X_D3DCOMMON_ISLOCKED))
|
if(pPixelContainer == NULL || !(pPixelContainer->Common & X_D3DCOMMON_ISLOCKED))
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -644,7 +644,7 @@ bool XTL::VertexPatcher::NormalizeTexCoords(VertexPatchDesc *pPatchDesc, UINT ui
|
||||||
|
|
||||||
for(uint08 i = 0; i < 4; i++)
|
for(uint08 i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
X_D3DPixelContainer *pPixelContainer = (X_D3DPixelContainer*)EmuD3DActiveTexture[i];
|
X_D3DPixelContainer *pPixelContainer = EmuD3DActiveTexture[i];
|
||||||
if (pPixelContainer)
|
if (pPixelContainer)
|
||||||
{
|
{
|
||||||
XTL::X_D3DFORMAT XBFormat = (XTL::X_D3DFORMAT)((pPixelContainer->Format & X_D3DFORMAT_FORMAT_MASK) >> X_D3DFORMAT_FORMAT_SHIFT);
|
XTL::X_D3DFORMAT XBFormat = (XTL::X_D3DFORMAT)((pPixelContainer->Format & X_D3DFORMAT_FORMAT_MASK) >> X_D3DFORMAT_FORMAT_SHIFT);
|
||||||
|
|
Loading…
Reference in New Issue