mirror of
https://github.com/syoyo/tinygltf.git
synced 2026-07-01 03:28:52 +00:00
Compare commits
5 Commits
github-act
...
jmousseau-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cbd3885049 | ||
|
|
9471517c1e | ||
|
|
e59028d68f | ||
|
|
0c7789b1e5 | ||
|
|
51b12d2546 |
33
tiny_gltf.h
33
tiny_gltf.h
@@ -1933,9 +1933,10 @@ bool Sampler::operator==(const Sampler &other) const {
|
||||
return this->extensions == other.extensions && this->extras == other.extras &&
|
||||
this->magFilter == other.magFilter &&
|
||||
this->minFilter == other.minFilter && this->name == other.name &&
|
||||
this->wrapS == other.wrapS &&
|
||||
this->wrapT == other.wrapT;
|
||||
|
||||
//this->wrapR == other.wrapR && this->wrapS == other.wrapS &&
|
||||
//this->wrapR == other.wrapR
|
||||
}
|
||||
bool Scene::operator==(const Scene &other) const {
|
||||
return this->extensions == other.extensions && this->extras == other.extras &&
|
||||
@@ -2216,7 +2217,7 @@ std::string base64_decode(std::string const &encoded_string) {
|
||||
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//
|
||||
namespace dlib {
|
||||
|
||||
inline unsigned char from_hex(unsigned char ch) {
|
||||
@@ -4216,7 +4217,9 @@ static bool ParseSparseAccessor(Accessor *accessor, std::string *err,
|
||||
accessor->sparse.isSparse = true;
|
||||
|
||||
int count = 0;
|
||||
ParseIntegerProperty(&count, err, o, "count", true);
|
||||
if (!ParseIntegerProperty(&count, err, o, "count", true, "SparseAccessor")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
json_const_iterator indices_iterator;
|
||||
json_const_iterator values_iterator;
|
||||
@@ -4234,18 +4237,24 @@ static bool ParseSparseAccessor(Accessor *accessor, std::string *err,
|
||||
const json &values_obj = GetValue(values_iterator);
|
||||
|
||||
int indices_buffer_view = 0, indices_byte_offset = 0, component_type = 0;
|
||||
ParseIntegerProperty(&indices_buffer_view, err, indices_obj, "bufferView",
|
||||
true);
|
||||
if (!ParseIntegerProperty(&indices_buffer_view, err, indices_obj, "bufferView",
|
||||
true, "SparseAccessor")) {
|
||||
return false;
|
||||
}
|
||||
ParseIntegerProperty(&indices_byte_offset, err, indices_obj, "byteOffset",
|
||||
true);
|
||||
ParseIntegerProperty(&component_type, err, indices_obj, "componentType",
|
||||
true);
|
||||
false);
|
||||
if (!ParseIntegerProperty(&component_type, err, indices_obj, "componentType",
|
||||
true, "SparseAccessor")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int values_buffer_view = 0, values_byte_offset = 0;
|
||||
ParseIntegerProperty(&values_buffer_view, err, values_obj, "bufferView",
|
||||
true);
|
||||
if (!ParseIntegerProperty(&values_buffer_view, err, values_obj, "bufferView",
|
||||
true, "SparseAccessor")) {
|
||||
return false;
|
||||
}
|
||||
ParseIntegerProperty(&values_byte_offset, err, values_obj, "byteOffset",
|
||||
true);
|
||||
false);
|
||||
|
||||
accessor->sparse.count = count;
|
||||
accessor->sparse.indices.bufferView = indices_buffer_view;
|
||||
@@ -4254,8 +4263,6 @@ static bool ParseSparseAccessor(Accessor *accessor, std::string *err,
|
||||
accessor->sparse.values.bufferView = values_buffer_view;
|
||||
accessor->sparse.values.byteOffset = values_byte_offset;
|
||||
|
||||
// todo check theses values
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user