- [PsyX] minor corrections to PGXP

This commit is contained in:
InspirationByte 2022-01-03 18:22:26 +03:00
parent a1feae3503
commit 21395fa51e
2 changed files with 8 additions and 7 deletions

View File

@ -42,8 +42,6 @@ extern PGXPVector3D g_FP_SXYZ0; // direct access PGXP without table lookup
extern PGXPVector3D g_FP_SXYZ1; extern PGXPVector3D g_FP_SXYZ1;
extern PGXPVector3D g_FP_SXYZ2; extern PGXPVector3D g_FP_SXYZ2;
extern int g_pgxpVertexIndex;
/* clears PGXP vertex buffer */ /* clears PGXP vertex buffer */
void PGXP_ClearCache(); void PGXP_ClearCache();

View File

@ -280,9 +280,12 @@ PGXPVector3D g_FP_SXYZ0; // direct access PGXP without table lookup
PGXPVector3D g_FP_SXYZ1; PGXPVector3D g_FP_SXYZ1;
PGXPVector3D g_FP_SXYZ2; PGXPVector3D g_FP_SXYZ2;
PGXPVData g_pgxpCache[65535]; PGXPVData g_pgxpCache[1 << sizeof(ushort)*8];
int g_pgxpVertexIndex = 0; ushort g_pgxpVertexIndex = 0;
int g_pgxpTransformed = 0; int g_pgxpTransformed = 0;
// "render" states
float g_pgxpZOffset = 0.0f; float g_pgxpZOffset = 0.0f;
float g_pgxpZScale = 1.0f; float g_pgxpZScale = 1.0f;
@ -330,10 +333,10 @@ int PGXP_GetCacheData(PGXPVData* out, uint lookup, ushort indexhint)
} }
// index hint allows us to start from specific index // index hint allows us to start from specific index
int start = max(0, indexhint - 8); ushort start = max(0, indexhint - 8);
int end = g_pgxpVertexIndex;// min(start + 256, g_pgxpVertexIndex); ushort end = g_pgxpVertexIndex;
for (int i = start; i < end; i++) for (ushort i = start; i < end; i++)
{ {
if (g_pgxpCache[i].lookup == lookup) if (g_pgxpCache[i].lookup == lookup)
{ {