Updated ozz-animation to version 0.14.3 (commit 92c392b667844)

This commit is contained in:
Martin Felis
2024-03-17 12:47:11 +01:00
parent 1ef53d6486
commit c7d2d195a3
28 changed files with 284 additions and 282 deletions
@@ -100,7 +100,7 @@ bool FormatFloat(float _value, char* _string, const char* _string_end) {
if (!_string || _string_end - _string < 8 + precision + 1) {
return false;
}
std::sprintf(_string, "%.2g\n", _value);
std::snprintf(_string, _string_end - _string, "%.2g\n", _value);
// Removes unnecessary '0' digits in the exponent.
char* exponent = strchr(_string, 'e');
@@ -160,12 +160,12 @@ bool Shooter::Process() {
GL(BindBuffer(GL_PIXEL_PACK_BUFFER, shot.pbo));
const void* pixels = glMapBuffer(GL_PIXEL_PACK_BUFFER, GL_READ_ONLY);
if (pixels) {
char name[16];
sprintf(name, "%06d.tga", shot_number_++);
char filename[16];
std::snprintf(filename, sizeof(filename), "%06d.tga", shot_number_++);
ozz::sample::image::WriteTGA(name, shot.width, shot.height, image_format_,
reinterpret_cast<const uint8_t*>(pixels),
false);
ozz::sample::image::WriteTGA(
filename, shot.width, shot.height, image_format_,
reinterpret_cast<const uint8_t*>(pixels), false);
GL(UnmapBuffer(GL_PIXEL_PACK_BUFFER));
}
GL(BindBuffer(GL_PIXEL_PACK_BUFFER, 0));