diff --git a/SConstruct b/SConstruct index 2dcf75530ab..4f76718b037 100755 --- a/SConstruct +++ b/SConstruct @@ -390,8 +390,7 @@ if env["prereqs"]: have_client_prereqs = have_client_prereqs & conf.CheckLib("vorbisfile") & conf.CheckOgg() have_client_prereqs = have_client_prereqs & conf.CheckPNG() have_client_prereqs = have_client_prereqs & conf.CheckJPG() -# have_client_prereqs = have_client_prereqs & conf.CheckOpenGL() -# have_client_prereqs = have_client_prereqs & conf.CheckGLEW() + have_client_prereqs = have_client_prereqs & conf.CheckWebP() have_client_prereqs = have_client_prereqs & conf.CheckCairo(min_version = "1.10") have_client_prereqs = have_client_prereqs & conf.CheckPango("cairo", require_version = "1.22.0") have_client_prereqs = have_client_prereqs & conf.CheckPKG("fontconfig") diff --git a/data/core/images/maps/background.jpg b/data/core/images/maps/background.jpg deleted file mode 100644 index 2a39b03d281..00000000000 Binary files a/data/core/images/maps/background.jpg and /dev/null differ diff --git a/data/core/images/maps/background.webp b/data/core/images/maps/background.webp new file mode 100644 index 00000000000..0131fc972bc Binary files /dev/null and b/data/core/images/maps/background.webp differ diff --git a/data/game_config.cfg b/data/game_config.cfg index 4db4b7a137f..f938d94c39d 100644 --- a/data/game_config.cfg +++ b/data/game_config.cfg @@ -62,7 +62,7 @@ [images] game_title="maps/titlescreen.png" - game_title_background="maps/background.jpg" + game_title_background="maps/background.webp" game_logo="misc/logo.png" game_logo_background="misc/logo-bg.png" diff --git a/scons/sdl.py b/scons/sdl.py index 0879a759597..c0939f5aead 100644 --- a/scons/sdl.py +++ b/scons/sdl.py @@ -191,6 +191,44 @@ def CheckPNG(context): context.Result("no") return False +def CheckWebP(context): + test_program = ''' + #include + #include + + int main(int argc, char **argv) + { + SDL_RWops *src; + char *testimage = "$TESTFILE"; + + src = SDL_RWFromFile(testimage, "rb"); + if (src == NULL) { + exit(2); + } + exit(!IMG_isWEBP(src)); + } +\n +''' + nodepath = File("data/core/images/maps/background.webp").rfile().abspath.replace("\\", "\\\\") + test_program1 = context.env.Clone(TESTFILE = nodepath).subst(test_program) + context.Message("Checking for WebP support in SDL... ") + if context.env["host"]: + context.Result("n/a (cross-compile)") + return True + (result, output) = context.TryRun(test_program1, ".c") + if result: + context.Result("yes") + return True + else: + test_program2 = context.env.Clone(TESTFILE = "data/core/images/maps/background.webp").subst(test_program) + (result, output) = context.TryRun(test_program2, ".c") + if result: + context.Result("yes") + return True + else: + context.Result("no") + return False + def CheckJPG(context): test_program = ''' #include @@ -209,7 +247,7 @@ def CheckJPG(context): } \n ''' - nodepath = File("data/core/images/maps/background.jpg").rfile().abspath.replace("\\", "\\\\") + nodepath = File("attic/northlands.jpg").rfile().abspath.replace("\\", "\\\\") test_program1 = context.env.Clone(TESTFILE = nodepath).subst(test_program) context.Message("Checking for JPG support in SDL... ") if context.env["host"]: @@ -220,7 +258,7 @@ def CheckJPG(context): context.Result("yes") return True else: - test_program2 = context.env.Clone(TESTFILE = "data/core/images/maps/background.jpg").subst(test_program) + test_program2 = context.env.Clone(TESTFILE = "attic/northlands.jpg").subst(test_program) (result, output) = context.TryRun(test_program2, ".c") if result: context.Result("yes") @@ -232,4 +270,5 @@ def CheckJPG(context): config_checks = { 'CheckSDL' : CheckSDL, 'CheckOgg' : CheckOgg, 'CheckPNG' : CheckPNG, - 'CheckJPG' : CheckJPG } + 'CheckJPG' : CheckJPG, + 'CheckWebP' : CheckWebP } diff --git a/utils/CI/check_utf8.sh b/utils/CI/check_utf8.sh index 40da75e1843..66ee8fbed2a 100755 --- a/utils/CI/check_utf8.sh +++ b/utils/CI/check_utf8.sh @@ -8,7 +8,7 @@ command -v isutf8 >/dev/null || { echo "Install 'isutf8' from moreutils to use t exit_code=0 find src/ -type f -not -path "src/modules/*" -print0 | xargs -0 isutf8 -- || exit_code=1 -for ex in png ogg jpg wav gif xcf bin; do args+=(! -name "*.$ex"); done +for ex in png ogg jpg wav gif xcf bin webp; do args+=(! -name "*.$ex"); done find data/ -type f "${args[@]}" ! -name "test_cve_2018_1999023_2.cfg" -print0 | xargs -0 isutf8 -- || exit_code=1 find po/ -type f -print0 | xargs -0 isutf8 -- || exit_code=1 diff --git a/utils/dockerbuilds/make_steam_image b/utils/dockerbuilds/make_steam_image index d6657acf47d..93c5d7fda40 100755 --- a/utils/dockerbuilds/make_steam_image +++ b/utils/dockerbuilds/make_steam_image @@ -2,7 +2,7 @@ VALVEFILE=com.valvesoftware.SteamRuntime.Sdk-amd64,i386-scout-sysroot.Dockerfile VALVETAR=com.valvesoftware.SteamRuntime.Sdk-amd64,i386-scout-sysroot.tar.gz -VALVE_SNAPSHOT=0.20211207.0 +VALVE_SNAPSHOT=0.20220119.0 DOCKERBASEIMAGE=steamrt_scout_amd64 DOCKERLOCALIMAGE=wesnoth/wesnoth:steamrt-master diff --git a/vcpkg.json b/vcpkg.json index b6fa25224f6..a404e280c55 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -6,8 +6,9 @@ "sdl2", { "name": "sdl2-image", - "features": [ "libjpeg-turbo" ] + "features": [ "libjpeg-turbo", "libwebp" ] }, + "libwebp", { "name": "sdl2-mixer", "features": [ "libvorbis", "dynamic-load" ]