From: terencehill Date: Wed, 10 Aug 2022 23:27:38 +0000 (+0200) Subject: Automatically generate map preview image on map compile from the first auto-screensho... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3253098ea6b3fe579c2c754dd477281de88eedd6;p=xonotic%2Fxonotic.git Automatically generate map preview image on map compile from the first auto-screenshot [untested] --- diff --git a/misc/tools/xonotic-map-compiler-autobuild b/misc/tools/xonotic-map-compiler-autobuild index 41ef0c30..c5e84a13 100755 --- a/misc/tools/xonotic-map-compiler-autobuild +++ b/misc/tools/xonotic-map-compiler-autobuild @@ -269,6 +269,11 @@ screenshotthemap() ;; esac fi + + # map preview for menu and map vote screen genertaed from the first auto-screenshot + # input image must be in 4:3 format (1024x768 is ok), output image has to be 512x512 + convert ~/.xonotic/data/screenshots/$M-000000.jpg -scale 1:1 -scale 512 ~/.xonotic/data/screenshots/$M.jpg + ) 2>&1 | tee ~/.xonotic/data/autoscreenshot.log good=false if mv ~/.xonotic/data/screenshots "$M-$blobhash"; then diff --git a/misc/tools/xonotic-map-screenshot b/misc/tools/xonotic-map-screenshot index aa97986c..37a4e4c2 100755 --- a/misc/tools/xonotic-map-screenshot +++ b/misc/tools/xonotic-map-screenshot @@ -8,16 +8,28 @@ dummy=$1; shift # convert count to unary count=`yes x | head -n "$count" | tr -cd x` +# NOTES: +# some settings are used to generate the very same screenshots if map geometry doesn't change +# - cl_animate_items 0 makes items static +# - slowmo 10 is used to quickly let powerups and superweapons spawn + ./all run \ -nocrashdialog \ -nosound \ -noconfig \ + -width 1024 \ + -height 768 \ +'locksession 0' \ +'scr_screenshot_timestamp 0' \ +'vid_fullscreen 0' \ +'exec effects-ultra.cfg' \ "$@" \ +'cl_welcome 0' \ + +'cl_animate_items 0' \ + +'g_pickup_respawntime_powerup 0' \ + +'g_pickup_respawntimejitter_powerup 0' \ + +'g_pickup_respawntime_superweapon 0' \ + +'g_pickup_respawntimejitter_superweapon 0' \ +'sv_precacheplayermodels 0' \ +'cl_hidewaypoints 1' \ +'cl_movement 0' \ @@ -34,11 +46,11 @@ count=`yes x | head -n "$count" | tr -cd x` +'set catchme "catchme_"' \ +"alias catchme_$count quit" \ +'alias NARF "sv_cmd nextframe cl_cmd nextframe sv_cmd nextframe cl_cmd nextframe $*"' \ - +'alias ZORT "god; NARF EGAD"' \ + +'alias ZORT "slowmo 1; god; NARF EGAD"' \ +'alias EGAD "noclip; NARF POIT"' \ +'alias POIT "$catchme; set catchme ${catchme}x; impulse 911; NARF TROZ"' \ +'alias TROZ "screenshot; NARF POIT"' \ - +'alias cl_hook_gamestart_all "defer 1.1 join; defer 2 ZORT"' \ + +'alias cl_hook_gamestart_all "slowmo 10; defer 1.1 join; defer 2 ZORT"' \ +"defer \"$watchdog\" quit" \ +"map \"$map\"" \ +'timelimit 0' \