Fix crash bug where an index buffer was bound as a vertex buffer

This commit is contained in:
Magnus Norddahl 2023-09-17 00:08:51 +02:00 committed by Christoph Oelckers
parent bb111fa96d
commit fd2b1e523c

View file

@ -213,7 +213,7 @@ void Draw2D(F2DDrawer* drawer, FRenderState& state, int x, int y, int width, int
state.SetIndexBuffer(buffers.GetBufferObjects().second); state.SetIndexBuffer(buffers.GetBufferObjects().second);
state.DrawIndexed(DT_Triangles, 0, cmd.shape2DIndexCount); state.DrawIndexed(DT_Triangles, 0, cmd.shape2DIndexCount);
state.SetVertexBuffer(vb.GetBufferObjects().first); state.SetVertexBuffer(vb.GetBufferObjects().first);
state.SetVertexBuffer(vb.GetBufferObjects().second); state.SetIndexBuffer(vb.GetBufferObjects().second);
if (cmd.shape2DCommandCounter == cmd.shape2DBufInfo->lastCommand) if (cmd.shape2DCommandCounter == cmd.shape2DBufInfo->lastCommand)
{ {
cmd.shape2DBufInfo->lastCommand = -1; cmd.shape2DBufInfo->lastCommand = -1;