取景(issue 04) - 新增 viewport-fitter.js:让立绘层缩放跟随背景图的 cover 缩放——背景放大多少倍、 特效就放大多少倍。原先背景走 cover、立绘层走 contain,比例一变两者就分叉。 16:9 下与作者设定逐像素一致(kv37 为 0 差异)。实测证伪了"contain 会裁掉作者视口" 这个最初的判断:contain 在任何比例下都完整含住作者视口。 - 应用方式为原地改写 config.viewport 字段后调 setViewport(),不重建播放器; 维护挂在 config.frame 上按画布比例增量进行(config.success 早于 setViewport,拿不到视口)。 WE 属性(issue 05) - project.json 新增 bgm combo(所有壁纸音源的并集 + 「随预设」);所选项不属于当前壁纸时 音频回落该壁纸默认,选择本身保留。 - fps 限流包裹实例 drawFrame 并接管排程。修掉两个实测缺陷:朴素丢帧会把 rAF 抖动放大成 整拍丢失(目标 30fps 实测只有 22.5fps);fps:0 被真值判断吞掉导致无法取消限流。 打包(issue 06) - project.json version 升至 3 并更新描述;preset 的 combo 取值保持 xilian/kv37 不变。 - preview.gif 821 KB → 347 KB(每 2 帧取 1 帧 + 128 色不抖动,逐帧与源帧像素完全相同)。 - index.html 加内联 favicon,消除 CEF 自动请求 /favicon.ico 造成的 404 报错。 其它 - dist/scripts/wallpaper-engine.js 移到 tools/:它没有任何入口引用,且环境判据依赖真实 WE 并不存在的 wallpaperRegisterListener,一旦按它自己的说明挂进 index.html 会在生产环境自我激活。 - 修正死文件检查:原检查会拿文件名匹配到文件自身的内容,使这类文件漏网。 - 新增离线算式验证与 resize / 属性 / 全量验收三套浏览器测试脚本。
27 lines
871 B
PowerShell
27 lines
871 B
PowerShell
$ErrorActionPreference = "Stop"
|
|
Set-Location D:\Workspace\Temp\SpineWallpaper
|
|
|
|
$sizes = @(
|
|
@(3440, 1440, "219"),
|
|
@(1920, 1080, "169"),
|
|
@(1080, 1920, "916")
|
|
)
|
|
$props = @{
|
|
"xilian" = ""
|
|
"kv37" = "&__props=%7B%22preset%22%3A%22kv37%22%7D"
|
|
}
|
|
|
|
New-Item -ItemType Directory -Force -Path tools\shots\fit | Out-Null
|
|
|
|
foreach ($p in @("xilian", "kv37")) {
|
|
foreach ($s in $sizes) {
|
|
$w = $s[0]; $h = $s[1]; $tag = $s[2]
|
|
$url = "http://127.0.0.1:8190/?__freeze=1" + $props[$p]
|
|
Write-Host "=== $p $tag ($w x $h) ==="
|
|
node tools/shot.mjs "tools/shots/fit/${p}_${tag}.png" $url $w $h 2>&1 | Select-Object -First 1
|
|
node tools/shot.mjs "tools/shots/fit/${p}_${tag}_ref.png" "$url&__hide=canvas" $w $h 2>&1 | Select-Object -First 1
|
|
node tools/subject.mjs "tools/shots/fit/${p}_${tag}.png" "tools/shots/fit/${p}_${tag}_ref.png"
|
|
Write-Host ""
|
|
}
|
|
}
|