Fix dialog rendering (PPGe). Fixes #15954

Was caused by 867eb99 , part of #15950 .
This commit is contained in:
Henrik Rydgård 2022-09-04 00:41:52 +02:00
parent 6b1e4806cf
commit 65c016d154
2 changed files with 7 additions and 2 deletions

View File

@ -467,6 +467,11 @@ struct PSPPointer
PSPPointerNotifyRW(2, (uint32_t)ptr, (uint32_t)sizeof(T), tag, tagLen - 1);
}
size_t ElementSize() const
{
return sizeof(T);
}
static PSPPointer<T> Create(u32 ptr) {
PSPPointer<T> p;
p = ptr;

View File

@ -182,13 +182,13 @@ static void Vertex(float x, float y, float u, float v, int tw, int th, u32 color
vtx->x = x; vtx->y = y; vtx->z = 0;
vtx->u = u * tw; vtx->v = v * th;
vtx->color = color;
dataWritePtr += sizeof(vtx);
dataWritePtr += (u32)vtx.ElementSize();
} else {
auto vtx = PSPPointer<PPGeVertex>::Create(dataWritePtr);
vtx->x = x; vtx->y = y; vtx->z = 0;
vtx->u = u * tw; vtx->v = v * th;
vtx->color = color;
dataWritePtr += sizeof(vtx);
dataWritePtr += (u32)vtx.ElementSize();
}
_dbg_assert_(dataWritePtr <= dataPtr + dataSize);
vertexCount++;