Commit Graph

298 Commits

Author SHA1 Message Date
Alexander Wood
327f0d4aaa - Remove clang warning suppression. I assume this stackoverflow reference can just be removed as it isn't a code snippet but a repost of clang documentation of ignoring warning levels.
- Remove stackoverflow reference that recommends the use of dlib. There's no source that was pulled from this s.o. post, only a recommendation on a library, I wouldn't think a link to s.o. is necessary here. Per the Boost License, I've included a copy of the license along with the snippet
2021-10-14 08:54:59 -04:00
Alexander Wood
9c55aceb51 Build fix. 2021-10-08 20:13:07 -04:00
Alexander Wood
1dce8df2d2 Build fix. 2021-10-08 20:09:08 -04:00
Alexander Wood
007fbafec5 Build fix. 2021-10-08 16:57:56 -04:00
Alexander Wood
d79477fd01 GetBaseFilename contained a logic error in that a filename that does not contain a path separator would result in a crash.
Removed the roundUp lambda, as this generalization is not necessary; the caller always attempts 4 byte alignment.
2021-10-08 12:19:13 -04:00
Julian Smith
ea13ec88ae Fix for OpenBSD - wordexp.h not available. 2021-08-25 12:06:08 +01:00
Idriss Chaouch
67cf72de3f update enum Type
the first element in an enum is 0, so it's not necessarily to affect values from 0 to 7.
2021-05-20 12:11:00 +01:00
zz
56921c23af Fix comment on minFilter 2021-05-14 13:49:33 +08:00
Mio Nilsson
d8162bd7a5 🐛 Store scene extras and exteions on the scene
This was being stored in the wrong place
2021-05-11 11:50:35 +02:00
Syoyo Fujita
3b5b7f6adf Do not write negative skeleton id(skeleton is not assigned).
Also ensure `inverseBindMatrices` should not be -2 or other negative values.
2021-04-28 19:15:16 +09:00
snowapril
eafd9bed15 Delete unused variable initialization code
Line 4536 in tinygltf.h file, there is unused variable initialization code like below.
```c++
    const auto pBuffer = pAttribute->buffer();
```

gcc compiler complain about that unused variable. 

I found there is no side-effect in  `pAttribute->buffer()` call and also pBuffer variable is never used. Therefore I delete that line entirely.
2021-03-30 00:16:04 +09:00
snowapril
07c2864649 add (void)err for handling unused variable warning
I saw in the `ParseExtensionsProperty`(3667) function,
unused variable err argument is wrapped with (void) keword.

I think err argument in the `ParseDracoExtension`(4472) is exactly
same situation with the above one.

