From 912123087fcdfff7b838a5d27026264d2faa985b Mon Sep 17 00:00:00 2001 From: David Date: Tue, 6 Oct 2026 08:43:39 +0200 Subject: [PATCH] Initialize Godot imports in quality gate --- game/presentation/cockpit/cockpit_material_palette.gd | 8 ++++---- scripts/quality_gate.sh | 11 +++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/game/presentation/cockpit/cockpit_material_palette.gd b/game/presentation/cockpit/cockpit_material_palette.gd index 8532676..5797657 100644 --- a/game/presentation/cockpit/cockpit_material_palette.gd +++ b/game/presentation/cockpit/cockpit_material_palette.gd @@ -177,12 +177,12 @@ func _textured_material( return material -func _load_texture(resource_path: String) -> ImageTexture: - var image := Image.load_from_file(resource_path) - if image == null or image.is_empty(): +func _load_texture(resource_path: String) -> Texture2D: + var texture := ResourceLoader.load(resource_path, "Texture2D") as Texture2D + if texture == null: push_error("Unable to load cockpit texture: %s" % resource_path) return null - return ImageTexture.create_from_image(image) + return texture func _dedicated_gauge_material(resource_path: String) -> StandardMaterial3D: diff --git a/scripts/quality_gate.sh b/scripts/quality_gate.sh index 379193f..c14fb7e 100755 --- a/scripts/quality_gate.sh +++ b/scripts/quality_gate.sh @@ -48,6 +48,17 @@ bash -n scripts/check_architecture.sh scripts/quality_gate.sh printf 'Quality gate: architecture\n' bash scripts/check_architecture.sh +printf 'Quality gate: project import\n' +if ! "$GODOT_EXECUTABLE" --headless \ + --log-file "$QUALITY_TEMP_DIRECTORY/import.log" \ + --path . \ + --import \ + >"$QUALITY_TEMP_DIRECTORY/import-console.log" 2>&1; then + printf 'Quality gate: project import failed\n' + cat "$QUALITY_TEMP_DIRECTORY/import-console.log" + exit 1 +fi + printf 'Quality gate: resource loading\n' "$GODOT_EXECUTABLE" --headless \ --log-file "$QUALITY_TEMP_DIRECTORY/load.log" \