diff --git a/Makefile.common b/Makefile.common index 70bb13e305..42e466bbeb 100644 --- a/Makefile.common +++ b/Makefile.common @@ -528,7 +528,7 @@ ifneq ($(HAVE_STRL), 1) OBJ += $(LIBRETRO_COMM_DIR)/compat/compat_strl.o endif -OBJ += $(LIBRETRO_COMM_DIR)/formats/image_texture.o \ +OBJ += $(LIBRETRO_COMM_DIR)/formats/image_texture.o $(LIBRETRO_COMM_DIR)/streams/image_texture_file.o \ $(LIBRETRO_COMM_DIR)/formats/image_texture_scale.o \ $(LIBRETRO_COMM_DIR)/formats/image_texture_set.o \ $(LIBRETRO_COMM_DIR)/formats/image/image_yuv_blit.o diff --git a/cores/libretro-imageviewer/image_core.c b/cores/libretro-imageviewer/image_core.c index 9086d09894..2061f28bb7 100644 --- a/cores/libretro-imageviewer/image_core.c +++ b/cores/libretro-imageviewer/image_core.c @@ -30,6 +30,7 @@ #include "stb_image.h" #else #include +#include #endif #include diff --git a/gfx/drivers/ctr_gfx.c b/gfx/drivers/ctr_gfx.c index 54731ddcfd..780e760886 100644 --- a/gfx/drivers/ctr_gfx.c +++ b/gfx/drivers/ctr_gfx.c @@ -27,6 +27,7 @@ #include #include #include +#include #ifdef HAVE_CONFIG_H #include "../../config.h" diff --git a/gfx/drivers/d3d10.c b/gfx/drivers/d3d10.c index 533beb7565..296be0f3ad 100644 --- a/gfx/drivers/d3d10.c +++ b/gfx/drivers/d3d10.c @@ -37,6 +37,7 @@ #include #include #include +#include #include diff --git a/gfx/drivers/d3d11.c b/gfx/drivers/d3d11.c index 1654f054d8..4740625db3 100644 --- a/gfx/drivers/d3d11.c +++ b/gfx/drivers/d3d11.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include "../common/video_import_color.h" diff --git a/gfx/drivers/d3d12.c b/gfx/drivers/d3d12.c index bb6ceec3bd..3da654575d 100644 --- a/gfx/drivers/d3d12.c +++ b/gfx/drivers/d3d12.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include "../common/video_import_color.h" diff --git a/gfx/drivers/d3d9cg.c b/gfx/drivers/d3d9cg.c index 51d7587d0e..1f31f5f41a 100644 --- a/gfx/drivers/d3d9cg.c +++ b/gfx/drivers/d3d9cg.c @@ -26,6 +26,7 @@ #define CINTERFACE #include +#include #include #include #include diff --git a/gfx/drivers/d3d9hlsl.c b/gfx/drivers/d3d9hlsl.c index 2799d5b397..0fae627d21 100644 --- a/gfx/drivers/d3d9hlsl.c +++ b/gfx/drivers/d3d9hlsl.c @@ -31,6 +31,7 @@ #endif #include +#include #include #include #include diff --git a/gfx/drivers/gl2.c b/gfx/drivers/gl2.c index a34a4518c1..9f6baaa41d 100644 --- a/gfx/drivers/gl2.c +++ b/gfx/drivers/gl2.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include diff --git a/gfx/drivers/gx2_gfx.c b/gfx/drivers/gx2_gfx.c index ebc958b410..d07ca5478f 100644 --- a/gfx/drivers/gx2_gfx.c +++ b/gfx/drivers/gx2_gfx.c @@ -24,6 +24,7 @@ #include #include +#include #include #include diff --git a/gfx/drivers/metal.m b/gfx/drivers/metal.m index 007795c312..fe9eeba49c 100644 --- a/gfx/drivers/metal.m +++ b/gfx/drivers/metal.m @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include diff --git a/gfx/drivers_shader/shader_gl3.c b/gfx/drivers_shader/shader_gl3.c index 18b8ba4879..5631272918 100644 --- a/gfx/drivers_shader/shader_gl3.c +++ b/gfx/drivers_shader/shader_gl3.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include "slang_process.h" diff --git a/gfx/drivers_shader/shader_vulkan.c b/gfx/drivers_shader/shader_vulkan.c index 5a47916230..7400bde46a 100644 --- a/gfx/drivers_shader/shader_vulkan.c +++ b/gfx/drivers_shader/shader_vulkan.c @@ -22,6 +22,7 @@ #include #include +#include #include #include #include diff --git a/gfx/gfx_surface.c b/gfx/gfx_surface.c index 797780a43f..9155664548 100644 --- a/gfx/gfx_surface.c +++ b/gfx/gfx_surface.c @@ -19,6 +19,7 @@ #include #include #include +#include #include "gfx_surface.h" #include "gfx_instrument.h" diff --git a/griffin/griffin.c b/griffin/griffin.c index 3f2d404a14..f35a08f9d4 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -576,6 +576,7 @@ VIDEO IMAGE ============================================================ */ #include "../libretro-common/formats/image_texture.c" +#include "../libretro-common/streams/image_texture_file.c" #include "../libretro-common/formats/image/image_yuv_blit.c" #include "../libretro-common/formats/image_texture_scale.c" #include "../libretro-common/formats/image_texture_set.c" diff --git a/libretro-common/formats/image_texture.c b/libretro-common/formats/image_texture.c index 0151bc1922..f0ecb95145 100644 --- a/libretro-common/formats/image_texture.c +++ b/libretro-common/formats/image_texture.c @@ -28,7 +28,6 @@ #include #include #include -#include #ifdef HAVE_RPNG #include #endif @@ -495,7 +494,7 @@ static void image_texture_clear(struct texture_image *img) img->fp16 = false; } -static bool image_texture_load_buffer_probe(data_transfer_t *keep, +bool image_texture_load_buffer_probe(data_transfer_t *keep, bool *kept, struct texture_image *out_img, enum image_type_enum type, const void *ptr, size_t len, const image_texture_request_t *req, @@ -544,56 +543,6 @@ bool image_texture_load_buffer_request(struct texture_image *out_img, should_abort, abort_ud, NULL); } -bool image_texture_load_request(struct texture_image *out_img, - const char *path, const image_texture_request_t *req, - bool (*should_abort)(void *ud), void *ud) -{ - return image_texture_load_request_ex(out_img, path, req, - should_abort, ud, NULL); -} - -bool image_texture_load_request_ex(struct texture_image *out_img, - const char *path, const image_texture_request_t *req, - bool (*should_abort)(void *ud), void *ud, int *png_probe) -{ - enum image_type_enum type = image_texture_get_type(path); - - if (png_probe) - *png_probe = -1; - - if (type != IMAGE_TYPE_NONE) - { - /* The synchronous read rides the data_transfer prefix spine - * like every other loader: filestream/VFS routing (overlays - * and driver assets from archive members or content:// - * documents), 64-bit lengths, the hardware guard behind the - * read, and honest short-read detection. A zero budget fills - * to completion in one blocking call, which is this API's - * contract. */ - struct data_transfer *dt = data_transfer_open_prefix(path, 0); - if (dt) - { - size_t file_len = 0; - const uint8_t *ptr = NULL; - bool kept = false; - bool loaded; - - data_transfer_iterate(dt, 0); - ptr = data_transfer_ptr(dt, &file_len); - loaded = data_transfer_complete(dt) && ptr && file_len - && image_texture_load_buffer_probe(dt, &kept, out_img, type, - ptr, file_len, req, should_abort, ud, png_probe); - if (!kept) - data_transfer_free(dt); - if (loaded) - return true; - } - } - if (out_img) - image_texture_clear(out_img); - return false; -} - /* The request the plain loads carry: the caller's image, whose * ->pix10 asks for 10-bit on the way in */ static void image_texture_request_of(const struct texture_image *img, @@ -605,10 +554,6 @@ static void image_texture_request_of(const struct texture_image *img, req->want_compressed = true; } -bool image_texture_load(struct texture_image *out_img, const char *path) -{ - return image_texture_load_ex(out_img, path, NULL, NULL); -} void image_texture_free(struct texture_image *img) { @@ -828,11 +773,3 @@ bool image_texture_load_buffer(struct texture_image *out_img, buffer_len, &req, NULL, NULL); } -bool image_texture_load_ex(struct texture_image *out_img, - const char *path, bool (*should_abort)(void *ud), void *ud) -{ - image_texture_request_t req; - image_texture_request_of(out_img, &req); - return image_texture_load_request(out_img, path, &req, - should_abort, ud); -} diff --git a/libretro-common/formats/image_texture_set.c b/libretro-common/formats/image_texture_set.c index 460f6d8ad0..cdc00057d4 100644 --- a/libretro-common/formats/image_texture_set.c +++ b/libretro-common/formats/image_texture_set.c @@ -25,6 +25,7 @@ #include #include #include +#include #ifdef HAVE_GCD #include #elif defined(HAVE_THREADS) diff --git a/libretro-common/include/formats/image.h b/libretro-common/include/formats/image.h index 889ea8c2d8..e6354ed6bd 100644 --- a/libretro-common/include/formats/image.h +++ b/libretro-common/include/formats/image.h @@ -33,6 +33,8 @@ RETRO_BEGIN_DECLS +struct data_transfer; + enum image_process_code { IMAGE_PROCESS_ERROR = -2, @@ -344,24 +346,25 @@ bool image_texture_scale(struct texture_image *img, bool image_texture_load_buffer(struct texture_image *img, enum image_type_enum type, void *s, size_t len); -/* The loader run to completion over a whole buffer or a file, with - * @req naming what the caller takes (NULL: the ordinary image). The - * abort hook is asked between steps; it may be NULL. False leaves - * @img empty. */ +/* The loader run to completion over a whole buffer, with @req naming + * what the caller takes (NULL: the ordinary image). The abort hook is + * asked between steps; it may be NULL. False leaves @img empty. Loading + * by path - image_texture_load and the rest - is in + * . */ bool image_texture_load_buffer_request(struct texture_image *img, enum image_type_enum type, const void *buf, size_t len, const image_texture_request_t *req, bool (*should_abort)(void *ud), void *ud); -bool image_texture_load_request(struct texture_image *img, - const char *path, const image_texture_request_t *req, - bool (*should_abort)(void *ud), void *ud); -/* image_texture_load_request answering, from the bytes it read, whether - * the file is an animated PNG: 1 yes, 0 a still, -1 not a PNG or no - * decode. Spares a caller that keeps an animation's bytes a second - * read of every still to ask. @png_probe may be NULL. */ -bool image_texture_load_request_ex(struct texture_image *img, - const char *path, const image_texture_request_t *req, +/* image_texture_load_buffer_request over bytes @keep, a data_transfer, + * holds: an image that can go on reading them (a compressed texture) + * takes @keep, frees it with itself and sets *@kept; *@png_probe, where + * not NULL, says whether the bytes are an animated PNG - 1 yes, 0 a + * still, -1 not a PNG or no decode. @keep and @kept may be NULL. */ +bool image_texture_load_buffer_probe(struct data_transfer *keep, + bool *kept, struct texture_image *img, + enum image_type_enum type, const void *buf, size_t len, + const image_texture_request_t *req, bool (*should_abort)(void *ud), void *ud, int *png_probe); /* Run @fn for every index below @n, across the cores at once where @@ -382,27 +385,14 @@ void image_texture_set_run_ex(unsigned n, void (*thread_done)(void)); /* Decode the @n files @paths name into @imgs together, each as - * image_texture_load_request does with @req; a path that is NULL, - * empty or unreadable leaves its image empty. Returns how many - * decoded. In formats/image_texture_set.c. */ + * image_texture_load_request () does with + * @req; a path that is NULL, empty or unreadable leaves its image + * empty. Returns how many decoded. In formats/image_texture_set.c. */ unsigned image_texture_load_set(const char *const *paths, struct texture_image *imgs, unsigned n, const image_texture_request_t *req); -/* ->pix10 is an ask on the way in and an answer on the way out: set - * it before the call to have a decoder that can emit XRGB2101010 do - * so, and read it after to find out whether it did. Clear on entry - * means the ordinary 8-bit image, as before. */ -bool image_texture_load(struct texture_image *img, const char *path); -/* image_texture_load with an abort hook: both decode stages are - * incremental (one chunk / one pass per step) and @should_abort is - * asked between steps; returning true abandons the decode, which then - * fails cleanly. For decodes on worker threads that must stop promptly - * at shutdown or when their result is no longer wanted. @should_abort - * may be NULL. */ -bool image_texture_load_ex(struct texture_image *img, const char *path, - bool (*should_abort)(void *ud), void *ud); void image_texture_free(struct texture_image *img); /* Force a CPU decode of a compressed texture_image into ->pixels (RGBA8). diff --git a/libretro-common/include/streams/image_texture_file.h b/libretro-common/include/streams/image_texture_file.h new file mode 100644 index 0000000000..568c228a82 --- /dev/null +++ b/libretro-common/include/streams/image_texture_file.h @@ -0,0 +1,68 @@ +/* Copyright (C) 2010-2026 The RetroArch team + * + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (image_texture_file.h). + * --------------------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +#ifndef __LIBRETRO_SDK_STREAMS_IMAGE_TEXTURE_FILE_H__ +#define __LIBRETRO_SDK_STREAMS_IMAGE_TEXTURE_FILE_H__ + +#include +#include +#include + +RETRO_BEGIN_DECLS + +/* Images loaded by path: the file read whole through + * data_transfer_open_prefix - filestream/VFS routing, so overlays and + * driver assets from archive members or content:// documents load like + * any other, 64-bit lengths, honest short reads - and decoded by + * image_texture_load_buffer_probe. */ + +/* ->pix10 is an ask on the way in and an answer on the way out: set + * it before the call to have a decoder that can emit XRGB2101010 do + * so, and read it after to find out whether it did. Clear on entry + * means the ordinary 8-bit image, as before. */ +bool image_texture_load(struct texture_image *img, const char *path); + +/* image_texture_load with an abort hook: both decode stages are + * incremental (one chunk / one pass per step) and @should_abort is + * asked between steps; returning true abandons the decode, which then + * fails cleanly. For decodes on worker threads that must stop promptly + * at shutdown or when their result is no longer wanted. @should_abort + * may be NULL. */ +bool image_texture_load_ex(struct texture_image *img, const char *path, + bool (*should_abort)(void *ud), void *ud); + +bool image_texture_load_request(struct texture_image *img, + const char *path, const image_texture_request_t *req, + bool (*should_abort)(void *ud), void *ud); + +/* image_texture_load_request answering, from the bytes it read, whether + * the file is an animated PNG: 1 yes, 0 a still, -1 not a PNG or no + * decode. Spares a caller that keeps an animation's bytes a second + * read of every still to ask. @png_probe may be NULL. */ +bool image_texture_load_request_ex(struct texture_image *img, + const char *path, const image_texture_request_t *req, + bool (*should_abort)(void *ud), void *ud, int *png_probe); + +RETRO_END_DECLS + +#endif diff --git a/libretro-common/samples/formats/image_loader/Makefile b/libretro-common/samples/formats/image_loader/Makefile index 46b50f44a7..81e7d567bb 100644 --- a/libretro-common/samples/formats/image_loader/Makefile +++ b/libretro-common/samples/formats/image_loader/Makefile @@ -20,7 +20,7 @@ SOURCES := image_loader_test.c \ $(LIBRETRO_COMM_DIR)/file/file_path_io.c \ $(LIBRETRO_COMM_DIR)/formats/data_transfer.c $(LIBRETRO_COMM_DIR)/streams/data_transfer_file.c \ $(LIBRETRO_COMM_DIR)/formats/dds/rdds.c \ - $(LIBRETRO_COMM_DIR)/formats/image_texture.c \ + $(LIBRETRO_COMM_DIR)/formats/image_texture.c $(LIBRETRO_COMM_DIR)/streams/image_texture_file.c \ $(LIBRETRO_COMM_DIR)/formats/image_texture_scale.c \ $(LIBRETRO_COMM_DIR)/formats/image_texture_set.c \ $(LIBRETRO_COMM_DIR)/formats/image_transfer.c \ diff --git a/libretro-common/samples/formats/image_loader/image_loader_test.c b/libretro-common/samples/formats/image_loader/image_loader_test.c index 3130d81dbd..ecb9b6615a 100644 --- a/libretro-common/samples/formats/image_loader/image_loader_test.c +++ b/libretro-common/samples/formats/image_loader/image_loader_test.c @@ -27,6 +27,7 @@ #include #include #include +#include #define W 24 #define H 16 diff --git a/libretro-common/streams/image_texture_file.c b/libretro-common/streams/image_texture_file.c new file mode 100644 index 0000000000..19978b0647 --- /dev/null +++ b/libretro-common/streams/image_texture_file.c @@ -0,0 +1,98 @@ +/* Copyright (C) 2010-2026 The RetroArch team + * + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (image_texture_file.c). + * --------------------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +/* The path side of image loading: formats/image_texture.c decodes the + * bytes it is given, and this reads them from the file. */ + +#include +#include + +#include +#include +#include +#include + +bool image_texture_load_request(struct texture_image *out_img, + const char *path, const image_texture_request_t *req, + bool (*should_abort)(void *ud), void *ud) +{ + return image_texture_load_request_ex(out_img, path, req, + should_abort, ud, NULL); +} + +bool image_texture_load_request_ex(struct texture_image *out_img, + const char *path, const image_texture_request_t *req, + bool (*should_abort)(void *ud), void *ud, int *png_probe) +{ + enum image_type_enum type = image_texture_get_type(path); + + if (png_probe) + *png_probe = -1; + + if (type != IMAGE_TYPE_NONE) + { + /* A zero budget fills to completion in one blocking call, which + * is this API's contract */ + struct data_transfer *dt = data_transfer_open_prefix(path, 0); + if (dt) + { + size_t file_len = 0; + const uint8_t *ptr = NULL; + bool kept = false; + bool loaded; + + data_transfer_iterate(dt, 0); + ptr = data_transfer_ptr(dt, &file_len); + loaded = data_transfer_complete(dt) && ptr && file_len + && image_texture_load_buffer_probe(dt, &kept, out_img, type, + ptr, file_len, req, should_abort, ud, png_probe); + if (!kept) + data_transfer_free(dt); + if (loaded) + return true; + } + } + /* nothing to decode leaves the image empty */ + if (out_img) + image_texture_load_buffer_probe(NULL, NULL, out_img, type, NULL, 0, + req, NULL, NULL, NULL); + return false; +} + + +bool image_texture_load_ex(struct texture_image *out_img, + const char *path, bool (*should_abort)(void *ud), void *ud) +{ + image_texture_request_t req; + req.rgba = out_img->supports_rgba; + req.want_10bit = out_img->pix10; + req.want_fp16 = false; + req.want_compressed = true; + return image_texture_load_request(out_img, path, &req, + should_abort, ud); +} + +bool image_texture_load(struct texture_image *out_img, const char *path) +{ + return image_texture_load_ex(out_img, path, NULL, NULL); +} diff --git a/samples/formats/image_avail/Makefile b/samples/formats/image_avail/Makefile index 20f4118c6d..552c79665a 100644 --- a/samples/formats/image_avail/Makefile +++ b/samples/formats/image_avail/Makefile @@ -13,7 +13,7 @@ SOURCES := image_avail_test.c \ $(LIBRETRO_COMM_DIR)/formats/png/rpng_apng.c \ $(LIBRETRO_COMM_DIR)/formats/jpeg/rjpeg.c \ $(LIBRETRO_COMM_DIR)/formats/image_transfer.c \ - $(LIBRETRO_COMM_DIR)/formats/image_texture.c \ + $(LIBRETRO_COMM_DIR)/formats/image_texture.c $(LIBRETRO_COMM_DIR)/streams/image_texture_file.c \ $(LIBRETRO_COMM_DIR)/formats/image/image_hdr_blit.c \ $(LIBRETRO_COMM_DIR)/formats/data_transfer.c $(LIBRETRO_COMM_DIR)/streams/data_transfer_file.c \ $(LIBRETRO_COMM_DIR)/encodings/encoding_deflate.c \ diff --git a/samples/formats/video_hdr_fp16/Makefile b/samples/formats/video_hdr_fp16/Makefile index 77fbafd064..e994bff193 100644 --- a/samples/formats/video_hdr_fp16/Makefile +++ b/samples/formats/video_hdr_fp16/Makefile @@ -16,7 +16,7 @@ SOURCES := video_hdr_fp16_test.c \ $(LIBRETRO_COMM_DIR)/file/file_path.c \ $(LIBRETRO_COMM_DIR)/file/file_path_io.c \ $(LIBRETRO_COMM_DIR)/formats/data_transfer.c $(LIBRETRO_COMM_DIR)/streams/data_transfer_file.c \ - $(LIBRETRO_COMM_DIR)/formats/image_texture.c \ + $(LIBRETRO_COMM_DIR)/formats/image_texture.c $(LIBRETRO_COMM_DIR)/streams/image_texture_file.c \ $(LIBRETRO_COMM_DIR)/formats/image_transfer.c \ $(LIBRETRO_COMM_DIR)/formats/image/image_hdr_blit.c \ $(LIBRETRO_COMM_DIR)/formats/image/image_blit_bands.c \ diff --git a/samples/gfx/gfx_thumbnail_anim/Makefile b/samples/gfx/gfx_thumbnail_anim/Makefile index ce2b27e094..d4c00bb17b 100644 --- a/samples/gfx/gfx_thumbnail_anim/Makefile +++ b/samples/gfx/gfx_thumbnail_anim/Makefile @@ -42,7 +42,7 @@ SOURCES := gfx_thumbnail_anim_test.c \ $(LIBRETRO_COMM_DIR)/file/file_path.c \ $(LIBRETRO_COMM_DIR)/file/file_path_io.c \ $(LIBRETRO_COMM_DIR)/formats/data_transfer.c $(LIBRETRO_COMM_DIR)/streams/data_transfer_file.c \ - $(LIBRETRO_COMM_DIR)/formats/image_texture.c \ + $(LIBRETRO_COMM_DIR)/formats/image_texture.c $(LIBRETRO_COMM_DIR)/streams/image_texture_file.c \ $(LIBRETRO_COMM_DIR)/formats/image/image_yuv_blit.c \ $(LIBRETRO_COMM_DIR)/formats/image_texture_set.c \ $(LIBRETRO_COMM_DIR)/formats/image_transfer.c \ diff --git a/samples/gfx/gfx_thumbnail_preview/Makefile b/samples/gfx/gfx_thumbnail_preview/Makefile index 7e4aa17c29..7c2ae0e448 100644 --- a/samples/gfx/gfx_thumbnail_preview/Makefile +++ b/samples/gfx/gfx_thumbnail_preview/Makefile @@ -58,7 +58,7 @@ SOURCES := gfx_thumbnail_preview_test.c \ $(LIBRETRO_COMM_DIR)/file/file_path.c \ $(LIBRETRO_COMM_DIR)/formats/audio_transfer.c \ $(LIBRETRO_COMM_DIR)/formats/data_transfer.c $(LIBRETRO_COMM_DIR)/streams/data_transfer_file.c \ - $(LIBRETRO_COMM_DIR)/formats/image_texture.c \ + $(LIBRETRO_COMM_DIR)/formats/image_texture.c $(LIBRETRO_COMM_DIR)/streams/image_texture_file.c \ $(LIBRETRO_COMM_DIR)/formats/image/image_yuv_blit.c \ $(LIBRETRO_COMM_DIR)/formats/image_texture_set.c \ $(LIBRETRO_COMM_DIR)/formats/image_transfer.c \ @@ -168,7 +168,7 @@ ANIM_WINDOW_SOURCES := preview_anim_window_test.c \ $(LIBRETRO_COMM_DIR)/file/file_path.c \ $(LIBRETRO_COMM_DIR)/file/file_path_io.c \ $(LIBRETRO_COMM_DIR)/formats/data_transfer.c $(LIBRETRO_COMM_DIR)/streams/data_transfer_file.c \ - $(LIBRETRO_COMM_DIR)/formats/image_texture.c \ + $(LIBRETRO_COMM_DIR)/formats/image_texture.c $(LIBRETRO_COMM_DIR)/streams/image_texture_file.c \ $(LIBRETRO_COMM_DIR)/formats/image_transfer.c \ $(LIBRETRO_COMM_DIR)/formats/png/rpng.c \ $(LIBRETRO_COMM_DIR)/formats/png/rpng_apng.c \ diff --git a/samples/gfx/gl2_pbo_readback/stubs.c b/samples/gfx/gl2_pbo_readback/stubs.c index e5107b0833..b31222b7b0 100644 --- a/samples/gfx/gl2_pbo_readback/stubs.c +++ b/samples/gfx/gl2_pbo_readback/stubs.c @@ -13,6 +13,7 @@ #include "../../../gfx/drivers_shader/shader_glsl.h" #include "../../../menu/menu_driver.h" #include +#include #include void RARCH_LOG(const char *fmt, ...) { va_list ap; va_start(ap, fmt); printf(" [log] "); vprintf(fmt, ap); va_end(ap); } diff --git a/samples/gfx/gl2_window_ui/stubs.c b/samples/gfx/gl2_window_ui/stubs.c index b67c5f1062..a3a6f64ee1 100644 --- a/samples/gfx/gl2_window_ui/stubs.c +++ b/samples/gfx/gl2_window_ui/stubs.c @@ -13,6 +13,7 @@ #include "../../../gfx/drivers_shader/shader_glsl.h" #include "../../../menu/menu_driver.h" #include +#include #include void RARCH_LOG(const char *fmt, ...) { va_list ap; va_start(ap, fmt); printf(" [log] "); vprintf(fmt, ap); va_end(ap); } diff --git a/samples/gfx/overlay_apng/Makefile b/samples/gfx/overlay_apng/Makefile index 3c1d042d33..9efa728b98 100644 --- a/samples/gfx/overlay_apng/Makefile +++ b/samples/gfx/overlay_apng/Makefile @@ -23,7 +23,7 @@ SOURCES := \ $(LIBRETRO_COMM_DIR)/features/features_cpu.c \ $(LIBRETRO_COMM_DIR)/file/file_path.c \ $(LIBRETRO_COMM_DIR)/file/file_path_io.c \ - $(LIBRETRO_COMM_DIR)/formats/image_texture.c \ + $(LIBRETRO_COMM_DIR)/formats/image_texture.c $(LIBRETRO_COMM_DIR)/streams/image_texture_file.c \ $(LIBRETRO_COMM_DIR)/formats/image_texture_set.c \ $(LIBRETRO_COMM_DIR)/formats/png/rpng.c \ $(LIBRETRO_COMM_DIR)/formats/png/rpng_apng.c \ diff --git a/samples/input/overlay_textures/Makefile b/samples/input/overlay_textures/Makefile index be09c06464..b70a813abb 100644 --- a/samples/input/overlay_textures/Makefile +++ b/samples/input/overlay_textures/Makefile @@ -17,7 +17,7 @@ SOURCES := \ $(REPO_ROOT)/gfx/gfx_surface_player.c \ $(LIBRETRO_COMM_DIR)/formats/video_player.c \ $(REPO_ROOT)/libretro-common/formats/image/image_yuv_blit.c \ - $(LIBRETRO_COMM_DIR)/formats/image_texture.c \ + $(LIBRETRO_COMM_DIR)/formats/image_texture.c $(LIBRETRO_COMM_DIR)/streams/image_texture_file.c \ $(LIBRETRO_COMM_DIR)/formats/image_texture_set.c \ $(LIBRETRO_COMM_DIR)/formats/image_transfer.c \ $(LIBRETRO_COMM_DIR)/formats/dds/rdds.c \ diff --git a/samples/tasks/image_decode_slice/Makefile b/samples/tasks/image_decode_slice/Makefile index 0648273eff..ae46e52131 100644 --- a/samples/tasks/image_decode_slice/Makefile +++ b/samples/tasks/image_decode_slice/Makefile @@ -33,7 +33,7 @@ SOURCES := image_decode_slice_test.c \ $(LIBRETRO_COMM_DIR)/file/file_path.c \ $(LIBRETRO_COMM_DIR)/file/file_path_io.c \ $(LIBRETRO_COMM_DIR)/formats/data_transfer.c $(LIBRETRO_COMM_DIR)/streams/data_transfer_file.c \ - $(LIBRETRO_COMM_DIR)/formats/image_texture.c \ + $(LIBRETRO_COMM_DIR)/formats/image_texture.c $(LIBRETRO_COMM_DIR)/streams/image_texture_file.c \ $(LIBRETRO_COMM_DIR)/formats/image_texture_scale.c \ $(LIBRETRO_COMM_DIR)/formats/image_texture_set.c \ $(LIBRETRO_COMM_DIR)/formats/image_transfer.c \ diff --git a/samples/ui/companion_thumbs_handoff/companion_thumbs_test.c b/samples/ui/companion_thumbs_handoff/companion_thumbs_test.c index d8716ab9c3..70c331b2be 100644 --- a/samples/ui/companion_thumbs_handoff/companion_thumbs_test.c +++ b/samples/ui/companion_thumbs_handoff/companion_thumbs_test.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include diff --git a/tasks/task_overlay.c b/tasks/task_overlay.c index dd5a6d118d..90af7862b3 100644 --- a/tasks/task_overlay.c +++ b/tasks/task_overlay.c @@ -25,6 +25,7 @@ #endif #include #include +#include #include #include #include diff --git a/tools/companion_cocoa_test.sh b/tools/companion_cocoa_test.sh index 8dc2d12781..1fca1b1480 100755 --- a/tools/companion_cocoa_test.sh +++ b/tools/companion_cocoa_test.sh @@ -73,7 +73,7 @@ CSRCS="ui/companion/companion_core.c \ ui/companion/test/companion_core_stubs.c \ ui/companion/test/companion_core_test.c \ playlist.c core_option_manager.c $LC/lists/nested_list.c $LC/file/config_file_io.c \ - $LC/formats/json/rjson.c $LC/formats/image_texture.c $LC/formats/image_transfer.c \ + $LC/formats/json/rjson.c $LC/formats/image_texture.c $LC/streams/image_texture_file.c $LC/formats/image_transfer.c \ $LC/formats/video_player.c \ $LC/formats/data_transfer.c $LC/streams/data_transfer_file.c $LC/formats/png/rpng.c $LC/formats/png/rpng_apng.c \ $LC/formats/png/rpng_encode.c $LC/file/rpng_file.c $LC/formats/tga/rtga.c $LC/memmap/memmap.c $LC/memory/mem_stats.c \ diff --git a/tools/companion_cocoa_test_macos.sh b/tools/companion_cocoa_test_macos.sh index 305fb96182..43653eb635 100755 --- a/tools/companion_cocoa_test_macos.sh +++ b/tools/companion_cocoa_test_macos.sh @@ -25,7 +25,7 @@ CSRCS="ui/companion/companion_core.c \ ui/companion/test/companion_core_stubs.c \ ui/companion/test/companion_core_test.c \ playlist.c core_option_manager.c $LC/lists/nested_list.c $LC/file/config_file_io.c \ - $LC/formats/json/rjson.c $LC/formats/image_texture.c $LC/formats/image_transfer.c \ + $LC/formats/json/rjson.c $LC/formats/image_texture.c $LC/streams/image_texture_file.c $LC/formats/image_transfer.c \ $LC/formats/video_player.c \ $LC/formats/data_transfer.c $LC/streams/data_transfer_file.c $LC/formats/png/rpng.c $LC/formats/png/rpng_apng.c \ $LC/formats/png/rpng_encode.c $LC/file/rpng_file.c $LC/formats/tga/rtga.c $LC/memmap/memmap.c $LC/memory/mem_stats.c \ diff --git a/tools/companion_core_test.sh b/tools/companion_core_test.sh index c6719dadaa..4ad0174670 100755 --- a/tools/companion_core_test.sh +++ b/tools/companion_core_test.sh @@ -38,7 +38,7 @@ SRCS="ui/companion/companion_core.c \ core_option_manager.c \ $LC/lists/nested_list.c \ $LC/formats/json/rjson.c \ - $LC/formats/image_texture.c \ + $LC/formats/image_texture.c $LC/streams/image_texture_file.c \ $LC/formats/image_transfer.c \ $LC/formats/video_player.c \ $LC/formats/data_transfer.c $LC/streams/data_transfer_file.c \ diff --git a/tools/companion_thumbs_test.sh b/tools/companion_thumbs_test.sh index 0f5a3017af..17ff2e1f5c 100755 --- a/tools/companion_thumbs_test.sh +++ b/tools/companion_thumbs_test.sh @@ -38,7 +38,7 @@ SRCS="ui/companion/companion_thumbs.c \ $LC/formats/image/image_blit_bands.c \ $LC/memory/mem_stats.c \ ui/companion/test/companion_thumbs_test.c \ - $LC/formats/image_texture.c \ + $LC/formats/image_texture.c $LC/streams/image_texture_file.c \ $LC/formats/image_transfer.c \ $LC/formats/video_player.c \ $LC/formats/data_transfer.c $LC/streams/data_transfer_file.c \ diff --git a/tools/companion_win32_test.sh b/tools/companion_win32_test.sh index 33c9d3cae3..116684dec4 100755 --- a/tools/companion_win32_test.sh +++ b/tools/companion_win32_test.sh @@ -34,7 +34,7 @@ CSRCS="ui/companion/companion_core.c \ ui/companion/test/companion_core_stubs.c \ ui/companion/test/companion_core_test.c \ playlist.c core_option_manager.c $LC/lists/nested_list.c $LC/file/config_file_io.c \ - $LC/formats/json/rjson.c $LC/formats/image_texture.c $LC/formats/image_transfer.c \ + $LC/formats/json/rjson.c $LC/formats/image_texture.c $LC/streams/image_texture_file.c $LC/formats/image_transfer.c \ $LC/formats/video_player.c \ $LC/formats/data_transfer.c $LC/streams/data_transfer_file.c $LC/formats/png/rpng.c $LC/formats/png/rpng_apng.c \ $LC/formats/png/rpng_encode.c $LC/file/rpng_file.c $LC/formats/tga/rtga.c $LC/memmap/memmap.c $LC/memory/mem_stats.c \ diff --git a/ui/companion/companion_core.c b/ui/companion/companion_core.c index 1e0c3a93fe..2060453056 100644 --- a/ui/companion/companion_core.c +++ b/ui/companion/companion_core.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include diff --git a/ui/companion/companion_thumbs.c b/ui/companion/companion_thumbs.c index 4abaee0d0c..6c76fcb9b8 100644 --- a/ui/companion/companion_thumbs.c +++ b/ui/companion/companion_thumbs.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include /* struct timespec, for retro_timers.h */ diff --git a/ui/companion/test/companion_core_test.c b/ui/companion/test/companion_core_test.c index 896e1b5371..eb09d71340 100644 --- a/ui/companion/test/companion_core_test.c +++ b/ui/companion/test/companion_core_test.c @@ -122,6 +122,7 @@ static void writef(const char *path, const char *text) } #include +#include static void write_tga_rgba(const char *path, unsigned w, unsigned h, uint32_t argb) { FILE *f = fopen(path, "wb"); diff --git a/ui/drivers/ui_win32_companion.c b/ui/drivers/ui_win32_companion.c index b05b7181d2..cf94c06871 100644 --- a/ui/drivers/ui_win32_companion.c +++ b/ui/drivers/ui_win32_companion.c @@ -59,6 +59,7 @@ #include #include #include +#include #include #include #include