Skip to content

Commit

Permalink
thirdparty: Upgrade stb header files
Browse files Browse the repository at this point in the history
  • Loading branch information
anlambert committed Oct 30, 2024
1 parent e57c816 commit d7bc8c9
Show file tree
Hide file tree
Showing 4 changed files with 10,895 additions and 2,836 deletions.
9 changes: 5 additions & 4 deletions library/talipot-ogl/src/GlTextureManager.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
*
* Copyright (C) 2019-2023 The Talipot developers
* Copyright (C) 2019-2024 The Talipot developers
*
* Talipot is a fork of Tulip, created by David Auber
* and the Tulip development Team from LaBRI, University of Bordeaux
Expand All @@ -19,8 +19,8 @@
#endif
#define STB_IMAGE_IMPLEMENTATION
#include <stb_image.h>
#define STB_IMAGE_RESIZE_IMPLEMENTATION
#include <stb_image_resize.h>
#define STB_IMAGE_RESIZE2_IMPLEMENTATION
#include <stb_image_resize2.h>
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
Expand Down Expand Up @@ -109,7 +109,8 @@ bool GlTextureLoader::loadTexture(const string &filename, GlTexture &texture) {
int nearestpotH = nearestPOT(h);
if (nearestpotW != w || nearestpotH != h) {
auto *newPixels = new unsigned char[nearestpotW * nearestpotH * nbBytesPerPixel];
stbir_resize_uint8(pixels, w, h, 0, newPixels, nearestpotW, nearestpotH, 0, nbBytesPerPixel);
stbir_resize_uint8_linear(pixels, w, h, 0, newPixels, nearestpotW, nearestpotH, 0,
static_cast<stbir_pixel_layout>(nbBytesPerPixel));
delete[] pixels;
pixels = newPixels;
w = nearestpotW;
Expand Down
Loading

0 comments on commit d7bc8c9

Please sign in to comment.