small fixes

This commit is contained in:
d1str4ught
2025-08-22 20:39:23 +02:00
parent 5b71a1e352
commit 6e42f1af3c
5 changed files with 6 additions and 16 deletions

View File

@@ -125,7 +125,8 @@ bool CGraphicIndexBuffer::Create(int idxCount, D3DFORMAT d3dFmt)
Destroy();
m_iidxCount = idxCount;
m_dwBufferSize = sizeof(WORD) * idxCount;
UINT bytesPerIndex = (d3dFmt == D3DFMT_INDEX32) ? 4u : 2u;
m_dwBufferSize = bytesPerIndex * idxCount;
m_d3dFmt = d3dFmt;
return CreateDeviceObjects();