mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +02:00
Fix polygon drawing: index of coordinates was off by one.
--HG-- branch : minor
This commit is contained in:
@@ -914,7 +914,7 @@ namespace opengl
|
|||||||
glDisable(GL_TEXTURE_2D);
|
glDisable(GL_TEXTURE_2D);
|
||||||
glEnableClientState(GL_VERTEX_ARRAY);
|
glEnableClientState(GL_VERTEX_ARRAY);
|
||||||
glVertexPointer(2, GL_FLOAT, 0, (const GLvoid*)coords);
|
glVertexPointer(2, GL_FLOAT, 0, (const GLvoid*)coords);
|
||||||
glDrawArrays(GL_POLYGON, 0, count / 2); // opengl will close the polygon for us
|
glDrawArrays(GL_POLYGON, 0, count/2-1); // opengl will close the polygon for us
|
||||||
glDisableClientState(GL_VERTEX_ARRAY);
|
glDisableClientState(GL_VERTEX_ARRAY);
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -901,7 +901,7 @@ namespace opengl
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < args; ++i)
|
for (int i = 0; i < args; ++i)
|
||||||
coords[i] = lua_tonumber(L, i + 1);
|
coords[i] = lua_tonumber(L, i + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// make a closed loop
|
// make a closed loop
|
||||||
|
|||||||
Reference in New Issue
Block a user