From e573d3a945bcd65ca9c22a338149ed8ff9c44407 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 12 Apr 2015 20:41:25 -0300 Subject: [PATCH] fixed broken lighting, closes #1671 --- drivers/gles2/rasterizer_gles2.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index 412def40ffb..f48105e3f1d 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;icompressed) { 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); }