0.1.0-0-pre.10-fix.1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# file: Cargo.toml
|
||||
# version: 19
|
||||
# version: 20
|
||||
|
||||
[workspace]
|
||||
resolver = "3"
|
||||
@@ -17,7 +17,7 @@ members = [
|
||||
]
|
||||
|
||||
[workspace.package]
|
||||
version = "0.1.0-0-pre.10"
|
||||
version = "0.1.0-0-pre.10.fix.1"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
repository = "https://git.sasedev.com/Sasedev/games"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// file: crates/engines/engine-v1-common/unit_tests/render.rs
|
||||
// version: 1
|
||||
// version: 2
|
||||
|
||||
#[test]
|
||||
fn normalized_rect_clamps_and_contains_points() {
|
||||
let rect = crate::NormalizedRect::new(0.8, 0.8, 0.5, 0.5);
|
||||
assert_eq!(rect.width(), 0.2);
|
||||
assert_eq!(rect.height(), 0.2);
|
||||
assert!((rect.width() - 0.2).abs() < f32::EPSILON);
|
||||
assert!((rect.height() - 0.2).abs() < f32::EPSILON);
|
||||
assert!(rect.contains(0.9, 0.9));
|
||||
assert!(!rect.contains(0.5, 0.5));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/engines/engine-v1-sdl/src/runtime.rs
|
||||
// version: 6
|
||||
// version: 7
|
||||
|
||||
/// Minimal SDL3 runtime used by Desktop and Android POC runners.
|
||||
pub struct SdlRuntime {
|
||||
@@ -110,7 +110,7 @@ fn render_scene(canvas: &mut sdl3::render::WindowCanvas, scene: engine_v1_common
|
||||
let color = rectangle.color();
|
||||
let rect = rectangle.rect();
|
||||
canvas.set_draw_color(sdl3::pixels::Color::RGBA(color.red(), color.green(), color.blue(), color.alpha()));
|
||||
let physical = sdl3::rect::FRect::new(rect.x() * width as f32, rect.y() * height as f32, rect.width() * width as f32, rect.height() * height as f32);
|
||||
let physical = sdl3::render::FRect::new(rect.x() * width as f32, rect.y() * height as f32, rect.width() * width as f32, rect.height() * height as f32);
|
||||
match canvas.fill_rect(physical) {
|
||||
std::result::Result::Ok(()) => {},
|
||||
std::result::Result::Err(error) => return std::result::Result::Err(error.to_string()),
|
||||
|
||||
86
deltas/0.1.0/0-pre.10.fix.1.md
Normal file
86
deltas/0.1.0/0-pre.10.fix.1.md
Normal file
@@ -0,0 +1,86 @@
|
||||
<!-- file: deltas/0.1.0/0-pre.10.fix.1.md -->
|
||||
<!-- version: 1 -->
|
||||
|
||||
# Delta 0.1.0-0-pre.10.fix.1
|
||||
|
||||
## Base
|
||||
|
||||
Base déclarée : `0.1.0-0-pre.10`, non validée.
|
||||
|
||||
## Échecs observés
|
||||
|
||||
La validation de `0-pre.10` a mis en évidence deux défauts locaux.
|
||||
|
||||
### SDL3 FRect
|
||||
|
||||
`sdl3 0.20.0` expose `FRect` publiquement sous :
|
||||
|
||||
```text
|
||||
sdl3::render::FRect
|
||||
```
|
||||
|
||||
Le delta utilisait à tort :
|
||||
|
||||
```text
|
||||
sdl3::rect::FRect
|
||||
```
|
||||
|
||||
qui est privé.
|
||||
|
||||
### Test flottant
|
||||
|
||||
Le test de `NormalizedRect` comparait directement :
|
||||
|
||||
```text
|
||||
0.19999999 == 0.2
|
||||
```
|
||||
|
||||
avec `assert_eq!`.
|
||||
|
||||
Le comportement du code est correct ; le test était trop strict pour des `f32`.
|
||||
|
||||
## Correctif
|
||||
|
||||
- remplacement de `sdl3::rect::FRect` par `sdl3::render::FRect` ;
|
||||
- comparaison de `width` et `height` avec une tolérance `f32::EPSILON`.
|
||||
|
||||
Aucun comportement gameplay n'est modifié.
|
||||
|
||||
## Validation à exécuter
|
||||
|
||||
```bash
|
||||
cargo fmt --all
|
||||
cargo fmt --all -- --check
|
||||
|
||||
python3 scripts/audit_rust_workspace_rules.py
|
||||
python3 scripts/audit_markdown_tables.py README.md RULES.md ROADMAP.md CHANGELOG.md docs prompts crates Android deltas history
|
||||
|
||||
cargo check --workspace
|
||||
cargo clippy --workspace --all-targets --all-features -- -D warnings
|
||||
|
||||
cargo test -p engine-v1-common --all-targets --all-features
|
||||
cargo test -p engine-v1-sdl --all-targets --all-features
|
||||
cargo test -p game-reflex-poc --all-targets --all-features
|
||||
```
|
||||
|
||||
Puis :
|
||||
|
||||
```bash
|
||||
cargo run -p game-reflex-poc-desktop
|
||||
```
|
||||
|
||||
Si le smoke Desktop est propre, reconstruire Android Reflex :
|
||||
|
||||
```bash
|
||||
python3 scripts/build_android_rust.py reflex
|
||||
|
||||
cd Android
|
||||
gradle :game-reflex-poc:assembleDebug
|
||||
cd ..
|
||||
```
|
||||
|
||||
## Transition
|
||||
|
||||
Si ces gates sont propres, `0.1.0-0-pre.10.fix.1` est validée et le travail passe automatiquement à `0.1.0-0-pre.11`.
|
||||
|
||||
En cas d'échec imputable au projet, produire `0.1.0-0-pre.10.fix.2`.
|
||||
Reference in New Issue
Block a user