Replaced the old TEXTURE_PACKER_PRESENT defines with the module system's generated defines.

This commit is contained in:
Relintai 2022-10-05 10:25:48 +02:00
parent 8e6ff671a8
commit ece362681d
55 changed files with 210 additions and 141 deletions

View File

@ -10,12 +10,6 @@ if os.path.isdir('../mesh_data_resource'):
if os.path.isdir('../props'):
module_env.Append(CPPDEFINES=['PROPS_PRESENT'])
has_texture_packer = False
if os.path.isdir('../texture_packer'):
has_texture_packer = True
module_env.Append(CPPDEFINES=['TEXTURE_PACKER_PRESENT'])
sources = [
"register_types.cpp",
@ -131,7 +125,7 @@ sources = [
"material_cache/ess_material_cache.cpp"
]
if has_texture_packer:
if env["module_texture_packer_enabled"]:
sources.append("material_cache/ess_material_cache_pcm.cpp")
if ARGUMENTS.get('custom_modules_shared', 'no') == 'yes':

View File

@ -131,7 +131,12 @@ SOFTWARE.
#include "database/ess_resource_db_static.h"
#include "material_cache/ess_material_cache.h"
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "material_cache/ess_material_cache_pcm.h"
#endif
#if PROPS_PRESENT
#include "props/prop_data_entity.h"
@ -265,7 +270,10 @@ void register_entity_spell_system_types() {
ClassDB::register_class<ESSEntitySpawner>();
ClassDB::register_class<ESSMaterialCache>();
#ifdef MODULE_TEXTURE_PACKER_ENABLED
ClassDB::register_class<ESSMaterialCachePCM>();
#endif
entity_data_manager = memnew(ESS);
ClassDB::register_class<ESS>();

View File

@ -28,6 +28,8 @@ SOFTWARE.
#include "../utility/entity_create_info.h"
#include "core/config/project_settings.h"
#include "modules/modules_enabled.gen.h"
ESS *ESS::instance;
ESS *ESS::get_singleton() {
@ -495,7 +497,7 @@ void ESS::set_class_xp_data(const PoolIntArray &data) {
_class_xps = data;
}
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
int ESS::get_texture_flags() const {
return _texture_flags;
}
@ -814,7 +816,7 @@ void ESS::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_class_xp_data", "data"), &ESS::set_character_xp_data);
ADD_PROPERTY(PropertyInfo(Variant::POOL_INT_ARRAY, "class_xp_data"), "set_class_xp_data", "get_class_xp_data");
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
ClassDB::bind_method(D_METHOD("get_texture_flags"), &ESS::get_texture_flags);
ClassDB::bind_method(D_METHOD("set_texture_flags", "flags"), &ESS::set_texture_flags);
ADD_PROPERTY(PropertyInfo(Variant::INT, "texture_flags", PROPERTY_HINT_FLAGS, "Mipmaps,Repeat,Filter,Anisotropic Linear,Convert to Linear,Mirrored Repeat,Video Surface"), "set_texture_flags", "get_texture_flags");
@ -899,13 +901,13 @@ ESS::ESS() {
_class_xps = GLOBAL_DEF("ess/xp/class_xps", PoolIntArray());
_character_xps = GLOBAL_DEF("ess/xp/character_xps", PoolIntArray());
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
_default_ess_material_cache_class = GLOBAL_DEF("ess/material_cache/default_ess_material_cache_class", "ESSMaterialCachePCM");
#else
_default_ess_material_cache_class = GLOBAL_DEF("ess/material_cache/default_ess_material_cache_class", "ESSMaterialCache");
#endif
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
_texture_flags = GLOBAL_DEF("ess/material_cache/texture_flags", Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER);
_max_atlas_size = GLOBAL_DEF("ess/material_cache/max_atlas_size", 1024);

View File

@ -31,6 +31,7 @@ SOFTWARE.
#include "scene/main/node.h"
#include "../defines.h"
#include "modules/modules_enabled.gen.h"
class ESSResourceDB;
class ESSEntitySpawner;
@ -171,7 +172,7 @@ public:
PoolIntArray get_class_xp_data();
void set_class_xp_data(const PoolIntArray &data);
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
int get_texture_flags() const;
void set_texture_flags(const int flags);
@ -277,7 +278,7 @@ private:
Map<uint64_t, Ref<ESSMaterialCache>> _material_cache;
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
int _texture_flags;
int _max_atlas_size;
bool _keep_original_atlases;

View File

@ -4,9 +4,6 @@ Import('env')
module_env = env.Clone()
if env["module_texture_packer_enabled"]:
module_env.Append(CPPDEFINES=['TEXTURE_PACKER_PRESENT'])
if env["module_props_enabled"]:
module_env.Append(CPPDEFINES=['PROPS_PRESENT'])

View File

@ -4,7 +4,9 @@
#include "core/io/image.h"
#if TEXTURE_PACKER_PRESENT
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "../../texture_packer/texture_resource/packer_image_resource.h"
#endif
@ -165,7 +167,7 @@ void MeshDataInstance::setup_material_texture() {
return;
}
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
Ref<PackerImageResource> r = _texture;
if (r.is_valid()) {

View File

@ -4,7 +4,9 @@
#include "core/io/image.h"
#if TEXTURE_PACKER_PRESENT
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "../../texture_packer/texture_resource/packer_image_resource.h"
#endif

View File

@ -22,6 +22,8 @@ SOFTWARE.
#include "prop_data_mesh_data.h"
#include "modules/modules_enabled.gen.h"
#if PROPS_PRESENT
#include "../nodes/mesh_data_instance.h"
@ -55,7 +57,7 @@ void PropDataMeshData::set_snap_axis(Vector3 value) {
_snap_axis = value;
}
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
void PropDataMeshData::_add_textures_into(Ref<TexturePacker> texture_packer) {
if (get_texture().is_valid()) {
texture_packer->add_texture(get_texture());
@ -122,7 +124,7 @@ void PropDataMeshData::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_snap_axis", "value"), &PropDataMeshData::set_snap_axis);
ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "snap_axis"), "set_snap_axis", "get_snap_axis");
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
ClassDB::bind_method(D_METHOD("_add_textures_into", "texture_packer"), &PropDataMeshData::_add_textures_into);
#endif
}

View File

@ -22,6 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "modules/modules_enabled.gen.h"
#if PROPS_PRESENT
#include "../../props/props/prop_data_entry.h"
@ -31,7 +33,7 @@ SOFTWARE.
#include "../mesh_data_resource.h"
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "../../texture_packer/texture_packer.h"
#endif
@ -53,7 +55,7 @@ public:
Vector3 get_snap_axis();
void set_snap_axis(Vector3 value);
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
void _add_textures_into(Ref<TexturePacker> texture_packer);
#endif

View File

@ -22,6 +22,8 @@ SOFTWARE.
#include "prop_2d_data_mesh_data.h"
#include "modules/modules_enabled.gen.h"
#if PROPS_2D_PRESENT
#include "../nodes/mesh_data_instance.h"
@ -55,7 +57,7 @@ void Prop2DDataMeshData::set_snap_axis(Vector3 value) {
_snap_axis = value;
}
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
void Prop2DDataMeshData::_add_textures_into(Ref<TexturePacker> texture_packer) {
if (get_texture().is_valid()) {
texture_packer->add_texture(get_texture());
@ -129,7 +131,7 @@ void Prop2DDataMeshData::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_snap_axis", "value"), &Prop2DDataMeshData::set_snap_axis);
ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "snap_axis"), "set_snap_axis", "get_snap_axis");
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
ClassDB::bind_method(D_METHOD("_add_textures_into", "texture_packer"), &Prop2DDataMeshData::_add_textures_into);
#endif
}

View File

@ -22,6 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "modules/modules_enabled.gen.h"
#if PROPS_2D_PRESENT
#include "../../props_2d/props/prop_2d_data_entry.h"
@ -31,7 +33,7 @@ SOFTWARE.
#include "../mesh_data_resource.h"
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "../../texture_packer/texture_packer.h"
#endif
@ -53,7 +55,7 @@ public:
Vector3 get_snap_axis();
void set_snap_axis(Vector3 value);
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
void _add_textures_into(Ref<TexturePacker> texture_packer);
#endif

View File

@ -9,12 +9,6 @@ import version
if os.path.isdir('../mesh_data_resource'):
module_env.Append(CPPDEFINES=['MESH_DATA_RESOURCE_PRESENT'])
has_texture_packer = False
if os.path.isdir('../texture_packer'):
has_texture_packer = True
module_env.Append(CPPDEFINES=['TEXTURE_PACKER_PRESENT'])
if os.path.isdir('../terraman'):
module_env.Append(CPPDEFINES=['TERRAMAN_PRESENT'])
@ -65,7 +59,7 @@ sources = [
if version.minor >= 4:
sources.append("props/prop_data_portal.cpp")
if has_texture_packer:
if env["module_texture_packer_enabled"]:
sources.append("material_cache/prop_material_cache_pcm.cpp")
if ARGUMENTS.get('custom_modules_shared', 'no') == 'yes':

View File

@ -22,6 +22,8 @@ SOFTWARE.
#include "ground_clutter.h"
#include "modules/modules_enabled.gen.h"
#ifdef VOXELMAN_PRESENT
#include "../../voxelman/world/voxel_chunk.h"
@ -38,7 +40,7 @@ void GroundClutter::add_meshes_to(Ref<VoxelMesher> mesher, Ref<VoxelChunk> chunk
}
#endif
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
void GroundClutter::add_textures_to(Ref<TexturePacker> packer) {
if (has_method("_add_textures_to"))
call("_add_textures_to", packer);
@ -52,7 +54,7 @@ GroundClutter::~GroundClutter() {
}
void GroundClutter::_bind_methods() {
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
BIND_VMETHOD(MethodInfo("_add_textures_to", PropertyInfo(Variant::OBJECT, "packer", PROPERTY_HINT_RESOURCE_TYPE, "TexturePacker")));
ClassDB::bind_method(D_METHOD("add_textures_to", "packer"), &GroundClutter::add_textures_to);

View File

@ -24,7 +24,9 @@ SOFTWARE.
#include "core/object/resource.h"
#ifdef TEXTURE_PACKER_PRESENT
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "../../texture_packer/texture_packer.h"
#endif
@ -45,7 +47,7 @@ public:
void add_meshes_to(Ref<VoxelMesher> mesher, Ref<VoxelChunk> chunk, int x, int y, int z);
#endif
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
void add_textures_to(Ref<TexturePacker> packer);
#endif

View File

@ -22,11 +22,13 @@ SOFTWARE.
#include "prop_texture_job.h"
#if TEXTURE_PACKER_PRESENT
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "../../texture_packer/texture_packer.h"
#endif
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
Ref<TexturePacker> PropTextureJob::get_merger() {
return _merger;
}
@ -37,7 +39,7 @@ void PropTextureJob::set_merger(const Ref<TexturePacker> &merger) {
#endif
void PropTextureJob::_execute() {
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
if (!_merger.is_valid()) {
set_complete(true);
return;
@ -56,7 +58,7 @@ PropTextureJob::~PropTextureJob() {
}
void PropTextureJob::_bind_methods() {
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
ClassDB::bind_method(D_METHOD("get_merger"), &PropTextureJob::get_merger);
ClassDB::bind_method(D_METHOD("set_merger", "value"), &PropTextureJob::set_merger);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "merger", PROPERTY_HINT_RESOURCE_TYPE, "TexturePacker"), "set_merger", "get_merger");

View File

@ -28,7 +28,9 @@ SOFTWARE.
#include "core/object/reference.h"
#if TEXTURE_PACKER_PRESENT
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_TEXTURE_PACKER_ENABLED
class TexturePacker;
#endif
@ -36,7 +38,7 @@ class PropTextureJob : public ThreadPoolJob {
GDCLASS(PropTextureJob, ThreadPoolJob);
public:
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
Ref<TexturePacker> get_merger();
void set_merger(const Ref<TexturePacker> &merger);
#endif
@ -49,7 +51,7 @@ public:
protected:
static void _bind_methods();
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
Ref<TexturePacker> _merger;
#endif
};

View File

@ -18,6 +18,10 @@
#include "servers/rendering_server.h"
#include "modules/modules_enabled.gen.h"
#include "./singleton/prop_cache.h"
#if MESH_DATA_RESOURCE_PRESENT
//define PROPS_PRESENT, so things compile. That module's scsub will define this too while compiling,
//but not when included from here.
@ -35,7 +39,7 @@
#include "scene/3d/camera.h"
#include "scene/main/viewport.h"
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "./singleton/prop_cache.h"
#endif

View File

@ -33,6 +33,8 @@ SOFTWARE.
#include "servers/physics_server.h"
#include "singleton/prop_cache.h"
#include "modules/modules_enabled.gen.h"
#ifdef MESH_DATA_RESOURCE_PRESENT
#include "../mesh_data_resource/mesh_data_resource.h"
#endif
@ -41,7 +43,7 @@ SOFTWARE.
#include "../mesh_utils/fast_quadratic_mesh_simplifier.h"
#endif
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "../texture_packer/texture_packer.h"
#endif

View File

@ -28,6 +28,8 @@ SOFTWARE.
#include "servers/physics_server.h"
#include "modules/modules_enabled.gen.h"
int PropData::get_id() const {
return _id;
}
@ -88,7 +90,7 @@ void PropData::set_props(const Vector<Variant> &props) {
}
}
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
void PropData::add_textures_into(Ref<TexturePacker> texture_packer) {
ERR_FAIL_COND(!texture_packer.is_valid());
@ -163,7 +165,7 @@ void PropData::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_props", "props"), &PropData::set_props);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "props", PROPERTY_HINT_NONE, "23/19:PropDataEntry", PROPERTY_USAGE_DEFAULT, "PropDataEntry"), "set_props", "get_props");
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
ClassDB::bind_method(D_METHOD("add_textures_into", "texture_packer"), &PropData::add_textures_into);
#endif

View File

@ -32,7 +32,9 @@ SOFTWARE.
#include "prop_data_entry.h"
#if TEXTURE_PACKER_PRESENT
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "../../texture_packer/texture_packer.h"
#endif
@ -59,7 +61,7 @@ public:
Vector<Variant> get_props();
void set_props(const Vector<Variant> &props);
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
void add_textures_into(Ref<TexturePacker> texture_packer);
#endif

View File

@ -26,7 +26,9 @@ SOFTWARE.
#include "scene/3d/spatial.h"
#if TEXTURE_PACKER_PRESENT
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "../../texture_packer/texture_packer.h"
#endif
@ -39,7 +41,7 @@ void PropDataEntry::set_transform(const Transform &value) {
_transform = value;
}
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
void PropDataEntry::add_textures_into(Ref<TexturePacker> texture_packer) {
if (has_method("_add_textures_into"))
call("_add_textures_into", texture_packer);
@ -81,7 +83,7 @@ void PropDataEntry::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_transform", "value"), &PropDataEntry::set_transform);
ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM, "transform"), "set_transform", "get_transform");
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
BIND_VMETHOD(MethodInfo("_add_textures_into", PropertyInfo(Variant::OBJECT, "texture_packer", PROPERTY_HINT_RESOURCE_TYPE, "TexturePacker")));
ClassDB::bind_method(D_METHOD("add_textures_into", "texture_packer"), &PropDataEntry::add_textures_into);

View File

@ -25,6 +25,8 @@ SOFTWARE.
#include "core/math/transform.h"
#include "core/object/resource.h"
#include "modules/modules_enabled.gen.h"
class PropData;
class PropMesher;
class TexturePacker;
@ -36,7 +38,7 @@ public:
Transform get_transform() const;
void set_transform(const Transform &value);
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
void add_textures_into(Ref<TexturePacker> texture_packer);
#endif

View File

@ -25,6 +25,8 @@ SOFTWARE.
#include "../prop_instance.h"
#include "prop_data.h"
#include "modules/modules_enabled.gen.h"
Ref<PropData> PropDataProp::get_prop() const {
return _prop;
}
@ -46,7 +48,7 @@ void PropDataProp::set_snap_axis(Vector3 value) {
_snap_axis = value;
}
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
void PropDataProp::_add_textures_into(Ref<TexturePacker> texture_packer) {
if (get_prop().is_valid()) {
get_prop()->add_textures_into(texture_packer);
@ -103,7 +105,7 @@ void PropDataProp::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_snap_axis", "value"), &PropDataProp::set_snap_axis);
ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "snap_axis"), "set_snap_axis", "get_snap_axis");
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
ClassDB::bind_method(D_METHOD("_add_textures_into", "texture_packer"), &PropDataProp::_add_textures_into);
#endif
}

View File

@ -27,7 +27,9 @@ SOFTWARE.
#include "prop_data.h"
#if TEXTURE_PACKER_PRESENT
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "../../texture_packer/texture_packer.h"
#endif
@ -44,7 +46,7 @@ public:
Vector3 get_snap_axis();
void set_snap_axis(Vector3 value);
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
void _add_textures_into(Ref<TexturePacker> texture_packer);
#endif

View File

@ -62,7 +62,9 @@ SOFTWARE.
#include "material_cache/prop_material_cache.h"
#ifdef TEXTURE_PACKER_PRESENT
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "material_cache/prop_material_cache_pcm.h"
#endif
@ -104,7 +106,7 @@ void register_props_types() {
ClassDB::register_class<PropMaterialCache>();
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
ClassDB::register_class<PropMaterialCachePCM>();
#endif

View File

@ -37,6 +37,8 @@ SOFTWARE.
#include "core/containers/hashfuncs.h"
#include "modules/modules_enabled.gen.h"
#define VARIANT_ARRAY_GET(arr) \
Vector<Variant> r; \
for (int i = 0; i < arr.size(); i++) { \
@ -57,7 +59,7 @@ void PropCache::set_default_prop_material_cache_class(const StringName &cls_name
_default_prop_material_cache_class = cls_name;
}
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
int PropCache::get_texture_flags() const {
return _texture_flags;
}
@ -342,13 +344,13 @@ Ref<Resource> PropCache::load_resource(const String &path, const String &type_hi
PropCache::PropCache() {
_instance = this;
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
_default_prop_material_cache_class = GLOBAL_DEF("props/default_prop_material_cache_class", "PropMaterialCachePCM");
#else
_default_prop_material_cache_class = GLOBAL_DEF("props/default_prop_material_cache_class", "PropMaterialCache");
#endif
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
_texture_flags = GLOBAL_DEF("props/texture_flags", Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER);
_max_atlas_size = GLOBAL_DEF("props/max_atlas_size", 1024);
@ -369,7 +371,7 @@ void PropCache::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_default_prop_material_cache_class", "cls_name"), &PropCache::set_default_prop_material_cache_class);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "default_prop_material_cache_class"), "set_default_prop_material_cache_class", "get_default_prop_material_cache_class");
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
ClassDB::bind_method(D_METHOD("get_texture_flags"), &PropCache::get_texture_flags);
ClassDB::bind_method(D_METHOD("set_texture_flags", "flags"), &PropCache::set_texture_flags);
ADD_PROPERTY(PropertyInfo(Variant::INT, "texture_flags", PROPERTY_HINT_FLAGS, "Mipmaps,Repeat,Filter,Anisotropic Linear,Convert to Linear,Mirrored Repeat,Video Surface"), "set_texture_flags", "get_texture_flags");

View File

@ -35,6 +35,8 @@ SOFTWARE.
#include "../props/prop_data.h"
#include "modules/modules_enabled.gen.h"
class PropMaterialCache;
class TiledWallData;
@ -47,7 +49,7 @@ public:
StringName get_default_prop_material_cache_class();
void set_default_prop_material_cache_class(const StringName &cls_name);
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
int get_texture_flags() const;
void set_texture_flags(const int flags);
@ -110,7 +112,7 @@ protected:
Mutex _tiled_wall_material_cache_mutex;
Mutex _custom_keyed_material_cache_mutex;
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
int _texture_flags;
int _max_atlas_size;
bool _keep_original_atlases;

View File

@ -4,7 +4,9 @@
#include "core/io/image.h"
#if TEXTURE_PACKER_PRESENT
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "../../texture_packer/texture_resource/packer_image_resource.h"
#endif

View File

@ -40,6 +40,8 @@ SOFTWARE.
#include "../material_cache/prop_material_cache.h"
#include "modules/modules_enabled.gen.h"
const String TiledWallData::BINDING_STRING_TILED_WALL_TILING_TYPE = "None,Horizontal,Vertical,Both";
const String TiledWallData::BINDING_STRING_TILED_WALL_COLLIDER_TYPE = "None,Plane,Box,Convex Mesh,Concave Mesh";
@ -274,7 +276,7 @@ void TiledWallData::materials_set(const Vector<Variant> &materials) {
emit_changed();
}
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
void TiledWallData::add_textures_into(Ref<TexturePacker> texture_packer) {
ERR_FAIL_COND(!texture_packer.is_valid());
@ -567,7 +569,7 @@ void TiledWallData::_bind_methods() {
ClassDB::bind_method(D_METHOD("materials_set"), &TiledWallData::materials_set);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "23/19:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get");
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
ClassDB::bind_method(D_METHOD("add_textures_into", "texture_packer"), &TiledWallData::add_textures_into);
#endif

View File

@ -33,7 +33,9 @@ SOFTWARE.
#include "scene/resources/material.h"
#include "scene/resources/texture.h"
#if TEXTURE_PACKER_PRESENT
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "../../texture_packer/texture_packer.h"
#endif
@ -145,7 +147,7 @@ public:
Vector<Variant> materials_get();
void materials_set(const Vector<Variant> &materials);
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
void add_textures_into(Ref<TexturePacker> texture_packer);
#endif

View File

@ -9,12 +9,6 @@ import version
if os.path.isdir('../mesh_data_resource'):
module_env.Append(CPPDEFINES=['MESH_DATA_RESOURCE_PRESENT'])
has_texture_packer = False
if os.path.isdir('../texture_packer'):
has_texture_packer = True
module_env.Append(CPPDEFINES=['TEXTURE_PACKER_PRESENT'])
if os.path.isdir('../terraman_2d'):
module_env.Append(CPPDEFINES=['TERRAMAN_2D_PRESENT'])
@ -64,7 +58,7 @@ sources = [
if version.minor >= 4:
sources.append("props/prop_2d_data_portal.cpp")
if has_texture_packer:
if env["module_texture_packer_enabled"]:
sources.append("material_cache/prop_2d_material_cache_pcm.cpp")
if ARGUMENTS.get('custom_modules_shared', 'no') == 'yes':

View File

@ -22,6 +22,8 @@ SOFTWARE.
#include "ground_clutter_2d.h"
#include "modules/modules_enabled.gen.h"
#ifdef VOXELMAN_PRESENT
#include "../../voxelman/world/voxel_chunk.h"
@ -38,7 +40,7 @@ void GroundClutter2D::add_meshes_to(Ref<VoxelMesher> mesher, Ref<VoxelChunk> chu
}
#endif
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
void GroundClutter2D::add_textures_to(Ref<TexturePacker> packer) {
if (has_method("_add_textures_to"))
call("_add_textures_to", packer);
@ -52,7 +54,7 @@ GroundClutter2D::~GroundClutter2D() {
}
void GroundClutter2D::_bind_methods() {
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
BIND_VMETHOD(MethodInfo("_add_textures_to", PropertyInfo(Variant::OBJECT, "packer", PROPERTY_HINT_RESOURCE_TYPE, "TexturePacker")));
ClassDB::bind_method(D_METHOD("add_textures_to", "packer"), &GroundClutter2D::add_textures_to);

View File

@ -24,7 +24,9 @@ SOFTWARE.
#include "core/object/resource.h"
#ifdef TEXTURE_PACKER_PRESENT
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "../../texture_packer/texture_packer.h"
#endif
@ -45,7 +47,7 @@ public:
void add_meshes_to(Ref<VoxelMesher> mesher, Ref<VoxelChunk> chunk, int x, int y, int z);
#endif
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
void add_textures_to(Ref<TexturePacker> packer);
#endif

View File

@ -22,11 +22,13 @@ SOFTWARE.
#include "prop_2d_texture_job.h"
#if TEXTURE_PACKER_PRESENT
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "../../texture_packer/texture_packer.h"
#endif
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
Ref<TexturePacker> Prop2DTextureJob::get_merger() {
return _merger;
}
@ -37,7 +39,7 @@ void Prop2DTextureJob::set_merger(const Ref<TexturePacker> &merger) {
#endif
void Prop2DTextureJob::_execute() {
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
if (!_merger.is_valid()) {
set_complete(true);
return;
@ -56,7 +58,7 @@ Prop2DTextureJob::~Prop2DTextureJob() {
}
void Prop2DTextureJob::_bind_methods() {
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
ClassDB::bind_method(D_METHOD("get_merger"), &Prop2DTextureJob::get_merger);
ClassDB::bind_method(D_METHOD("set_merger", "value"), &Prop2DTextureJob::set_merger);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "merger", PROPERTY_HINT_RESOURCE_TYPE, "TexturePacker"), "set_merger", "get_merger");

View File

@ -28,7 +28,9 @@ SOFTWARE.
#include "core/object/reference.h"
#if TEXTURE_PACKER_PRESENT
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_TEXTURE_PACKER_ENABLED
class TexturePacker;
#endif
@ -36,7 +38,7 @@ class Prop2DTextureJob : public ThreadPoolJob {
GDCLASS(Prop2DTextureJob, ThreadPoolJob);
public:
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
Ref<TexturePacker> get_merger();
void set_merger(const Ref<TexturePacker> &merger);
#endif
@ -49,7 +51,7 @@ public:
protected:
static void _bind_methods();
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
Ref<TexturePacker> _merger;
#endif
};

View File

@ -8,6 +8,10 @@
#include "core/config/engine.h"
#include "modules/modules_enabled.gen.h"
#include "./singleton/prop_2d_cache.h"
#define VARIANT_ARRAY_GET(arr) \
Vector<Variant> r; \
for (int i = 0; i < arr.size(); i++) { \
@ -32,7 +36,7 @@
#include "material_cache/prop_2d_material_cache.h"
#include "scene/3d/camera.h"
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "./singleton/prop_2d_cache.h"
#endif

View File

@ -30,6 +30,8 @@ SOFTWARE.
#include "scene/resources/shape.h"
#include "singleton/prop_2d_cache.h"
#include "modules/modules_enabled.gen.h"
#ifdef MESH_DATA_RESOURCE_PRESENT
#include "../mesh_data_resource/mesh_data_resource.h"
#endif
@ -38,7 +40,7 @@ SOFTWARE.
#include "../mesh_utils/fast_quadratic_mesh_simplifier.h"
#endif
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "../texture_packer/texture_packer.h"
#endif

View File

@ -28,6 +28,8 @@ SOFTWARE.
#include "servers/physics_server.h"
#include "modules/modules_enabled.gen.h"
int Prop2DData::get_id() const {
return _id;
}
@ -74,7 +76,7 @@ void Prop2DData::set_props(const Vector<Variant> &props) {
}
}
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
void Prop2DData::add_textures_into(Ref<TexturePacker> texture_packer) {
ERR_FAIL_COND(!texture_packer.is_valid());
@ -141,7 +143,7 @@ void Prop2DData::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_props", "props"), &Prop2DData::set_props);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "props", PROPERTY_HINT_NONE, "23/19:Prop2DDataEntry", PROPERTY_USAGE_DEFAULT, "Prop2DDataEntry"), "set_props", "get_props");
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
ClassDB::bind_method(D_METHOD("add_textures_into", "texture_packer"), &Prop2DData::add_textures_into);
#endif

View File

@ -32,7 +32,9 @@ SOFTWARE.
#include "prop_2d_data_entry.h"
#if TEXTURE_PACKER_PRESENT
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "../../texture_packer/texture_packer.h"
#endif
@ -53,7 +55,7 @@ public:
Vector<Variant> get_props();
void set_props(const Vector<Variant> &props);
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
void add_textures_into(Ref<TexturePacker> texture_packer);
#endif

View File

@ -26,7 +26,9 @@ SOFTWARE.
#include "scene/2d/node_2d.h"
#if TEXTURE_PACKER_PRESENT
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "../../texture_packer/texture_packer.h"
#endif
@ -108,7 +110,7 @@ void Prop2DDataEntry::set_use_parent_material(const bool value) {
_use_parent_material = value;
}
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
void Prop2DDataEntry::add_textures_into(Ref<TexturePacker> texture_packer) {
if (has_method("_add_textures_into"))
call("_add_textures_into", texture_packer);
@ -248,7 +250,7 @@ void Prop2DDataEntry::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_use_parent_material", "value"), &Prop2DDataEntry::set_use_parent_material);
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_parent_material"), "set_use_parent_material", "get_use_parent_material");
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
BIND_VMETHOD(MethodInfo("_add_textures_into", PropertyInfo(Variant::OBJECT, "texture_packer", PROPERTY_HINT_RESOURCE_TYPE, "TexturePacker")));
ClassDB::bind_method(D_METHOD("add_textures_into", "texture_packer"), &Prop2DDataEntry::add_textures_into);

View File

@ -28,6 +28,8 @@ SOFTWARE.
#include "scene/resources/material.h"
#include "modules/modules_enabled.gen.h"
class Prop2DData;
class Prop2DMesher;
class TexturePacker;
@ -69,7 +71,7 @@ public:
bool get_use_parent_material() const;
void set_use_parent_material(const bool value);
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
void add_textures_into(Ref<TexturePacker> texture_packer);
#endif

View File

@ -25,6 +25,8 @@ SOFTWARE.
#include "../prop_2d_instance.h"
#include "prop_2d_data.h"
#include "modules/modules_enabled.gen.h"
Ref<Prop2DData> Prop2DDataProp2D::get_prop() const {
return _prop;
}
@ -32,7 +34,7 @@ void Prop2DDataProp2D::set_prop(const Ref<Prop2DData> value) {
_prop = value;
}
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
void Prop2DDataProp2D::_add_textures_into(Ref<TexturePacker> texture_packer) {
if (get_prop().is_valid()) {
get_prop()->add_textures_into(texture_packer);
@ -92,7 +94,7 @@ void Prop2DDataProp2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_prop", "value"), &Prop2DDataProp2D::set_prop);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "prop", PROPERTY_HINT_RESOURCE_TYPE, "Prop2DData"), "set_prop", "get_prop");
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
ClassDB::bind_method(D_METHOD("_add_textures_into", "texture_packer"), &Prop2DDataProp2D::_add_textures_into);
#endif
}

View File

@ -28,7 +28,9 @@ SOFTWARE.
#include "prop_2d_data.h"
#if TEXTURE_PACKER_PRESENT
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "../../texture_packer/texture_packer.h"
#endif
@ -39,7 +41,7 @@ public:
Ref<Prop2DData> get_prop() const;
void set_prop(const Ref<Prop2DData> value);
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
void _add_textures_into(Ref<TexturePacker> texture_packer);
#endif

View File

@ -62,7 +62,9 @@ SOFTWARE.
#include "material_cache/prop_2d_material_cache.h"
#ifdef TEXTURE_PACKER_PRESENT
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "material_cache/prop_2d_material_cache_pcm.h"
#endif
@ -104,7 +106,7 @@ void register_props_2d_types() {
ClassDB::register_class<Prop2DMaterialCache>();
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
ClassDB::register_class<Prop2DMaterialCachePCM>();
#endif

View File

@ -37,6 +37,8 @@ SOFTWARE.
#include "core/containers/hashfuncs.h"
#include "modules/modules_enabled.gen.h"
#define VARIANT_ARRAY_GET(arr) \
Vector<Variant> r; \
for (int i = 0; i < arr.size(); i++) { \
@ -64,7 +66,7 @@ void Prop2DCache::set_default_prop_material_cache_class(const StringName &cls_na
_default_prop_material_cache_class = cls_name;
}
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
int Prop2DCache::get_texture_flags() const {
return _texture_flags;
}
@ -315,13 +317,13 @@ Prop2DCache::Prop2DCache() {
_default_pixels_per_unit = GLOBAL_DEF("props_2d/default_pixels_per_unit", 64);
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
_default_prop_material_cache_class = GLOBAL_DEF("props_2d/default_prop_material_cache_class", "Prop2DMaterialCachePCM");
#else
_default_prop_material_cache_class = GLOBAL_DEF("props_2d/default_prop_material_cache_class", "Prop2DMaterialCache");
#endif
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
_texture_flags = GLOBAL_DEF("props_2d/texture_flags", Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER);
_max_atlas_size = GLOBAL_DEF("props_2d/max_atlas_size", 1024);
@ -346,7 +348,7 @@ void Prop2DCache::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_default_prop_material_cache_class", "cls_name"), &Prop2DCache::set_default_prop_material_cache_class);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "default_prop_material_cache_class"), "set_default_prop_material_cache_class", "get_default_prop_material_cache_class");
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
ClassDB::bind_method(D_METHOD("get_texture_flags"), &Prop2DCache::get_texture_flags);
ClassDB::bind_method(D_METHOD("set_texture_flags", "flags"), &Prop2DCache::set_texture_flags);
ADD_PROPERTY(PropertyInfo(Variant::INT, "texture_flags", PROPERTY_HINT_FLAGS, "Mipmaps,Repeat,Filter,Anisotropic Linear,Convert to Linear,Mirrored Repeat,Video Surface"), "set_texture_flags", "get_texture_flags");

View File

@ -35,6 +35,8 @@ SOFTWARE.
#include "../props/prop_2d_data.h"
#include "modules/modules_enabled.gen.h"
class Prop2DMaterialCache;
class TiledWall2DData;
@ -50,7 +52,7 @@ public:
StringName get_default_prop_material_cache_class();
void set_default_prop_material_cache_class(const StringName &cls_name);
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
int get_texture_flags() const;
void set_texture_flags(const int flags);
@ -108,7 +110,7 @@ protected:
Mutex _tiled_wall_material_cache_mutex;
Mutex _custom_keyed_material_cache_mutex;
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
int _texture_flags;
int _max_atlas_size;
bool _keep_original_atlases;

View File

@ -4,7 +4,9 @@
#include "core/io/image.h"
#if TEXTURE_PACKER_PRESENT
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "../../texture_packer/texture_resource/packer_image_resource.h"
#endif

View File

@ -40,6 +40,8 @@ SOFTWARE.
#include "../material_cache/prop_2d_material_cache.h"
#include "modules/modules_enabled.gen.h"
const String TiledWall2DData::BINDING_STRING_TILED_WALL_TILING_TYPE = "None,Horizontal,Vertical,Both";
TiledWall2DData::TiledWall2DTilingType TiledWall2DData::get_tiling_type() const {
@ -159,7 +161,7 @@ void TiledWall2DData::material_set(const Ref<Material> &value) {
emit_changed();
}
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
void TiledWall2DData::add_textures_into(Ref<TexturePacker> texture_packer) {
ERR_FAIL_COND(!texture_packer.is_valid());
@ -278,7 +280,7 @@ void TiledWall2DData::_bind_methods() {
ClassDB::bind_method(D_METHOD("material_set", "value"), &TiledWall2DData::material_set);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "material", PROPERTY_HINT_RESOURCE_TYPE, "Material"), "material_set", "material_get");
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
ClassDB::bind_method(D_METHOD("add_textures_into", "texture_packer"), &TiledWall2DData::add_textures_into);
#endif

View File

@ -33,7 +33,9 @@ SOFTWARE.
#include "scene/resources/material.h"
#include "scene/resources/texture.h"
#if TEXTURE_PACKER_PRESENT
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "../../texture_packer/texture_packer.h"
#endif
@ -86,7 +88,7 @@ public:
Ref<Material> material_get();
void material_set(const Ref<Material> &value);
#if TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
void add_textures_into(Ref<TexturePacker> texture_packer);
#endif

View File

@ -4,11 +4,6 @@ Import('env')
module_env = env.Clone()
has_texture_packer = False
if os.path.isdir('../texture_packer'):
module_env.Append(CPPDEFINES=['TEXTURE_PACKER_PRESENT'])
has_texture_packer = True
if os.path.isdir('../mesh_data_resource'):
module_env.Append(CPPDEFINES=['MESH_DATA_RESOURCE_PRESENT'])
@ -66,7 +61,7 @@ sources = [
"world/jobs/terrain_prop_job.cpp",
]
if has_texture_packer:
if env["module_texture_packer_enabled"]:
sources.append("library/terrain_library_merger.cpp")
sources.append("library/terrain_library_merger_pcm.cpp")
sources.append("library/terrain_surface_merger.cpp")

View File

@ -29,7 +29,9 @@ SOFTWARE.
#include "library/terrain_library_simple.h"
#include "library/terrain_material_cache.h"
#ifdef TEXTURE_PACKER_PRESENT
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "library/terrain_library_merger.h"
#include "library/terrain_library_merger_pcm.h"
#include "library/terrain_material_cache_pcm.h"
@ -80,7 +82,7 @@ void register_terraman_types() {
ClassDB::register_class<TerrainMaterialCache>();
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
ClassDB::register_class<TerrainSurfaceMerger>();
ClassDB::register_class<TerrainLibraryMerger>();
ClassDB::register_class<TerrainLibraryMergerPCM>();

View File

@ -4,11 +4,6 @@ Import('env')
module_env = env.Clone()
has_texture_packer = False
if os.path.isdir('../texture_packer'):
module_env.Append(CPPDEFINES=['TEXTURE_PACKER_PRESENT'])
has_texture_packer = True
if os.path.isdir('../mesh_data_resource'):
module_env.Append(CPPDEFINES=['MESH_DATA_RESOURCE_PRESENT'])
@ -69,7 +64,7 @@ sources = [
"world/jobs/terrain_2d_prop_job.cpp",
]
if has_texture_packer:
if env["module_texture_packer_enabled"]:
sources.append("library/terrain_2d_library_merger.cpp")
sources.append("library/terrain_2d_library_merger_pcm.cpp")
sources.append("library/terrain_2d_surface_merger.cpp")

View File

@ -29,7 +29,9 @@ SOFTWARE.
#include "library/terrain_2d_library_simple.h"
#include "library/terrain_2d_material_cache.h"
#ifdef TEXTURE_PACKER_PRESENT
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "library/terrain_2d_library_merger.h"
#include "library/terrain_2d_library_merger_pcm.h"
#include "library/terrain_2d_material_cache_pcm.h"
@ -82,7 +84,7 @@ void register_terraman_2d_types() {
ClassDB::register_class<Terrain2DMaterialCache>();
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
ClassDB::register_class<Terrain2DSurfaceMerger>();
ClassDB::register_class<Terrain2DLibraryMerger>();
ClassDB::register_class<Terrain2DLibraryMergerPCM>();

View File

@ -4,11 +4,6 @@ Import('env')
module_env = env.Clone()
has_texture_packer = False
if os.path.isdir('../texture_packer'):
module_env.Append(CPPDEFINES=['TEXTURE_PACKER_PRESENT'])
has_texture_packer = True
if os.path.isdir('../mesh_data_resource'):
module_env.Append(CPPDEFINES=['MESH_DATA_RESOURCE_PRESENT'])
@ -80,7 +75,7 @@ sources = [
"world/jobs/voxel_prop_job.cpp",
]
if has_texture_packer:
if env["module_texture_packer_enabled"]:
sources.append("library/voxel_library_merger.cpp")
sources.append("library/voxel_surface_merger.cpp")
sources.append("library/voxel_library_merger_pcm.cpp")

View File

@ -29,7 +29,9 @@ SOFTWARE.
#include "library/voxel_library_simple.h"
#include "library/voxel_material_cache.h"
#ifdef TEXTURE_PACKER_PRESENT
#include "modules/modules_enabled.gen.h"
#ifdef MODULE_TEXTURE_PACKER_ENABLED
#include "library/voxel_library_merger.h"
#include "library/voxel_library_merger_pcm.h"
#include "library/voxel_material_cache_pcm.h"
@ -96,7 +98,7 @@ void register_voxelman_types() {
ClassDB::register_class<VoxelMaterialCache>();
#ifdef TEXTURE_PACKER_PRESENT
#ifdef MODULE_TEXTURE_PACKER_ENABLED
ClassDB::register_class<VoxelSurfaceMerger>();
ClassDB::register_class<VoxelLibraryMerger>();
ClassDB::register_class<VoxelLibraryMergerPCM>();