]> git.rm.cloudns.org Git - xonotic/xonotic.git/commitdiff
Automatically generate map preview image on map compile from the first auto-screensho... terencehill/map_preview
authorterencehill <piuntn@gmail.com>
Wed, 10 Aug 2022 23:27:38 +0000 (01:27 +0200)
committerterencehill <piuntn@gmail.com>
Wed, 10 Aug 2022 23:27:38 +0000 (01:27 +0200)
misc/tools/xonotic-map-compiler-autobuild
misc/tools/xonotic-map-screenshot

index 41ef0c30dc63c562eced6b02401f978ba80f9023..c5e84a134f1fccf582ca81c651e96aae098b98f7 100755 (executable)
@@ -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
index aa97986ccce83b7c89fe30847f85d27c6b3f9772..37a4e4c20846e395f214772a8ec1627c70bb2101 100755 (executable)
@@ -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' \