Compare commits

..

7 Commits

Author SHA1 Message Date
Syoyo Fujita
350c296802 Merge pull request #418 from agnat/fix_get_file_size_bug
[Bugfix] Actually invoke the user-supplied function instead of subtracting from a pointer...
2023-04-26 19:28:58 +09:00
David Siegel
cc93e1fd25 Fix: Actually invoke the user-supplied function 2023-04-26 12:13:41 +02:00
Syoyo Fujita
59cc44ad4f Merge pull request #417 from syoyo/filesize-check
Fix to #416
2023-04-23 23:15:07 +09:00
Syoyo Fujita
5c06b7d03b Merge pull request #415 from louwaque/release
Fix serialization of AnimationChannel::target_node when it is zero
2023-04-19 05:17:06 +09:00
Loïc Escales
a75355b018 Fix serialization of AnimationChannel::target_node when it is zero 2023-04-18 21:03:39 +02:00
Syoyo Fujita
a977f7a16f Merge pull request #412 from agnat/add_char_pointer_ctor
Fix #411 by adding a Value(const char *) constructor.
2023-04-10 19:11:35 +09:00
David Siegel
49caa65177 Fix #411 by adding a Value(const char *) constructor.
Avoid implicit conversion of pointers to bool. Closes #411.
2023-04-08 23:44:53 +02:00

View File

@@ -301,6 +301,9 @@ class Value {
}
explicit Value(std::string &&s)
: type_(STRING_TYPE), string_value_(std::move(s)) {}
explicit Value(const char *s) : type_(STRING_TYPE) {
string_value_ = s;
}
explicit Value(const unsigned char *p, size_t n) : type_(BINARY_TYPE) {
binary_value_.resize(n);
memcpy(binary_value_.data(), p, n);
@@ -2422,7 +2425,7 @@ static bool LoadExternalFile(std::vector<unsigned char> *out, std::string *err,
size_t file_size{0};
std::string _err;
bool ok = fs-GetFileSizeInBytes(&file_size, &_err, filepath, fs->user_data);
bool ok = fs->GetFileSizeInBytes(&file_size, &_err, filepath, fs->user_data);
if (!ok) {
if (_err.size()) {
if (failMsgOut) {
@@ -7155,7 +7158,7 @@ static void SerializeGltfAnimationChannel(const AnimationChannel &channel,
{
detail::json target;
if (channel.target_node > 0) {
if (channel.target_node >= 0) {
SerializeNumberProperty("node", channel.target_node, target);
}