mirror of
https://github.com/Relintai/props.git
synced 2025-02-04 16:05:54 +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"
|
#include "prop_material_cache.h"
|
||||||
|
|
||||||
#ifdef PROPS_PRESENT
|
|
||||||
#include "../../props/props/prop_data.h"
|
#include "../../props/props/prop_data.h"
|
||||||
#include "../../props/props/prop_data_prop.h"
|
#include "../../props/props/prop_data_prop.h"
|
||||||
|
|
||||||
#if MESH_DATA_RESOURCE_PRESENT
|
#if MESH_DATA_RESOURCE_PRESENT
|
||||||
|
#define PROPS_PRESENT 1
|
||||||
#include "../../mesh_data_resource/props/prop_data_mesh_data.h"
|
#include "../../mesh_data_resource/props/prop_data_mesh_data.h"
|
||||||
#endif
|
#undef PROPS_PRESENT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if VERSION_MAJOR > 3
|
#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) {
|
void PropMaterialCache::prop_add_textures(const Ref<PropData> &prop) {
|
||||||
if (!prop.is_valid()) {
|
if (!prop.is_valid()) {
|
||||||
return;
|
return;
|
||||||
@ -224,7 +223,6 @@ void PropMaterialCache::prop_remove_textures(const Ref<PropData> &prop) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void PropMaterialCache::refresh_rects() {
|
void PropMaterialCache::refresh_rects() {
|
||||||
_initialized = true;
|
_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_atlas_tex", "index"), &PropMaterialCache::texture_get_atlas_tex);
|
||||||
ClassDB::bind_method(D_METHOD("texture_get_uv_rect", "texture"), &PropMaterialCache::texture_get_uv_rect);
|
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_add_textures", "prop"), &PropMaterialCache::prop_add_textures);
|
||||||
ClassDB::bind_method(D_METHOD("prop_remove_textures", "prop"), &PropMaterialCache::prop_remove_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);
|
ClassDB::bind_method(D_METHOD("refresh_rects"), &PropMaterialCache::refresh_rects);
|
||||||
|
|
||||||
|
@ -38,6 +38,8 @@ SOFTWARE.
|
|||||||
#include "core/math/rect2.h"
|
#include "core/math/rect2.h"
|
||||||
#include "scene/resources/material.h"
|
#include "scene/resources/material.h"
|
||||||
|
|
||||||
|
class PropData;
|
||||||
|
|
||||||
class PropMaterialCache : public Resource {
|
class PropMaterialCache : public Resource {
|
||||||
GDCLASS(PropMaterialCache, Resource)
|
GDCLASS(PropMaterialCache, Resource)
|
||||||
|
|
||||||
@ -71,11 +73,8 @@ public:
|
|||||||
virtual Ref<AtlasTexture> texture_get_atlas_tex(const Ref<Texture> &texture);
|
virtual Ref<AtlasTexture> texture_get_atlas_tex(const Ref<Texture> &texture);
|
||||||
virtual Rect2 texture_get_uv_rect(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_add_textures(const Ref<PropData> &prop);
|
||||||
void prop_remove_textures(const Ref<PropData> &prop);
|
void prop_remove_textures(const Ref<PropData> &prop);
|
||||||
#endif
|
|
||||||
|
|
||||||
virtual void refresh_rects();
|
virtual void refresh_rects();
|
||||||
|
|
||||||
void setup_material_albedo(Ref<Texture> texture);
|
void setup_material_albedo(Ref<Texture> texture);
|
||||||
|
Loading…
Reference in New Issue
Block a user