From 4b1faf1a5a5ba7cf516afc1e110915d1ad42cdc1 Mon Sep 17 00:00:00 2001 From: Iris Morelle Date: Sun, 17 Oct 2021 23:49:12 -0300 Subject: [PATCH] Remove support for writing BMP screenshots This is redundant now that PNG support is part of SDL_image and therefore always available to us on supported configurations. BMP files are horribly expensive to store. --- src/editor/controller/editor_controller.cpp | 2 +- src/editor/controller/editor_controller.hpp | 2 +- src/editor/editor_main.cpp | 2 +- src/editor/editor_main.hpp | 2 +- src/game_launcher.cpp | 2 +- src/picture.cpp | 6 ------ 6 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/editor/controller/editor_controller.cpp b/src/editor/controller/editor_controller.cpp index f9ec869c19b..d3bef83e31e 100644 --- a/src/editor/controller/editor_controller.cpp +++ b/src/editor/controller/editor_controller.cpp @@ -189,7 +189,7 @@ EXIT_STATUS editor_controller::main_loop() void editor_controller::status_table() { } -void editor_controller::do_screenshot(const std::string& screenshot_filename /* = "map_screenshot.bmp" */) +void editor_controller::do_screenshot(const std::string& screenshot_filename /* = "map_screenshot.png" */) { try { surface screenshot = gui().screenshot(true); diff --git a/src/editor/controller/editor_controller.hpp b/src/editor/controller/editor_controller.hpp index 5250a4367f1..cb603b80c8e 100644 --- a/src/editor/controller/editor_controller.hpp +++ b/src/editor/controller/editor_controller.hpp @@ -88,7 +88,7 @@ class editor_controller : public controller_base, EXIT_STATUS main_loop(); /** Takes a screenshot **/ - void do_screenshot(const std::string& screenshot_filename = "map_screenshot.bmp"); + void do_screenshot(const std::string& screenshot_filename = "map_screenshot.png"); /** Process a hotkey quit command */ void hotkey_quit(); diff --git a/src/editor/editor_main.cpp b/src/editor/editor_main.cpp index 15963aff9b0..089b5080351 100644 --- a/src/editor/editor_main.cpp +++ b/src/editor/editor_main.cpp @@ -28,7 +28,7 @@ lg::log_domain log_editor("editor"); namespace editor { EXIT_STATUS start(const std::string& filename /* = "" */, - bool take_screenshot /* = false */, const std::string& screenshot_filename /* = "map_screenshot.bmp" */) + bool take_screenshot /* = false */, const std::string& screenshot_filename /* = "map_screenshot.png" */) { EXIT_STATUS e = EXIT_ERROR; try { diff --git a/src/editor/editor_main.hpp b/src/editor/editor_main.hpp index 73c53fefbbc..ad931da4327 100644 --- a/src/editor/editor_main.hpp +++ b/src/editor/editor_main.hpp @@ -34,6 +34,6 @@ enum EXIT_STATUS { * go back to the titlescreen or quit to desktop altogether) */ -EXIT_STATUS start(const std::string& filename = "", bool take_screenshot = false, const std::string& screenshot_filename = "map_screenshot.bmp"); +EXIT_STATUS start(const std::string& filename = "", bool take_screenshot = false, const std::string& screenshot_filename = "map_screenshot.png"); } //end namespace editor diff --git a/src/game_launcher.cpp b/src/game_launcher.cpp index 38fc51478fc..7f879f834a8 100644 --- a/src/game_launcher.cpp +++ b/src/game_launcher.cpp @@ -656,7 +656,7 @@ bool game_launcher::play_render_image_mode() } // A default output filename - std::string outfile = "wesnoth_image.bmp"; + std::string outfile = "wesnoth_image.png"; // If a output path was given as an argument, use that instead if(cmdline_opts_.render_image_dst) { diff --git a/src/picture.cpp b/src/picture.cpp index 53194682433..b15bd41090a 100644 --- a/src/picture.cpp +++ b/src/picture.cpp @@ -1103,12 +1103,6 @@ save_result save_image(const surface& surf, const std::string& filename) return err == 0 ? save_result::success : save_result::save_failed; } - if(filesystem::ends_with(filename, ".bmp")) { - LOG_DP << "Writing a BMP image to " << filename << std::endl; - const int err = SDL_SaveBMP(surf, filename.c_str()) == 0; - return err == 0 ? save_result::success : save_result::save_failed; - } - return save_result::unsupported_format; }