Files
tidewall/tools/contact_sheet.gd
T
claudeandClaude Opus 5.5 4a2d0b4031 H6: Full visual QA pass, with a checklist and make qa-captures
Rendered all 82 capture scenarios and the HUD at 3840x2160, and viewed
every one against a checklist covering menus, the lobby, the drop, every
biome, points of interest, building, players and items, combat, the HUD,
the chart, each tide phase, the gale, under water and results
(docs/VISUAL_QA.md). Two defects were filed and fixed: H15 (#84) and H16
(#85).

- make qa-captures (tools/qa_captures.sh) renders the whole set one
  container at a time, waiting when the host is short of memory, and
  tools/contact_sheet.gd lays them out four to a sheet for a first look.
- No placeholder art or text remains: ARCHITECTURE.md no longer calls the
  figures, barge and items stand-ins. The plain shapes in the camera*
  scenarios are test cards under test/, which isn't exported.

Closes #59

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 15:08:55 -05:00

45 lines
1.9 KiB
GDScript

## Lays out the PNGs in a directory as contact sheets of four, in name order, left to
## right then top to bottom, for reviewing a whole capture pass (H6). It prints which
## captures each sheet holds; open a capture on its own to judge detail.
## tools/godot.sh --script res://tools/contact_sheet.gd -- --dir=res://captures/qa --out=res://captures/qa/sheets
extends SceneTree
const CELL: Vector2i = Vector2i(960, 540)
func _init() -> void:
var dir: String = "res://captures/qa"
var out: String = dir + "/sheets"
for arg: String in OS.get_cmdline_user_args():
if arg.begins_with("--dir="):
dir = arg.substr(6)
elif arg.begins_with("--out="):
out = arg.substr(6)
DirAccess.make_dir_recursive_absolute(ProjectSettings.globalize_path(out))
var names: Array[String] = []
for name: String in DirAccess.get_files_at(dir):
if name.ends_with(".png") and not name.begins_with("hud_2160"):
names.append(name)
names.sort()
var sheets: int = 0
for first: int in range(0, names.size(), 4):
var sheet: Image = Image.create(CELL.x * 2, CELL.y * 2, false, Image.FORMAT_RGB8)
sheet.fill(Color.BLACK)
for index: int in range(first, mini(first + 4, names.size())):
var image: Image = Image.load_from_file(ProjectSettings.globalize_path(dir.path_join(names[index])))
if image == null:
push_error("contact sheet: can't read %s" % names[index])
quit(1)
return
image.convert(Image.FORMAT_RGB8)
image.resize(CELL.x, CELL.y, Image.INTERPOLATE_BILINEAR)
var slot: int = index - first
sheet.blit_rect(image, Rect2i(Vector2i.ZERO, CELL), Vector2i(slot % 2 * CELL.x, slot / 2 * CELL.y))
var path: String = out.path_join("sheet_%02d.png" % sheets)
sheet.save_png(ProjectSettings.globalize_path(path))
var listed: PackedStringArray = PackedStringArray(names.slice(first, first + 4))
print("%s: %s" % [path, ", ".join(listed)])
sheets += 1
print("contact sheets: %d from %d captures" % [sheets, names.size()])
quit(0)