mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
ability to shrink all images x2 on load
this is for extreme cases when running on devices with very low video memory, so you can still retain compatibility.
This commit is contained in:
committed by
Ariel Manzur
parent
4bc494ae2e
commit
d6e30256ad
@@ -196,6 +196,8 @@ public:
|
||||
virtual String texture_get_path(RID p_texture) const=0;
|
||||
virtual void texture_debug_usage(List<VS::TextureInfo> *r_info)=0;
|
||||
|
||||
virtual void texture_set_shrink_all_x2_on_set_data(bool p_enable)=0;
|
||||
|
||||
/* SHADER API */
|
||||
|
||||
virtual RID shader_create(VS::ShaderMode p_mode=VS::SHADER_MATERIAL)=0;
|
||||
|
||||
@@ -415,6 +415,8 @@ public:
|
||||
virtual String texture_get_path(RID p_texture) const { return String(); }
|
||||
virtual void texture_debug_usage(List<VS::TextureInfo> *r_info) {}
|
||||
|
||||
virtual void texture_set_shrink_all_x2_on_set_data(bool p_enable) {}
|
||||
|
||||
/* SHADER API */
|
||||
|
||||
virtual RID shader_create(VS::ShaderMode p_mode=VS::SHADER_MATERIAL);
|
||||
|
||||
@@ -127,6 +127,11 @@ void VisualServerRaster::texture_debug_usage(List<TextureInfo> *r_info){
|
||||
rasterizer->texture_debug_usage(r_info);
|
||||
}
|
||||
|
||||
void VisualServerRaster::texture_set_shrink_all_x2_on_set_data(bool p_enable) {
|
||||
|
||||
rasterizer->texture_set_shrink_all_x2_on_set_data(p_enable);
|
||||
}
|
||||
|
||||
/* SHADER API */
|
||||
|
||||
RID VisualServerRaster::shader_create(ShaderMode p_mode) {
|
||||
|
||||
@@ -659,7 +659,7 @@ public:
|
||||
|
||||
virtual RID texture_create();
|
||||
virtual void texture_allocate(RID p_texture,int p_width, int p_height,Image::Format p_format,uint32_t p_flags=TEXTURE_FLAGS_DEFAULT);
|
||||
virtual void texture_set_data(RID p_texture,const Image& p_image,CubeMapSide p_cube_side=CUBEMAP_LEFT);
|
||||
virtual void texture_set_data(RID p_texture,const Image& p_image,CubeMapSide p_cube_side=CUBEMAP_LEFT);
|
||||
virtual Image texture_get_data(RID p_texture,CubeMapSide p_cube_side=CUBEMAP_LEFT) const;
|
||||
virtual void texture_set_flags(RID p_texture,uint32_t p_flags) ;
|
||||
virtual uint32_t texture_get_flags(RID p_texture) const;
|
||||
@@ -675,6 +675,8 @@ public:
|
||||
|
||||
virtual void texture_debug_usage(List<TextureInfo> *r_info);
|
||||
|
||||
virtual void texture_set_shrink_all_x2_on_set_data(bool p_enable);
|
||||
|
||||
|
||||
/* SHADER API */
|
||||
|
||||
|
||||
@@ -101,6 +101,8 @@ public:
|
||||
FUNC2(texture_set_path,RID,const String&);
|
||||
FUNC1RC(String,texture_get_path,RID);
|
||||
|
||||
FUNC1(texture_set_shrink_all_x2_on_set_data,bool);
|
||||
|
||||
virtual void texture_debug_usage(List<TextureInfo> *r_info) {
|
||||
//pass directly, should lock the server anyway
|
||||
visual_server->texture_debug_usage(r_info);
|
||||
|
||||
Reference in New Issue
Block a user