summaryrefslogtreecommitdiff
path: root/drivers/gles2/rasterizer_gles2.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-04-06 21:48:20 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-04-06 21:48:20 -0300
commitb36e41cb7117757011e6f1ccc476ccc806219a58 (patch)
tree56cc08bad161f167d9217b0621123dd0947ea763 /drivers/gles2/rasterizer_gles2.cpp
parent5d99e15e43d5a446b35d48e8a3b08a478f1998a9 (diff)
Added a PVRTC encoder for iOS
Diffstat (limited to 'drivers/gles2/rasterizer_gles2.cpp')
-rw-r--r--drivers/gles2/rasterizer_gles2.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp
index 3660be20db..b40eccb239 100644
--- a/drivers/gles2/rasterizer_gles2.cpp
+++ b/drivers/gles2/rasterizer_gles2.cpp
@@ -1033,32 +1033,33 @@ 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;
- img.get_mipmap_offset_and_size(i,ofs,size);
+ int mm_w,mm_h;
+ img.get_mipmap_offset_size_and_dimensions(i,ofs,size,mm_w,mm_h);
if (texture->compressed) {
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
- glCompressedTexImage2D( blit_target, i, format,w,h,0,size,&read[ofs] );
+ glCompressedTexImage2D( blit_target, i, format,mm_w,mm_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,w,h,format,GL_UNSIGNED_BYTE,&read[ofs] );
+ glTexSubImage2D( blit_target, i, 0,0,mm_w, mm_h,format,GL_UNSIGNED_BYTE,&read[ofs] );
} else {
- glTexImage2D(blit_target, i, internal_format, w, h, 0, format, GL_UNSIGNED_BYTE,&read[ofs]);
+ glTexImage2D(blit_target, i, internal_format, mm_w, mm_h, 0, format, GL_UNSIGNED_BYTE,&read[ofs]);
}
}
tsize+=size;
- w = MAX(1,w>>1);
- h = MAX(1,h>>1);
+ //w = MAX(Image::,w>>1);
+ //h = MAX(1,h>>1);
}