clang format

This commit is contained in:
Johan Bowald 2019-07-17 09:06:45 +02:00
parent 1af7c1d784
commit 52936a00e0

View File

@ -817,7 +817,7 @@ struct SpotLight {
double innerConeAngle; double innerConeAngle;
double outerConeAngle; double outerConeAngle;
SpotLight() : innerConeAngle(0.0), outerConeAngle(0.7853981634) { } SpotLight() : innerConeAngle(0.0), outerConeAngle(0.7853981634) {}
bool operator==(const SpotLight &) const; bool operator==(const SpotLight &) const;
@ -1061,7 +1061,6 @@ class TinyGLTF {
const char *str, const unsigned int length, const char *str, const unsigned int length,
const std::string &base_dir, unsigned int check_sections); const std::string &base_dir, unsigned int check_sections);
const unsigned char *bin_data_; const unsigned char *bin_data_;
size_t bin_size_; size_t bin_size_;
bool is_binary_; bool is_binary_;
@ -3704,8 +3703,7 @@ static bool ParsePerspectiveCamera(PerspectiveCamera *camera, std::string *err,
return true; return true;
} }
static bool ParseSpotLight(SpotLight *light, static bool ParseSpotLight(SpotLight *light, std::string *err, const json &o) {
std::string *err, const json &o) {
ParseNumberProperty(&light->innerConeAngle, err, o, "innerConeAngle", false); ParseNumberProperty(&light->innerConeAngle, err, o, "innerConeAngle", false);
ParseNumberProperty(&light->outerConeAngle, err, o, "outerConeAngle", false); ParseNumberProperty(&light->outerConeAngle, err, o, "outerConeAngle", false);
@ -5268,7 +5266,6 @@ static void SerializeGltfTexture(Texture &texture, json &o) {
/// Serialize all properties except buffers and images. /// Serialize all properties except buffers and images.
/// ///
static void SerializeGltfModel(Model *model, json &o) { static void SerializeGltfModel(Model *model, json &o) {
// ACCESSORS // ACCESSORS
json accessors; json accessors;
for (unsigned int i = 0; i < model->accessors.size(); ++i) { for (unsigned int i = 0; i < model->accessors.size(); ++i) {
@ -5296,7 +5293,6 @@ static void SerializeGltfModel(Model *model, json &o) {
SerializeGltfAsset(model->asset, asset); SerializeGltfAsset(model->asset, asset);
o["asset"] = asset; o["asset"] = asset;
// BUFFERVIEWS // BUFFERVIEWS
json bufferViews; json bufferViews;
for (unsigned int i = 0; i < model->bufferViews.size(); ++i) { for (unsigned int i = 0; i < model->bufferViews.size(); ++i) {
@ -5308,8 +5304,7 @@ static void SerializeGltfModel(Model *model, json &o) {
// Extensions used // Extensions used
if (model->extensionsUsed.size()) { if (model->extensionsUsed.size()) {
SerializeStringArrayProperty("extensionsUsed", model->extensionsUsed, SerializeStringArrayProperty("extensionsUsed", model->extensionsUsed, o);
o);
} }
// Extensions required // Extensions required
@ -5441,8 +5436,7 @@ static void SerializeGltfModel(Model *model, json &o) {
} }
} }
static bool WriteGltfStream(std::ostream &stream, static bool WriteGltfStream(std::ostream &stream, const std::string &content) {
const std::string &content) {
stream << content << std::endl; stream << content << std::endl;
return true; return true;
} }
@ -5456,7 +5450,6 @@ static bool WriteGltfFile(const std::string &output,
static void WriteBinaryGltfStream(std::ostream &stream, static void WriteBinaryGltfStream(std::ostream &stream,
const std::string &content) { const std::string &content) {
const std::string header = "glTF"; const std::string header = "glTF";
const int version = 2; const int version = 2;
const int padding_size = content.size() % 4; const int padding_size = content.size() % 4;
@ -5516,8 +5509,9 @@ bool TinyGLTF::WriteGltfSceneToStream(Model *model, std::ostream &stream,
json image; json image;
std::string dummystring = ""; std::string dummystring = "";
// UpdateImageObject need baseDir but only uses it if embededImages is enable, // UpdateImageObject need baseDir but only uses it if embededImages is
// since we won't write separte images when writing to a stream we use a dummystring // enable, since we won't write separte images when writing to a stream we
// use a dummystring
UpdateImageObject(model->images[i], dummystring, int(i), false, UpdateImageObject(model->images[i], dummystring, int(i), false,
&this->WriteImageData, this->write_image_user_data_); &this->WriteImageData, this->write_image_user_data_);
SerializeGltfImage(model->images[i], image); SerializeGltfImage(model->images[i], image);