merge and update all copies of stb_image.h

pull/3889/head
Krishty 2021-05-05 23:05:44 +02:00
parent be85eac703
commit 24df52647f
5 changed files with 514 additions and 7934 deletions

View File

@ -56,6 +56,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//#define ASSIMP_USE_M3D_READFILECB
//#define M3D_ASCII
// Share stb_image's PNG loader with other importers/exporters instead of bringing our own copy.
#define STBI_ONLY_PNG
#include <contrib/stb_image/stb_image.h>
#include "m3d.h"
namespace Assimp {

View File

@ -1251,3 +1251,36 @@ ASSIMP_API void aiQuaternionInterpolate(
ai_assert(nullptr != end);
aiQuaternion::Interpolate(*dst, *start, *end, factor);
}
// stb_image is a lightweight image loader. It is shared by:
// - M3D import
// - PBRT export
// Since it's a header-only library, its implementation must be instantiated in some cpp file.
// Don't scatter this task over multiple importers/exporters. Maintain it in a central place (here!).
#define ASSIMP_HAS_PBRT_EXPORT (!ASSIMP_BUILD_NO_EXPORT && !ASSIMP_BUILD_NO_PBRT_EXPORTER)
#define ASSIMP_HAS_M3D ((!ASSIMP_BUILD_NO_EXPORT && !ASSIMP_BUILD_NO_M3D_EXPORTER) || !ASSIMP_BUILD_NO_M3D_IMPORTER)
#if ASSIMP_HAS_PBRT_EXPORT
# define ASSIMP_NEEDS_STB_IMAGE 1
#elif ASSIMP_HAS_M3D
# define ASSIMP_NEEDS_STB_IMAGE 1
# define STBI_ONLY_PNG
#endif
#if ASSIMP_NEEDS_STB_IMAGE
# if _MSC_VER // "unreferenced function has been removed" (SSE2 detection routine in x64 builds)
# pragma warning(push)
# pragma warning(disable: 4505)
# endif
# define STB_IMAGE_IMPLEMENTATION
# include "../contrib/stb_image/stb_image.h"
# if _MSC_VER
# pragma warning(pop)
# endif
#endif

View File

@ -83,8 +83,7 @@ Other:
#include <sstream>
#include <string>
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
#include "../contrib/stb_image/stb_image.h"
using namespace Assimp;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff