diff --git a/art/portraits/cao_cao.png b/art/portraits/cao_cao.png index 2c4798f..c973d4a 100644 Binary files a/art/portraits/cao_cao.png and b/art/portraits/cao_cao.png differ diff --git a/art/portraits/cao_ren.png b/art/portraits/cao_ren.png index f7fb72e..8fe534e 100644 Binary files a/art/portraits/cao_ren.png and b/art/portraits/cao_ren.png differ diff --git a/art/portraits/dian_wei.png b/art/portraits/dian_wei.png index ac53cfd..511c4a9 100644 Binary files a/art/portraits/dian_wei.png and b/art/portraits/dian_wei.png differ diff --git a/art/portraits/guo_jia.png b/art/portraits/guo_jia.png index 183a821..40ec717 100644 Binary files a/art/portraits/guo_jia.png and b/art/portraits/guo_jia.png differ diff --git a/art/portraits/xiahou_dun.png b/art/portraits/xiahou_dun.png index 7911440..5e2a4d2 100644 Binary files a/art/portraits/xiahou_dun.png and b/art/portraits/xiahou_dun.png differ diff --git a/art/portraits/xiahou_yuan.png b/art/portraits/xiahou_yuan.png index 5b09820..a8e9ab0 100644 Binary files a/art/portraits/xiahou_yuan.png and b/art/portraits/xiahou_yuan.png differ diff --git a/art/portraits/zhang_he.png b/art/portraits/zhang_he.png index 17cfede..4c354ad 100644 Binary files a/art/portraits/zhang_he.png and b/art/portraits/zhang_he.png differ diff --git a/tools/smoke_visual_assets.gd b/tools/smoke_visual_assets.gd index f7022d3..879d127 100644 --- a/tools/smoke_visual_assets.gd +++ b/tools/smoke_visual_assets.gd @@ -106,6 +106,17 @@ func _check_battle_visual_data(failures: Array[String]) -> void: ]: _check_alpha_cutout_path(failures, path, "unit cutout %s" % path) + for path in [ + "res://art/portraits/cao_cao.png", + "res://art/portraits/cao_ren.png", + "res://art/portraits/dian_wei.png", + "res://art/portraits/guo_jia.png", + "res://art/portraits/xiahou_dun.png", + "res://art/portraits/xiahou_yuan.png", + "res://art/portraits/zhang_he.png" + ]: + _check_alpha_cutout_path(failures, path, "officer portrait cutout %s" % path) + var gate_state = BattleStateScript.new() if not gate_state.load_battle("res://data/scenarios/002_sishui_gate.json"): failures.append("could not load Sishui Gate for enemy cavalry sprite") diff --git a/tools/validate_data.ps1 b/tools/validate_data.ps1 index 5248d7d..72b8c16 100644 --- a/tools/validate_data.ps1 +++ b/tools/validate_data.ps1 @@ -1851,6 +1851,9 @@ function Check-Portrait-Path($Portrait, [string]$Context) { Fail "$Context references missing file: $Portrait" } Check-Portrait-Image $absolutePath ([string]$Portrait) $Context + if ($relativePath -match '^art[\\/]+portraits[\\/]+.+\.png$') { + Check-Alpha-Cutout-File $absolutePath ([string]$Portrait) $Context + } } function Check-Portrait-Image([string]$AbsolutePath, [string]$Portrait, [string]$Context) { @@ -1876,14 +1879,12 @@ function Check-Portrait-Image([string]$AbsolutePath, [string]$Portrait, [string] } } -function Check-Item-Icon-Cutout([string]$Icon, [string]$Context) { - $relativePath = $Icon.Substring("res://".Length) - $absolutePath = [System.IO.Path]::GetFullPath((Join-Path ([System.IO.Path]::GetFullPath($Root)) $relativePath)) +function Check-Alpha-Cutout-File([string]$AbsolutePath, [string]$DisplayPath, [string]$Context) { $bitmap = $null try { - $bitmap = [System.Drawing.Bitmap]::FromFile($absolutePath) + $bitmap = [System.Drawing.Bitmap]::FromFile($AbsolutePath) if (-not [System.Drawing.Image]::IsAlphaPixelFormat($bitmap.PixelFormat)) { - Fail "$Context must be an alpha PNG cutout: $Icon" + Fail "$Context must be an alpha PNG cutout: $DisplayPath" } $cornerPixels = @( $bitmap.GetPixel(0, 0), @@ -1893,7 +1894,7 @@ function Check-Item-Icon-Cutout([string]$Icon, [string]$Context) { ) foreach ($pixel in $cornerPixels) { if ($pixel.A -gt 3) { - Fail "$Context must have transparent corners: $Icon" + Fail "$Context must have transparent corners: $DisplayPath" } } $transparentSamples = 0 @@ -1907,13 +1908,13 @@ function Check-Item-Icon-Cutout([string]$Icon, [string]$Context) { } } if ($transparentSamples -lt [int]($totalSamples * 0.20)) { - Fail "$Context must have substantial transparent background: $Icon ($transparentSamples/$totalSamples sampled pixels)" + Fail "$Context must have substantial transparent background: $DisplayPath ($transparentSamples/$totalSamples sampled pixels)" } } catch { if ($_.Exception.Message -like "$Context*") { throw } - Fail "$Context could not inspect alpha cutout data: $Icon" + Fail "$Context could not inspect alpha cutout data: $DisplayPath" } finally { if ($null -ne $bitmap) { $bitmap.Dispose() @@ -1921,6 +1922,12 @@ function Check-Item-Icon-Cutout([string]$Icon, [string]$Context) { } } +function Check-Item-Icon-Cutout([string]$Icon, [string]$Context) { + $relativePath = $Icon.Substring("res://".Length) + $absolutePath = [System.IO.Path]::GetFullPath((Join-Path ([System.IO.Path]::GetFullPath($Root)) $relativePath)) + Check-Alpha-Cutout-File $absolutePath $Icon $Context +} + function Check-Post-Battle-Dialogue($Dialogue, [string]$ScenarioId) { if ($null -eq $Dialogue) { return