mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-11 19:59:00 +08:00
Updates asset object (glTF 2.0)
This commit is contained in:
parent
ab7b218385
commit
d48bbdcd90
@ -482,12 +482,11 @@ typedef struct {
|
|||||||
} Buffer;
|
} Buffer;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
std::string version; // required
|
||||||
std::string generator;
|
std::string generator;
|
||||||
std::string version;
|
std::string minVersion;
|
||||||
std::string profile_api;
|
std::string copyright;
|
||||||
std::string profile_version;
|
ParameterMap extensions;
|
||||||
bool premultipliedAlpha;
|
|
||||||
char pad[7];
|
|
||||||
Value extras;
|
Value extras;
|
||||||
} Asset;
|
} Asset;
|
||||||
|
|
||||||
@ -1347,22 +1346,12 @@ static bool ParseJSONProperty(std::map<std::string, double> *ret, std::string *e
|
|||||||
|
|
||||||
static bool ParseAsset(Asset *asset, std::string *err,
|
static bool ParseAsset(Asset *asset, std::string *err,
|
||||||
const picojson::object &o) {
|
const picojson::object &o) {
|
||||||
|
ParseStringProperty(&asset->version, err, o, "version", true);
|
||||||
ParseStringProperty(&asset->generator, err, o, "generator", false);
|
ParseStringProperty(&asset->generator, err, o, "generator", false);
|
||||||
ParseBooleanProperty(&asset->premultipliedAlpha, err, o, "premultipliedAlpha",
|
ParseStringProperty(&asset->minVersion, err, o, "minVersion", false);
|
||||||
false);
|
|
||||||
|
|
||||||
ParseStringProperty(&asset->version, err, o, "version", false);
|
// Unity exporter version is added as extra here
|
||||||
|
ParseExtrasProperty(&(asset->extras), o);
|
||||||
picojson::object::const_iterator profile = o.find("profile");
|
|
||||||
if (profile != o.end()) {
|
|
||||||
const picojson::value &v = profile->second;
|
|
||||||
if (v.contains("api") & v.get("api").is<std::string>()) {
|
|
||||||
asset->profile_api = v.get("api").get<std::string>();
|
|
||||||
}
|
|
||||||
if (v.contains("version") & v.get("version").is<std::string>()) {
|
|
||||||
asset->profile_version = v.get("version").get<std::string>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user