mirror of https://github.com/bjornbytes/lovr.git
Improve Mesh error message;
This commit is contained in:
parent
d1a8a5b156
commit
b417df1de9
|
@ -216,7 +216,7 @@ int l_lovrMeshSetVertices(lua_State* L) {
|
||||||
int vertexCount = lua_objlen(L, 2);
|
int vertexCount = lua_objlen(L, 2);
|
||||||
|
|
||||||
if (vertexCount > lovrMeshGetVertexCount(mesh)) {
|
if (vertexCount > lovrMeshGetVertexCount(mesh)) {
|
||||||
return luaL_error(L, "Too many vertices for Mesh\n", lovrMeshGetVertexCount(mesh));
|
return luaL_error(L, "Too many vertices for Mesh (max is %d, got %d)\n", lovrMeshGetVertexCount(mesh), vertexCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
char* vertices = malloc(mesh->stride * vertexCount);
|
char* vertices = malloc(mesh->stride * vertexCount);
|
||||||
|
|
Loading…
Reference in New Issue