Tail's Head now renders in Sonic Heroes E3 Demo, Zapper is still broken..
This commit is contained in:
parent
6c2c3d5fb2
commit
53998f41ed
|
@ -278,8 +278,7 @@ bool XTL::VertexPatcher::ApplyCachedStream(VertexPatchDesc *pPatchDesc,
|
||||||
pCalculateData = (void*)GetDataFromXboxResource(pOrigVertexBuffer);
|
pCalculateData = (void*)GetDataFromXboxResource(pOrigVertexBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use the cached stream length (which is a must for the UP stream)
|
uint32_t uiHash = XXHash32::hash((void *)pCalculateData, uiLength, HASH_SEED);
|
||||||
uint32_t uiHash = XXHash32::hash((void *)pCalculateData, pCachedStream->uiLength, HASH_SEED);
|
|
||||||
if(uiHash == pCachedStream->uiHash)
|
if(uiHash == pCachedStream->uiHash)
|
||||||
{
|
{
|
||||||
// Take a while longer to check
|
// Take a while longer to check
|
||||||
|
@ -342,35 +341,36 @@ bool XTL::VertexPatcher::ApplyCachedStream(VertexPatchDesc *pPatchDesc,
|
||||||
return bApplied;
|
return bApplied;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CountActiveD3DStreams()
|
||||||
|
{
|
||||||
|
int lastStreamIndex;
|
||||||
|
for (int i = 0; i < 16; i++) {
|
||||||
|
if (g_D3DStreams[i] != nullptr) {
|
||||||
|
lastStreamIndex = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return lastStreamIndex + 1;
|
||||||
|
}
|
||||||
|
|
||||||
UINT XTL::VertexPatcher::GetNbrStreams(VertexPatchDesc *pPatchDesc)
|
UINT XTL::VertexPatcher::GetNbrStreams(VertexPatchDesc *pPatchDesc)
|
||||||
{
|
{
|
||||||
if(VshHandleIsVertexShader(pPatchDesc->hVertexShader))
|
// Draw..Up always have one stream
|
||||||
{
|
if (pPatchDesc->pVertexStreamZeroData != nullptr) {
|
||||||
VERTEX_DYNAMIC_PATCH *pDynamicPatch = VshGetVertexDynamicPatch(pPatchDesc->hVertexShader);
|
return 1;
|
||||||
if(pDynamicPatch)
|
}
|
||||||
{
|
|
||||||
return pDynamicPatch->NbrStreams;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Draw..Up always have one stream
|
|
||||||
if (pPatchDesc->pVertexStreamZeroData != nullptr) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int lastStreamIndex;
|
if(VshHandleIsVertexShader(pPatchDesc->hVertexShader)) {
|
||||||
for (int i = 0; i < 16; i++) {
|
VERTEX_DYNAMIC_PATCH *pDynamicPatch = VshGetVertexDynamicPatch(pPatchDesc->hVertexShader);
|
||||||
if (g_D3DStreams[i] != nullptr) {
|
if (pDynamicPatch) {
|
||||||
lastStreamIndex = i;
|
return pDynamicPatch->NbrStreams;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
return CountActiveD3DStreams();
|
||||||
return lastStreamIndex + 1;
|
}
|
||||||
}
|
|
||||||
}
|
if (pPatchDesc->hVertexShader) {
|
||||||
else if(pPatchDesc->hVertexShader)
|
return CountActiveD3DStreams();
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -965,7 +965,7 @@ bool XTL::VertexPatcher::PatchPrimitive(VertexPatchDesc *pPatchDesc,
|
||||||
{
|
{
|
||||||
pStream->pPatchedStream->Unlock();
|
pStream->pPatchedStream->Unlock();
|
||||||
|
|
||||||
g_pD3DDevice8->SetStreamSource(0, pStream->pPatchedStream, pStream->uiOrigStride);
|
g_pD3DDevice8->SetStreamSource(uiStream, pStream->pPatchedStream, pStream->uiOrigStride);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_bPatched = true;
|
m_bPatched = true;
|
||||||
|
|
Loading…
Reference in New Issue