Improve error message when loading textures that are not PNGs.
PiperOrigin-RevId: 452052514 Change-Id: Ic2f0e8717e43d1a17b2d07ac0e07efe96c5ae1bd
This commit is contained in:
committed by
Copybara-Service
parent
8902c2089a
commit
d7ae7f5433
@@ -2236,7 +2236,8 @@ void mjCTexture::LoadCustom(string filename, const mjVFS* vfs,
|
|||||||
mju_free(buffer);
|
mju_free(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw mjCError(this, "non-positive texture dimensions in file '%s'", filename.c_str());
|
throw mjCError(this, "Non-PNG texture, assuming custom binary file format,\n"
|
||||||
|
"non-positive texture dimensions in file '%s'", filename.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// check buffer size
|
// check buffer size
|
||||||
@@ -2245,7 +2246,8 @@ void mjCTexture::LoadCustom(string filename, const mjVFS* vfs,
|
|||||||
mju_free(buffer);
|
mju_free(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw mjCError(this, "unexpected file size in file '%s'", filename.c_str());
|
throw mjCError(this, "Non-PNG texture, assuming custom binary file format,\n"
|
||||||
|
"unexpected file size in file '%s'", filename.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// allocate and copy
|
// allocate and copy
|
||||||
|
|||||||
Reference in New Issue
Block a user