mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-15 10:25:56 +08:00
Fix MSVC build: removing static keyowrd befor tinygltf::LoadImageData
This is peculiar: It looks like MSVC doesn't want to build when multiple compilation units (e.g. multiple .cc files) uses tiny_gltf and this funciton is static. The only one file that will build without error is the one that defined the `TINYGLTF_IMPLEMENTATION` macro. Removing `static` here solves the issue... Signed-off-by: Arthur Brainville (Ybalrid) <ybalrid@ybalrid.info>
This commit is contained in:
parent
34c8b60325
commit
68174a3fb3
12
tiny_gltf.h
12
tiny_gltf.h
@ -732,9 +732,9 @@ typedef bool (*LoadImageDataFunction)(Image *, std::string *, int, int,
|
|||||||
|
|
||||||
#ifndef TINYGLTF_NO_STB_IMAGE
|
#ifndef TINYGLTF_NO_STB_IMAGE
|
||||||
// Declaration of default image loader callback
|
// Declaration of default image loader callback
|
||||||
static bool LoadImageData(Image *image, std::string *err, int req_width,
|
bool LoadImageData(Image *image, std::string *err, int req_width,
|
||||||
int req_height, const unsigned char *bytes, int size,
|
int req_height, const unsigned char *bytes, int size,
|
||||||
void *);
|
void *);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class TinyGLTF {
|
class TinyGLTF {
|
||||||
@ -1197,9 +1197,9 @@ void TinyGLTF::SetImageLoader(LoadImageDataFunction func, void *user_data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef TINYGLTF_NO_STB_IMAGE
|
#ifndef TINYGLTF_NO_STB_IMAGE
|
||||||
static bool LoadImageData(Image *image, std::string *err, int req_width,
|
bool LoadImageData(Image *image, std::string *err, int req_width,
|
||||||
int req_height, const unsigned char *bytes, int size,
|
int req_height, const unsigned char *bytes, int size,
|
||||||
void *) {
|
void *) {
|
||||||
int w, h, comp;
|
int w, h, comp;
|
||||||
// if image cannot be decoded, ignore parsing and keep it by its path
|
// if image cannot be decoded, ignore parsing and keep it by its path
|
||||||
// don't break in this case
|
// don't break in this case
|
||||||
|
Loading…
x
Reference in New Issue
Block a user