diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-04-12 20:41:25 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-04-12 20:41:25 -0300 |
commit | e573d3a945bcd65ca9c22a338149ed8ff9c44407 (patch) | |
tree | c1d8da739f672e9eb0146b05cf5e01903b15fbba /drivers/gles2 | |
parent | 61ab20a0bb16db8320a4e85432f0b3b0292d1130 (diff) |
fixed broken lighting, closes #1671
Diffstat (limited to 'drivers/gles2')
-rw-r--r-- | drivers/gles2/rasterizer_gles2.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index 412def40ff..f48105e3f1 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -1037,33 +1037,34 @@ void RasterizerGLES2::texture_set_data(RID p_texture,const Image& p_image,VS::Cu int mipmaps= (texture->flags&VS::TEXTURE_FLAG_MIPMAPS && img.get_mipmaps()>0) ? img.get_mipmaps() +1 : 1; - //int w=img.get_width(); - //int h=img.get_height(); + int w=img.get_width(); + int h=img.get_height(); int tsize=0; for(int i=0;i<mipmaps;i++) { int size,ofs; - int mm_w,mm_h; - img.get_mipmap_offset_size_and_dimensions(i,ofs,size,mm_w,mm_h); + img.get_mipmap_offset_and_size(i,ofs,size); + + //print_line("mipmap: "+itos(i)+" size: "+itos(size)+" w: "+itos(mm_w)+", h: "+itos(mm_h)); if (texture->compressed) { glPixelStorei(GL_UNPACK_ALIGNMENT, 4); - glCompressedTexImage2D( blit_target, i, format,mm_w,mm_h,0,size,&read[ofs] ); + glCompressedTexImage2D( blit_target, i, format,w,h,0,size,&read[ofs] ); } else { glPixelStorei(GL_UNPACK_ALIGNMENT, 1); if (texture->flags&VS::TEXTURE_FLAG_VIDEO_SURFACE) { - glTexSubImage2D( blit_target, i, 0,0,mm_w, mm_h,format,GL_UNSIGNED_BYTE,&read[ofs] ); + glTexSubImage2D( blit_target, i, 0,0,w, h,format,GL_UNSIGNED_BYTE,&read[ofs] ); } else { - glTexImage2D(blit_target, i, internal_format, mm_w, mm_h, 0, format, GL_UNSIGNED_BYTE,&read[ofs]); + glTexImage2D(blit_target, i, internal_format, w, h, 0, format, GL_UNSIGNED_BYTE,&read[ofs]); } } tsize+=size; - //w = MAX(Image::,w>>1); - //h = MAX(1,h>>1); + w = MAX(1,w>>1); + h = MAX(1,h>>1); } |