X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Ftexture2darray.cpp;h=1a085ed8e73bbe6c89c5361b7839a5fe32180c32;hp=27e0d5334f357f10ec88761231f4012b6279f855;hb=03d3984ecd2c4e7c38b6a62b4b7a81bab69f8d40;hpb=55dbeb5e04516699b8415104e346243d5e4c48c9 diff --git a/source/texture2darray.cpp b/source/texture2darray.cpp index 27e0d533..1a085ed8 100644 --- a/source/texture2darray.cpp +++ b/source/texture2darray.cpp @@ -28,13 +28,13 @@ void Texture2DArray::layer_image(unsigned level, unsigned z, PixelFormat fmt, Da void Texture2DArray::layer_image(unsigned level, unsigned z, const Graphics::Image &img) { if(!get_width()) - throw invalid_operation("Texture2D::layer_image"); + throw invalid_operation("Texture2DArray::layer_image"); unsigned w = img.get_width(); unsigned h = img.get_height(); PixelFormat fmt = pixelformat_from_graphics(img.get_format()); if(w!=get_width() || h!=get_height()) - throw incompatible_data("Texture2D::image"); + throw incompatible_data("Texture2DArray::layer_image"); PixelStore pstore = PixelStore::from_image(img); BindRestore _bind_ps(pstore); @@ -64,6 +64,8 @@ void Texture2DArray::Loader::external_image(unsigned z, const string &fn) { Graphics::Image img; RefPtr io = get_collection().open_raw(fn); + if(!io) + throw IO::file_not_found(fn); img.load_io(*io); obj.layer_image(0, z, img);