|
|
4 天之前 | |
|---|---|---|
| .. | ||
| README.md | 4 天之前 | |
| apply_clang.sh | 1 月之前 | |
| build-windows.py | 1 月之前 | |
| csv2ts.sh | 1 月之前 | |
| debug-audio.sh | 1 月之前 | |
| remove-comments.sh | 4 天之前 | |
| run-clang-tidy-fixes.sh | 1 月之前 | |
| setup-deps.sh | 1 月之前 | |
| ts2csv.sh | 1 月之前 | |
| update_contributors.py | 1 月之前 | |
| validate-shader-uniforms.sh | 1 月之前 | |
| validate_mounted_ground_offsets.py | 2 周之前 | |
| validate_shader_config.py | 6 天之前 | |
| validate_shader_uniforms.py | 1 月之前 | |
This directory contains utility scripts for building and maintaining the Standard-of-Iron project.
build-windows.py - Windows Local Build ScriptA user-friendly Python script that automates the Windows build process. It verifies dependencies, sets up the MSVC environment, builds the project, and creates a distributable package.
Features:
Requirements:
Usage:
# Full build with dependency checks
python scripts/build-windows.py
# Build in Debug mode
python scripts/build-windows.py --build-type Debug
# Clean build (remove build directory first)
python scripts/build-windows.py --clean
# Skip dependency checks (faster if you know everything is installed)
python scripts/build-windows.py --skip-checks
# Only deploy Qt dependencies (assumes project is already built)
python scripts/build-windows.py --deploy-only
# Build without creating package
python scripts/build-windows.py --no-package
# Show help
python scripts/build-windows.py --help
Output:
build/bin/standard_of_iron.exestandard_of_iron-win-x64-Release.zipTroubleshooting:
If the script can't find Qt, set the QT_ROOT environment variable:
$env:QT_ROOT = "C:\Qt\6.6.3\msvc2019_64"
python scripts/build-windows.py
If you encounter MSVC issues, ensure "Desktop development with C++" is installed in Visual Studio.
update_contributors.py - Contributor Tracking ScriptAutomatically generates and maintains a CONTRIBUTORS.md file based on Git commit history. This script uses Git as the single source of truth for contributor information.
Features:
Requirements:
Usage:
# Update contributor list
python scripts/update_contributors.py
Output:
CONTRIBUTORS.md (repository root)Example Output:
# 🌍 Project Contributors
| Name | Email | Contributions | First Commit | Last Commit | Reference |
|------|--------|----------------|---------------|--------------|-----------|
| Alice Dev | [email protected] | 42 commits | 2024-03-11 | 2025-10-28 | |
| Bob Writer | [email protected] | 9 commits | 2025-03-15 | 2025-10-20 | |
Note: The Reference column is left empty by default and can be manually edited to add links to GitHub profiles, websites, or other references. The script automatically preserves any manually-added Reference values when it regenerates the file, so your edits will not be lost on subsequent runs.
setup-deps.sh - Dependency InstallerVerifies and installs required toolchain and Qt/QML runtime modules for Linux (Debian/Ubuntu, Arch/Manjaro) and macOS.
Usage:
./scripts/setup-deps.sh # Interactive install
./scripts/setup-deps.sh --yes # Non-interactive (assume yes)
./scripts/setup-deps.sh --dry-run # Show actions without installing
./scripts/setup-deps.sh --no-install # Only verify, don't install
csv2ts.sh - CSV to Qt Translation FilesConverts CSV translation files to Qt .ts format.
ts2csv.sh - Qt Translation Files to CSVExports Qt .ts translation files to CSV format for easier editing.
Usage:
./scripts/csv2ts.sh # Convert CSV to .ts files
./scripts/ts2csv.sh # Convert .ts files to CSV
validate_shader_uniforms.py - Shader Uniform Validation⚠️ IMPORTANT: Always run this after modifying shader code or backend uniform handling!
Validates that uniform names in GLSL shaders match the names used in C++ backend code. Prevents rendering bugs caused by naming convention mismatches (camelCase vs snake_case).
Features:
.frag and .vert shader files in assets/shaders/uniformHandle() calls in render/gl/backend.cppUsage:
# Validate all shaders and backend code
python3 scripts/validate_shader_uniforms.py
# Alternative bash version
./scripts/validate-shader-uniforms.sh
Example Output:
=== Shader Uniform Validation ===
Found 35 shader files
Total unique uniforms in shaders: 56
Found 50 unique uniformHandle() calls in backend.cpp
✓ All uniform names match between shaders and backend!
When to Run:
Common Issues Found:
u_view_proj (backend) vs u_viewProj (shader) ❌u_light_dir (backend) vs u_lightDir (shader) ❌u_tile_size (backend) vs u_tileSize (shader) ❌validate-shader-uniforms.sh - Shader Validation (Bash)Alternative bash implementation of shader uniform validation. Use the Python version for more detailed output.
run-clang-tidy-fixes.sh - Clang-Tidy Auto-FixRuns clang-tidy with automatic fixes enabled.
debug-audio.sh - Audio DebuggingHelper script for debugging audio issues.
remove-comments.sh - Code CleanupRemoves comments from C/C++ source files and shader files (use with caution).
Features:
.c, .cpp, .h, .hpp, etc.).vert, .frag, .glsl).qml)Usage:
# Remove comments from all supported files in current directory
./scripts/remove-comments.sh
# Dry-run to see what would be modified
./scripts/remove-comments.sh --dry-run
# Remove comments from shader files only
./scripts/remove-comments.sh assets/shaders/
# Create backups before modifying
./scripts/remove-comments.sh --backup
python scripts/build-windows.pybuild/bin/standard_of_iron.exestandard_of_iron-win-x64-Release.zip./scripts/setup-deps.sh to install dependenciesBuild with CMake:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
Find the executable at build/bin/standard_of_iron
When adding new scripts:
#!/usr/bin/env bash or #!/usr/bin/env python3)chmod +x scripts/your-script.sh