mirror of
https://github.com/Relintai/texture_packer.git
synced 2025-01-29 15:49:21 +01:00
Clang format.
This commit is contained in:
parent
189810d164
commit
8d3b160f02
@ -59,9 +59,9 @@ void TextureLayerMerger::add_texture(Ref<Texture> p_texture, Color p_color, Vect
|
|||||||
entry.color = p_color;
|
entry.color = p_color;
|
||||||
entry.position = p_position;
|
entry.position = p_position;
|
||||||
|
|
||||||
if (p_rect.size.x <= 0)
|
if (p_rect.size.x <= 0)
|
||||||
p_rect.size.x = p_texture->get_width();
|
p_rect.size.x = p_texture->get_width();
|
||||||
|
|
||||||
if (p_rect.size.y <= 0)
|
if (p_rect.size.y <= 0)
|
||||||
p_rect.size.y = p_texture->get_height();
|
p_rect.size.y = p_texture->get_height();
|
||||||
|
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
#include "core/reference.h"
|
#include "core/reference.h"
|
||||||
|
|
||||||
|
#include "core/image.h"
|
||||||
#include "core/math/rect2.h"
|
#include "core/math/rect2.h"
|
||||||
#include "core/vector.h"
|
#include "core/vector.h"
|
||||||
#include "core/image.h"
|
|
||||||
#include "scene/resources/texture.h"
|
#include "scene/resources/texture.h"
|
||||||
|
|
||||||
class TextureLayerMerger : public Reference {
|
class TextureLayerMerger : public Reference {
|
||||||
@ -24,7 +24,7 @@ public:
|
|||||||
|
|
||||||
Color get_base_color() const;
|
Color get_base_color() const;
|
||||||
void set_base_color(const Color p_color);
|
void set_base_color(const Color p_color);
|
||||||
|
|
||||||
Ref<Image> get_data() const;
|
Ref<Image> get_data() const;
|
||||||
void set_data(const Ref<Image> &p_image);
|
void set_data(const Ref<Image> &p_image);
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "register_types.h"
|
#include "register_types.h"
|
||||||
|
|
||||||
#include "texture_packer.h"
|
|
||||||
#include "texture_merger.h"
|
#include "texture_merger.h"
|
||||||
|
#include "texture_packer.h"
|
||||||
|
|
||||||
#include "texture_resource/packer_image_resource.h"
|
#include "texture_resource/packer_image_resource.h"
|
||||||
|
|
||||||
@ -21,12 +21,10 @@ void register_texture_packer_types() {
|
|||||||
|
|
||||||
ClassDB::register_class<TextureLayerMerger>();
|
ClassDB::register_class<TextureLayerMerger>();
|
||||||
|
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
EditorPlugins::add_by_type<EditorPluginPackerImageResource>();
|
EditorPlugins::add_by_type<EditorPluginPackerImageResource>();
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
void unregister_texture_packer_types() {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void unregister_texture_packer_types() {
|
||||||
|
}
|
||||||
|
@ -238,7 +238,7 @@ void TextureMerger::_notification(int p_what) {
|
|||||||
|
|
||||||
if (!_dirty)
|
if (!_dirty)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_dirty = false;
|
_dirty = false;
|
||||||
|
|
||||||
merge();
|
merge();
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
#include "scene/main/node.h"
|
#include "scene/main/node.h"
|
||||||
|
|
||||||
#include "core/vector.h"
|
|
||||||
#include "core/engine.h"
|
#include "core/engine.h"
|
||||||
|
#include "core/vector.h"
|
||||||
|
|
||||||
#include "texture_packer.h"
|
#include "texture_packer.h"
|
||||||
|
|
||||||
|
@ -362,8 +362,6 @@ void TexturePacker::merge() {
|
|||||||
int row_width = (r->w - 2 * _margin);
|
int row_width = (r->w - 2 * _margin);
|
||||||
for (int x = 0; x < row_width; ++x) {
|
for (int x = 0; x < row_width; ++x) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (int sx = 0; sx < input_format_offset; ++sx) {
|
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)]);
|
data.set(start_indx + (x * 4) + sx, image_data[orig_img_indx + sx + (x * input_format_offset)]);
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#ifndef TEXTURE_PACKER_H
|
#ifndef TEXTURE_PACKER_H
|
||||||
#define TEXTURE_PACKER_H
|
#define TEXTURE_PACKER_H
|
||||||
|
|
||||||
#include "core/reference.h"
|
|
||||||
#include "core/image.h"
|
|
||||||
#include "core/color.h"
|
#include "core/color.h"
|
||||||
|
#include "core/image.h"
|
||||||
|
#include "core/reference.h"
|
||||||
#include "core/ustring.h"
|
#include "core/ustring.h"
|
||||||
#include "core/vector.h"
|
#include "core/vector.h"
|
||||||
#include "scene/resources/texture.h"
|
#include "scene/resources/texture.h"
|
||||||
@ -31,13 +31,13 @@ public:
|
|||||||
void set_margin(const int margin);
|
void set_margin(const int margin);
|
||||||
|
|
||||||
Ref<AtlasTexture> add_texture(Ref<Texture> texture);
|
Ref<AtlasTexture> add_texture(Ref<Texture> texture);
|
||||||
|
|
||||||
Ref<AtlasTexture> get_texture(Ref<Texture> texture);
|
Ref<AtlasTexture> get_texture(Ref<Texture> texture);
|
||||||
Ref<AtlasTexture> get_texture_index(int index);
|
Ref<AtlasTexture> get_texture_index(int index);
|
||||||
|
|
||||||
Ref<Texture> get_original_texture(int index);
|
Ref<Texture> get_original_texture(int index);
|
||||||
|
|
||||||
bool contains_texture(Ref<Texture> texture);
|
bool contains_texture(Ref<Texture> texture);
|
||||||
|
|
||||||
bool unref_texture_index(int index);
|
bool unref_texture_index(int index);
|
||||||
bool unref_texture(Ref<Texture> texture);
|
bool unref_texture(Ref<Texture> texture);
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
#ifndef EDITOR_PLUGIN_PACKER_IMAGE_RESOURCE_H
|
#ifndef EDITOR_PLUGIN_PACKER_IMAGE_RESOURCE_H
|
||||||
#define EDITOR_PLUGIN_PACKER_IMAGE_RESOURCE_H
|
#define EDITOR_PLUGIN_PACKER_IMAGE_RESOURCE_H
|
||||||
|
|
||||||
#include "editor/editor_plugin.h"
|
|
||||||
#include "core/ustring.h"
|
#include "core/ustring.h"
|
||||||
|
#include "editor/editor_plugin.h"
|
||||||
|
|
||||||
#include "packer_image_resource_importer.h"
|
#include "packer_image_resource_importer.h"
|
||||||
|
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
#ifndef EDITOR_IMPORT_COLLADA_MDR
|
#ifndef EDITOR_IMPORT_COLLADA_MDR
|
||||||
#define 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/io/resource_saver.h"
|
||||||
|
#include "core/ustring.h"
|
||||||
|
#include "editor/import/editor_import_plugin.h"
|
||||||
|
|
||||||
#include "core/image.h"
|
#include "core/image.h"
|
||||||
#include "core/io/image_loader.h"
|
#include "core/io/image_loader.h"
|
||||||
@ -35,7 +35,6 @@ public:
|
|||||||
~PackerImageResourceImporter();
|
~PackerImageResourceImporter();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user