[wesnoth-commits] [wesnoth/wesnoth] dfc42e: Use SDL_Image to handle saving PNG screenshots ins...

GitHub noreply at github.com
Wed Mar 14 17:31:33 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: dfc42e8a8dd550ca04ae16e2d2d7ebffbba0bc21
      https://github.com/wesnoth/wesnoth/commit/dfc42e8a8dd550ca04ae16e2d2d7ebffbba0bc21
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-03-15 (Thu, 15 Mar 2018)

  Changed paths:
    M INSTALL.md
    M projectfiles/VC12/wesnoth.vcxproj
    M projectfiles/VC12/wesnoth.vcxproj.filters
    M src/CMakeLists.txt
    M src/SConscript
    R src/SDL_SavePNG/README.md
    R src/SDL_SavePNG/savepng.c
    R src/SDL_SavePNG/savepng.h
    M src/build_info.cpp
    M src/hotkey/command_executor.cpp
    M src/image.cpp

  Log Message:
  -----------
  Use SDL_Image to handle saving PNG screenshots instead of SDL_SavePNG

When iceiceice (@cbeck88) added "save screenshots as PNGs" support back in 2014
(8dfdc6b185f7d9c5d6166f28dd2693fc64a30a27) we had yet to switch to SDL 2. At the
time, SDL_Image didn't provide any method of saving PNG files on its own. However,
it does as of SDL_Image 2.0.0.

A small caveat is that this built-in PNG save functionality is a bit less efficient
at compression than SDL_SavePNG. A test in DiD S1 with SDL_SavePNG_RW vs IMG_SavePNG_RW
yielded a file ~ 1 MB larger in the latter case.

This removed SDL_SavePNG and it's optional build-time dependency of libpng.


  Commit: 686aca2667caa5d155760c73956d0d8558449de3
      https://github.com/wesnoth/wesnoth/commit/686aca2667caa5d155760c73956d0d8558449de3
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-03-15 (Thu, 15 Mar 2018)

  Changed paths:
    M changelog.md
    M src/build_info.cpp
    M src/hotkey/command_executor.cpp
    M src/image.cpp

  Log Message:
  -----------
  Save screenshots as JPGs when building with SDL_Image 2.0.2 or newer

This functionality was added in that release. Since it's only 4 months old, it's
too early to make minimum; it won't be available on some Linux distros yet.

There's currently no way to choose between JPG or PNG files. That can (and should)
be added later. For now, it defaults to JPG files if SDL_Image is of the appropriate
version.

I've also left the BMP fallback path, but that should never be reached now, since
PNG saving is always available

Closes #1448.


Compare: https://github.com/wesnoth/wesnoth/compare/9b128d7ec89f...686aca2667ca


More information about the Commits mailing list