mirror of https://github.com/bjornbytes/lovr.git
Fix warnings;
This commit is contained in:
parent
9a1579a773
commit
5b0fa8b522
|
@ -290,7 +290,9 @@ static int l_lovrGraphicsPresent(lua_State* L) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static int l_lovrGraphicsCreateWindow(lua_State* L) {
|
static int l_lovrGraphicsCreateWindow(lua_State* L) {
|
||||||
WindowFlags flags = { 0 };
|
WindowFlags flags;
|
||||||
|
memset(&flags, 0, sizeof(flags));
|
||||||
|
|
||||||
luaL_checktype(L, 1, LUA_TTABLE);
|
luaL_checktype(L, 1, LUA_TTABLE);
|
||||||
|
|
||||||
lua_getfield(L, 1, "width");
|
lua_getfield(L, 1, "width");
|
||||||
|
|
|
@ -193,7 +193,9 @@ ModelData* lovrModelDataInitGltf(ModelData* model, Blob* source) {
|
||||||
jsmntok_t* scenes;
|
jsmntok_t* scenes;
|
||||||
jsmntok_t* skins;
|
jsmntok_t* skins;
|
||||||
int sceneCount;
|
int sceneCount;
|
||||||
} info = { 0 };
|
} info;
|
||||||
|
|
||||||
|
memset(&info, 0, sizeof(info));
|
||||||
|
|
||||||
gltfAnimationSampler* animationSamplers = NULL;
|
gltfAnimationSampler* animationSamplers = NULL;
|
||||||
gltfMesh* meshes = NULL;
|
gltfMesh* meshes = NULL;
|
||||||
|
@ -411,7 +413,8 @@ ModelData* lovrModelDataInitGltf(ModelData* model, Blob* source) {
|
||||||
jsmntok_t* token = info.buffers;
|
jsmntok_t* token = info.buffers;
|
||||||
Blob** blob = model->blobs;
|
Blob** blob = model->blobs;
|
||||||
for (int i = (token++)->size; i > 0; i--, blob++) {
|
for (int i = (token++)->size; i > 0; i--, blob++) {
|
||||||
gltfString uri = { 0 };
|
gltfString uri;
|
||||||
|
memset(&uri, 0, sizeof(uri));
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
|
|
||||||
for (int k = (token++)->size; k > 0; k--) {
|
for (int k = (token++)->size; k > 0; k--) {
|
||||||
|
@ -708,7 +711,7 @@ ModelData* lovrModelDataInitGltf(ModelData* model, Blob* source) {
|
||||||
} else if (STR_EQ(key, "attributes")) {
|
} else if (STR_EQ(key, "attributes")) {
|
||||||
int attributeCount = (token++)->size;
|
int attributeCount = (token++)->size;
|
||||||
for (int a = 0; a < attributeCount; a++) {
|
for (int a = 0; a < attributeCount; a++) {
|
||||||
DefaultAttribute attributeType = -1;
|
DefaultAttribute attributeType = ~0;
|
||||||
gltfString name = NOM_STR(json, token);
|
gltfString name = NOM_STR(json, token);
|
||||||
int attributeIndex = NOM_INT(json, token);
|
int attributeIndex = NOM_INT(json, token);
|
||||||
if (STR_EQ(name, "POSITION")) { attributeType = ATTR_POSITION; }
|
if (STR_EQ(name, "POSITION")) { attributeType = ATTR_POSITION; }
|
||||||
|
@ -718,7 +721,7 @@ ModelData* lovrModelDataInitGltf(ModelData* model, Blob* source) {
|
||||||
else if (STR_EQ(name, "TANGENT")) { attributeType = ATTR_TANGENT; }
|
else if (STR_EQ(name, "TANGENT")) { attributeType = ATTR_TANGENT; }
|
||||||
else if (STR_EQ(name, "JOINTS_0")) { attributeType = ATTR_BONES; }
|
else if (STR_EQ(name, "JOINTS_0")) { attributeType = ATTR_BONES; }
|
||||||
else if (STR_EQ(name, "WEIGHTS_0")) { attributeType = ATTR_WEIGHTS; }
|
else if (STR_EQ(name, "WEIGHTS_0")) { attributeType = ATTR_WEIGHTS; }
|
||||||
if (attributeType >= 0) {
|
if (attributeType != (DefaultAttribute) ~0) {
|
||||||
primitive->attributes[attributeType] = &model->attributes[attributeIndex];
|
primitive->attributes[attributeType] = &model->attributes[attributeIndex];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue