Skip to content

Commit 36a0a94

Browse files
committed
..........
1 parent 6461d9d commit 36a0a94

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/picture.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,8 @@ bool locator::operator<(const locator& a) const
327327
// Load overlay image and compose it with the original surface.
328328
static void add_localized_overlay(const std::string& ovr_file, surface& orig_surf)
329329
{
330-
surface ovr_surf = IMG_Load_IO(SDL_IOFromFile(ovr_file.c_str(), "rb"), true);
330+
SDL_IOStream* stream = SDL_IOFromFile(ovr_file.c_str(), "rb");
331+
surface ovr_surf = IMG_Load_IO(stream, true);
331332
if(!ovr_surf) {
332333
return;
333334
}
@@ -365,7 +366,8 @@ static surface load_image_file(const image::locator& loc)
365366
location = loc_location.value();
366367
}
367368

368-
res = IMG_Load_IO(SDL_IOFromFile(location.value().c_str(), "rb"), true);
369+
SDL_IOStream* stream = SDL_IOFromFile(location.value().c_str(), "rb");
370+
res = IMG_Load_IO(stream, true);
369371

370372
// If there was no standalone localized image, check if there is an overlay.
371373
if(res && !loc_location) {
@@ -925,14 +927,16 @@ save_result save_image(const surface& surf, const std::string& filename)
925927
if(boost::algorithm::ends_with(filename, ".jpeg") || boost::algorithm::ends_with(filename, ".jpg") || boost::algorithm::ends_with(filename, ".jpe")) {
926928
LOG_IMG << "Writing a JPG image to " << filename;
927929

928-
const int err = IMG_SaveJPG_IO(surf, SDL_IOFromFile(filename.c_str(), "rb"), true, 75);
930+
SDL_IOStream* stream = SDL_IOFromFile(filename.c_str(), "rb");
931+
const int err = IMG_SaveJPG_IO(surf, stream, true, 75);
929932
return err == 0 ? save_result::success : save_result::save_failed;
930933
}
931934

932935
if(boost::algorithm::ends_with(filename, ".png")) {
933936
LOG_IMG << "Writing a PNG image to " << filename;
934937

935-
const int err = IMG_SavePNG_IO(surf, SDL_IOFromFile(filename.c_str(), "rb"), true);
938+
SDL_IOStream* stream = SDL_IOFromFile(filename.c_str(), "rb");
939+
const int err = IMG_SavePNG_IO(surf, stream, true);
936940
return err == 0 ? save_result::success : save_result::save_failed;
937941
}
938942

utils/dockerbuilds/make_mingw_build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cd mingw || exit
77
rm -rf ../mingwbuild
88
mkdir ../mingwbuild || exit
99

10-
docker run -v "$PWD"/../../..:/wesnoth -v "$PWD"/../mingwbuild:/output --tmpfs /build -u "$(id -u)" wesnoth/wesnoth:mingw-master sh -c 'cd /output &&
10+
docker run -v "$PWD"/../../..:/wesnoth -v "$PWD"/../mingwbuild:/output --tmpfs /build -u "$(id -u)" wesnoth/wesnoth:mingw-sdl3 sh -c 'cd /output &&
1111
scons -j $(nproc) arch=x86-64 prefix=/msys64/mingw64 gtkdir=/msys64/mingw64 host=x86_64-w64-mingw32 -Y /wesnoth force_color=true &&
1212
python3 /wesnoth/utils/dockerbuilds/mingw/get_dlls.py &&
1313
rm -rf packaging &&

0 commit comments

Comments
 (0)