summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorYuri Sizov <11782833+YuriSizov@users.noreply.github.com>2023-02-17 15:39:37 +0300
committerGitHub <noreply@github.com>2023-02-17 15:39:37 +0300
commitb51290383f2d8e4460ea6a9ad25ded6bc6396fee (patch)
treea9d5205dafdc299695aafcbf2609ac0f71624173 /scene
parentdb9007aef4fff2e23c090646e6f9452cd199213f (diff)
parent1075931c64716f634ed5efb842e6173d813ab03b (diff)
Merge pull request #73492 from akien-mga/remove-unexposed-ProxyTexture
Remove unexposed ProxyTexture, mark AnimatedTexture as deprecated
Diffstat (limited to 'scene')
-rw-r--r--scene/resources/texture.cpp67
-rw-r--r--scene/resources/texture.h23
2 files changed, 0 insertions, 90 deletions
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index 085becb033..05be40c446 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -2566,73 +2566,6 @@ void GradientTexture2D::_bind_methods() {
//////////////////////////////////////
-void ProxyTexture::set_base(const Ref<Texture2D> &p_texture) {
- ERR_FAIL_COND(p_texture == this);
-
- base = p_texture;
- if (base.is_valid()) {
- ERR_FAIL_NULL(RenderingServer::get_singleton());
- if (proxy_ph.is_valid()) {
- RS::get_singleton()->texture_proxy_update(proxy, base->get_rid());
- RS::get_singleton()->free(proxy_ph);
- proxy_ph = RID();
- } else if (proxy.is_valid()) {
- RS::get_singleton()->texture_proxy_update(proxy, base->get_rid());
- } else {
- proxy = RS::get_singleton()->texture_proxy_create(base->get_rid());
- }
- }
-}
-
-Ref<Texture2D> ProxyTexture::get_base() const {
- return base;
-}
-
-int ProxyTexture::get_width() const {
- if (base.is_valid()) {
- return base->get_width();
- }
- return 1;
-}
-
-int ProxyTexture::get_height() const {
- if (base.is_valid()) {
- return base->get_height();
- }
- return 1;
-}
-
-RID ProxyTexture::get_rid() const {
- if (proxy.is_null()) {
- proxy_ph = RS::get_singleton()->texture_2d_placeholder_create();
- proxy = RS::get_singleton()->texture_proxy_create(proxy_ph);
- }
- return proxy;
-}
-
-bool ProxyTexture::has_alpha() const {
- if (base.is_valid()) {
- return base->has_alpha();
- }
- return false;
-}
-
-ProxyTexture::ProxyTexture() {
- //proxy = RS::get_singleton()->texture_create();
-}
-
-ProxyTexture::~ProxyTexture() {
- ERR_FAIL_NULL(RenderingServer::get_singleton());
- if (proxy_ph.is_valid()) {
- RS::get_singleton()->free(proxy_ph);
- }
- if (proxy.is_valid()) {
- RS::get_singleton()->free(proxy);
- }
-}
-
-//////////////////////////////////////////////
-
void AnimatedTexture::_update_proxy() {
RWLockRead r(rw_lock);
diff --git a/scene/resources/texture.h b/scene/resources/texture.h
index 7f74ae6941..7c4d479da8 100644
--- a/scene/resources/texture.h
+++ b/scene/resources/texture.h
@@ -892,29 +892,6 @@ public:
VARIANT_ENUM_CAST(GradientTexture2D::Fill);
VARIANT_ENUM_CAST(GradientTexture2D::Repeat);
-class ProxyTexture : public Texture2D {
-private:
- mutable RID proxy_ph;
- mutable RID proxy;
- Ref<Texture2D> base;
-
-protected:
- static void _bind_methods();
-
-public:
- void set_base(const Ref<Texture2D> &p_texture);
- Ref<Texture2D> get_base() const;
-
- virtual int get_width() const override;
- virtual int get_height() const override;
- virtual RID get_rid() const override;
-
- virtual bool has_alpha() const override;
-
- ProxyTexture();
- ~ProxyTexture();
-};
-
class AnimatedTexture : public Texture2D {
GDCLASS(AnimatedTexture, Texture2D);