D3D : Don't crash hard when SetStreamSource fails (this gets Galleon in-game again)

This commit is contained in:
patrickvl 2018-05-12 01:15:23 +02:00
parent 70af9c5684
commit e8e6fc56fb
2 changed files with 4 additions and 4 deletions

View File

@ -4239,9 +4239,9 @@ VOID XTL::DxbxUpdateActivePixelShader() // NOPATCH
HRESULT Result = D3D_OK; HRESULT Result = D3D_OK;
// TODO: Is this even right? he first RenderState is PSAlpha, // TODO: Is this even right? The first RenderState is PSAlpha,
// The pixel shader is stored in pDevice->m_pPixelShader // The pixel shader is stored in pDevice->m_pPixelShader
// For now, we still patch SetPixleShader and read from there... // For now, we still patch SetPixelShader and read from there...
//DWORD *XTL_D3D__RenderState = XTL::EmuMappedD3DRenderState[0]; //DWORD *XTL_D3D__RenderState = XTL::EmuMappedD3DRenderState[0];
//pPSDef = (XTL::X_D3DPIXELSHADERDEF*)(XTL_D3D__RenderState); //pPSDef = (XTL::X_D3DPIXELSHADERDEF*)(XTL_D3D__RenderState);
pPSDef = g_D3DActivePixelShader != nullptr ? g_D3DActivePixelShader->pPSDef : nullptr; pPSDef = g_D3DActivePixelShader != nullptr ? g_D3DActivePixelShader->pPSDef : nullptr;

View File

@ -350,7 +350,7 @@ void XTL::CxbxVertexBufferConverter::ConvertStream
HRESULT hRet = g_pD3DDevice->SetStreamSource(uiStream, nullptr, 0); HRESULT hRet = g_pD3DDevice->SetStreamSource(uiStream, nullptr, 0);
// DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetStreamSource"); // DEBUG_D3DRESULT(hRet, "g_pD3DDevice->SetStreamSource");
if (FAILED(hRet)) { if (FAILED(hRet)) {
CxbxKrnlCleanup("g_pD3DDevice->SetStreamSource(uiStream, nullptr, 0)\n"); EmuWarning("g_pD3DDevice->SetStreamSource(uiStream, nullptr, 0)");
} }
return; return;
@ -407,7 +407,7 @@ void XTL::CxbxVertexBufferConverter::ConvertStream
((SHORT *)pHostVertexAsFloat)[0] = ((SHORT*)pXboxVertex)[0]; ((SHORT *)pHostVertexAsFloat)[0] = ((SHORT*)pXboxVertex)[0];
((SHORT *)pHostVertexAsFloat)[1] = ((SHORT*)pXboxVertex)[1]; ((SHORT *)pHostVertexAsFloat)[1] = ((SHORT*)pXboxVertex)[1];
((SHORT *)pHostVertexAsFloat)[2] = ((SHORT*)pXboxVertex)[2]; ((SHORT *)pHostVertexAsFloat)[2] = ((SHORT*)pXboxVertex)[2];
((SHORT *)pHostVertexAsFloat)[3] = 0x01; ((SHORT *)pHostVertexAsFloat)[3] = 0x01; // Turok verified (character disappears when this is 32767)
pXboxVertex += 3 * sizeof(SHORT); pXboxVertex += 3 * sizeof(SHORT);
break; break;
} }