For consistency, I think it need to be added (void)err in the
`ParseDracoExtension` function.
2021-03-20 19:25:58 +09:00
Alvaro Barua
2bd38a0d51 Added TINYGLTF_NO_INCLUDE_RAPIDJSON for consistency and because my project already used rapidjson/ 2021-03-18 00:21:23 +00:00
Syoyo Fujita
dd002c761f asset.version is a required field so write "2.0" when asset.version is empty. Fixes #308 2021-03-02 19:08:29 +09:00
Hill Ma
d118748400 Drop an unnecessary 'const'. 2021-02-20 22:30:44 -08:00
Selmar
089b517943 check correct extensionsUsed for serialization 2021-02-01 19:24:41 +01:00
Syoyo Fujita
e5e9c6cbf6 Merge pull request #303 from syoyo/int-minmax-serialize
Issue #301. Serialize accessor min/vax value as int
2021-01-22 03:40:52 +09:00
Syoyo Fujita
fa5a7902e1 Issue #301. Serialize accessor min/vax value as int if its component type is an integer. 2021-01-21 20:33:11 +09:00
Syoyo Fujita
4f9dd612b8 Remove sampler.wrapR parameter(unused tinygltf extension). Fixes #287
Suppress clang `-Wdocumentation-unknown-command` warning.
2020-12-04 00:50:46 +09:00
Syoyo Fujita
eeef0ec9e5 Add SetPreserveImageChannels feature(preserve image channels in stored image file. Only effective when using builtin ImageLoad function(STB image load)). 2020-10-31 19:35:55 +09:00
Syoyo Fujita
85962aee8a Serialize empty JSON object when material has all default parameters. Fixes #294 . 2020-10-22 22:27:12 +09:00
Syoyo Fujita
3f1d5ccbed Fix inequality. Should allow 0 for bufferView. 2020-07-15 13:52:39 +09:00
Rahul Sheth
9c894f2d89 Fix sparse morph targets 2020-07-13 13:56:50 -04:00
Rahul Sheth
4909d0be84 Run clang-format 2020-07-10 14:27:46 -04:00
Rahul Sheth
17fc862965 Use std::string instead of const char* for GetKey function 2020-07-10 14:27:37 -04:00
daemyung jang
d417d3c2d3 Initialize member variables 2020-07-03 13:27:39 +09:00
Syoyo Fujita
b275837d50 Add comment on tinygltf::ExpandFilePath() 2020-06-06 18:13:15 +09:00
Syoyo Fujita
e05f9ca781 Use nullptr instead of NULL. 2020-06-06 17:11:50 +09:00
cwbhhjl
e1fd746d21 fix an error occurred while expanding utf8 path 2020-06-04 10:40:38 +08:00
Ivo van Dongen
be5639536d cast size_t to uint_64_t for rapidjson serialization 2020-05-29 11:24:11 +03:00
Syoyo Fujita
66938e0ea5 Support llvm-mingw(clang + libcxx) to open UTF-8 path in ifstream. 2020-05-18 20:50:45 +09:00
Syoyo Fujita
67c27aa091 Fix existing "extensions" were overwritten in serialization when the scene contains lights(serialized as "KHR_light_punctual")
Append "KHR_light_punctual" to `extensionsUsed` if not exist in serialization.
Apply clang-format.
Fixes #261
2020-05-15 21:32:06 +09:00
Syoyo Fujita
e306c0fc7f Only serialize light.range when range > 0. Fixes #260 2020-05-13 21:22:23 +09:00
Syoyo Fujita
3639a23222 Return type must be int for GetNumberAsInt(). Fixes #258 2020-05-11 19:07:00 +09:00
Syoyo
4e803bdd96 Serialize extension and extras for Camera. Fixes #257 2020-05-09 02:41:07 +09:00
Syoyo Fujita
5d34059f06 Fix float and int comparison. 2020-04-29 19:16:35 +09:00
Syoyo Fujita
bd73fe76f1 Include cmath for std::fabs 2020-04-29 17:33:48 +09:00
Syoyo Fujita
3ca5b278a1 Return false for zero-sized asset. Fixes #255 2020-04-28 01:06:34 +09:00
Luiz Henrique Laurini
8a127d5771 Fix write functions so they work with MinGW 2020-04-12 16:00:33 -03:00
Syoyo Fujita
c91003e7bd Merge pull request #250 from FsiGuy00015623/prevent-cloning-buffer-images
Prevent cloning of images in buffers
2020-03-10 14:53:13 +09:00
FsiGuy00015623
5d104f637a Prevent cloning of images in buffers
Now, in UpdateImageObject, if an image has no URI but had a valid bufferView, it will no longer change the image object or copy the buffer object to an outside file at baseDir. 
(When saving files from streams, this function would previously save textures in buffers as "#.png" in the program's working directory instead of the model file's directory, and create a broken link in the updated image object if the two locations were different.)
2020-03-09 16:57:21 -05:00
Sanjeet Suhag
164a84f090 Ensures only valid bufferViews are mentioned in accessor 2020-03-04 17:40:10 -05:00
Syoyo Fujita
70456ba892 Merge branch 'uri-decode' 2020-03-03 18:49:27 +09:00
Syoyo Fujita
027e39e8fb Update copyright year.
Add note on the result from fuzzer test.
2020-02-24 01:36:24 +09:00
Miguel Sousa
632810eeca Reading copyright field in ParseAsset() 2020-02-20 14:16:58 +01:00
Selmar Kok
694f27461d Merge remote-tracking branch 'origin/master' into some_empty_array_fixes 2020-01-28 13:46:22 +01:00
Selmar Kok
3c15e73a6b dont serialize a couple of empty arrays 2020-01-28 13:45:38 +01:00
Marcin Kacprzak
327d1da3ee Set target for bufferView used by MorphTargets 2020-01-22 13:13:35 +01:00
Selmar Kok
02da28450a Merge remote-tracking branch 'origin/master' into channel_target_extensions 2020-01-21 18:46:58 +01:00
Selmar Kok
2ded9adf42 add channel.target extensions 2020-01-21 18:45:24 +01:00