summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-01-02 21:38:20 +0100
committerRémi Verschelde <rverschelde@gmail.com>2017-01-02 21:52:26 +0100
commit3f3f5a5359973e95e94148676a9793d6f52468f3 (patch)
tree65adf17c3d3f8d3a83bec29f51142fe884e942d8 /modules
parentdb46a344180d4eae1455e97e22bf84c9c304be7c (diff)
parent2820b2d82b2ed747011e37c543aefc6d4d4edee9 (diff)
Merge remote-tracking branch 'origin/gles3' into gles3-on-master
Various merge conflicts have been fixed manually and some mistakes might have been made - time will tell :)
Diffstat (limited to 'modules')
-rw-r--r--modules/dds/texture_loader_dds.cpp29
-rw-r--r--modules/etc1/image_etc.cpp16
-rw-r--r--modules/gridmap/config.py3
-rw-r--r--modules/gridmap/grid_map.cpp4
-rw-r--r--modules/jpg/image_loader_jpegd.cpp4
-rw-r--r--modules/pvr/texture_loader_pvr.cpp38
-rw-r--r--modules/squish/image_compress_squish.cpp18
-rw-r--r--modules/theora/video_stream_theora.cpp10
-rw-r--r--modules/webm/video_stream_webm.cpp4
-rw-r--r--modules/webp/image_loader_webp.cpp10
10 files changed, 68 insertions, 68 deletions
diff --git a/modules/dds/texture_loader_dds.cpp b/modules/dds/texture_loader_dds.cpp
index 59d4238e40..2fbd53d3d1 100644
--- a/modules/dds/texture_loader_dds.cpp
+++ b/modules/dds/texture_loader_dds.cpp
@@ -74,21 +74,20 @@ struct DDSFormatInfo {
static const DDSFormatInfo dds_format_info[DDS_MAX]={
- {"DXT1",true,false,4,8,Image::FORMAT_BC1},
- {"DXT3",true,false,4,16,Image::FORMAT_BC2},
- {"DXT5",true,false,4,16,Image::FORMAT_BC3},
- {"ATI1",true,false,4,8,Image::FORMAT_BC4},
- {"ATI2",true,false,4,16,Image::FORMAT_BC5},
- {"BGRA8",false,false,1,4,Image::FORMAT_RGBA},
- {"BGR8",false,false,1,3,Image::FORMAT_RGB},
- {"RGBA8",false,false,1,4,Image::FORMAT_RGBA},
- {"RGB8",false,false,1,3,Image::FORMAT_RGB},
- {"BGR5A1",false,false,1,2,Image::FORMAT_RGBA},
- {"BGR565",false,false,1,2,Image::FORMAT_RGB},
- {"BGR10A2",false,false,1,4,Image::FORMAT_RGBA},
- {"INDEXED",false,true,1,1,Image::FORMAT_INDEXED},
- {"GRAYSCALE",false,false,1,1,Image::FORMAT_GRAYSCALE},
- {"GRAYSCALE_ALPHA",false,false,1,2,Image::FORMAT_GRAYSCALE_ALPHA}
+ {"DXT1",true,false,4,8,Image::FORMAT_DXT1},
+ {"DXT3",true,false,4,16,Image::FORMAT_DXT3},
+ {"DXT5",true,false,4,16,Image::FORMAT_DXT5},
+ {"ATI1",true,false,4,8,Image::FORMAT_ATI1},
+ {"ATI2",true,false,4,16,Image::FORMAT_ATI2},
+ {"BGRA8",false,false,1,4,Image::FORMAT_RGBA8},
+ {"BGR8",false,false,1,3,Image::FORMAT_RGB8},
+ {"RGBA8",false,false,1,4,Image::FORMAT_RGBA8},
+ {"RGB8",false,false,1,3,Image::FORMAT_RGB8},
+ {"BGR5A1",false,false,1,2,Image::FORMAT_RGBA8},
+ {"BGR565",false,false,1,2,Image::FORMAT_RGB8},
+ {"BGR10A2",false,false,1,4,Image::FORMAT_RGBA8},
+ {"GRAYSCALE",false,false,1,1,Image::FORMAT_L8},
+ {"GRAYSCALE_ALPHA",false,false,1,2,Image::FORMAT_LA8}
};
diff --git a/modules/etc1/image_etc.cpp b/modules/etc1/image_etc.cpp
index fdca19046c..4bbdc0a60a 100644
--- a/modules/etc1/image_etc.cpp
+++ b/modules/etc1/image_etc.cpp
@@ -42,7 +42,7 @@ static void _decompress_etc(Image *p_img) {
DVector<uint8_t>::Read r = src.read();
- int mmc=p_img->get_mipmaps();
+ int mmc=p_img->get_mipmap_count();
for(int i=0;i<=mmc;i++) {
@@ -93,9 +93,9 @@ static void _decompress_etc(Image *p_img) {
r=DVector<uint8_t>::Read();
//print_line("Re Creating ETC into regular image: w "+itos(p_img->get_width())+" h "+itos(p_img->get_height())+" mm "+itos(p_img->get_mipmaps()));
- *p_img=Image(p_img->get_width(),p_img->get_height(),p_img->get_mipmaps(),Image::FORMAT_RGB,dst);
- if (p_img->get_mipmaps())
- p_img->generate_mipmaps(-1,true);
+ *p_img=Image(p_img->get_width(),p_img->get_height(),p_img->has_mipmaps(),Image::FORMAT_RGB8,dst);
+ if (p_img->has_mipmaps())
+ p_img->generate_mipmaps(true);
}
@@ -108,11 +108,11 @@ static void _compress_etc(Image *p_img) {
ERR_FAIL_COND( nearest_power_of_2(imgw)!=imgw || nearest_power_of_2(imgh)!=imgh );
- if (img.get_format()!=Image::FORMAT_RGB)
- img.convert(Image::FORMAT_RGB);
+ if (img.get_format()!=Image::FORMAT_RGB8)
+ img.convert(Image::FORMAT_RGB8);
- int mmc=img.get_mipmaps();
+ int mmc=img.get_mipmap_count();
if (mmc==0)
img.generate_mipmaps(); // force mipmaps, so it works on most hardware
@@ -186,7 +186,7 @@ static void _compress_etc(Image *p_img) {
}
- *p_img=Image(p_img->get_width(),p_img->get_height(),mc-1,Image::FORMAT_ETC,dst_data);
+ *p_img=Image(p_img->get_width(),p_img->get_height(),(mc-1)?true:false,Image::FORMAT_ETC,dst_data);
}
diff --git a/modules/gridmap/config.py b/modules/gridmap/config.py
index 5698a37295..1ab13c4aeb 100644
--- a/modules/gridmap/config.py
+++ b/modules/gridmap/config.py
@@ -1,7 +1,8 @@
def can_build(platform):
- return True
+ # FIXME: Disabled temporary for gles3 implementation
+ return False
def configure(env):
diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp
index 755934a0bb..b7c18ba477 100644
--- a/modules/gridmap/grid_map.cpp
+++ b/modules/gridmap/grid_map.cpp
@@ -960,9 +960,9 @@ void GridMap::_octant_bake(const OctantKey &p_key, const Ref<TriangleMesh>& p_tm
st->add_to_format(VS::ARRAY_FORMAT_COLOR);
if (m.is_valid()) {
- Ref<FixedMaterial> fm = m;
+ Ref<FixedSpatialMaterial> fm = m;
if (fm.is_valid())
- fm->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY,true);
+ fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY,true);
}
}
}
diff --git a/modules/jpg/image_loader_jpegd.cpp b/modules/jpg/image_loader_jpegd.cpp
index 096e655d74..9709c0c706 100644
--- a/modules/jpg/image_loader_jpegd.cpp
+++ b/modules/jpg/image_loader_jpegd.cpp
@@ -84,9 +84,9 @@ Error jpeg_load_image_from_buffer(Image *p_image,const uint8_t* p_buffer, int p_
Image::Format fmt;
if (comps==1)
- fmt=Image::FORMAT_GRAYSCALE;
+ fmt=Image::FORMAT_L8;
else
- fmt=Image::FORMAT_RGBA;
+ fmt=Image::FORMAT_RGBA8;
dw = DVector<uint8_t>::Write();
p_image->create(image_width,image_height,0,fmt,data);
diff --git a/modules/pvr/texture_loader_pvr.cpp b/modules/pvr/texture_loader_pvr.cpp
index 48475cb9c2..b650d5687d 100644
--- a/modules/pvr/texture_loader_pvr.cpp
+++ b/modules/pvr/texture_loader_pvr.cpp
@@ -116,33 +116,33 @@ RES ResourceFormatPVR::load(const String &p_path,const String& p_original_path,E
switch(flags&0xFF) {
case 0x18:
- case 0xC: format=(flags&PVR_HAS_ALPHA)?Image::FORMAT_PVRTC2_ALPHA:Image::FORMAT_PVRTC2; break;
+ case 0xC: format=(flags&PVR_HAS_ALPHA)?Image::FORMAT_PVRTC2A:Image::FORMAT_PVRTC2; break;
case 0x19:
- case 0xD: format=(flags&PVR_HAS_ALPHA)?Image::FORMAT_PVRTC4_ALPHA:Image::FORMAT_PVRTC4; break;
+ case 0xD: format=(flags&PVR_HAS_ALPHA)?Image::FORMAT_PVRTC4A:Image::FORMAT_PVRTC4; break;
case 0x16:
- format=Image::FORMAT_GRAYSCALE; break;
+ format=Image::FORMAT_L8; break;
case 0x17:
- format=Image::FORMAT_GRAYSCALE_ALPHA; break;
+ format=Image::FORMAT_LA8; break;
case 0x20:
case 0x80:
case 0x81:
- format=Image::FORMAT_BC1; break;
+ format=Image::FORMAT_DXT1; break;
case 0x21:
case 0x22:
case 0x82:
case 0x83:
- format=Image::FORMAT_BC2; break;
+ format=Image::FORMAT_DXT3; break;
case 0x23:
case 0x24:
case 0x84:
case 0x85:
- format=Image::FORMAT_BC3; break;
+ format=Image::FORMAT_DXT5; break;
case 0x4:
case 0x15:
- format=Image::FORMAT_RGB; break;
+ format=Image::FORMAT_RGB8; break;
case 0x5:
case 0x12:
- format=Image::FORMAT_RGBA; break;
+ format=Image::FORMAT_RGBA8; break;
case 0x36:
format=Image::FORMAT_ETC; break;
default:
@@ -198,24 +198,24 @@ static void _compress_pvrtc4(Image * p_img) {
bool make_mipmaps=false;
if (img.get_width()%8 || img.get_height()%8) {
- make_mipmaps=img.get_mipmaps()>0;
+ make_mipmaps=img.has_mipmaps();
img.resize(img.get_width()+(8-(img.get_width()%8)),img.get_height()+(8-(img.get_height()%8)));
}
- img.convert(Image::FORMAT_RGBA);
- if (img.get_mipmaps()==0 && make_mipmaps)
+ img.convert(Image::FORMAT_RGBA8);
+ if (!img.has_mipmaps() && make_mipmaps)
img.generate_mipmaps();
bool use_alpha=img.detect_alpha();
Image new_img;
- new_img.create(img.get_width(),img.get_height(),true,use_alpha?Image::FORMAT_PVRTC4_ALPHA:Image::FORMAT_PVRTC4);
+ new_img.create(img.get_width(),img.get_height(),true,use_alpha?Image::FORMAT_PVRTC4A:Image::FORMAT_PVRTC4);
DVector<uint8_t> data=new_img.get_data();
{
DVector<uint8_t>::Write wr=data.write();
DVector<uint8_t>::Read r=img.get_data().read();
- for(int i=0;i<=new_img.get_mipmaps();i++) {
+ for(int i=0;i<=new_img.get_mipmap_count();i++) {
int ofs,size,w,h;
img.get_mipmap_offset_size_and_dimensions(i,ofs,size,w,h);
@@ -234,7 +234,7 @@ static void _compress_pvrtc4(Image * p_img) {
}
- *p_img = Image(new_img.get_width(),new_img.get_height(),new_img.get_mipmaps(),new_img.get_format(),data);
+ *p_img = Image(new_img.get_width(),new_img.get_height(),new_img.has_mipmaps(),new_img.get_format(),data);
}
@@ -673,9 +673,9 @@ static void _pvrtc_decompress(Image* p_img) {
// decompress_pvrtc((PVRTCBlock*)p_comp_img,p_2bit,p_width,p_height,1,p_dst);
// }
- ERR_FAIL_COND( p_img->get_format()!=Image::FORMAT_PVRTC2 && p_img->get_format()!=Image::FORMAT_PVRTC2_ALPHA && p_img->get_format()!=Image::FORMAT_PVRTC4 && p_img->get_format()!=Image::FORMAT_PVRTC4_ALPHA);
+ ERR_FAIL_COND( p_img->get_format()!=Image::FORMAT_PVRTC2 && p_img->get_format()!=Image::FORMAT_PVRTC2A && p_img->get_format()!=Image::FORMAT_PVRTC4 && p_img->get_format()!=Image::FORMAT_PVRTC4A);
- bool _2bit = (p_img->get_format()==Image::FORMAT_PVRTC2 || p_img->get_format()==Image::FORMAT_PVRTC2_ALPHA );
+ bool _2bit = (p_img->get_format()==Image::FORMAT_PVRTC2 || p_img->get_format()==Image::FORMAT_PVRTC2A );
DVector<uint8_t> data = p_img->get_data();
DVector<uint8_t>::Read r = data.read();
@@ -694,8 +694,8 @@ static void _pvrtc_decompress(Image* p_img) {
w=DVector<uint8_t>::Write();
r=DVector<uint8_t>::Read();
- bool make_mipmaps=p_img->get_mipmaps()>0;
- Image newimg(p_img->get_width(),p_img->get_height(),0,Image::FORMAT_RGBA,newdata);
+ bool make_mipmaps=p_img->has_mipmaps();
+ Image newimg(p_img->get_width(),p_img->get_height(),false,Image::FORMAT_RGBA8,newdata);
if (make_mipmaps)
newimg.generate_mipmaps();
*p_img=newimg;
diff --git a/modules/squish/image_compress_squish.cpp b/modules/squish/image_compress_squish.cpp
index e90996e340..6cd9048f1b 100644
--- a/modules/squish/image_compress_squish.cpp
+++ b/modules/squish/image_compress_squish.cpp
@@ -37,7 +37,7 @@ void image_compress_squish(Image *p_image) {
int w=p_image->get_width();
int h=p_image->get_height();
- if (p_image->get_mipmaps() == 0) {
+ if (!p_image->has_mipmaps() ) {
ERR_FAIL_COND( !w || w % 4 != 0);
ERR_FAIL_COND( !h || h % 4 != 0);
} else {
@@ -45,26 +45,26 @@ void image_compress_squish(Image *p_image) {
ERR_FAIL_COND( !h || h !=nearest_power_of_2(h) );
};
- if (p_image->get_format()>=Image::FORMAT_BC1)
+ if (p_image->get_format()>=Image::FORMAT_DXT1)
return; //do not compress, already compressed
int shift=0;
int squish_comp=squish::kColourRangeFit;
Image::Format target_format;
- if (p_image->get_format()==Image::FORMAT_GRAYSCALE_ALPHA) {
+ if (p_image->get_format()==Image::FORMAT_LA8) {
//compressed normalmap
- target_format = Image::FORMAT_BC3; squish_comp|=squish::kDxt5;;
+ target_format = Image::FORMAT_DXT5; squish_comp|=squish::kDxt5;;
} else if (p_image->detect_alpha()!=Image::ALPHA_NONE) {
- target_format = Image::FORMAT_BC2; squish_comp|=squish::kDxt3;;
+ target_format = Image::FORMAT_DXT3; squish_comp|=squish::kDxt3;;
} else {
- target_format = Image::FORMAT_BC1; shift=1; squish_comp|=squish::kDxt1;;
+ target_format = Image::FORMAT_DXT1; shift=1; squish_comp|=squish::kDxt1;;
}
- p_image->convert(Image::FORMAT_RGBA); //always expects rgba
+ p_image->convert(Image::FORMAT_RGBA8); //always expects rgba
- int mm_count = p_image->get_mipmaps();
+ int mm_count = p_image->get_mipmap_count();
DVector<uint8_t> data;
int target_size = Image::get_image_data_size(w,h,target_format,mm_count);
@@ -87,6 +87,6 @@ void image_compress_squish(Image *p_image) {
rb = DVector<uint8_t>::Read();
wb = DVector<uint8_t>::Write();
- p_image->create(p_image->get_width(),p_image->get_height(),p_image->get_mipmaps(),target_format,data);
+ p_image->create(p_image->get_width(),p_image->get_height(),p_image->has_mipmaps(),target_format,data);
}
diff --git a/modules/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp
index d98ec9ee79..b7fa3ac5ec 100644
--- a/modules/theora/video_stream_theora.cpp
+++ b/modules/theora/video_stream_theora.cpp
@@ -103,7 +103,7 @@ void VideoStreamPlaybackTheora::video_write(void){
dst[p++] = 255;
};
}
- format = Image::FORMAT_RGBA;
+ format = Image::FORMAT_RGBA8;
}
// */
@@ -130,10 +130,10 @@ void VideoStreamPlaybackTheora::video_write(void){
yuv420_2_rgb8888((uint8_t*)dst, (uint8_t*)yuv[0].data, (uint8_t*)yuv[2].data, (uint8_t*)yuv[1].data, size.x, size.y, yuv[0].stride, yuv[1].stride, size.x<<2, 0);
};
- format = Image::FORMAT_RGBA;
+ format = Image::FORMAT_RGBA8;
}
- Image img(size.x,size.y,0,Image::FORMAT_RGBA,frame_data); //zero copy image creation
+ Image img(size.x,size.y,0,Image::FORMAT_RGBA8,frame_data); //zero copy image creation
texture->set_data(img); //zero copy send to visual server
@@ -202,7 +202,7 @@ void VideoStreamPlaybackTheora::video_write(void){
}
}
- format = Image::FORMAT_RGBA;
+ format = Image::FORMAT_RGBA8;
} else {
@@ -470,7 +470,7 @@ void VideoStreamPlaybackTheora::set_file(const String& p_file) {
size.x = w;
size.y = h;
- texture->create(w,h,Image::FORMAT_RGBA,Texture::FLAG_FILTER|Texture::FLAG_VIDEO_SURFACE);
+ texture->create(w,h,Image::FORMAT_RGBA8,Texture::FLAG_FILTER|Texture::FLAG_VIDEO_SURFACE);
}else{
/* tear down the partial theora setup */
diff --git a/modules/webm/video_stream_webm.cpp b/modules/webm/video_stream_webm.cpp
index d7a5155351..f47e254f4b 100644
--- a/modules/webm/video_stream_webm.cpp
+++ b/modules/webm/video_stream_webm.cpp
@@ -127,7 +127,7 @@ bool VideoStreamPlaybackWebm::open_file(const String &p_file) {
}
frame_data.resize((webm->getWidth() * webm->getHeight()) << 2);
- texture->create(webm->getWidth(), webm->getHeight(), Image::FORMAT_RGBA, Texture::FLAG_FILTER | Texture::FLAG_VIDEO_SURFACE);
+ texture->create(webm->getWidth(), webm->getHeight(), Image::FORMAT_RGBA8, Texture::FLAG_FILTER | Texture::FLAG_VIDEO_SURFACE);
return true;
}
@@ -318,7 +318,7 @@ void VideoStreamPlaybackWebm::update(float p_delta) {
}
if (converted)
- texture->set_data(Image(image.w, image.h, 0, Image::FORMAT_RGBA, frame_data)); //Zero copy send to visual server
+ texture->set_data(Image(image.w, image.h, 0, Image::FORMAT_RGBA8, frame_data)); //Zero copy send to visual server
}
break;
diff --git a/modules/webp/image_loader_webp.cpp b/modules/webp/image_loader_webp.cpp
index ebeb674a7c..56fc386ef4 100644
--- a/modules/webp/image_loader_webp.cpp
+++ b/modules/webp/image_loader_webp.cpp
@@ -42,9 +42,9 @@ static DVector<uint8_t> _webp_lossy_pack(const Image& p_image,float p_quality) {
Image img=p_image;
if (img.detect_alpha())
- img.convert(Image::FORMAT_RGBA);
+ img.convert(Image::FORMAT_RGBA8);
else
- img.convert(Image::FORMAT_RGB);
+ img.convert(Image::FORMAT_RGB8);
Size2 s(img.get_width(),img.get_height());
DVector<uint8_t> data = img.get_data();
@@ -52,7 +52,7 @@ static DVector<uint8_t> _webp_lossy_pack(const Image& p_image,float p_quality) {
uint8_t *dst_buff=NULL;
size_t dst_size=0;
- if (img.get_format()==Image::FORMAT_RGB) {
+ if (img.get_format()==Image::FORMAT_RGB8) {
dst_size = WebPEncodeRGB(r.ptr(),s.width,s.height,3*s.width,CLAMP(p_quality*100.0,0,100.0),&dst_buff);
} else {
@@ -109,7 +109,7 @@ static Image _webp_lossy_unpack(const DVector<uint8_t>& p_buffer) {
dst_w = DVector<uint8_t>::Write();
- return Image(features.width,features.height,0,features.has_alpha?Image::FORMAT_RGBA:Image::FORMAT_RGB,dst_image);
+ return Image(features.width,features.height,0,features.has_alpha?Image::FORMAT_RGBA8:Image::FORMAT_RGB8,dst_image);
}
@@ -161,7 +161,7 @@ Error ImageLoaderWEBP::load_image(Image *p_image,FileAccess *f) {
src_r = DVector<uint8_t>::Read();
dst_w = DVector<uint8_t>::Write();
- *p_image = Image(features.width,features.height,0,features.has_alpha?Image::FORMAT_RGBA:Image::FORMAT_RGB,dst_image);
+ *p_image = Image(features.width,features.height,0,features.has_alpha?Image::FORMAT_RGBA8:Image::FORMAT_RGB8,dst_image);
return OK;