From b90fd355150a0f56e368bb33619459b19ec92bee Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Thu, 8 Oct 2020 02:04:31 +1100 Subject: Various improvements to image file handling: Moved MS DIB parser out of ICO file reader and made it available for artwork and layout images. Added more efficient I/O and better error checking for JPEG file loading (MAME will no longer exit immediately on a bad JPEG file). Made caller responsible for opening files for loading images, to avoid decompressing images used in ZIP/7z artwork multiple times. Added support for JPEG and Windows DIB to picture_image_device. Added support for SVG image files in external artwork. Added support for using I/O port value for animation state and masking animation state values. Made bounds elements more flexible in layouts. Reworked headers to reduce dependencies. Updated layout file format documentation. --- src/osd/modules/render/bgfx/texturemanager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/osd/modules/render/bgfx/texturemanager.cpp') diff --git a/src/osd/modules/render/bgfx/texturemanager.cpp b/src/osd/modules/render/bgfx/texturemanager.cpp index a03a6b46125..d539d1aae46 100644 --- a/src/osd/modules/render/bgfx/texturemanager.cpp +++ b/src/osd/modules/render/bgfx/texturemanager.cpp @@ -59,7 +59,11 @@ bgfx_texture* texture_manager::create_png_texture(std::string path, std::string { bitmap_argb32 bitmap; emu_file file(path.c_str(), OPEN_FLAG_READ); - render_load_png(bitmap, file, nullptr, file_name.c_str()); + if (file.open(file_name) == osd_file::error::NONE) + { + render_load_png(bitmap, file); + file.close(); + } if (bitmap.width() == 0 || bitmap.height() == 0) { -- cgit v1.2.3-70-g09d2