diff --git a/prop_instance_prop_job.cpp b/prop_instance_prop_job.cpp index 4c67b4f..05b1932 100644 --- a/prop_instance_prop_job.cpp +++ b/prop_instance_prop_job.cpp @@ -33,6 +33,19 @@ SOFTWARE. #include "../mesh_utils/fast_quadratic_mesh_simplifier.h" #endif +#if TEXTURE_PACKER_PRESENT +#include "../texture_packer/texture_packer.h" +#endif + +#if TEXTURE_PACKER_PRESENT +Ref PropInstancePropJob::get_texture_packer() { + return _texture_packer; +} +void PropInstancePropJob::set_texture_packer(const Ref &packer) { + _texture_packer = packer; +} +#endif + PropInstance *PropInstancePropJob::get_prop_instace() { return _prop_instace; } @@ -389,6 +402,12 @@ PropInstancePropJob::~PropInstancePropJob() { } void PropInstancePropJob::_bind_methods() { +#if TEXTURE_PACKER_PRESENT + ClassDB::bind_method(D_METHOD("get_texture_packer"), &PropInstancePropJob::get_texture_packer); + ClassDB::bind_method(D_METHOD("set_texture_packer", "packer"), &PropInstancePropJob::set_texture_packer); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "texture_packer", PROPERTY_HINT_RESOURCE_TYPE, "TexturePacker", 0), "set_texture_packer", "get_texture_packer"); +#endif + ClassDB::bind_method(D_METHOD("get_prop_mesher"), &PropInstancePropJob::get_prop_mesher); ClassDB::bind_method(D_METHOD("set_prop_mesher", "mesher"), &PropInstancePropJob::set_prop_mesher); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "prop_mesher", PROPERTY_HINT_RESOURCE_TYPE, "PropMesher", 0), "set_prop_mesher", "get_prop_mesher"); diff --git a/prop_instance_prop_job.h b/prop_instance_prop_job.h index 6e7e96b..32dd793 100644 --- a/prop_instance_prop_job.h +++ b/prop_instance_prop_job.h @@ -25,6 +25,10 @@ SOFTWARE. #include "prop_instance_job.h" +#if TEXTURE_PACKER_PRESENT +class TexturePacker; +#endif + class PropMesher; class PropInstance; @@ -32,6 +36,11 @@ class PropInstancePropJob : public PropInstanceJob { GDCLASS(PropInstancePropJob, PropInstanceJob); public: +#if TEXTURE_PACKER_PRESENT + Ref get_texture_packer(); + void set_texture_packer(const Ref &packer); +#endif + PropInstance *get_prop_instace(); void set_prop_instace(PropInstance *prop); void set_prop_instace_bind(Node *prop); @@ -52,6 +61,9 @@ public: protected: static void _bind_methods(); +#if TEXTURE_PACKER_PRESENT + Ref _texture_packer; +#endif Ref _prop_mesher; PropInstance *_prop_instace;