summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-10-21 09:50:44 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-10-21 09:50:44 -0300
commitb59c86f6f953ce6957bccbcc1ec6f3ce4c55572d (patch)
tree39a74205feb03436beacf8c4dcf9d4fd70f2e344 /scene
parentf6a790d58c596773466437140f6d7e2a6a29e5e7 (diff)
-Ability to debug video memory usage
-Small fix to xml saver (swapping > and <)
Diffstat (limited to 'scene')
-rw-r--r--scene/resources/texture.cpp20
-rw-r--r--scene/resources/texture.h5
2 files changed, 24 insertions, 1 deletions
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index 7b261f7791..994473f11e 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -366,6 +366,16 @@ void ImageTexture::set_size_override(const Size2& p_size) {
VisualServer::get_singleton()->texture_set_size_override(texture,w,h);
}
+void ImageTexture::set_path(const String& p_path,bool p_take_over) {
+
+ if (texture.is_valid()) {
+ VisualServer::get_singleton()->texture_set_path(texture,p_path);
+ }
+
+ Resource::set_path(p_path,p_take_over);
+}
+
+
void ImageTexture::set_storage(Storage p_storage) {
storage=p_storage;
@@ -944,6 +954,16 @@ float CubeMap::get_lossy_storage_quality() const {
return lossy_storage_quality;
}
+void CubeMap::set_path(const String& p_path,bool p_take_over) {
+
+ if (cubemap.is_valid()) {
+ VisualServer::get_singleton()->texture_set_path(cubemap,p_path);
+ }
+
+ Resource::set_path(p_path,p_take_over);
+}
+
+
bool CubeMap::_set(const StringName& p_name, const Variant& p_value) {
if (p_name=="side/left") {
diff --git a/scene/resources/texture.h b/scene/resources/texture.h
index ad0e21093d..1a4f211af1 100644
--- a/scene/resources/texture.h
+++ b/scene/resources/texture.h
@@ -152,7 +152,8 @@ public:
void set_size_override(const Size2& p_size);
-
+ virtual void set_path(const String& p_path,bool p_take_over=false);
+
ImageTexture();
~ImageTexture();
@@ -320,6 +321,8 @@ public:
void set_lossy_storage_quality(float p_lossy_storage_quality);
float get_lossy_storage_quality() const;
+ virtual void set_path(const String& p_path,bool p_take_over=false);
+
CubeMap();
~CubeMap();