mirror of
https://github.com/Relintai/props.git
synced 2024-11-12 10:15:25 +01:00
Don't check for PROPS_PRESENT in the props module.
This commit is contained in:
parent
fea813eae3
commit
e34649c44f
@ -22,13 +22,13 @@ SOFTWARE.
|
||||
|
||||
#include "prop_material_cache.h"
|
||||
|
||||
#ifdef PROPS_PRESENT
|
||||
#include "../../props/props/prop_data.h"
|
||||
#include "../../props/props/prop_data_prop.h"
|
||||
|
||||
#if MESH_DATA_RESOURCE_PRESENT
|
||||
#define PROPS_PRESENT 1
|
||||
#include "../../mesh_data_resource/props/prop_data_mesh_data.h"
|
||||
#endif
|
||||
#undef PROPS_PRESENT
|
||||
#endif
|
||||
|
||||
#if VERSION_MAJOR > 3
|
||||
@ -171,7 +171,6 @@ Rect2 PropMaterialCache::texture_get_uv_rect(const Ref<Texture> &texture) {
|
||||
}
|
||||
|
||||
|
||||
#ifdef PROPS_PRESENT
|
||||
void PropMaterialCache::prop_add_textures(const Ref<PropData> &prop) {
|
||||
if (!prop.is_valid()) {
|
||||
return;
|
||||
@ -224,7 +223,6 @@ void PropMaterialCache::prop_remove_textures(const Ref<PropData> &prop) {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void PropMaterialCache::refresh_rects() {
|
||||
_initialized = true;
|
||||
@ -279,10 +277,8 @@ void PropMaterialCache::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("texture_get_atlas_tex", "index"), &PropMaterialCache::texture_get_atlas_tex);
|
||||
ClassDB::bind_method(D_METHOD("texture_get_uv_rect", "texture"), &PropMaterialCache::texture_get_uv_rect);
|
||||
|
||||
#ifdef PROPS_PRESENT
|
||||
ClassDB::bind_method(D_METHOD("prop_add_textures", "prop"), &PropMaterialCache::prop_add_textures);
|
||||
ClassDB::bind_method(D_METHOD("prop_remove_textures", "prop"), &PropMaterialCache::prop_remove_textures);
|
||||
#endif
|
||||
|
||||
ClassDB::bind_method(D_METHOD("refresh_rects"), &PropMaterialCache::refresh_rects);
|
||||
|
||||
|
@ -38,6 +38,8 @@ SOFTWARE.
|
||||
#include "core/math/rect2.h"
|
||||
#include "scene/resources/material.h"
|
||||
|
||||
class PropData;
|
||||
|
||||
class PropMaterialCache : public Resource {
|
||||
GDCLASS(PropMaterialCache, Resource)
|
||||
|
||||
@ -71,11 +73,8 @@ public:
|
||||
virtual Ref<AtlasTexture> texture_get_atlas_tex(const Ref<Texture> &texture);
|
||||
virtual Rect2 texture_get_uv_rect(const Ref<Texture> &texture);
|
||||
|
||||
#ifdef PROPS_PRESENT
|
||||
void prop_add_textures(const Ref<PropData> &prop);
|
||||
void prop_remove_textures(const Ref<PropData> &prop);
|
||||
#endif
|
||||
|
||||
virtual void refresh_rects();
|
||||
|
||||
void setup_material_albedo(Ref<Texture> texture);
|
||||
|
Loading…
Reference in New Issue
Block a user