diff options
author | MarianoGNU <marianognu.easyrpg@gmail.com> | 2015-10-24 11:55:00 -0300 |
---|---|---|
committer | MarianoGNU <marianognu.easyrpg@gmail.com> | 2015-10-24 11:55:00 -0300 |
commit | 754908844ae52c04ed68ef27c02481479f1e2ab4 (patch) | |
tree | 90b95accfabc9bc12a6479c004183ff7d28b6fcd /drivers | |
parent | 6df7d923797908ecf38684c0008c0e4b6475d884 (diff) | |
parent | 4baf65dab78b6e8062de760010338c316c628394 (diff) |
Merge branch 'master' of https://github.com/okamstudio/godot into posta
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gles2/rasterizer_gles2.cpp | 46 | ||||
-rw-r--r-- | drivers/gles2/rasterizer_gles2.h | 5 | ||||
-rw-r--r-- | drivers/vorbis/audio_stream_ogg_vorbis.cpp | 2 |
3 files changed, 50 insertions, 3 deletions
diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index 3d75ed29f3..d84ee5a758 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -1408,6 +1408,40 @@ GLuint RasterizerGLES2::_texture_get_name(RID p_tex) { return texture->tex_id; }; +void RasterizerGLES2::texture_set_path(RID p_texture,const String& p_path) { + Texture * texture = texture_owner.get(p_texture); + ERR_FAIL_COND(!texture); + + texture->path=p_path; + +} + +String RasterizerGLES2::texture_get_path(RID p_texture) const{ + + Texture * texture = texture_owner.get(p_texture); + ERR_FAIL_COND_V(!texture,String()); + return texture->path; +} +void RasterizerGLES2::texture_debug_usage(List<VS::TextureInfo> *r_info){ + + List<RID> textures; + texture_owner.get_owned_list(&textures); + + for (List<RID>::Element *E=textures.front();E;E=E->next()) { + + Texture *t = texture_owner.get(E->get()); + if (!t) + continue; + VS::TextureInfo tinfo; + tinfo.path=t->path; + tinfo.format=t->format; + tinfo.size.x=t->alloc_width; + tinfo.size.y=t->alloc_height; + tinfo.bytes=t->total_data_size; + r_info->push_back(tinfo); + } + +} /* SHADER API */ @@ -9164,7 +9198,11 @@ void RasterizerGLES2::_canvas_item_setup_shader_params(CanvasItemMaterial *mater glBindTexture(GL_TEXTURE_2D,framebuffer.sample_color); if (framebuffer.scale==1 && !canvas_texscreen_used) { #ifdef GLEW_ENABLED - glReadBuffer(GL_COLOR_ATTACHMENT0); + if (current_rt) { + glReadBuffer(GL_COLOR_ATTACHMENT0); + } else { + glReadBuffer(GL_BACK); + } #endif glCopyTexSubImage2D(GL_TEXTURE_2D,0,x,y,x,y,viewport.width,viewport.height); // if (current_clip) { @@ -9344,7 +9382,11 @@ void RasterizerGLES2::canvas_render_items(CanvasItem *p_item_list,int p_z,const glBindTexture(GL_TEXTURE_2D,framebuffer.sample_color); #ifdef GLEW_ENABLED - glReadBuffer(GL_COLOR_ATTACHMENT0); + if (current_rt) { + glReadBuffer(GL_COLOR_ATTACHMENT0); + } else { + glReadBuffer(GL_BACK); + } #endif glCopyTexSubImage2D(GL_TEXTURE_2D,0,x,y,x,y,w,h); // if (current_clip) { diff --git a/drivers/gles2/rasterizer_gles2.h b/drivers/gles2/rasterizer_gles2.h index f759e84b53..507e46ae75 100644 --- a/drivers/gles2/rasterizer_gles2.h +++ b/drivers/gles2/rasterizer_gles2.h @@ -115,6 +115,7 @@ class RasterizerGLES2 : public Rasterizer { struct Texture { + String path; uint32_t flags; int width,height; int alloc_width, alloc_height; @@ -1325,6 +1326,10 @@ public: virtual void texture_set_size_override(RID p_texture,int p_width, int p_height); virtual void texture_set_reload_hook(RID p_texture,ObjectID p_owner,const StringName& p_function) const; + virtual void texture_set_path(RID p_texture,const String& p_path); + virtual String texture_get_path(RID p_texture) const; + virtual void texture_debug_usage(List<VS::TextureInfo> *r_info); + GLuint _texture_get_name(RID p_tex); /* SHADER API */ diff --git a/drivers/vorbis/audio_stream_ogg_vorbis.cpp b/drivers/vorbis/audio_stream_ogg_vorbis.cpp index ca055c8b62..8c1c05006f 100644 --- a/drivers/vorbis/audio_stream_ogg_vorbis.cpp +++ b/drivers/vorbis/audio_stream_ogg_vorbis.cpp @@ -361,7 +361,7 @@ void AudioStreamPlaybackOGGVorbis::_clear_stream() { _close_file(); stream_loaded=false; - stream_channels=1; + //stream_channels=1; playing=false; } |