Bug in GFXDevice::drawWireCube()
by Tom Spilman · in Torque Game Engine Advanced · 04/07/2005 (2:33 pm) · 2 replies
Simple bug in GFXDevice::drawWireCube():
void GFXDevice::drawWireCube( const Point3F &size, const Point3F &pos, const ColorI &color )
{
setBaseRenderState();
GFXVertexBufferHandle<GFXVertexPC> verts(GFX, 30, GFXBufferTypeVolatile);
verts.lock();
// setup 6 line loops
U32 vertexIndex = 0;
for(int i = 0; i < 6; i++)
{
for(int j = 0; j < 5; j++)
{
int idx = cubeFaces[i][j%4];
verts[vertexIndex].point = ( cubePoints[idx] * size ) + pos;
verts[vertexIndex].color = color;
vertexIndex; // BUG... should be ++vertexIndex!
}
}About the author
Tom is a programmer and co-owner of Sickhead Games, LLC.
Torque Owner Brian Ramage
Black Jacket Games
Thanks anyway though ;)