mirror of
https://github.com/love2d/love.git
synced 2026-08-14 01:20:56 +02:00
Fix newMesh(format, ...). Fix Mesh:attachAttribute.
Deprecate the mesh argument variant of attachAttribute in favor of the buffer argument variant.
This commit is contained in:
@@ -1690,7 +1690,7 @@ static Mesh *newCustomMesh(lua_State *L)
|
||||
|
||||
const char *name = luaL_checkstring(L, -3);
|
||||
|
||||
DataFormat format = DATAFORMAT_FLOAT;
|
||||
DataFormat format = DATAFORMAT_MAX_ENUM;
|
||||
const char *tname = luaL_checkstring(L, -2);
|
||||
|
||||
if (!lua_isnoneornil(L, -1))
|
||||
@@ -1728,10 +1728,11 @@ static Mesh *newCustomMesh(lua_State *L)
|
||||
else
|
||||
luaL_error(L, "Invalid component count (%d) for vertex data type %s", components, tname);
|
||||
}
|
||||
else if (!getConstant(tname, format))
|
||||
luax_enumerror(L, "vertex data format", getConstants(format), tname);
|
||||
}
|
||||
|
||||
if (format == DATAFORMAT_MAX_ENUM && !getConstant(tname, format))
|
||||
luax_enumerror(L, "vertex data format", getConstants(format), tname);
|
||||
|
||||
lua_pop(L, 4);
|
||||
vertexformat.emplace_back(name, format);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user