Apply the same vertex buffer fix from FF13 to FF13-2
This commit is contained in:
parent
d2233f42ce
commit
b311d46163
1 changed files with 10 additions and 7 deletions
|
@ -133,13 +133,14 @@ bool MainContext::ApplyBehaviorFlagsFix(DWORD* flags)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY MainContext::ApplyVertexBufferFix(IDirect3DDevice9 *pIDirect3DDevice9, UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle)
|
HRESULT APIENTRY MainContext::ApplyVertexBufferFix(IDirect3DDevice9* pIDirect3DDevice9, UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle)
|
||||||
{
|
{
|
||||||
if (autofix == AutoFixes::NONE) return pIDirect3DDevice9->CreateVertexBuffer(Length,Usage,FVF,Pool,ppVertexBuffer,pSharedHandle);
|
switch (autofix) {
|
||||||
|
case AutoFixes::NONE:
|
||||||
// Final Fantasy XIII
|
return pIDirect3DDevice9->CreateVertexBuffer(Length, Usage, FVF, Pool, ppVertexBuffer, pSharedHandle);
|
||||||
if (autofix == FINAL_FANTASY_XIII)
|
case FINAL_FANTASY_XIII:
|
||||||
{
|
case FINAL_FANTASY_XIII2:
|
||||||
|
// Both games lock a vertex buffer 358400 before drawing any 2D element on screen (sometimes multiple times per frame)
|
||||||
if (Length == 358400 && Pool == D3DPOOL_MANAGED) {
|
if (Length == 358400 && Pool == D3DPOOL_MANAGED) {
|
||||||
Usage = D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY;
|
Usage = D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY;
|
||||||
Pool = D3DPOOL_SYSTEMMEM;
|
Pool = D3DPOOL_SYSTEMMEM;
|
||||||
|
@ -154,7 +155,9 @@ HRESULT APIENTRY MainContext::ApplyVertexBufferFix(IDirect3DDevice9 *pIDirect3DD
|
||||||
//if(ppVertexBuffer) *ppVertexBuffer = new hkIDirect3DVertexBuffer9(pIDirect3DDevice9, buffer);
|
//if(ppVertexBuffer) *ppVertexBuffer = new hkIDirect3DVertexBuffer9(pIDirect3DDevice9, buffer);
|
||||||
//return hr;
|
//return hr;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return pIDirect3DDevice9->CreateVertexBuffer(Length, Usage, FVF, Pool, ppVertexBuffer, pSharedHandle);
|
return pIDirect3DDevice9->CreateVertexBuffer(Length, Usage, FVF, Pool, ppVertexBuffer, pSharedHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue