tr2/output: fix crash with z-buffer disabled

Resolves #1761.
This commit is contained in:
Marcin Kurczewski 2024-11-02 00:17:58 +01:00
parent 5194daccf6
commit 6651aacdfd
2 changed files with 3 additions and 3 deletions

View file

@ -42,6 +42,7 @@
- fixed the dragon reviving itself after Lara removes the dagger in rare circumstances (#1572)
- fixed grenades counting as double kills in the game statistics (#1560)
- fixed the ammo counter being hidden while a demo plays in NG+ (#1559)
- fixed the game crashing in large rooms with z-buffer disabled (#1761, regression from 0.2)
- fixed the game hanging if exited during the level stats, credits, or final stats (#1585)
## [0.5](https://github.com/LostArtefacts/TRX/compare/afaf12a...tr2-0.5) - 2024-10-08

View file

@ -269,9 +269,8 @@ void __cdecl HWR_GetPageHandles(void)
bool __cdecl HWR_VertexBufferFull(void)
{
const int32_t index =
(g_HWR_VertexPtr - g_HWR_VertexBuffer) / sizeof(D3DTLVERTEX);
return index >= MAX_VERTICES;
const int32_t index = g_HWR_VertexPtr - g_HWR_VertexBuffer;
return index >= MAX_VERTICES - 0x200;
}
bool __cdecl HWR_Init(void)