From 8d3b160f02054323a1dc4a9bc8b7e1c44fc57753 Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 9 Jan 2020 04:29:45 +0100 Subject: [PATCH] Clang format. --- layers/texture_layer_merger.cpp | 4 ++-- layers/texture_layer_merger.h | 4 ++-- register_types.cpp | 12 +++++------- texture_merger.cpp | 2 +- texture_merger.h | 2 +- texture_packer.cpp | 2 -- texture_packer.h | 12 ++++++------ .../editor_plugin_packer_image_resource.h | 2 +- texture_resource/packer_image_resource_importer.h | 5 ++--- 9 files changed, 20 insertions(+), 25 deletions(-) diff --git a/layers/texture_layer_merger.cpp b/layers/texture_layer_merger.cpp index 0e5f0fd..46410d8 100644 --- a/layers/texture_layer_merger.cpp +++ b/layers/texture_layer_merger.cpp @@ -59,9 +59,9 @@ void TextureLayerMerger::add_texture(Ref p_texture, Color p_color, Vect entry.color = p_color; entry.position = p_position; - if (p_rect.size.x <= 0) + if (p_rect.size.x <= 0) p_rect.size.x = p_texture->get_width(); - + if (p_rect.size.y <= 0) p_rect.size.y = p_texture->get_height(); diff --git a/layers/texture_layer_merger.h b/layers/texture_layer_merger.h index e6c96b5..136841e 100644 --- a/layers/texture_layer_merger.h +++ b/layers/texture_layer_merger.h @@ -3,9 +3,9 @@ #include "core/reference.h" +#include "core/image.h" #include "core/math/rect2.h" #include "core/vector.h" -#include "core/image.h" #include "scene/resources/texture.h" class TextureLayerMerger : public Reference { @@ -24,7 +24,7 @@ public: Color get_base_color() const; void set_base_color(const Color p_color); - + Ref get_data() const; void set_data(const Ref &p_image); diff --git a/register_types.cpp b/register_types.cpp index 0f5ddcf..aa877cf 100644 --- a/register_types.cpp +++ b/register_types.cpp @@ -1,7 +1,7 @@ #include "register_types.h" -#include "texture_packer.h" #include "texture_merger.h" +#include "texture_packer.h" #include "texture_resource/packer_image_resource.h" @@ -21,12 +21,10 @@ void register_texture_packer_types() { ClassDB::register_class(); - #ifdef TOOLS_ENABLED +#ifdef TOOLS_ENABLED EditorPlugins::add_by_type(); - #endif -} - -void unregister_texture_packer_types() { - +#endif } +void unregister_texture_packer_types() { +} diff --git a/texture_merger.cpp b/texture_merger.cpp index 7d60ff4..1c1c5a9 100644 --- a/texture_merger.cpp +++ b/texture_merger.cpp @@ -238,7 +238,7 @@ void TextureMerger::_notification(int p_what) { if (!_dirty) return; - + _dirty = false; merge(); diff --git a/texture_merger.h b/texture_merger.h index e9275eb..d18e096 100644 --- a/texture_merger.h +++ b/texture_merger.h @@ -3,8 +3,8 @@ #include "scene/main/node.h" -#include "core/vector.h" #include "core/engine.h" +#include "core/vector.h" #include "texture_packer.h" diff --git a/texture_packer.cpp b/texture_packer.cpp index c5a4949..c9077d6 100644 --- a/texture_packer.cpp +++ b/texture_packer.cpp @@ -362,8 +362,6 @@ void TexturePacker::merge() { int row_width = (r->w - 2 * _margin); for (int x = 0; x < row_width; ++x) { - - for (int sx = 0; sx < input_format_offset; ++sx) { data.set(start_indx + (x * 4) + sx, image_data[orig_img_indx + sx + (x * input_format_offset)]); } diff --git a/texture_packer.h b/texture_packer.h index 1336a57..3a10d56 100644 --- a/texture_packer.h +++ b/texture_packer.h @@ -1,9 +1,9 @@ #ifndef TEXTURE_PACKER_H #define TEXTURE_PACKER_H -#include "core/reference.h" -#include "core/image.h" #include "core/color.h" +#include "core/image.h" +#include "core/reference.h" #include "core/ustring.h" #include "core/vector.h" #include "scene/resources/texture.h" @@ -31,13 +31,13 @@ public: void set_margin(const int margin); Ref add_texture(Ref texture); - + Ref get_texture(Ref texture); Ref get_texture_index(int index); - + Ref get_original_texture(int index); - - bool contains_texture(Ref texture); + + bool contains_texture(Ref texture); bool unref_texture_index(int index); bool unref_texture(Ref texture); diff --git a/texture_resource/editor_plugin_packer_image_resource.h b/texture_resource/editor_plugin_packer_image_resource.h index e557bdb..8358611 100644 --- a/texture_resource/editor_plugin_packer_image_resource.h +++ b/texture_resource/editor_plugin_packer_image_resource.h @@ -2,8 +2,8 @@ #ifndef EDITOR_PLUGIN_PACKER_IMAGE_RESOURCE_H #define EDITOR_PLUGIN_PACKER_IMAGE_RESOURCE_H -#include "editor/editor_plugin.h" #include "core/ustring.h" +#include "editor/editor_plugin.h" #include "packer_image_resource_importer.h" diff --git a/texture_resource/packer_image_resource_importer.h b/texture_resource/packer_image_resource_importer.h index d8e8a96..718941b 100644 --- a/texture_resource/packer_image_resource_importer.h +++ b/texture_resource/packer_image_resource_importer.h @@ -2,9 +2,9 @@ #ifndef EDITOR_IMPORT_COLLADA_MDR #define EDITOR_IMPORT_COLLADA_MDR -#include "editor/import/editor_import_plugin.h" -#include "core/ustring.h" #include "core/io/resource_saver.h" +#include "core/ustring.h" +#include "editor/import/editor_import_plugin.h" #include "core/image.h" #include "core/io/image_loader.h" @@ -35,7 +35,6 @@ public: ~PackerImageResourceImporter(); private: - }; #endif