From 70e13a494abb1b2f4b13057540ecb4d43ce0f041 Mon Sep 17 00:00:00 2001 From: leonidarider <358984476+leonidarider@users.noreply.github.com> Date: Thu, 3 Dec 2026 17:19:00 +0100 Subject: [PATCH] Rename or-particle to or-particle-model and or-worlds to or-world-registry --- .config/nextest.toml | 2 +- AGENTS.md | 4 +- Cargo.lock | 20 ++++---- Cargo.toml | 12 ++--- README.md | 2 +- .../Cargo.toml | 4 +- .../README.md | 6 +-- .../src/behaviour/mod.rs | 0 .../src/behaviour/record.rs | 0 .../src/behaviour/types.rs | 0 .../src/domain/mod.rs | 0 .../src/domain/shape.rs | 0 .../src/domain/types.rs | 0 .../src/evolution.rs | 0 .../src/keyframe/data.rs | 0 .../src/keyframe/mod.rs | 0 .../src/lib.rs | 0 .../src/list.rs | 0 .../src/rage/mod.rs | 0 .../src/rules/effect.rs | 0 .../src/rules/emitter.rs | 0 .../src/rules/mod.rs | 0 .../src/rules/particle.rs | 0 .../src/sample.rs | 0 .../a_particle_list_edit_saves_and_reopens.rs | 2 +- crates/domain/or-particles/Cargo.toml | 2 +- crates/domain/or-particles/README.md | 2 +- crates/domain/or-particles/src/lib.rs | 2 +- .../domain/or-particles/tests/common/mod.rs | 2 +- crates/domain/or-source/Cargo.toml | 2 +- crates/domain/or-source/src/particles/list.rs | 12 ++--- crates/domain/or-source/src/particles/mod.rs | 8 +-- .../domain/or-source/src/particles/records.rs | 2 +- crates/domain/or-source/tests/particles.rs | 20 +++++--- .../domain/or-world-gta5/src/map/map_data.rs | 2 +- .../Cargo.toml | 2 +- .../src/lib.rs | 0 .../tests/edit_fixture/mod.rs | 2 +- .../tests/flushed/mod.rs | 0 .../gta5_edits_are_written_at_a_flush.rs | 0 .../gta5_edits_with_a_schema_snapshot.rs | 0 .../tests/gta5_passes_the_kit.rs | 0 .../or-world/tests/the_core_names_no_game.rs | 2 +- crates/foundation/or-transport/README.md | 2 +- crates/runtime/or-anim/Cargo.toml | 2 +- crates/runtime/or-anim/README.md | 2 +- crates/runtime/or-renderer/Cargo.toml | 2 +- crates/runtime/or-renderer/src/particles.rs | 4 +- crates/runtime/or-simulation/Cargo.toml | 2 +- crates/runtime/or-simulation/src/behaviour.rs | 10 ++-- .../src/behaviours/acceleration.rs | 2 +- .../or-simulation/src/behaviours/age.rs | 2 +- .../src/behaviours/animate_texture.rs | 4 +- .../or-simulation/src/behaviours/attractor.rs | 2 +- .../or-simulation/src/behaviours/collision.rs | 2 +- .../or-simulation/src/behaviours/colour.rs | 2 +- .../or-simulation/src/behaviours/dampening.rs | 2 +- .../src/behaviours/decal_pool.rs | 2 +- .../src/behaviours/draw_decal.rs | 2 +- .../src/behaviours/draw_fog_volume.rs | 2 +- .../src/behaviours/draw_light.rs | 10 ++-- .../src/behaviours/draw_model.rs | 2 +- .../src/behaviours/draw_sprite.rs | 2 +- .../src/behaviours/draw_trail.rs | 2 +- .../or-simulation/src/behaviours/fade.rs | 2 +- .../or-simulation/src/behaviours/gravity.rs | 2 +- .../or-simulation/src/behaviours/liquid.rs | 2 +- .../src/behaviours/matrix_weight.rs | 2 +- .../or-simulation/src/behaviours/mod.rs | 7 +-- .../or-simulation/src/behaviours/noise.rs | 2 +- .../or-simulation/src/behaviours/pause.rs | 2 +- .../or-simulation/src/behaviours/river.rs | 2 +- .../or-simulation/src/behaviours/rotation.rs | 2 +- .../or-simulation/src/behaviours/size.rs | 2 +- .../or-simulation/src/behaviours/velocity.rs | 2 +- .../or-simulation/src/behaviours/wind.rs | 2 +- .../or-simulation/src/behaviours/zculling.rs | 2 +- crates/runtime/or-simulation/src/build.rs | 6 +-- .../or-simulation/src/domain_sample.rs | 2 +- .../runtime/or-simulation/src/effect_inst.rs | 4 +- .../runtime/or-simulation/src/emitter_inst.rs | 10 ++-- crates/runtime/or-simulation/src/kfp.rs | 14 +++-- crates/runtime/or-simulation/src/manager.rs | 10 ++-- .../or-simulation/src/reference_space.rs | 2 +- .../tests/camera_facing_check.rs | 2 +- .../or-simulation/tests/engine_parity.rs | 30 +++++------ ...ery_corpus_effect_simulates_as_recorded.rs | 2 +- .../runtime/or-simulation/tests/kfp_query.rs | 4 +- .../or-simulation/tests/phase_e_behaviours.rs | 2 +- .../or-simulation/tests/sinks_smoke.rs | 6 +-- .../or-simulation/tests/synthetic/mod.rs | 6 +-- crates/runtime/or-simulation/tests/ws3_sim.rs | 2 +- crates/tools/or-cli/Cargo.toml | 4 +- crates/tools/or-cli/src/world/neutral.rs | 2 +- ...ted_and_read_back_from_the_command_line.rs | 2 +- docs/direction/OR_IO_Specification.md | 4 +- docs/direction/Project_Context.md | 4 +- docs/direction/Roadmap.md | 12 ++--- docs/direction/Source_Format_Design.md | 2 +- docs/direction/Unified_World_Plan.md | 2 +- docs/direction/Workbench_Views_Design.md | 6 +-- docs/features/GTA_V_World_Viewer.md | 2 +- docs/reference/Crate_Reference.md | 28 +++++----- src/render/meshes.rs | 2 +- src/render/particle_gizmos.rs | 2 +- src/render/particle_models.rs | 13 ++--- src/render/particles/mod.rs | 4 +- src/render/trails.rs | 8 +-- src/state/capabilities.rs | 5 +- src/state/drivers/exposure.rs | 2 +- src/state/drivers/mod.rs | 2 +- src/state/drivers/time_of_day.rs | 2 +- src/state/drivers/weather.rs | 2 +- src/state/drivers/world.rs | 2 +- .../gta6/particles/gta6_particles/mod.rs | 2 +- .../particles/gta6_particles/tests/colour.rs | 6 +-- .../particles/gta6_particles/tests/mod.rs | 8 +-- .../particles/gta6_particles/tests/remove.rs | 2 +- .../particles/gta6_particles_save/copies.rs | 4 +- .../gta6/particles/gta6_particles_save/mod.rs | 2 +- .../particles/gta6_particles_save/remove.rs | 2 +- src/state/models.rs | 4 +- src/state/name_index.rs | 4 +- src/state/payload_handlers.rs | 10 ++-- src/state/reload_open_file.rs | 2 +- .../headerless_tests/saves_per_kind/edits.rs | 2 +- src/state/selection_lookup.rs | 8 +-- ...pinned_inspector_shows_its_own_document.rs | 2 +- .../adding_particle_files_is_an_import.rs | 2 +- .../every_viewer_path_takes_both_targets.rs | 2 +- .../the_default_views_in_a_modders_words.rs | 2 +- ...els_around_the_viewer_take_both_targets.rs | 2 +- ...the_sliders_follow_the_pinned_inspector.rs | 2 +- src/state/textures.rs | 4 +- src/state/world_session/driven/mod.rs | 2 +- src/state/world_session/mod.rs | 2 +- src/state/world_session/tests.rs | 6 +-- src/ui/panels/hierarchy/dispatch.rs | 2 +- src/ui/panels/hierarchy/mod.rs | 2 +- src/ui/panels/hierarchy/ypt/menus.rs | 27 ++++++---- src/ui/panels/hierarchy/ypt/mod.rs | 6 +-- src/ui/panels/hierarchy/ypt/models.rs | 2 +- src/ui/panels/hierarchy/ypt/ops.rs | 4 +- src/ui/panels/inspector/mod.rs | 2 +- src/ui/panels/inspector/ypt/behaviour.rs | 25 +++++---- src/ui/panels/inspector/ypt/mod.rs | 2 +- src/ui/panels/inspector/ypt/model.rs | 2 +- src/ui/panels/inspector/ypt/selected.rs | 2 +- src/ui/panels/inspector/ypt/steps.rs | 2 +- src/ui/panels/timeline.rs | 51 ++++++++++--------- ...ry_context_menu_draws_from_the_registry.rs | 2 +- src/ui/tests/the_particle_screen_on_screen.rs | 2 +- 152 files changed, 334 insertions(+), 300 deletions(-) rename crates/domain/{or-particle => or-particle-model}/Cargo.toml (80%) rename crates/domain/{or-particle => or-particle-model}/README.md (77%) rename crates/domain/{or-particle => or-particle-model}/src/behaviour/mod.rs (100%) rename crates/domain/{or-particle => or-particle-model}/src/behaviour/record.rs (100%) rename crates/domain/{or-particle => or-particle-model}/src/behaviour/types.rs (100%) rename crates/domain/{or-particle => or-particle-model}/src/domain/mod.rs (100%) rename crates/domain/{or-particle => or-particle-model}/src/domain/shape.rs (100%) rename crates/domain/{or-particle => or-particle-model}/src/domain/types.rs (100%) rename crates/domain/{or-particle => or-particle-model}/src/evolution.rs (100%) rename crates/domain/{or-particle => or-particle-model}/src/keyframe/data.rs (100%) rename crates/domain/{or-particle => or-particle-model}/src/keyframe/mod.rs (100%) rename crates/domain/{or-particle => or-particle-model}/src/lib.rs (100%) rename crates/domain/{or-particle => or-particle-model}/src/list.rs (100%) rename crates/domain/{or-particle => or-particle-model}/src/rage/mod.rs (100%) rename crates/domain/{or-particle => or-particle-model}/src/rules/effect.rs (100%) rename crates/domain/{or-particle => or-particle-model}/src/rules/emitter.rs (100%) rename crates/domain/{or-particle => or-particle-model}/src/rules/mod.rs (100%) rename crates/domain/{or-particle => or-particle-model}/src/rules/particle.rs (100%) rename crates/domain/{or-particle => or-particle-model}/src/sample.rs (100%) rename crates/domain/{or-particle => or-particle-model}/tests/a_particle_list_edit_saves_and_reopens.rs (99%) rename crates/domain/{or-worlds => or-world-registry}/Cargo.toml (97%) rename crates/domain/{or-worlds => or-world-registry}/src/lib.rs (100%) rename crates/domain/{or-worlds => or-world-registry}/tests/edit_fixture/mod.rs (97%) rename crates/domain/{or-worlds => or-world-registry}/tests/flushed/mod.rs (100%) rename crates/domain/{or-worlds => or-world-registry}/tests/gta5_edits_are_written_at_a_flush.rs (100%) rename crates/domain/{or-worlds => or-world-registry}/tests/gta5_edits_with_a_schema_snapshot.rs (100%) rename crates/domain/{or-worlds => or-world-registry}/tests/gta5_passes_the_kit.rs (100%) diff --git a/.config/nextest.toml b/.config/nextest.toml index 37557ea0a..aa995f13d 100644 --- a/.config/nextest.toml +++ b/.config/nextest.toml @@ -417,7 +417,7 @@ not ( | binary_id(=or-maps::what_the_interior_rules_say_of_the_install) | binary_id(=or-maps::what_the_rules_say_of_the_install) | binary_id(=or-media::bink_audio_matches_ffmpeg) - | binary_id(=or-particle::a_particle_list_edit_saves_and_reopens) + | binary_id(=or-particle-model::a_particle_list_edit_saves_and_reopens) | (binary_id(=or-particles) & ( test(/^import::tests::/) )) diff --git a/AGENTS.md b/AGENTS.md index cdeff0ad8..e951a17fa 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -134,7 +134,7 @@ publication (R66g, R66h). | `crates/foundation/` | or-job, or-test-support, or-transport | | `crates/io/` | or-io, or-io-macros, or-io-verify, or-kraken, or-media | | `crates/title/` | or-title | -| `crates/domain/` | or-addonped, or-content, or-depends, or-editor, or-interchange, or-maps, or-particle, or-particles, or-plugin, or-project, or-source, or-wardrobe, or-weapons, or-world, or-world-gta5, or-world-gta6, or-worlds | +| `crates/domain/` | or-addonped, or-content, or-depends, or-editor, or-interchange, or-maps, or-particle-model, or-particles, or-plugin, or-project, or-source, or-wardrobe, or-weapons, or-world, or-world-gta5, or-world-gta6, or-world-registry | | `crates/runtime/` | or-anim, or-renderer, or-simulation | | `crates/tools/` | or-cli (`openrage-cli`), or-loader (`openrage-loader`), or-shader-front, or-shader-tool, xtask | | `src/` | the `openrage` app, which also builds the `openrage-cli` binary | @@ -150,7 +150,7 @@ publication (R66g, R66h). `or-title`; code that needs only the bytes goes in `or-io`, but a new decoder of a file's audio or video goes in `or-media`, where code ported from an open implementation keeps its licence out of `or-io`. -- Edges that stay absent: `or-anim` → `or-particle` (the playback clock is +- Edges that stay absent: `or-anim` → `or-particle-model` (the playback clock is `or-transport`). - The app owns egui integration; `or-renderer` has no egui dependency. - Adding a title is one `GameProfile` impl and one registry line diff --git a/Cargo.lock b/Cargo.lock index f59ca32a1..8aaff2e99 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2998,7 +2998,7 @@ dependencies = [ "or-job", "or-maps", "or-media", - "or-particle", + "or-particle-model", "or-particles", "or-plugin", "or-project", @@ -3014,7 +3014,7 @@ dependencies = [ "or-world", "or-world-gta5", "or-world-gta6", - "or-worlds", + "or-world-registry", "pelite", "pollster", "rayon", @@ -3090,7 +3090,7 @@ dependencies = [ "or-job", "or-maps", "or-media", - "or-particle", + "or-particle-model", "or-particles", "or-project", "or-shader-front", @@ -3102,7 +3102,7 @@ dependencies = [ "or-world", "or-world-gta5", "or-world-gta6", - "or-worlds", + "or-world-registry", "serde", "serde_json", "sha1", @@ -3269,7 +3269,7 @@ dependencies = [ ] [[package]] -name = "or-particle" +name = "or-particle-model" version = "0.2.0" dependencies = [ "or-io", @@ -3282,7 +3282,7 @@ name = "or-particles" version = "0.2.0" dependencies = [ "or-io", - "or-particle", + "or-particle-model", "or-project", "or-source", "or-test-support", @@ -3342,7 +3342,7 @@ dependencies = [ "or-interchange", "or-io", "or-job", - "or-particle", + "or-particle-model", "or-test-support", "or-title", "or-world", @@ -3409,7 +3409,7 @@ dependencies = [ "bytemuck", "glam", "or-io", - "or-particle", + "or-particle-model", "or-test-support", "or-transport", "rayon", @@ -3425,7 +3425,7 @@ dependencies = [ "image", "or-interchange", "or-io", - "or-particle", + "or-particle-model", "or-test-support", "schemars", "serde", @@ -3555,7 +3555,7 @@ dependencies = [ ] [[package]] -name = "or-worlds" +name = "or-world-registry" version = "0.2.0" dependencies = [ "glam", diff --git a/Cargo.toml b/Cargo.toml index 8885049d1..b35663a08 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ members = [ "crates/domain/or-editor", "crates/domain/or-interchange", "crates/domain/or-plugin", - "crates/domain/or-particle", + "crates/domain/or-particle-model", "crates/domain/or-particles", "crates/domain/or-maps", "crates/domain/or-project", @@ -52,7 +52,7 @@ members = [ "crates/domain/or-world", "crates/domain/or-world-gta5", "crates/domain/or-world-gta6", - "crates/domain/or-worlds", + "crates/domain/or-world-registry", # Things that run: evaluated, simulated, drawn. "crates/runtime/or-anim", @@ -215,7 +215,7 @@ or-depends = { path = "crates/domain/or-depends" } or-editor = { path = "crates/domain/or-editor" } or-interchange = { path = "crates/domain/or-interchange" } or-plugin = { path = "crates/domain/or-plugin" } -or-particle = { path = "crates/domain/or-particle" } +or-particle-model = { path = "crates/domain/or-particle-model" } or-particles = { path = "crates/domain/or-particles" } or-maps = { path = "crates/domain/or-maps" } or-project = { path = "crates/domain/or-project" } @@ -227,7 +227,7 @@ or-weapons = { path = "crates/domain/or-weapons" } or-world = { path = "crates/domain/or-world" } or-world-gta5 = { path = "crates/domain/or-world-gta5" } or-world-gta6 = { path = "crates/domain/or-world-gta6" } -or-worlds = { path = "crates/domain/or-worlds" } +or-world-registry = { path = "crates/domain/or-world-registry" } or-title = { path = "crates/title/or-title" } or-renderer = { path = "crates/runtime/or-renderer" } or-cli = { path = "crates/tools/or-cli" } @@ -311,7 +311,7 @@ or-anim = { workspace = true, features = ["gta6"] } or-depends.workspace = true or-editor.workspace = true or-interchange.workspace = true -or-particle.workspace = true +or-particle-model.workspace = true # The container keys of a `.openrage-proj`, and the paths it stores, which # `openrage-cli project` reads and writes the same way. or-project.workspace = true @@ -339,7 +339,7 @@ or-world.workspace = true # forms a script takes a position in. or-world-gta5.workspace = true or-world-gta6.workspace = true -or-worlds.workspace = true +or-world-registry.workspace = true # Cancellation and progress-as-data, shared with `or-cli`. The app does depend # on `or-cli`, to host the `openrage-cli` binary; `or-job` keeps the job model # out of that edge. diff --git a/README.md b/README.md index e7d85c3a2..7e3a8313f 100644 --- a/README.md +++ b/README.md @@ -327,7 +327,7 @@ Dependencies run one way: foundation → io → title → domain → runtime → |---|---|---| | app | the editor and the `openrage-cli` entry point | [src](src) | | [runtime](crates/runtime) | what is evaluated, simulated or drawn | or-anim, or-renderer, or-simulation | -| [domain](crates/domain) | what is edited, and what a project builds | or-project, or-source, or-content, or-wardrobe, or-addonped, or-weapons, or-maps, or-particles, or-particle, or-world, or-world-gta5, or-world-gta6, or-worlds, or-depends, or-interchange, or-editor, or-plugin | +| [domain](crates/domain) | what is edited, and what a project builds | or-project, or-source, or-content, or-wardrobe, or-addonped, or-weapons, or-maps, or-particles, or-particle-model, or-world, or-world-gta5, or-world-gta6, or-world-registry, or-depends, or-interchange, or-editor, or-plugin | | [title](crates/title) | a game install: editions, archives, DLC order | or-title | | [io](crates/io) | file formats, archives, media decoders | or-io, or-io-macros, or-io-verify, or-kraken, or-media | | [foundation](crates/foundation) | building blocks that know no format | or-job, or-transport, or-test-support | diff --git a/crates/domain/or-particle/Cargo.toml b/crates/domain/or-particle-model/Cargo.toml similarity index 80% rename from crates/domain/or-particle/Cargo.toml rename to crates/domain/or-particle-model/Cargo.toml index 1fc714a62..01b57a901 100644 --- a/crates/domain/or-particle/Cargo.toml +++ b/crates/domain/or-particle-model/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "or-particle" +name = "or-particle-model" version.workspace = true edition.workspace = true authors.workspace = true @@ -10,7 +10,7 @@ description = "The particle editor's model: the effect / emitter / particle rule [dependencies] serde.workspace = true -# Jenkins hashing lives below this crate now. `or_particle::rage` re-exports it so +# Jenkins hashing lives below this crate now. `or_particle_model::rage` re-exports it so # existing callers are unaffected; see that module for why it moved. or-io.workspace = true diff --git a/crates/domain/or-particle/README.md b/crates/domain/or-particle-model/README.md similarity index 77% rename from crates/domain/or-particle/README.md rename to crates/domain/or-particle-model/README.md index 887448e19..c3c4539b9 100644 --- a/crates/domain/or-particle/README.md +++ b/crates/domain/or-particle-model/README.md @@ -1,13 +1,13 @@ -# or-particle +# or-particle-model The particle editor's model: the effect, emitter and particle rule hierarchy of an open `.ypt`. -It sits over the owned records `or-io` declares for a `.ypt` and shows them as the editor does: behaviours, domains, keyframes and evolutions. `or_particle::list` finds rules by name, and adds, renames and removes them. +It sits over the owned records `or-io` declares for a `.ypt` and shows them as the editor does: behaviours, domains, keyframes and evolutions. `or_particle_model::list` finds rules by name, and adds, renames and removes them. ⚠ Not [or-particles](../or-particles), which is particle effects as content of a project. - Layer: domain. - Start at [src/lib.rs](src/lib.rs). -- Tests: `just test-crate or-particle`. +- Tests: `just test-crate or-particle-model`. - How the preview plays one: [Particle_Preview.md](../../../docs/features/Particle_Preview.md). - Reference: [Crate_Reference.md](../../../docs/reference/Crate_Reference.md#domain-crates). diff --git a/crates/domain/or-particle/src/behaviour/mod.rs b/crates/domain/or-particle-model/src/behaviour/mod.rs similarity index 100% rename from crates/domain/or-particle/src/behaviour/mod.rs rename to crates/domain/or-particle-model/src/behaviour/mod.rs diff --git a/crates/domain/or-particle/src/behaviour/record.rs b/crates/domain/or-particle-model/src/behaviour/record.rs similarity index 100% rename from crates/domain/or-particle/src/behaviour/record.rs rename to crates/domain/or-particle-model/src/behaviour/record.rs diff --git a/crates/domain/or-particle/src/behaviour/types.rs b/crates/domain/or-particle-model/src/behaviour/types.rs similarity index 100% rename from crates/domain/or-particle/src/behaviour/types.rs rename to crates/domain/or-particle-model/src/behaviour/types.rs diff --git a/crates/domain/or-particle/src/domain/mod.rs b/crates/domain/or-particle-model/src/domain/mod.rs similarity index 100% rename from crates/domain/or-particle/src/domain/mod.rs rename to crates/domain/or-particle-model/src/domain/mod.rs diff --git a/crates/domain/or-particle/src/domain/shape.rs b/crates/domain/or-particle-model/src/domain/shape.rs similarity index 100% rename from crates/domain/or-particle/src/domain/shape.rs rename to crates/domain/or-particle-model/src/domain/shape.rs diff --git a/crates/domain/or-particle/src/domain/types.rs b/crates/domain/or-particle-model/src/domain/types.rs similarity index 100% rename from crates/domain/or-particle/src/domain/types.rs rename to crates/domain/or-particle-model/src/domain/types.rs diff --git a/crates/domain/or-particle/src/evolution.rs b/crates/domain/or-particle-model/src/evolution.rs similarity index 100% rename from crates/domain/or-particle/src/evolution.rs rename to crates/domain/or-particle-model/src/evolution.rs diff --git a/crates/domain/or-particle/src/keyframe/data.rs b/crates/domain/or-particle-model/src/keyframe/data.rs similarity index 100% rename from crates/domain/or-particle/src/keyframe/data.rs rename to crates/domain/or-particle-model/src/keyframe/data.rs diff --git a/crates/domain/or-particle/src/keyframe/mod.rs b/crates/domain/or-particle-model/src/keyframe/mod.rs similarity index 100% rename from crates/domain/or-particle/src/keyframe/mod.rs rename to crates/domain/or-particle-model/src/keyframe/mod.rs diff --git a/crates/domain/or-particle/src/lib.rs b/crates/domain/or-particle-model/src/lib.rs similarity index 100% rename from crates/domain/or-particle/src/lib.rs rename to crates/domain/or-particle-model/src/lib.rs diff --git a/crates/domain/or-particle/src/list.rs b/crates/domain/or-particle-model/src/list.rs similarity index 100% rename from crates/domain/or-particle/src/list.rs rename to crates/domain/or-particle-model/src/list.rs diff --git a/crates/domain/or-particle/src/rage/mod.rs b/crates/domain/or-particle-model/src/rage/mod.rs similarity index 100% rename from crates/domain/or-particle/src/rage/mod.rs rename to crates/domain/or-particle-model/src/rage/mod.rs diff --git a/crates/domain/or-particle/src/rules/effect.rs b/crates/domain/or-particle-model/src/rules/effect.rs similarity index 100% rename from crates/domain/or-particle/src/rules/effect.rs rename to crates/domain/or-particle-model/src/rules/effect.rs diff --git a/crates/domain/or-particle/src/rules/emitter.rs b/crates/domain/or-particle-model/src/rules/emitter.rs similarity index 100% rename from crates/domain/or-particle/src/rules/emitter.rs rename to crates/domain/or-particle-model/src/rules/emitter.rs diff --git a/crates/domain/or-particle/src/rules/mod.rs b/crates/domain/or-particle-model/src/rules/mod.rs similarity index 100% rename from crates/domain/or-particle/src/rules/mod.rs rename to crates/domain/or-particle-model/src/rules/mod.rs diff --git a/crates/domain/or-particle/src/rules/particle.rs b/crates/domain/or-particle-model/src/rules/particle.rs similarity index 100% rename from crates/domain/or-particle/src/rules/particle.rs rename to crates/domain/or-particle-model/src/rules/particle.rs diff --git a/crates/domain/or-particle/src/sample.rs b/crates/domain/or-particle-model/src/sample.rs similarity index 100% rename from crates/domain/or-particle/src/sample.rs rename to crates/domain/or-particle-model/src/sample.rs diff --git a/crates/domain/or-particle/tests/a_particle_list_edit_saves_and_reopens.rs b/crates/domain/or-particle-model/tests/a_particle_list_edit_saves_and_reopens.rs similarity index 99% rename from crates/domain/or-particle/tests/a_particle_list_edit_saves_and_reopens.rs rename to crates/domain/or-particle-model/tests/a_particle_list_edit_saves_and_reopens.rs index 11c390eb7..34c7815ab 100644 --- a/crates/domain/or-particle/tests/a_particle_list_edit_saves_and_reopens.rs +++ b/crates/domain/or-particle-model/tests/a_particle_list_edit_saves_and_reopens.rs @@ -4,7 +4,7 @@ use or_io::decl::{File, OwnedOrKeyed, Resource, View}; use or_io::gta5::particle::PtxFxList; -use or_particle::list; +use or_particle_model::list; use or_test_support::{shared_corpus_root, Corpus, TARGET_GEN8}; /// Every Legacy corpus `.ypt`, laid out as the editor edits it. diff --git a/crates/domain/or-particles/Cargo.toml b/crates/domain/or-particles/Cargo.toml index 3408ee9ea..eaaef6218 100644 --- a/crates/domain/or-particles/Cargo.toml +++ b/crates/domain/or-particles/Cargo.toml @@ -25,6 +25,6 @@ sha2.workspace = true tempfile.workspace = true or-test-support.workspace = true # The editor's calls that make the small lists the suites build sources from. -or-particle.workspace = true +or-particle-model.workspace = true # The mounted install the particle files are measured on. or-title.workspace = true diff --git a/crates/domain/or-particles/README.md b/crates/domain/or-particles/README.md index 17f772488..f9de090c2 100644 --- a/crates/domain/or-particles/README.md +++ b/crates/domain/or-particles/README.md @@ -4,7 +4,7 @@ The particles engine: the particle effects a person streams into the game, as co `effects.json` is the assets of a pack, each the source of a `.ypt`: its rules as one document, its textures as exact DDS files and its models kept whole. The crate says what is wrong as rules, what the effects contribute to a build's plan, and reads a build back to verify it. `openrage-cli particles` runs it with no window. -⚠ Not [or-particle](../or-particle), which is the editor's model of one open effects list. This crate is the kind of content a project holds. +⚠ Not [or-particle-model](../or-particle-model), which is the editor's model of one open effects list. This crate is the kind of content a project holds. - Layer: domain; a kind of content of [or-project](../or-project). - Start at [src/lib.rs](src/lib.rs). diff --git a/crates/domain/or-particles/src/lib.rs b/crates/domain/or-particles/src/lib.rs index 9cf7a724c..69ea97042 100644 --- a/crates/domain/or-particles/src/lib.rs +++ b/crates/domain/or-particles/src/lib.rs @@ -7,7 +7,7 @@ //! `openrage-cli particles` runs it without the editor. //! //! The source of a `.ypt` is `or_source::particles`: its rules as one document, its textures as exact DDS files and its models kept whole. -//! `or-particle` is the editor's model of an open list, and this crate is the kind of content a project holds. +//! `or-particle-model` is the editor's model of an open list, and this crate is the kind of content a project holds. //! //! ⚠ **Nothing here says an effect plays in game.** A build says that every file it wrote reloads through the readers, which is all //! that can be measured without running GTA V. diff --git a/crates/domain/or-particles/tests/common/mod.rs b/crates/domain/or-particles/tests/common/mod.rs index 20dc50656..04db228fd 100644 --- a/crates/domain/or-particles/tests/common/mod.rs +++ b/crates/domain/or-particles/tests/common/mod.rs @@ -21,5 +21,5 @@ pub fn mount(root: &Path) -> Option { /// A `.ypt` with the effect `effect`, firing one emitter rule and one particle rule, and no texture. pub fn a_ypt(name: &str, effect: &str) -> Vec { - or_particle::sample::list_of(name, &[effect]) + or_particle_model::sample::list_of(name, &[effect]) } diff --git a/crates/domain/or-source/Cargo.toml b/crates/domain/or-source/Cargo.toml index 83a67921d..3b1d66abe 100644 --- a/crates/domain/or-source/Cargo.toml +++ b/crates/domain/or-source/Cargo.toml @@ -16,7 +16,7 @@ or-io = { workspace = true, features = ["authoring", "bc7-encode", "meta"] } # A model source is a glb, which this reads and writes. or-interchange.workspace = true # The layout a particle list is laid out in before it is written as a source or compiled from one. -or-particle.workspace = true +or-particle-model.workspace = true serde.workspace = true serde_json.workspace = true # The JSON Schemas of asset.json, textures.json, drawable.json and dictionary.json. diff --git a/crates/domain/or-source/src/particles/list.rs b/crates/domain/or-source/src/particles/list.rs index 354964e7e..7f0852c11 100644 --- a/crates/domain/or-source/src/particles/list.rs +++ b/crates/domain/or-source/src/particles/list.rs @@ -85,7 +85,7 @@ pub fn write(list: &PtxFxList) -> Value { document.insert( "effect_rules".into(), Value::Array( - or_particle::list::effect_rules(list) + or_particle_model::list::effect_rules(list) .map(Json::write) .collect(), ), @@ -93,7 +93,7 @@ pub fn write(list: &PtxFxList) -> Value { document.insert( "emitter_rules".into(), Value::Array( - or_particle::list::emitter_rules(list) + or_particle_model::list::emitter_rules(list) .map(Json::write) .collect(), ), @@ -101,7 +101,7 @@ pub fn write(list: &PtxFxList) -> Value { document.insert( "particle_rules".into(), Value::Array( - or_particle::list::particle_rules(list) + or_particle_model::list::particle_rules(list) .map(Json::write) .collect(), ), @@ -124,7 +124,7 @@ pub fn read(document: &Value) -> Result, Fault> &r.name })?; ask_for_the_maps(&mut list); - or_particle::list::canonical(&mut list); + or_particle_model::list::canonical(&mut list); Ok(list) } @@ -142,11 +142,11 @@ fn ask_for_the_maps(list: &mut PtxFxList) { }]; } }; - for rule in or_particle::list::effect_rules_mut(list) { + for rule in or_particle_model::list::effect_rules_mut(list) { if let Some(l) = rule.evolution_list.as_deref_mut() { stale(l); } - for event in or_particle::list::events_mut(rule) { + for event in or_particle_model::list::events_mut(rule) { if let Some(l) = event.base.evolution_list.as_deref_mut() { stale(l); } diff --git a/crates/domain/or-source/src/particles/mod.rs b/crates/domain/or-source/src/particles/mod.rs index 6a2661d07..3cba76dea 100644 --- a/crates/domain/or-source/src/particles/mod.rs +++ b/crates/domain/or-source/src/particles/mod.rs @@ -147,7 +147,7 @@ where if !refusals.is_empty() { return Err(refusals.into_iter().map(Problem::new).collect()); } - or_particle::list::canonical(&mut list); + or_particle_model::list::canonical(&mut list); let origin = Origin { how: How::Extracted, @@ -243,7 +243,7 @@ where ))] })?; let mut back = back; - or_particle::list::canonical(&mut back); + or_particle_model::list::canonical(&mut back); match first_difference(list, &back) { None => Ok(()), Some(what) => Err(vec![Problem::new(format!( @@ -482,9 +482,9 @@ where .map_err(|e| vec![Problem::new(format!("the source does not compile: {e}"))])?; let mut after = PtxFxList::::from_bytes(ypt) .map_err(|e| vec![Problem::new(format!("cannot read the list: {e}"))])?; - or_particle::list::canonical(&mut after); + or_particle_model::list::canonical(&mut after); let mut before = before; - or_particle::list::canonical(&mut before); + or_particle_model::list::canonical(&mut before); if first_difference(&before, &after).is_none() { return Ok(()); } diff --git a/crates/domain/or-source/src/particles/records.rs b/crates/domain/or-source/src/particles/records.rs index 4059ba4d4..5e3e9f95b 100644 --- a/crates/domain/or-source/src/particles/records.rs +++ b/crates/domain/or-source/src/particles/records.rs @@ -3,7 +3,7 @@ //! A record's text is an object of its members, and the members a document does not state are the ones the declaration holds only //! as runtime words, or that follow from the others: the lists naming a rule's behaviours (they follow from the classes), the map //! of an evolution list (it follows from the values it names), and the pointers an event or a spawner holds at a rule it names -//! (they follow from the name, once the list is laid out with [`or_particle::list::canonical`]). +//! (they follow from the name, once the list is laid out with [`or_particle_model::list::canonical`]). //! //! `mismatches` holds every record to the declaration: a member the declaration shows and neither list names is reported, and so is a //! name the declaration lacks. diff --git a/crates/domain/or-source/tests/particles.rs b/crates/domain/or-source/tests/particles.rs index 3f8876442..df61c8e12 100644 --- a/crates/domain/or-source/tests/particles.rs +++ b/crates/domain/or-source/tests/particles.rs @@ -9,7 +9,7 @@ use or_io::decl::{File, Gen8}; use or_io::gta5::gen8::GrcTexture; use or_io::gta5::particle::{PtxEventEmitter, PtxFxList}; use or_io::gta5::PgDictionary; -use or_particle::behaviour::{AccelerationBehaviour, Behaviour, ColourBehaviour}; +use or_particle_model::behaviour::{AccelerationBehaviour, Behaviour, ColourBehaviour}; use or_source::asset::Source; use or_source::particles::{self, RULES}; use or_source::sample; @@ -21,10 +21,14 @@ fn a_list() -> PtxFxList { name: "fx_test".into(), ..Default::default() }; - assert!(or_particle::list::add_effect(&mut list, "fx_spark")); - assert!(or_particle::list::add_emitter_rule(&mut list, "em_spark")); - assert!(or_particle::list::add_particle_rule(&mut list, "pt_spark")); - let effect = or_particle::list::effect_rules_mut(&mut list) + assert!(or_particle_model::list::add_effect(&mut list, "fx_spark")); + assert!(or_particle_model::list::add_emitter_rule( + &mut list, "em_spark" + )); + assert!(or_particle_model::list::add_particle_rule( + &mut list, "pt_spark" + )); + let effect = or_particle_model::list::effect_rules_mut(&mut list) .next() .expect("the effect"); effect.num_loops = 3; @@ -34,10 +38,10 @@ fn a_list() -> PtxFxList { particle_rule_name: "pt_spark".into(), ..Default::default() }))); - let particle = or_particle::list::particle_rules_mut(&mut list) + let particle = or_particle_model::list::particle_rules_mut(&mut list) .next() .expect("the particle rule"); - or_particle::list::set_behaviours( + or_particle_model::list::set_behaviours( particle, &[ Behaviour::Acceleration(AccelerationBehaviour::default()), @@ -48,7 +52,7 @@ fn a_list() -> PtxFxList { PgDictionary::::from_bytes(&sample::texture_dictionary("fx_smoke", 40)) .expect("a sample dictionary reads"); list.texture_dict = Some(Box::new(dictionary)); - or_particle::list::canonical(&mut list); + or_particle_model::list::canonical(&mut list); list } diff --git a/crates/domain/or-world-gta5/src/map/map_data.rs b/crates/domain/or-world-gta5/src/map/map_data.rs index a7e506278..440351394 100644 --- a/crates/domain/or-world-gta5/src/map/map_data.rs +++ b/crates/domain/or-world-gta5/src/map/map_data.rs @@ -1,7 +1,7 @@ //! `CMapData`: what a `.ymap` places, as a view over the value tree. //! //! ⚠ Nothing here copies the tree: a model holding its own copy of every field -//! drops, when written back, the fields it forgot — the mistake `or-particle` +//! drops, when written back, the fields it forgot — the mistake `or-particle-model` //! cost ~329,000 mismatches to learn. use glam::{Quat, Vec3}; diff --git a/crates/domain/or-worlds/Cargo.toml b/crates/domain/or-world-registry/Cargo.toml similarity index 97% rename from crates/domain/or-worlds/Cargo.toml rename to crates/domain/or-world-registry/Cargo.toml index 440bf4ecf..39a055e96 100644 --- a/crates/domain/or-worlds/Cargo.toml +++ b/crates/domain/or-world-registry/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "or-worlds" +name = "or-world-registry" version.workspace = true edition.workspace = true authors.workspace = true diff --git a/crates/domain/or-worlds/src/lib.rs b/crates/domain/or-world-registry/src/lib.rs similarity index 100% rename from crates/domain/or-worlds/src/lib.rs rename to crates/domain/or-world-registry/src/lib.rs diff --git a/crates/domain/or-worlds/tests/edit_fixture/mod.rs b/crates/domain/or-world-registry/tests/edit_fixture/mod.rs similarity index 97% rename from crates/domain/or-worlds/tests/edit_fixture/mod.rs rename to crates/domain/or-world-registry/tests/edit_fixture/mod.rs index 146934122..5aeb6ac12 100644 --- a/crates/domain/or-worlds/tests/edit_fixture/mod.rs +++ b/crates/domain/or-world-registry/tests/edit_fixture/mod.rs @@ -66,7 +66,7 @@ pub fn fixture() -> Fixture { let guard = session.guard(&Address(OWN_SOURCE.to_owned())); store::add(OWN_SOURCE, "hd_a", pose, None, guard) }; - let entry = or_worlds::by_id(or_world_gta5::TITLE).expect("GTA V is registered"); + let entry = or_world_registry::by_id(or_world_gta5::TITLE).expect("GTA V is registered"); assert!(entry.edits.is_some(), "the registry states GTA V's store"); let op = |session: &dyn EditSession| { let at = child(); diff --git a/crates/domain/or-worlds/tests/flushed/mod.rs b/crates/domain/or-world-registry/tests/flushed/mod.rs similarity index 100% rename from crates/domain/or-worlds/tests/flushed/mod.rs rename to crates/domain/or-world-registry/tests/flushed/mod.rs diff --git a/crates/domain/or-worlds/tests/gta5_edits_are_written_at_a_flush.rs b/crates/domain/or-world-registry/tests/gta5_edits_are_written_at_a_flush.rs similarity index 100% rename from crates/domain/or-worlds/tests/gta5_edits_are_written_at_a_flush.rs rename to crates/domain/or-world-registry/tests/gta5_edits_are_written_at_a_flush.rs diff --git a/crates/domain/or-worlds/tests/gta5_edits_with_a_schema_snapshot.rs b/crates/domain/or-world-registry/tests/gta5_edits_with_a_schema_snapshot.rs similarity index 100% rename from crates/domain/or-worlds/tests/gta5_edits_with_a_schema_snapshot.rs rename to crates/domain/or-world-registry/tests/gta5_edits_with_a_schema_snapshot.rs diff --git a/crates/domain/or-worlds/tests/gta5_passes_the_kit.rs b/crates/domain/or-world-registry/tests/gta5_passes_the_kit.rs similarity index 100% rename from crates/domain/or-worlds/tests/gta5_passes_the_kit.rs rename to crates/domain/or-world-registry/tests/gta5_passes_the_kit.rs diff --git a/crates/domain/or-world/tests/the_core_names_no_game.rs b/crates/domain/or-world/tests/the_core_names_no_game.rs index 034862352..9847d1d9a 100644 --- a/crates/domain/or-world/tests/the_core_names_no_game.rs +++ b/crates/domain/or-world/tests/the_core_names_no_game.rs @@ -303,7 +303,7 @@ fn faults_of_the_adapters(root: &Path) -> Vec { .flatten() .flatten() .filter_map(|entry| entry.file_name().into_string().ok()) - .filter(|name| name.starts_with("or-world-")) + .filter(|name| name.starts_with("or-world-") && name != "or-world-registry") .collect(); adapters.sort(); // ⚠ A crate of the domain that an adapter leaned on would be free to lean on the adapter no diff --git a/crates/foundation/or-transport/README.md b/crates/foundation/or-transport/README.md index 5de3ae421..3d4fc6f16 100644 --- a/crates/foundation/or-transport/README.md +++ b/crates/foundation/or-transport/README.md @@ -2,7 +2,7 @@ The playback clock the editor's previews share: play, loop and scrub. -The particle preview and the animation preview both run on it, which is why neither `or-anim` nor `or-particle` depends on the other. +The particle preview and the animation preview both run on it, which is why neither `or-anim` nor `or-particle-model` depends on the other. [src/clock.rs](src/clock.rs) is the frame clock, the game clock and the random source of what moves from frame to frame, which a shots run fixes so that two runs draw the same frames. diff --git a/crates/runtime/or-anim/Cargo.toml b/crates/runtime/or-anim/Cargo.toml index 7c29d9346..fc047d358 100644 --- a/crates/runtime/or-anim/Cargo.toml +++ b/crates/runtime/or-anim/Cargo.toml @@ -10,7 +10,7 @@ description = "Skeletal animation runtime for RAGE clips: forward kinematics, po [dependencies] # The playback clock, and nothing else from that direction. This used to be -# `or-particle`, which meant animation depended on the particle rule hierarchy +# `or-particle-model`, which meant animation depended on the particle rule hierarchy # to know what time it was. or-transport.workspace = true # The io layer, and only that: this reads formats, it never mounts an diff --git a/crates/runtime/or-anim/README.md b/crates/runtime/or-anim/README.md index 71479f939..8ec81b758 100644 --- a/crates/runtime/or-anim/README.md +++ b/crates/runtime/or-anim/README.md @@ -6,7 +6,7 @@ It takes a decoded `.ycd` to a moving figure with no GPU, so it is tested anywhe ⚠ Skinning is `world * inverse_bind`, in that order; the reverse explodes the mesh. -- Layer: runtime. It does not depend on `or-particle`: the previews share the clock in `or-transport`. +- Layer: runtime. It does not depend on `or-particle-model`: the previews share the clock in `or-transport`. - Start at [src/lib.rs](src/lib.rs). - Tests: `just test-crate or-anim`. - How the preview plays a clip: [Animation_Preview.md](../../../docs/features/Animation_Preview.md). diff --git a/crates/runtime/or-renderer/Cargo.toml b/crates/runtime/or-renderer/Cargo.toml index 12ee155d0..cd0c4fc33 100644 --- a/crates/runtime/or-renderer/Cargo.toml +++ b/crates/runtime/or-renderer/Cargo.toml @@ -48,7 +48,7 @@ rayon.workspace = true # The particle rule types the material binder reads: pure data, since the # renderer never opens a file. -or-particle.workspace = true +or-particle-model.workspace = true # The scene a drawable extracts to, which `game_shaders::drawable` turns into the surfaces the game's passes draw. or-interchange.workspace = true # A texture of a scene is a PNG. diff --git a/crates/runtime/or-renderer/src/particles.rs b/crates/runtime/or-renderer/src/particles.rs index ea7733ef9..5af3a2d0e 100644 --- a/crates/runtime/or-renderer/src/particles.rs +++ b/crates/runtime/or-renderer/src/particles.rs @@ -41,8 +41,8 @@ impl ParticleBlendMode { Self::Screen, ]; - pub fn from_core(mode: or_particle::rules::BlendMode) -> Self { - use or_particle::rules::BlendMode as B; + pub fn from_core(mode: or_particle_model::rules::BlendMode) -> Self { + use or_particle_model::rules::BlendMode as B; match mode { B::Alpha => Self::Alpha, B::Additive => Self::Additive, diff --git a/crates/runtime/or-simulation/Cargo.toml b/crates/runtime/or-simulation/Cargo.toml index cc47a199c..8e08f8478 100644 --- a/crates/runtime/or-simulation/Cargo.toml +++ b/crates/runtime/or-simulation/Cargo.toml @@ -10,7 +10,7 @@ description = "Particle simulation engine for RAGE engine particle effects" [dependencies] or-transport.workspace = true -or-particle.workspace = true +or-particle-model.workspace = true or-io.workspace = true tracing.workspace = true glam.workspace = true diff --git a/crates/runtime/or-simulation/src/behaviour.rs b/crates/runtime/or-simulation/src/behaviour.rs index 3bd5305e7..325879c0e 100644 --- a/crates/runtime/or-simulation/src/behaviour.rs +++ b/crates/runtime/or-simulation/src/behaviour.rs @@ -2,7 +2,7 @@ use crate::point::PointBuffer; use crate::random::RandomTable; use crate::random_table::PtxRandomTable; use glam::{Mat4, Vec3}; -use or_particle::rules::EvolutionList; +use or_particle_model::rules::EvolutionList; #[derive(Debug, Clone, Copy, Default)] pub struct AttractorGeometry { pub pos: Vec3, @@ -112,7 +112,7 @@ pub struct BehaviourParams<'a> { impl<'a> BehaviourParams<'a> { pub fn query_kpd( &self, - kpd: &Option, + kpd: &Option, time: f32, default_value: glam::Vec4, ) -> glam::Vec4 { @@ -153,7 +153,7 @@ impl<'a> BehaviourParams<'a> { pub fn query_kpd_at( &self, - kpd: &Option, + kpd: &Option, clock: crate::kfp::KfpClock, point_life: f32, default_value: glam::Vec4, @@ -166,7 +166,7 @@ impl<'a> BehaviourParams<'a> { &self, buf: &crate::point::PointBuffer, idx: usize, - kpd: &Option, + kpd: &Option, time: f32, default_value: glam::Vec4, ) -> glam::Vec4 { @@ -199,7 +199,7 @@ impl<'a> BehaviourParams<'a> { &self, buf: &crate::point::PointBuffer, idx: usize, - kpd: &Option, + kpd: &Option, clock: crate::kfp::KfpClock, point_life: f32, default_value: glam::Vec4, diff --git a/crates/runtime/or-simulation/src/behaviours/acceleration.rs b/crates/runtime/or-simulation/src/behaviours/acceleration.rs index df1b4d5d1..9b01f25fd 100644 --- a/crates/runtime/or-simulation/src/behaviours/acceleration.rs +++ b/crates/runtime/or-simulation/src/behaviours/acceleration.rs @@ -3,7 +3,7 @@ use crate::kfp::{bias_value_kpd, KfpClock}; use crate::point::PointBuffer; use crate::reference_space; use glam::{Vec3, Vec4}; -use or_particle::behaviour::AccelerationBehaviour; +use or_particle_model::behaviour::AccelerationBehaviour; #[derive(Debug, Clone)] pub struct Acceleration { pub data: AccelerationBehaviour, diff --git a/crates/runtime/or-simulation/src/behaviours/age.rs b/crates/runtime/or-simulation/src/behaviours/age.rs index e7af81d88..a6e29b3ae 100644 --- a/crates/runtime/or-simulation/src/behaviours/age.rs +++ b/crates/runtime/or-simulation/src/behaviours/age.rs @@ -1,6 +1,6 @@ use crate::behaviour::{order, BehaviourImpl, BehaviourParams}; use crate::point::{PointBuffer, PointFlags}; -use or_particle::behaviour::AgeBehaviour; +use or_particle_model::behaviour::AgeBehaviour; #[derive(Debug, Clone)] pub struct Age { pub data: AgeBehaviour, diff --git a/crates/runtime/or-simulation/src/behaviours/animate_texture.rs b/crates/runtime/or-simulation/src/behaviours/animate_texture.rs index 5918b24ad..06ddbdee7 100644 --- a/crates/runtime/or-simulation/src/behaviours/animate_texture.rs +++ b/crates/runtime/or-simulation/src/behaviours/animate_texture.rs @@ -3,7 +3,7 @@ use crate::kfp::{key_time_for_mode, KeyframeMode as SimKeyframeMode}; use crate::point::PointBuffer; use glam::{Vec2, Vec4}; use or_io::gta5::particle::{AnimTexLoopMode, KeyframeMode}; -use or_particle::behaviour::AnimateTextureBehaviour; +use or_particle_model::behaviour::AnimateTextureBehaviour; #[derive(Debug, Clone)] pub struct AnimateTexture { pub data: AnimateTextureBehaviour, @@ -172,7 +172,7 @@ mod tests { use or_io::decl::Gen8; use or_io::gta5::particle::RawKeyframeEntry; use or_io::gta5::particle::{PtxEffectRule, PtxParticleRule}; - use or_particle::keyframe::KeyframePropData; + use or_particle_model::keyframe::KeyframePropData; fn make_buf() -> PointBuffer { let mut buf = PointBuffer::default(); let _ = buf.spawn(0); diff --git a/crates/runtime/or-simulation/src/behaviours/attractor.rs b/crates/runtime/or-simulation/src/behaviours/attractor.rs index 14bda09eb..cf038f55f 100644 --- a/crates/runtime/or-simulation/src/behaviours/attractor.rs +++ b/crates/runtime/or-simulation/src/behaviours/attractor.rs @@ -2,7 +2,7 @@ use crate::behaviour::{order, BehaviourImpl, BehaviourParams}; use crate::kfp::bias_value_kpd; use crate::point::{PointBuffer, PointFlags}; use glam::{Vec3, Vec4}; -use or_particle::behaviour::AttractorBehaviour; +use or_particle_model::behaviour::AttractorBehaviour; #[derive(Debug, Clone)] pub struct Attractor { pub data: AttractorBehaviour, diff --git a/crates/runtime/or-simulation/src/behaviours/collision.rs b/crates/runtime/or-simulation/src/behaviours/collision.rs index 761a2430c..015586dac 100644 --- a/crates/runtime/or-simulation/src/behaviours/collision.rs +++ b/crates/runtime/or-simulation/src/behaviours/collision.rs @@ -2,7 +2,7 @@ use crate::behaviour::{order, BehaviourImpl, BehaviourParams}; use crate::collision::Hit; use crate::point::{PointBuffer, PointFlags}; use glam::{Vec3, Vec4}; -use or_particle::behaviour::CollisionBehaviour; +use or_particle_model::behaviour::CollisionBehaviour; fn apply_bounce_variance( reflected: Vec3, coln_normal: Vec3, diff --git a/crates/runtime/or-simulation/src/behaviours/colour.rs b/crates/runtime/or-simulation/src/behaviours/colour.rs index a7fe2173f..f026f1ba8 100644 --- a/crates/runtime/or-simulation/src/behaviours/colour.rs +++ b/crates/runtime/or-simulation/src/behaviours/colour.rs @@ -2,7 +2,7 @@ use crate::behaviour::{order, BehaviourImpl, BehaviourParams}; use crate::kfp::{bias_value_kpd, key_time_for_mode, KeyframeMode}; use crate::point::PointBuffer; use glam::Vec4; -use or_particle::behaviour::ColourBehaviour; +use or_particle_model::behaviour::ColourBehaviour; #[derive(Debug, Clone)] pub struct Colour { pub data: ColourBehaviour, diff --git a/crates/runtime/or-simulation/src/behaviours/dampening.rs b/crates/runtime/or-simulation/src/behaviours/dampening.rs index c220cfddb..7a4a9547a 100644 --- a/crates/runtime/or-simulation/src/behaviours/dampening.rs +++ b/crates/runtime/or-simulation/src/behaviours/dampening.rs @@ -3,7 +3,7 @@ use crate::kfp::{bias_value_kpd, KfpClock}; use crate::point::{PointBuffer, PointFlags}; use glam::{Mat3, Vec3, Vec4}; use or_io::gta5::particle::ReferenceSpace; -use or_particle::behaviour::DampeningBehaviour; +use or_particle_model::behaviour::DampeningBehaviour; #[derive(Debug, Clone)] pub struct Dampening { pub data: DampeningBehaviour, diff --git a/crates/runtime/or-simulation/src/behaviours/decal_pool.rs b/crates/runtime/or-simulation/src/behaviours/decal_pool.rs index ad029c6f6..6aa7a338b 100644 --- a/crates/runtime/or-simulation/src/behaviours/decal_pool.rs +++ b/crates/runtime/or-simulation/src/behaviours/decal_pool.rs @@ -1,7 +1,7 @@ use crate::behaviour::{order, BehaviourImpl, BehaviourParams, EmitSink}; use crate::point::{PointBuffer, PointFlags}; use glam::{Vec3, Vec4}; -use or_particle::behaviour::DecalPoolBehaviour; +use or_particle_model::behaviour::DecalPoolBehaviour; use std::sync::Mutex; #[derive(Debug, Clone, Copy, PartialEq)] pub struct DecalPoolEmit { diff --git a/crates/runtime/or-simulation/src/behaviours/draw_decal.rs b/crates/runtime/or-simulation/src/behaviours/draw_decal.rs index a3e72529d..feeac7c9b 100644 --- a/crates/runtime/or-simulation/src/behaviours/draw_decal.rs +++ b/crates/runtime/or-simulation/src/behaviours/draw_decal.rs @@ -1,7 +1,7 @@ use crate::behaviour::{order, BehaviourImpl, BehaviourParams}; use crate::point::PointBuffer; use glam::Vec4; -use or_particle::behaviour::DecalBehaviour; +use or_particle_model::behaviour::DecalBehaviour; #[derive(Debug, Clone)] pub struct DrawDecal { pub data: DecalBehaviour, diff --git a/crates/runtime/or-simulation/src/behaviours/draw_fog_volume.rs b/crates/runtime/or-simulation/src/behaviours/draw_fog_volume.rs index 65a895dc3..58ba99410 100644 --- a/crates/runtime/or-simulation/src/behaviours/draw_fog_volume.rs +++ b/crates/runtime/or-simulation/src/behaviours/draw_fog_volume.rs @@ -2,7 +2,7 @@ use crate::behaviour::{order, BehaviourImpl, BehaviourParams}; use crate::point::PointBuffer; use crate::sinks::{FogLighting, FogVolumeInfo}; use glam::{Vec3, Vec4}; -use or_particle::behaviour::FogVolumeBehaviour; +use or_particle_model::behaviour::FogVolumeBehaviour; #[derive(Debug, Clone)] pub struct DrawFogVolume { pub data: FogVolumeBehaviour, diff --git a/crates/runtime/or-simulation/src/behaviours/draw_light.rs b/crates/runtime/or-simulation/src/behaviours/draw_light.rs index ef2d14176..04a2678c5 100644 --- a/crates/runtime/or-simulation/src/behaviours/draw_light.rs +++ b/crates/runtime/or-simulation/src/behaviours/draw_light.rs @@ -1,7 +1,7 @@ use crate::behaviour::{order, BehaviourImpl, BehaviourParams}; use crate::point::PointBuffer; use glam::Vec4; -use or_particle::behaviour::LightBehaviour; +use or_particle_model::behaviour::LightBehaviour; #[derive(Debug, Clone)] pub struct DrawLight { pub data: LightBehaviour, @@ -106,7 +106,7 @@ impl DrawLight { } fn sample_kfp_scalar( - kfp: &Option, + kfp: &Option, life_ratio: f32, default: f32, ) -> f32 { @@ -114,7 +114,7 @@ fn sample_kfp_scalar( } fn sample_kfp_rgb( - kfp: &Option, + kfp: &Option, life_ratio: f32, default: [f32; 3], ) -> [f32; 3] { @@ -130,8 +130,8 @@ fn sample_kfp_rgb( mod tests { use super::*; use or_io::gta5::particle::RawKeyframeEntry; - use or_particle::behaviour::LightBehaviour; - use or_particle::keyframe::KeyframePropData; + use or_particle_model::behaviour::LightBehaviour; + use or_particle_model::keyframe::KeyframePropData; fn make_curve(values: &[(f32, [f32; 4])]) -> KeyframePropData { let mut entries = Vec::with_capacity(values.len()); for i in 0..values.len() { diff --git a/crates/runtime/or-simulation/src/behaviours/draw_model.rs b/crates/runtime/or-simulation/src/behaviours/draw_model.rs index 74eaec155..c7d819851 100644 --- a/crates/runtime/or-simulation/src/behaviours/draw_model.rs +++ b/crates/runtime/or-simulation/src/behaviours/draw_model.rs @@ -1,6 +1,6 @@ use crate::behaviour::{order, BehaviourImpl, BehaviourParams}; use crate::point::{PointBuffer, PointFlags}; -use or_particle::behaviour::DrawModelBehaviour; +use or_particle_model::behaviour::DrawModelBehaviour; #[derive(Debug, Clone)] pub struct DrawModel { pub data: DrawModelBehaviour, diff --git a/crates/runtime/or-simulation/src/behaviours/draw_sprite.rs b/crates/runtime/or-simulation/src/behaviours/draw_sprite.rs index d9858f08a..458692156 100644 --- a/crates/runtime/or-simulation/src/behaviours/draw_sprite.rs +++ b/crates/runtime/or-simulation/src/behaviours/draw_sprite.rs @@ -1,7 +1,7 @@ use crate::behaviour::{order, BehaviourImpl, BehaviourParams}; use crate::point::{PointBuffer, PointFlags}; use or_io::gta5::particle::AlignmentMode; -use or_particle::behaviour::DrawSpriteBehaviour; +use or_particle_model::behaviour::DrawSpriteBehaviour; #[derive(Debug, Clone)] pub struct DrawSprite { pub data: DrawSpriteBehaviour, diff --git a/crates/runtime/or-simulation/src/behaviours/draw_trail.rs b/crates/runtime/or-simulation/src/behaviours/draw_trail.rs index b09a5200a..496dfbd51 100644 --- a/crates/runtime/or-simulation/src/behaviours/draw_trail.rs +++ b/crates/runtime/or-simulation/src/behaviours/draw_trail.rs @@ -1,6 +1,6 @@ use crate::behaviour::{order, BehaviourImpl, BehaviourParams}; use crate::point::{PointBuffer, PointFlags}; -use or_particle::behaviour::DrawTrailBehaviour; +use or_particle_model::behaviour::DrawTrailBehaviour; #[derive(Debug, Clone)] pub struct DrawTrail { pub data: DrawTrailBehaviour, diff --git a/crates/runtime/or-simulation/src/behaviours/fade.rs b/crates/runtime/or-simulation/src/behaviours/fade.rs index 797b24e31..6f8200c23 100644 --- a/crates/runtime/or-simulation/src/behaviours/fade.rs +++ b/crates/runtime/or-simulation/src/behaviours/fade.rs @@ -1,6 +1,6 @@ use crate::behaviour::{order, BehaviourImpl, BehaviourParams}; use crate::point::PointBuffer; -use or_particle::behaviour::{FadeInBehaviour, FadeOutBehaviour}; +use or_particle_model::behaviour::{FadeInBehaviour, FadeOutBehaviour}; #[derive(Debug, Clone)] pub struct FadeIn { pub data: FadeInBehaviour, diff --git a/crates/runtime/or-simulation/src/behaviours/gravity.rs b/crates/runtime/or-simulation/src/behaviours/gravity.rs index 2b63bde2a..8f3a0fdbe 100644 --- a/crates/runtime/or-simulation/src/behaviours/gravity.rs +++ b/crates/runtime/or-simulation/src/behaviours/gravity.rs @@ -1,7 +1,7 @@ use crate::behaviour::{order, BehaviourImpl, BehaviourParams}; use crate::point::{PointBuffer, PointFlags}; use glam::Vec3; -use or_particle::behaviour::GravityBehaviour; +use or_particle_model::behaviour::GravityBehaviour; #[derive(Debug, Clone)] pub struct Gravity { pub data: GravityBehaviour, diff --git a/crates/runtime/or-simulation/src/behaviours/liquid.rs b/crates/runtime/or-simulation/src/behaviours/liquid.rs index 3c9dee2e3..b6d2c7ab2 100644 --- a/crates/runtime/or-simulation/src/behaviours/liquid.rs +++ b/crates/runtime/or-simulation/src/behaviours/liquid.rs @@ -1,7 +1,7 @@ use crate::behaviour::{order, BehaviourImpl, BehaviourParams, EmitSink}; use crate::point::{PointBuffer, PointFlags}; use glam::{Vec3, Vec4}; -use or_particle::behaviour::LiquidBehaviour; +use or_particle_model::behaviour::LiquidBehaviour; use std::sync::Mutex; #[derive(Debug, Clone, Copy, PartialEq)] pub struct LiquidEmit { diff --git a/crates/runtime/or-simulation/src/behaviours/matrix_weight.rs b/crates/runtime/or-simulation/src/behaviours/matrix_weight.rs index b31198377..ae786fa19 100644 --- a/crates/runtime/or-simulation/src/behaviours/matrix_weight.rs +++ b/crates/runtime/or-simulation/src/behaviours/matrix_weight.rs @@ -3,7 +3,7 @@ use crate::kfp::{bias_value_kpd, KfpClock}; use crate::point::PointBuffer; use glam::{Vec3, Vec4}; use or_io::gta5::particle::ReferenceSpace; -use or_particle::behaviour::MatrixWeightBehaviour; +use or_particle_model::behaviour::MatrixWeightBehaviour; #[derive(Debug, Clone)] pub struct MatrixWeight { pub data: MatrixWeightBehaviour, diff --git a/crates/runtime/or-simulation/src/behaviours/mod.rs b/crates/runtime/or-simulation/src/behaviours/mod.rs index dc32fb371..cd4554f31 100644 --- a/crates/runtime/or-simulation/src/behaviours/mod.rs +++ b/crates/runtime/or-simulation/src/behaviours/mod.rs @@ -1,5 +1,5 @@ use crate::behaviour::{BehaviourImpl, DrawKind}; -use or_particle::behaviour::Behaviour; +use or_particle_model::behaviour::Behaviour; use std::collections::HashSet; use std::sync::Mutex; mod acceleration; @@ -58,8 +58,9 @@ pub use water::{ConstantWaterField, WaterField}; pub use wind::Wind; pub use wind_field::{ConstantWindField, WindField}; pub use zculling::{ZCullMode, ZCulling}; -const BEHAVIOUR_HASH_FIRE: u32 = or_particle::rage::hash::string_hash(b"ptxu_Fire"); -const BEHAVIOUR_HASH_DECAL_TRAIL: u32 = or_particle::rage::hash::string_hash(b"ptxu_DecalTrail"); +const BEHAVIOUR_HASH_FIRE: u32 = or_particle_model::rage::hash::string_hash(b"ptxu_Fire"); +const BEHAVIOUR_HASH_DECAL_TRAIL: u32 = + or_particle_model::rage::hash::string_hash(b"ptxu_DecalTrail"); #[derive(Debug, Clone)] struct FireStub; impl BehaviourImpl for FireStub { diff --git a/crates/runtime/or-simulation/src/behaviours/noise.rs b/crates/runtime/or-simulation/src/behaviours/noise.rs index 4dd50134c..5614fa34b 100644 --- a/crates/runtime/or-simulation/src/behaviours/noise.rs +++ b/crates/runtime/or-simulation/src/behaviours/noise.rs @@ -2,7 +2,7 @@ use crate::behaviour::{order, BehaviourImpl, BehaviourParams}; use crate::point::{PointBuffer, PointFlags}; use glam::{Mat3, Vec3, Vec4}; use or_io::gta5::particle::ReferenceSpace; -use or_particle::behaviour::NoiseBehaviour; +use or_particle_model::behaviour::NoiseBehaviour; #[derive(Debug, Clone)] pub struct Noise { pub data: NoiseBehaviour, diff --git a/crates/runtime/or-simulation/src/behaviours/pause.rs b/crates/runtime/or-simulation/src/behaviours/pause.rs index 6111acb1e..ad61494ae 100644 --- a/crates/runtime/or-simulation/src/behaviours/pause.rs +++ b/crates/runtime/or-simulation/src/behaviours/pause.rs @@ -1,6 +1,6 @@ use crate::behaviour::{order, BehaviourImpl, BehaviourParams}; use crate::point::{PointBuffer, PointFlags}; -use or_particle::behaviour::PauseBehaviour; +use or_particle_model::behaviour::PauseBehaviour; #[derive(Debug, Clone)] pub struct Pause { pub data: PauseBehaviour, diff --git a/crates/runtime/or-simulation/src/behaviours/river.rs b/crates/runtime/or-simulation/src/behaviours/river.rs index c186d1a00..e546a0f8f 100644 --- a/crates/runtime/or-simulation/src/behaviours/river.rs +++ b/crates/runtime/or-simulation/src/behaviours/river.rs @@ -1,7 +1,7 @@ use crate::behaviour::{order, BehaviourImpl, BehaviourParams}; use crate::point::PointBuffer; use glam::Vec3; -use or_particle::behaviour::RiverBehaviour; +use or_particle_model::behaviour::RiverBehaviour; pub trait RiverField: std::fmt::Debug { fn velocity_at(&self, pos: Vec3) -> Vec3; } diff --git a/crates/runtime/or-simulation/src/behaviours/rotation.rs b/crates/runtime/or-simulation/src/behaviours/rotation.rs index afac49bac..15bc63e6e 100644 --- a/crates/runtime/or-simulation/src/behaviours/rotation.rs +++ b/crates/runtime/or-simulation/src/behaviours/rotation.rs @@ -2,7 +2,7 @@ use crate::behaviour::{order, BehaviourImpl, BehaviourParams, DrawKind}; use crate::kfp::bias_value_kpd; use crate::point::PointBuffer; use glam::{Quat, Vec3, Vec4}; -use or_particle::behaviour::{RotationBehaviour, RotationSpeedBehaviour}; +use or_particle_model::behaviour::{RotationBehaviour, RotationSpeedBehaviour}; // Sprites/trails store spin radians in quat.x (not a real quaternion); models use full orientation. fn rotation_quat(draw_kind: DrawKind, a: Vec3, rotate_init_angle_axes: bool) -> Quat { diff --git a/crates/runtime/or-simulation/src/behaviours/size.rs b/crates/runtime/or-simulation/src/behaviours/size.rs index 1b687fdef..18d541ca6 100644 --- a/crates/runtime/or-simulation/src/behaviours/size.rs +++ b/crates/runtime/or-simulation/src/behaviours/size.rs @@ -2,7 +2,7 @@ use crate::behaviour::{order, BehaviourImpl, BehaviourParams, DrawKind}; use crate::kfp::{bias_value_kpd, key_time_for_mode, KeyframeMode, KfpClock}; use crate::point::PointBuffer; use glam::Vec4; -use or_particle::behaviour::SizeBehaviour; +use or_particle_model::behaviour::SizeBehaviour; #[derive(Debug, Clone)] pub struct Size { pub data: SizeBehaviour, diff --git a/crates/runtime/or-simulation/src/behaviours/velocity.rs b/crates/runtime/or-simulation/src/behaviours/velocity.rs index 7a060378f..fe600839f 100644 --- a/crates/runtime/or-simulation/src/behaviours/velocity.rs +++ b/crates/runtime/or-simulation/src/behaviours/velocity.rs @@ -1,6 +1,6 @@ use crate::behaviour::{order, BehaviourImpl, BehaviourParams}; use crate::point::PointBuffer; -use or_particle::behaviour::VelocityBehaviour; +use or_particle_model::behaviour::VelocityBehaviour; #[derive(Debug, Clone)] pub struct Velocity { pub data: VelocityBehaviour, diff --git a/crates/runtime/or-simulation/src/behaviours/wind.rs b/crates/runtime/or-simulation/src/behaviours/wind.rs index 9d7093f71..833aef409 100644 --- a/crates/runtime/or-simulation/src/behaviours/wind.rs +++ b/crates/runtime/or-simulation/src/behaviours/wind.rs @@ -2,7 +2,7 @@ use crate::behaviour::{order, BehaviourImpl, BehaviourParams}; use crate::kfp::bias_value_kpd; use crate::point::{PointBuffer, PointFlags}; use glam::Vec4; -use or_particle::behaviour::WindBehaviour; +use or_particle_model::behaviour::WindBehaviour; #[derive(Debug, Clone)] pub struct Wind { pub data: WindBehaviour, diff --git a/crates/runtime/or-simulation/src/behaviours/zculling.rs b/crates/runtime/or-simulation/src/behaviours/zculling.rs index 14de1d26f..9f14aff2d 100644 --- a/crates/runtime/or-simulation/src/behaviours/zculling.rs +++ b/crates/runtime/or-simulation/src/behaviours/zculling.rs @@ -2,7 +2,7 @@ use crate::behaviour::{order, BehaviourImpl, BehaviourParams}; use crate::point::{PointBuffer, PointFlags}; use glam::Vec4; use or_io::gta5::particle::ReferenceSpace; -use or_particle::behaviour::ZCullingBehaviour; +use or_particle_model::behaviour::ZCullingBehaviour; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum ZCullMode { CullUnder, diff --git a/crates/runtime/or-simulation/src/build.rs b/crates/runtime/or-simulation/src/build.rs index 2ee3d36a5..3c43baea6 100644 --- a/crates/runtime/or-simulation/src/build.rs +++ b/crates/runtime/or-simulation/src/build.rs @@ -4,9 +4,9 @@ use or_io::decl::{Gen8, OwnedOrKeyed}; use or_io::gta5::particle::{ PtxEffectRule, PtxEmitterRule, PtxEvent, PtxEventEmitter, PtxFxList, PtxParticleRule, }; -use or_particle::keyframe::constant; -use or_particle::list; -use or_particle::rules::EvolutionList; +use or_particle_model::keyframe::constant; +use or_particle_model::list; +use or_particle_model::rules::EvolutionList; #[derive(Debug, Clone)] pub enum PreviewTarget { Effect(usize), diff --git a/crates/runtime/or-simulation/src/domain_sample.rs b/crates/runtime/or-simulation/src/domain_sample.rs index aaaf7a6ec..dc68a9eaa 100644 --- a/crates/runtime/or-simulation/src/domain_sample.rs +++ b/crates/runtime/or-simulation/src/domain_sample.rs @@ -2,7 +2,7 @@ use crate::kfp::query_kfp; use crate::random::RandomTable; use glam::{Mat4, Quat, Vec3, Vec4}; use or_io::gta5::particle::PtxDomain; -use or_particle::domain::PtxDomainShape; +use or_particle_model::domain::PtxDomainShape; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum DomainSlot { Creation, diff --git a/crates/runtime/or-simulation/src/effect_inst.rs b/crates/runtime/or-simulation/src/effect_inst.rs index 489b7bfe7..eb6db3df8 100644 --- a/crates/runtime/or-simulation/src/effect_inst.rs +++ b/crates/runtime/or-simulation/src/effect_inst.rs @@ -6,8 +6,8 @@ use crate::random_table::PtxRandomTable; use glam::{Mat4, Vec3}; use or_io::decl::Gen8; use or_io::gta5::particle::PtxEffectRule; -use or_particle::list; -use or_particle::rules::EvolutionList; +use or_particle_model::list; +use or_particle_model::rules::EvolutionList; pub struct EffectInst { /// ⚠ Its timeline is dropped: the emitters hold what its events play. pub rule: PtxEffectRule, diff --git a/crates/runtime/or-simulation/src/emitter_inst.rs b/crates/runtime/or-simulation/src/emitter_inst.rs index b89da01e7..0dd7b01b3 100644 --- a/crates/runtime/or-simulation/src/emitter_inst.rs +++ b/crates/runtime/or-simulation/src/emitter_inst.rs @@ -10,8 +10,8 @@ use or_io::gta5::particle::{ PtxDomain, PtxEffectSpawner, PtxEmitterRule, PtxEventEmitter, PtxParticleRule, PtxSpawnedEffectScalars, ShaderVar, }; -use or_particle::behaviour::Behaviour; -use or_particle::list; +use or_particle_model::behaviour::Behaviour; +use or_particle_model::list; #[derive(Debug, Clone, Copy)] pub struct SpawnedScalars { pub duration_scalar: f32, @@ -229,7 +229,7 @@ pub struct EmitterInst { pub max_particles_soft_cap: usize, pub next_rand_index: u8, pub pending_spawns: Vec, - pub evolution_list: Option, + pub evolution_list: Option, pub evo_values: Vec, pub prev_world_pos: Vec3, pub has_prev_world_pos: bool, @@ -279,7 +279,7 @@ impl EmitterInst { self.has_fired_one_shot = false; } - pub fn set_evolution_list(&mut self, list: Option) { + pub fn set_evolution_list(&mut self, list: Option) { for v in self.evo_values.iter_mut() { *v = 0.0; } @@ -913,7 +913,7 @@ pub struct BehaviourParamsTemplate<'a> { pub wind_velocity: Vec3, pub random: &'a RandomTable, pub ptx_random_table: &'a crate::random_table::PtxRandomTable, - pub evo_list: Option<&'a or_particle::rules::EvolutionList>, + pub evo_list: Option<&'a or_particle_model::rules::EvolutionList>, pub evo_values: &'a [f32], pub effect_rule: &'a or_io::gta5::particle::PtxEffectRule, pub camera_pos: Vec3, diff --git a/crates/runtime/or-simulation/src/kfp.rs b/crates/runtime/or-simulation/src/kfp.rs index fee3d6cff..7e232c76f 100644 --- a/crates/runtime/or-simulation/src/kfp.rs +++ b/crates/runtime/or-simulation/src/kfp.rs @@ -4,9 +4,9 @@ use or_io::gta5::particle::RawKeyframeEntry; use or_io::gta5::particle::{ PtxBiasLink, PtxEffectRule, PtxEmitterRule, PtxKeyframeEntry, PtxKeyframeProp, ShaderVar, }; -use or_particle::behaviour::Behaviour; -use or_particle::keyframe::KeyframePropData; -use or_particle::rules::{EvolutionList, EvolvedKeyframeProp}; +use or_particle_model::behaviour::Behaviour; +use or_particle_model::keyframe::KeyframePropData; +use or_particle_model::rules::{EvolutionList, EvolvedKeyframeProp}; pub const MAX_EVOLUTIONS: usize = 8; pub mod evo_blend { pub const AVERAGE: u32 = 0; @@ -489,8 +489,12 @@ mod tests { assert!((v_past - 10.0).abs() < 1e-5); } - fn make_evolved(idx: i32, value: f32, is_lod: bool) -> or_particle::rules::EvolvedKeyframe { - or_particle::rules::EvolvedKeyframe { + fn make_evolved( + idx: i32, + value: f32, + is_lod: bool, + ) -> or_particle_model::rules::EvolvedKeyframe { + or_particle_model::rules::EvolvedKeyframe { evolution_index: idx, is_lod_evolution: is_lod, entries: vec![RawKeyframeEntry { diff --git a/crates/runtime/or-simulation/src/manager.rs b/crates/runtime/or-simulation/src/manager.rs index 101d4aa33..c9a035604 100644 --- a/crates/runtime/or-simulation/src/manager.rs +++ b/crates/runtime/or-simulation/src/manager.rs @@ -12,7 +12,7 @@ use crate::time::SimClock; use glam::{Mat4, Vec3}; use or_io::decl::OwnedOrKeyed; use or_io::gta5::particle::PtxFxList; -use or_particle::list; +use or_particle_model::list; use std::sync::Arc; #[derive(Debug, Clone)] pub struct SnapshotFrame { @@ -293,7 +293,7 @@ impl PtfxManager { effect.high_quality_evo = self.env.high_quality_evo; crate::zcull_spawner::give(&mut effect, &self.zcull_spawners); let r = &self.random; - let seed = or_particle::list::code(&effect.rule.name).wrapping_add(0xC0FF_EE01); + let seed = or_particle_model::list::code(&effect.rule.name).wrapping_add(0xC0FF_EE01); let bx = r.value(seed) * 2.0 - 1.0; let by = r.value(seed.wrapping_add(1)) * 2.0 - 1.0; let bz = r.value(seed.wrapping_add(2)) * 2.0 - 1.0; @@ -434,7 +434,7 @@ impl PtfxManager { self.spawned_effects.clear(); if let Some(asset) = self.asset_snapshot.as_ref() { for child_snap in &frame.spawned { - let Some(eff_idx) = or_particle::list::effect_rules(asset) + let Some(eff_idx) = or_particle_model::list::effect_rules(asset) .position(|e| e.name == child_snap.effect_rule_name) else { continue; @@ -567,11 +567,11 @@ impl PtfxManager { break; } if let Some(asset) = self.asset_snapshot.as_ref() { - if let Some(eff_idx) = or_particle::list::effect_rules(asset) + if let Some(eff_idx) = or_particle_model::list::effect_rules(asset) .position(|e| e.name == req.effect_rule_name) { let rule_hash = - or_particle::rage::hash::string_hash(req.effect_rule_name.as_bytes()); + or_particle_model::rage::hash::string_hash(req.effect_rule_name.as_bytes()); let world_pos = req.matrix.w_axis.truncate(); if self.history_check_radius > 0.0 && self diff --git a/crates/runtime/or-simulation/src/reference_space.rs b/crates/runtime/or-simulation/src/reference_space.rs index 27a61288a..78ce871cd 100644 --- a/crates/runtime/or-simulation/src/reference_space.rs +++ b/crates/runtime/or-simulation/src/reference_space.rs @@ -3,7 +3,7 @@ use glam::{Mat3, Vec3}; use or_io::gta5::particle::ReferenceSpace; #[inline] #[allow(dead_code)] -pub fn to_glam(v: or_particle::domain::Vec3) -> Vec3 { +pub fn to_glam(v: or_particle_model::domain::Vec3) -> Vec3 { Vec3::new(v.x, v.y, v.z) } diff --git a/crates/runtime/or-simulation/tests/camera_facing_check.rs b/crates/runtime/or-simulation/tests/camera_facing_check.rs index b482ee54c..357b6f456 100644 --- a/crates/runtime/or-simulation/tests/camera_facing_check.rs +++ b/crates/runtime/or-simulation/tests/camera_facing_check.rs @@ -14,7 +14,7 @@ fn camera_facing_quad_is_perpendicular_to_view_direction() { return; } let asset = or_io::gta5::PtxFxList::open(&path).expect("the fixture opens owned"); - let eff_idx = or_particle::list::effect_rules(&asset) + let eff_idx = or_particle_model::list::effect_rules(&asset) .position(|e| e.name == EFFECT_NAME) .expect("effect present"); diff --git a/crates/runtime/or-simulation/tests/engine_parity.rs b/crates/runtime/or-simulation/tests/engine_parity.rs index 1c6d4bf39..934a3994a 100644 --- a/crates/runtime/or-simulation/tests/engine_parity.rs +++ b/crates/runtime/or-simulation/tests/engine_parity.rs @@ -81,7 +81,7 @@ fn age_advances_life_by_one_over_life_times_dt() { let rand = RandomTable::new(); let ptx_table = PtxRandomTable::default(); let params = make_params(&rule, &effect, &emitter, &rand, &ptx_table, 0.5); - let age = Age::from_data(or_particle::behaviour::AgeBehaviour::default()); + let age = Age::from_data(or_particle_model::behaviour::AgeBehaviour::default()); age.update_point(0, &mut buf2, ¶ms); assert!( (buf2.life_ratio[0] - 0.25).abs() < 1e-5, @@ -93,7 +93,7 @@ fn age_advances_life_by_one_over_life_times_dt() { #[test] fn pause_clamps_life_on_transition_frame() { let mut buf = one_point(0.6); - let mut data = or_particle::behaviour::PauseBehaviour::default(); + let mut data = or_particle_model::behaviour::PauseBehaviour::default(); data.pause_life_ratio = 0.5; data.unpause_time = 100.0; let p = Pause::from_data(data); @@ -123,7 +123,7 @@ fn ptx_random_table_cursor_wraps_at_256() { } use or_io::gta5::particle::ReferenceSpace; -use or_particle::behaviour::{WindBehaviour, ZCullingBehaviour}; +use or_particle_model::behaviour::{WindBehaviour, ZCullingBehaviour}; use or_simulation::behaviours::{Dampening, Wind, ZCulling}; fn zcull_data(mode: u32, refspace: ReferenceSpace) -> ZCullingBehaviour { let mut d = ZCullingBehaviour::default(); @@ -175,7 +175,7 @@ fn wind_outside_low_lod_is_no_op() { ); } -use or_particle::behaviour::DampeningBehaviour as DampB; +use or_particle_model::behaviour::DampeningBehaviour as DampB; #[test] fn dampening_effect_space_scales_matrix_columns_not_vector() { @@ -183,15 +183,15 @@ fn dampening_effect_space_scales_matrix_columns_not_vector() { let mut buf = one_point(0.5); buf.curr_vel[0] = Vec3::new(5.0, 0.0, 0.0); let mut data = DampB::default(); - data.xyz_min = or_particle::domain::Vec3::new(0.0, 1.0, 0.0); - data.xyz_max = or_particle::domain::Vec3::new(0.0, 1.0, 0.0); + data.xyz_min = or_particle_model::domain::Vec3::new(0.0, 1.0, 0.0); + data.xyz_max = or_particle_model::domain::Vec3::new(0.0, 1.0, 0.0); data.reference_space = ReferenceSpace::EFFECT; data.enable_air_resistance = false; let d = Dampening::from_data(data); let rule = PtxParticleRule::default(); let effect = PtxEffectRule::default(); let mut emitter = PtxEmitterRule::default(); - emitter.dampening_scalar_kfp = or_particle::keyframe::constant([100.0; 4]); + emitter.dampening_scalar_kfp = or_particle_model::keyframe::constant([100.0; 4]); let rand = RandomTable::new(); let ptx_table = PtxRandomTable::default(); let mut params = make_params(&rule, &effect, &emitter, &rand, &ptx_table, 0.1); @@ -229,14 +229,14 @@ fn update_culled_effect_freezes_clock() { #[test] fn size_sprite_tblr_layout_matches_engine_swizzle() { use or_io::gta5::particle::KeyframeMode; - use or_particle::behaviour::SizeBehaviour; + use or_particle_model::behaviour::SizeBehaviour; use or_simulation::behaviours::Size as SizeSim; let mut buf = one_point(0.5); buf.curr_vel[0] = Vec3::ZERO; let mut data = SizeBehaviour::default(); data.is_proportional = true; data.keyframe_mode = KeyframeMode::Point; - data.whd_min_keyframes = Some(or_particle::KeyframePropData { + data.whd_min_keyframes = Some(or_particle_model::KeyframePropData { entries: vec![or_io::gta5::particle::RawKeyframeEntry { time: [0.0, 0.0, 0.0, 0.0], value: [4.0, 8.0, 0.0, 0.0], @@ -249,7 +249,7 @@ fn size_sprite_tblr_layout_matches_engine_swizzle() { rule.draw_type = 0; let effect = PtxEffectRule::default(); let mut emitter = PtxEmitterRule::default(); - emitter.size_scalar_kfp = or_particle::keyframe::constant([100.0; 4]); + emitter.size_scalar_kfp = or_particle_model::keyframe::constant([100.0; 4]); let rand = RandomTable::new(); let ptx_table = PtxRandomTable::default(); let params = make_params(&rule, &effect, &emitter, &rand, &ptx_table, 0.016); @@ -268,8 +268,8 @@ fn size_sprite_tblr_layout_matches_engine_swizzle() { #[test] fn query_kpd_point_uses_per_particle_snapshot_not_live_slider() { use or_io::gta5::particle::RawKeyframeEntry; - use or_particle::keyframe::KeyframePropData; - use or_particle::rules::{EvolutionList, EvolvedKeyframe, EvolvedKeyframeProp}; + use or_particle_model::keyframe::KeyframePropData; + use or_particle_model::rules::{EvolutionList, EvolvedKeyframe, EvolvedKeyframeProp}; let mut buf = PointBuffer::default(); buf.spawn(0); buf.set_evo_snapshot(0, &[0.25_f32, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]); @@ -279,7 +279,7 @@ fn query_kpd_point_uses_per_particle_snapshot_not_live_slider() { ..Default::default() }); let evo_list = EvolutionList { - evolutions: vec![or_particle::rules::Evolution { + evolutions: vec![or_particle_model::rules::Evolution { name: "TestSlider".into(), name_hash: 0, override_value: 0.0, @@ -327,7 +327,7 @@ fn query_kpd_point_uses_per_particle_snapshot_not_live_slider() { #[test] fn colour_folds_lod_alpha_mult_and_resets_alpha_mult() { use or_io::gta5::particle::KeyframeMode; - use or_particle::behaviour::ColourBehaviour; + use or_particle_model::behaviour::ColourBehaviour; use or_simulation::behaviours::Colour as ColourSim; let mut buf = one_point(0.5); buf.alpha_mult[0] = 0.5; @@ -359,7 +359,7 @@ fn colour_folds_lod_alpha_mult_and_resets_alpha_mult() { /// particles stay embedded in the surface. #[test] fn collision_kill_chance_runs_after_position_fix() { - use or_particle::behaviour::CollisionBehaviour; + use or_particle_model::behaviour::CollisionBehaviour; use or_simulation::behaviours::Collision as CollisionSim; let mut data = CollisionBehaviour::default(); data.collision_chance = 100; diff --git a/crates/runtime/or-simulation/tests/every_corpus_effect_simulates_as_recorded.rs b/crates/runtime/or-simulation/tests/every_corpus_effect_simulates_as_recorded.rs index 10a7805fc..0d84b1f63 100644 --- a/crates/runtime/or-simulation/tests/every_corpus_effect_simulates_as_recorded.rs +++ b/crates/runtime/or-simulation/tests/every_corpus_effect_simulates_as_recorded.rs @@ -239,7 +239,7 @@ fn simulate(asset: &PtxFxList, rules: &Arc, effect: usize) -> Option< fn effects(path: &Path) -> Result)>, String> { let asset = PtxFxList::open(path).map_err(|e| e.to_string())?; let rules = rules_of(asset.clone()); - Ok(or_particle::list::effect_rules(&asset) + Ok(or_particle_model::list::effect_rules(&asset) .enumerate() .filter_map(|(index, effect)| { let stream = simulate(&asset, &rules, index)?; diff --git a/crates/runtime/or-simulation/tests/kfp_query.rs b/crates/runtime/or-simulation/tests/kfp_query.rs index 1efa3883a..5390dff32 100644 --- a/crates/runtime/or-simulation/tests/kfp_query.rs +++ b/crates/runtime/or-simulation/tests/kfp_query.rs @@ -1,7 +1,7 @@ use glam::Vec4; use or_io::gta5::particle::RawKeyframeEntry; -use or_particle::keyframe::KeyframePropData; -use or_particle::rules::{EvolutionList, EvolvedKeyframe, EvolvedKeyframeProp}; +use or_particle_model::keyframe::KeyframePropData; +use or_particle_model::rules::{EvolutionList, EvolvedKeyframe, EvolvedKeyframeProp}; use or_simulation::kfp::{evo_blend, query_kpd_with_evo, MAX_EVOLUTIONS}; fn entry(time: f32, inv_dt: f32, val: f32) -> RawKeyframeEntry { RawKeyframeEntry { diff --git a/crates/runtime/or-simulation/tests/phase_e_behaviours.rs b/crates/runtime/or-simulation/tests/phase_e_behaviours.rs index 415dc9a26..12481be95 100644 --- a/crates/runtime/or-simulation/tests/phase_e_behaviours.rs +++ b/crates/runtime/or-simulation/tests/phase_e_behaviours.rs @@ -3,7 +3,7 @@ use glam::{Mat4, Vec3, Vec4}; use or_io::decl::Gen8; use or_io::gta5::particle::{PtxEffectRule, PtxEmitterRule, PtxParticleRule}; -use or_particle::behaviour::AttractorBehaviour; +use or_particle_model::behaviour::AttractorBehaviour; use or_simulation::behaviour::{AttractorGeometry, BehaviourImpl, BehaviourParams}; use or_simulation::behaviours::Attractor; use or_simulation::point::{PointBuffer, PointFlags}; diff --git a/crates/runtime/or-simulation/tests/sinks_smoke.rs b/crates/runtime/or-simulation/tests/sinks_smoke.rs index a9fdfd348..793b825e9 100644 --- a/crates/runtime/or-simulation/tests/sinks_smoke.rs +++ b/crates/runtime/or-simulation/tests/sinks_smoke.rs @@ -1,7 +1,7 @@ mod synthetic; use glam::{Mat3, Mat4, Vec3, Vec4}; -use or_particle::behaviour::{FogVolumeBehaviour, LightBehaviour, LiquidBehaviour}; +use or_particle_model::behaviour::{FogVolumeBehaviour, LightBehaviour, LiquidBehaviour}; use or_simulation::{ behaviour::{AttractorGeometry, BehaviourImpl, BehaviourParams, EmitSink}, behaviours::{DrawFogVolume, DrawLight, Liquid}, @@ -129,8 +129,8 @@ fn a_liquid_that_collides_is_drained_as_an_emit_where_it_struck() { } /// A curve that holds `value` for the whole of a life. -fn held(value: [f32; 4]) -> Option { - Some(or_particle::keyframe::KeyframePropData { +fn held(value: [f32; 4]) -> Option { + Some(or_particle_model::keyframe::KeyframePropData { entries: vec![or_io::gta5::particle::RawKeyframeEntry { time: [0.0; 4], value, diff --git a/crates/runtime/or-simulation/tests/synthetic/mod.rs b/crates/runtime/or-simulation/tests/synthetic/mod.rs index a3b4cee69..a79384821 100644 --- a/crates/runtime/or-simulation/tests/synthetic/mod.rs +++ b/crates/runtime/or-simulation/tests/synthetic/mod.rs @@ -8,9 +8,9 @@ use or_io::decl::Gen8; use or_io::gta5::particle::{ PtxEffectRule, PtxEmitterRule, PtxEventEmitter, PtxFxList, PtxParticleRule, }; -use or_particle::behaviour::Behaviour; -use or_particle::keyframe::constant; -use or_particle::list; +use or_particle_model::behaviour::Behaviour; +use or_particle_model::keyframe::constant; +use or_particle_model::list; pub const EFFECT: &str = "test_effect"; pub const EMITTER: &str = "test_emitter"; diff --git a/crates/runtime/or-simulation/tests/ws3_sim.rs b/crates/runtime/or-simulation/tests/ws3_sim.rs index d8ab19029..8bf9b2573 100644 --- a/crates/runtime/or-simulation/tests/ws3_sim.rs +++ b/crates/runtime/or-simulation/tests/ws3_sim.rs @@ -1,5 +1,5 @@ use or_io::gta5::particle::PtxFxList; -use or_particle::behaviour::Behaviour; +use or_particle_model::behaviour::Behaviour; use or_simulation::{build, PreviewTarget, PtfxManager}; mod synthetic; diff --git a/crates/tools/or-cli/Cargo.toml b/crates/tools/or-cli/Cargo.toml index 1afb25c3b..da5910aa0 100644 --- a/crates/tools/or-cli/Cargo.toml +++ b/crates/tools/or-cli/Cargo.toml @@ -19,7 +19,7 @@ or-title.workspace = true # The world core: the contract, the kept file and the driver the neutral world verbs answer through. or-world.workspace = true # The titles whose world this build opens, for the world verbs any title answers. -or-worlds.workspace = true +or-world-registry.workspace = true # GTA V's world: its model, for openrage-cli world on a `.ymap` or `.ytyp`, and its index, its forest, its collision # and its search, for the world verbs of GTA V's own. or-world-gta5.workspace = true @@ -80,7 +80,7 @@ tempfile.workspace = true # Finds the shared corpus the behaviour baseline samples. or-test-support.workspace = true # The editor's calls that make the small particle list the command tests build a pack from. -or-particle.workspace = true +or-particle-model.workspace = true # The zlib chunks of the synthetic GTA VI archive the `mcp` archive tools are tested on. flate2.workspace = true # The archive of a mapping the tests of `project adopt` write, with the crate that reads it. diff --git a/crates/tools/or-cli/src/world/neutral.rs b/crates/tools/or-cli/src/world/neutral.rs index b9d1958d6..2172a0f28 100644 --- a/crates/tools/or-cli/src/world/neutral.rs +++ b/crates/tools/or-cli/src/world/neutral.rs @@ -702,7 +702,7 @@ fn said(verb: &str, args: &[String]) -> Result, String> { let layers_asked = (verb == "layers").then(|| layers_asked(args)).transpose()?; let (install, rest) = crate::world::index::install_of(args, VALUED_FLAGS)?; let root = std::fs::canonicalize(&install).map_err(|e| format!("{install}: {e}"))?; - let (entry, game) = or_worlds::of_install(&root) + let (entry, game) = or_world_registry::of_install(&root) .ok_or("no title of this build opens a world of that install")?; let world = WorldSpec { options: options_of(args, &entry.title.options())?, diff --git a/crates/tools/or-cli/tests/a_particle_pack_is_listed_validated_and_read_back_from_the_command_line.rs b/crates/tools/or-cli/tests/a_particle_pack_is_listed_validated_and_read_back_from_the_command_line.rs index efc6b679c..a8d7b1efd 100644 --- a/crates/tools/or-cli/tests/a_particle_pack_is_listed_validated_and_read_back_from_the_command_line.rs +++ b/crates/tools/or-cli/tests/a_particle_pack_is_listed_validated_and_read_back_from_the_command_line.rs @@ -16,7 +16,7 @@ fn text(path: &Path) -> &str { /// A `.ypt` of one effect that fires one emitter rule and one particle rule. fn a_ypt(effect: &str) -> Vec { - or_particle::sample::list_of("fx_test", &[effect]) + or_particle_model::sample::list_of("fx_test", &[effect]) } /// A project with a particles content whose pack holds the file `fx_test`, which states the effect `effect`. diff --git a/docs/direction/OR_IO_Specification.md b/docs/direction/OR_IO_Specification.md index 19944e080..b439fdd9d 100644 --- a/docs/direction/OR_IO_Specification.md +++ b/docs/direction/OR_IO_Specification.md @@ -106,7 +106,7 @@ foundation -> io -> title -> domain -> runtime -> app | `or-macros` | `or-io-macros` (`#[record]`) | deleted in R66f with `#[rage_struct]` and `#[rage_enum]` (P66); `or-io-macros` is the one proc-macro crate | | `or-asset` | everything, by [the module map](#the-or-asset-module-map) | deleted in R66f (D10, P62, #332), once its last importers, all tests, had moved onto the owned types | | `or-meta` | `or_io::meta` behind `meta` | merged and deleted (#267, D5); its schema is data installed at run time, not a build input (#243) | -| `or-ptx` | its codec half into `gta5::particle`, its editor half into `or-particle` | the editor half moved and `YptAsset` is deleted (OD-PTX, P52, #320); `or-ptx` is deleted (P70, #333) | +| `or-ptx` | its codec half into `gta5::particle`, its editor half into `or-particle-model` | the editor half moved and `YptAsset` is deleted (OD-PTX, P52, #320); `or-ptx` is deleted (P70, #333) | `or-test-support` stays, unpublished. `or-title` is unchanged and depends on `or-io`: code that needs to know where a file lives belongs there, and code that needs only the bytes belongs in `or-io`. ### The or-asset module map @@ -779,7 +779,7 @@ Phases P0–P7 are [R66a–R66h](Roadmap.md#r66-the-or-io-crate); the roadmap ho - **P1, [R66b](Roadmap.md#r66b-clean-what-the-crate-will-contain): clean what the crate will contain.** Done: the key snapshot out of the tree, the extractor measured per executable, the version table measured, the bundled material table dropped, the attribution corrected, citations out of the tree, and the pattern lint fatal on every crate that moves in. The engine-name rule and the denylist it also built were withdrawn by D15, and D18 bundles the key snapshot again in `or-io`. - **P2, [R66c](Roadmap.md#r66c-the-crate-and-the-macro-on-synthetic-types): the crate and the macro on synthetic types.** Done: `or-io` and `or-io-macros` exist, the six crates merged with no facade, and one declaration makes a struct, a view, a record and a description. - **P3, [R66d](Roadmap.md#r66d-declare-gta-v-format-by-format): declare GTA V format by format.** Done: every paged format `FORMATS` lists and the RSC7 header are declared, and every root in the Owned column of [R66d's table](Roadmap.md#r66d-declare-gta-v-format-by-format) is migrated to the owned form under D15's names; RPF7's header and entry table are declared (#262); the pose database moved in as ordinary code (OD-YPDB, #254); GXT2 is declared and owned as `Gxt2` (#265); `or-meta` moved in whole as `or_io::meta` (#267); AWC and DDS moved in as ordinary code behind features (#266), and the texture codec and authoring path behind them (#268). Carried past it: `.ysc` stays ordinary code under a time-limited exception, declared once a corpus exists (OD-YSC); one site a save still loses (`census::STILL_LOST`); and `#[bits]` exists in `#[record]` but no GTA V resource declaration names its bit ranges with it yet (OD-BITS). What `or-asset` still held went with it in R66f (P62, #332). Every declaration is owned, the drawables one generic declaration per class (OD-10.8) and Gen9-only words under measured names (OD-10.9), and `#[record(raw, ...)]` is retired (P57, #319). Done when [the gates per format](#the-gates-per-format) hold for every format and target, and for metadata when every metadata suite is green in its new home and every document still reaches its fixed point. -- **P4, [R66e](Roadmap.md#r66e-move-the-consumers): move the consumers.** Done (P39–P60): the viewport mesh walk (`src/render/meshes.rs`), `or-interchange` for both targets, `or-anim`, `or-simulation` and `or-particle` with behaviour unchanged (D9), the editors, `or-cli`, and the app's one resource payload, onto typed values and views; `src/state/payload_handlers.rs` stays the one table of each format's open, save and empty, and plugins keep their ABI. Done when no crate outside `or-io` names `or-asset`'s types or `or-format-api`'s `names`, `just self-check` paints every panel, and every corpus drawable exports the same `.glb` content, every clip the same poses frame for frame, every effect the same deterministic simulation snapshot, and every documented CLI command the same values. +- **P4, [R66e](Roadmap.md#r66e-move-the-consumers): move the consumers.** Done (P39–P60): the viewport mesh walk (`src/render/meshes.rs`), `or-interchange` for both targets, `or-anim`, `or-simulation` and `or-particle-model` with behaviour unchanged (D9), the editors, `or-cli`, and the app's one resource payload, onto typed values and views; `src/state/payload_handlers.rs` stays the one table of each format's open, save and empty, and plugins keep their ABI. Done when no crate outside `or-io` names `or-asset`'s types or `or-format-api`'s `names`, `just self-check` paints every panel, and every corpus drawable exports the same `.glb` content, every clip the same poses frame for frame, every effect the same deterministic simulation snapshot, and every documented CLI command the same values. - **P5, [R66f](Roadmap.md#r66f-delete-the-old-crates): delete the old.** Done (P61–P67): `or-asset` (D10; `or-meta` left already, whole, in R66d, #267, D5), `or_asset::rage_types` and the domain glue, the compiled readers and writers once the testimony runs green against the built-in description, `pack_required`, `pack_walk`, `#[rage_struct]`'s code generators, the `inventory` registration and `or-format-api`'s `names`. `openrage-packs` is no longer read by the app and stays the second description the structural diff runs against, authored in what [the open question](#open-questions-for-the-owner) settles. That sentence superseded on 2026-09-26 by D17: nothing reads the pack after R66f, and [R66i](Roadmap.md#r66i-retire-openrage-packs) retires it. Done when those crates are gone, the pattern lint is clean on the tip, the workspace opens every declared format with no pack, and the standing documents describe the result. - **P6, [R66g](Roadmap.md#r66g-rewrite-the-history): rewrite the history** as [above](#rewriting-the-history). D12, taken on 2026-10-01, keeps the engine's names in old revisions, so the rewrite renames nothing; since D15 the tip carries engine names as well. - **P7, [R66h](Roadmap.md#r66h-publish-the-crate-and-the-editor-together): publish the crate and the editor together** (D8): a README with the not-affiliated statement, docs.rs configuration, this repository public, and `or-io` and `or-io-macros` 0.1.0 on crates.io the same day, with `publish` flipped for those two. Done when the lawyer questions are answered, the pattern lint is clean on the tip, a clean clone passes hosted CI with the synthetic round trips, `cargo-deny` is clean, and `cargo publish --dry-run` succeeds for both crates from the published package alone. diff --git a/docs/direction/Project_Context.md b/docs/direction/Project_Context.md index 1168baf0a..9b8500bfc 100644 --- a/docs/direction/Project_Context.md +++ b/docs/direction/Project_Context.md @@ -567,9 +567,9 @@ Taken under the [standing instruction](#r66s-open-decisions-take-the-plans-recom Taken under the [standing instruction](#r66s-open-decisions-take-the-plans-recommendation-2026-09-26) (OD-REGISTRY). `or_asset::format_registry` splits: its detection, the header and extension scoring and the target, becomes or_io::open and its Asset, and `FormatHandler` and `Tier` move into the app's `src/state/` as editor policy. Moving both halves into `gta5::formats`, where the specification's module map had put it, and keeping it as it is were not taken. -### or-ptx splits between or-io and or-particle (2026-09-26) +### or-ptx splits between or-io and or-particle-model (2026-09-26) -Taken under the [standing instruction](#r66s-open-decisions-take-the-plans-recommendation-2026-09-26) (OD-PTX). `or-io` cannot depend on `or-ptx`, so its file vocabulary, `ShaderVar` included, moves into `gta5::particle` and its editor half into `or-particle`, with behaviour unchanged (D9) and held by R66e's simulation baselines. The crate is deleted only after `or-asset` and the pack repository stop depending on it, since both import it today. Keeping the behaviour codec and `YptAsset` in `or-particle` was not taken. +Taken under the [standing instruction](#r66s-open-decisions-take-the-plans-recommendation-2026-09-26) (OD-PTX). `or-io` cannot depend on `or-ptx`, so its file vocabulary, `ShaderVar` included, moves into `gta5::particle` and its editor half into `or-particle-model`, with behaviour unchanged (D9) and held by R66e's simulation baselines. The crate is deleted only after `or-asset` and the pack repository stop depending on it, since both import it today. Keeping the behaviour codec and `YptAsset` in `or-particle-model` was not taken. ### D16's sample stays as approved, and an engine-named twin compiles (2026-09-26) diff --git a/docs/direction/Roadmap.md b/docs/direction/Roadmap.md index a74db2695..d465210eb 100644 --- a/docs/direction/Roadmap.md +++ b/docs/direction/Roadmap.md @@ -1293,7 +1293,7 @@ changing. The figures are in [Keys](OR_IO_Specification.md#keys-d4). **Done.** A per-title reverse index over both hash functions, with collisions recorded, `.nametable` read and written, and `openrage-cli hash` and `names`. `string_hash` is pinned against names the -game writes. `crates/domain/or-particle/src/rage/mod.rs` re-exports `or_io::hash`, so there is one +game writes. `crates/domain/or-particle-model/src/rage/mod.rs` re-exports `or_io::hash`, so there is one hash; the literal-hash schema index of `or_io::meta` (`crates/io/or-io/src/meta/binary/hash_index.rs`) stays separate. Persistence waits on [R26](#r26-index-dependencies-and-summaries). @@ -8640,7 +8640,7 @@ it sits at 0x58 ([Oracle_Testimony.md](../guides/Oracle_Testimony.md)). - **Bit ranges** (OD-BITS): `#[bits]` is in `#[record]`, and RPF7's header and entry name their ranges with it (#262); no GTA V resource declaration declares its bit ranges yet. - **What references still leave.** A copied `.ypt` rule and a hand-written `RefPath` are tracked - by position in a run: reordering breaks the copy (`or_particle::list::canonical` lays a list out + by position in a run: reordering breaks the copy (`or_particle_model::list::canonical` lays a list out so the dictionaries own the rules, #320), and removing an earlier element saves an equal copy as its alias (OD-ALIAS-BY-VALUE). [The owned form](OR_IO_Specification.md#the-owned-form-d16) owns the detail. @@ -8650,7 +8650,7 @@ it sits at 0x58 ([Oracle_Testimony.md](../guides/Oracle_Testimony.md)). [↑ checklist](#phase-1--the-or-io-crate-the-critical-path) **What.** Phase P4: the viewport mesh walk, `or-interchange` for both targets, `or-anim`, -`or-simulation` and `or-particle` with behaviour unchanged (D9), the editors, `or-cli` and the +`or-simulation` and `or-particle-model` with behaviour unchanged (D9), the editors, `or-cli` and the app's one resource payload, onto the owned values of D16. It replaces [R65i](#r65i-animation-on-the-pack) through [R65n](#r65n-the-cli-on-the-pack). @@ -10867,7 +10867,7 @@ and `openrage-cli world index`, `at`, `ground`, `find` and `select` for any regi ([brief](Unified_World_Plan.md#the-gta-v-world-behind-the-contract-and-one-kept-file-r71d)). **Where it stands.** Built, with no file moved: `crates/domain/or-world-gta5` answers the -contract for both games and `crates/domain/or-worlds` lists it. The kit passes over an install +contract for both games and `crates/domain/or-world-registry` lists it. The kit passes over an install built by hand; on each install the selection through the core's driver is `WorldForest`'s at 16 of 16 views (`the_adapter_selects_as_the_forest_does_at_fixed_cameras_of_a_real_install`, 2026-11-28) and 13 of the kit's 20 rules are asked; the verbs answer with `--neutral`. A body @@ -11029,7 +11029,7 @@ else of the row is built [Crate_Reference.md](../reference/Crate_Reference.md#the-world-session)). `crates/domain/or-maps/src/store.rs` is GTA V's store: it places or deletes an entity, holds the edit unwritten, guards each map file, and answers each changed map as a body. The kit's -four edit rules hold it (`crates/domain/or-worlds/tests/gta5_passes_the_kit.rs`). +four edit rules hold it (`crates/domain/or-world-registry/tests/gta5_passes_the_kit.rs`). *A session's own maps.* `OwnMap` is the row an edit session states of a map the index holds none of: the driver streams it from the session alone @@ -11225,7 +11225,7 @@ surface as it is, and GTA V's index on the core's kept file script forms that reads a sample map of `or-maps`, which is now `crates/domain/or-maps/tests/a_heading_written_for_a_stored_rotation_is_the_turn_about_z.rs`. - **Counted.** `cargo nextest list --profile all` over `or-world`, `or-world-gta5`, `or-world-gta6`, - `or-worlds`, `or-depends`, `or-maps`, `or-project`, `or-cli` and the app lists 6142 tests before + `or-world-registry`, `or-depends`, `or-maps`, `or-project`, `or-cli` and the app lists 6142 tests before and after, with no test's name lost or gained; no body changed. The ledger of `crates/domain/or-world/tests/the_core_names_no_game.rs` shrank from 22 files and 29 pairs to one file and two pairs, and to nothing once [R71b](#r71b-the-gta-vi-world-behind-the-contract)'s diff --git a/docs/direction/Source_Format_Design.md b/docs/direction/Source_Format_Design.md index 5ab1e5b81..0bce3e70c 100644 --- a/docs/direction/Source_Format_Design.md +++ b/docs/direction/Source_Format_Design.md @@ -323,7 +323,7 @@ Wave P43 of [Workbench_Plan.md](Workbench_Plan.md) made the source of a `.ypt`, ``` - **`particles.json` states every member the declaration shows, by its names.** The list's `name` and its `effect_rules`, `emitter_rules` and `particle_rules`, each in the order of its dictionary, which is the order of the hash of its name; an effect holds its `timeline` of events, a particle rule its behaviours, its shader variables and the models it draws, each by the engine's name in the engine's casing (`PtxEffectRule`'s `num_loops`, a behaviour's `class` as `ptxu_Acceleration`). A member that is the declaration's own default is left out, and one a document does not state reads as the default. A hash is `"0x…"`, a vector one text of its four floats, a float the shortest decimal that reads back as the same float, and one no decimal holds exactly (a NaN with a payload) its bits. `every_member_the_declaration_shows_is_stated_or_left_out_by_name_and_no_name_is_made_up` holds the lists of members to the declaration, so a member added to a record fails it. -- **What follows from the rest is not stated.** The five lists that name a rule's behaviours (they follow from the classes), the map of an evolution list's values (it follows from the values), and the pointers an event or a spawner holds at the rule it names (they follow from the name) are laid out by `or_particle::list::canonical` when the list is made, as the editor lays them out on every open. +- **What follows from the rest is not stated.** The five lists that name a rule's behaviours (they follow from the classes), the map of an evolution list's values (it follows from the values), and the pointers an event or a spawner holds at the rule it names (they follow from the name) are laid out by `or_particle_model::list::canonical` when the list is made, as the editor lays them out on every open. - **What is not carried.** What the declaration holds only as runtime words: the virtual-table addresses (`PgBase`, `PgBaseRefCounted`, every behaviour), runtime pointers and flags, reference counts, the `Back` pointer of an effect rule that the file held null, and padding. The engine's own declaration of a technique descriptor ignores its three padding bytes, and 182 of the sampled descriptors hold a `1` in them. The one word of the declaration that is data and had no name, the two numbers of a camera evolution behaviour (`settings`, 1 or 3 and then 2 in the 129 shipped), was private and is public now, so a source states it. - **The textures are the source of a `.ytd`.** An extraction makes the textures source of the list's dictionary and moves its `textures/` and `textures.json` in, so a texture is edited as a DDS or an image beside it and compiled with the rules [textures](#textures) states, for either edition. - **The models are kept whole.** A particle draws a `rmcDrawable`, which the `.ydr` source (a `GtaDrawable` with its glb) does not hold, so the models of a list are kept as `models.ypt`, a particle list that holds only them. The owner is asked whether they should become glTF. diff --git a/docs/direction/Unified_World_Plan.md b/docs/direction/Unified_World_Plan.md index 004194e4f..4330a63c2 100644 --- a/docs/direction/Unified_World_Plan.md +++ b/docs/direction/Unified_World_Plan.md @@ -91,7 +91,7 @@ Each row is a duplicate the programme ends, at `9fdf0fee`: | `or-world`, the core | domain | The contract, the read model, the stream policy, the driver with the world thread and reader pool around it, the kept file, the queries, collision shapes, the neutral half of the transform, the manipulator and the scene types, the edit envelope, the key of a sentence, the kit and the fake title | `or-job` alone: a game is the core's own id | | or-world-gta5 | domain | First the contract over GTA V's crates as they stand; after R71n also its model, index, mount source, find and placements. One crate for the Legacy and the Enhanced game | the core, `or-io`, `or-title`; `or-depends` until R71n | | or-world-gta6 | domain | GTA VI's index, scan and mount binding, its readers, its material record, its streaming rules, its look, its edit operations, its render profile as data | the core, `or-io`, `or-title` | -| or-worlds, the registry | domain | One function that lists each title with its edit store and maps a registered game onto the core's id, in the manner of `kinds` in `crates/domain/or-content/src/lib.rs` | every adapter, `or-maps` | +| or-world-registry, the registry | domain | One function that lists each title with its edit store and maps a registered game onto the core's id, in the manner of `kinds` in `crates/domain/or-content/src/lib.rs` | every adapter, `or-maps` | | `or-renderer`, the host | runtime | The frame host and the neutral fallback, typed on the core's model, and a module named for each title whose passes or fallback families it holds | the core, and each adapter whose module it holds | `or-renderer` gains an edge to `or-world` and to each adapter it holds a module for, both down the chain ([ruling 2](#asked-of-the-owner)). `or-maps` stays GTA V's edit store, over `or-project` and `or-source`; the edge between the GTA V adapter and `or-depends` turns round at R71n, which leaves that crate audio, the census, the export, the rules and the resolver. No adapter depends on another, on `or-renderer`, on a tool crate or on the app. File reading stays in `or-io`: GTA V's as declarations (D15), GTA VI's as readers by member hash. diff --git a/docs/direction/Workbench_Views_Design.md b/docs/direction/Workbench_Views_Design.md index 1428c248d..9bb124521 100644 --- a/docs/direction/Workbench_Views_Design.md +++ b/docs/direction/Workbench_Views_Design.md @@ -193,9 +193,9 @@ The Particles view serves a person who makes effects: a `.ypt` holds effect rule The left column is the Project panel with an Effects panel beside it: every `.ypt` of the project, the effects each holds and their emitters, with a mark on what needs attention. Choosing an effect plays it in the viewport, a Ctrl-click pins it so several play together (as [Particle_Preview.md](../features/Particle_Preview.md#the-editor-around-it) describes), and the timeline, the Inspector and the texture preview are the ones that exist. Problems, Build and History join the timeline as tabs. A Used by section lists the weapons and vehicles whose effect metadata names an effect, and arrives only after the weapon family is declared. -The preview draws through the pack of the game's shaders, which the app bakes once a game is set. With none, or with a technique the pack lacks, the batch is skipped and nothing else draws the effect, so a view of effects says that in its viewport and not in a log. R58f, which the brief for this wave names as the particle pack work, is that shader baking; the particle code is `crates/domain/or-particle`, `crates/io/or-io/src/gta5/particle.rs` and `crates/runtime/or-simulation`. +The preview draws through the pack of the game's shaders, which the app bakes once a game is set. With none, or with a technique the pack lacks, the batch is skipped and nothing else draws the effect, so a view of effects says that in its viewport and not in a log. R58f, which the brief for this wave names as the particle pack work, is that shader baking; the particle code is `crates/domain/or-particle-model`, `crates/io/or-io/src/gta5/particle.rs` and `crates/runtime/or-simulation`. -**Content kind.** The draft recommended none at first (ruling V4), and the owner changed that: the kind is `particles`, built by wave P43 ([below](#what-wave-p43-built-for-particles)). The draft's reasoning stays as the history of the question. A `.ypt` that a person adds was a compiled file with no source form, kept whole under `files/` and joined to the Files content (ruling R3 of [the second plan](../audit/workbench-waves-2026-10-08.json)), and the build already planned it, copied it and reloaded it through its reader, since `ypt` is a declared format (`crates/io/or-io/src/gta5/formats.rs`). What a content kind of its own gives a project is a rule or a cross-reference that a file cannot give, and its rules start from what `crates/domain/or-particle/src/list.rs` already guarantees, that each rule is held once before a save. The references from a weapon, a vehicle or a ped to an effect need those families declared first, and stay unbuilt. +**Content kind.** The draft recommended none at first (ruling V4), and the owner changed that: the kind is `particles`, built by wave P43 ([below](#what-wave-p43-built-for-particles)). The draft's reasoning stays as the history of the question. A `.ypt` that a person adds was a compiled file with no source form, kept whole under `files/` and joined to the Files content (ruling R3 of [the second plan](../audit/workbench-waves-2026-10-08.json)), and the build already planned it, copied it and reloaded it through its reader, since `ypt` is a declared format (`crates/io/or-io/src/gta5/formats.rs`). What a content kind of its own gives a project is a rule or a cross-reference that a file cannot give, and its rules start from what `crates/domain/or-particle-model/src/list.rs` already guarantees, that each rule is held once before a save. The references from a weapon, a vehicle or a ped to an effect need those families declared first, and stay unbuilt. The source form was the second question, and the one the draft said had to be measured first: [the source design](Source_Format_Design.md#layout-per-format) planned a `.particles.src` of JSON rules and DDS, and the check was whether the rules of a particle list reach a fixed point through JSON. Wave P43 measured it on both installs and built it ([what it built](Source_Format_Design.md#what-wave-p43-built)). @@ -215,7 +215,7 @@ The source form was the second question, and the one the draft said had to be me **Empty state and ways in.** The workspace with a project and no effect reads *No particle effects in this project*, with *Add particle effects…* (the files picked, each made a source), *New particle effects* (File ▸ New, the row the menu already names *Particle effects (.ypt)*), *Import game files…* and *Open a .ypt…*. Built (wave P43): the screen offers Add particle effects… and New particle effects, and Import game files… makes the same sources. A drop on the Effects panel adds the files to the project, with the hint saying so, and a drop elsewhere on the workspace only opens, as ruling R4 of the second plan has it. -**Edited here, in a plugin, elsewhere.** In OpenRage: every field of an effect, an emitter, a rule, a domain and a keyframe (`crates/domain/or-particle`, saved and reopened by `a_particle_list_edit_saves_and_reopens`), the textures by replacement, and the rules of a list by name. In another tool: the pictures, the models a particle draws, and tuning against the running game. The preview says what it does not draw: lights, fog volumes and decals are not drawn, the mirror, refraction and shadow passes are not, and only a Legacy `.ypt` is simulated ([Particle_Preview.md](../features/Particle_Preview.md#known-gaps)). +**Edited here, in a plugin, elsewhere.** In OpenRage: every field of an effect, an emitter, a rule, a domain and a keyframe (`crates/domain/or-particle-model`, saved and reopened by `a_particle_list_edit_saves_and_reopens`), the textures by replacement, and the rules of a list by name. In another tool: the pictures, the models a particle draws, and tuning against the running game. The preview says what it does not draw: lights, fog volumes and decals are not drawn, the mirror, refraction and shadow passes are not, and only a Legacy `.ypt` is simulated ([Particle_Preview.md](../features/Particle_Preview.md#known-gaps)). **The bar.** The repository names CodeWalker as a tool to replace and measured one thing about it for particles: `tools/cw-compare` loads an original and a re-encoded `.ypt` in CodeWalker and diffs them, to answer whether CodeWalker loads what OpenRage wrote. It is a diagnostic and not a gate, and CodeWalker misreads some formats. So the bar is that a `.ypt` OpenRage saves still loads there, that the simulation follows the engine's solver at full fidelity (the owner's decision D9, recorded in Particle_Preview.md), and, as a check of the project and not of the editor, that the same file is planned, built and read back with its textures counted against a memory figure. diff --git a/docs/features/GTA_V_World_Viewer.md b/docs/features/GTA_V_World_Viewer.md index eaf86f4b3..597f3e5cf 100644 --- a/docs/features/GTA_V_World_Viewer.md +++ b/docs/features/GTA_V_World_Viewer.md @@ -583,7 +583,7 @@ The world is the map a game starts on, the story's, unless **Mode** says multipl ## How it is read and drawn Nothing is read on the thread that draws. The session opens the install through the registry of -titles (`or_worlds`), streams and selects with the world core's `Driver` on a thread of its own, +titles (`or_world_registry`), streams and selects with the world core's `Driver` on a thread of its own, and reads maps, models and textures in the core's reader pools. A frame takes what arrived, puts it on the device, and lays out the instances of the last selection the camera sees. diff --git a/docs/reference/Crate_Reference.md b/docs/reference/Crate_Reference.md index 69616a094..5030273ad 100644 --- a/docs/reference/Crate_Reference.md +++ b/docs/reference/Crate_Reference.md @@ -18,7 +18,7 @@ list. | foundation | `crates/foundation/` | or-job, or-test-support, or-transport | building blocks that know no file format | | io | `crates/io/` | or-io, or-io-macros, or-io-verify, or-kraken, or-media | GTA V's containers, descriptions, canonical writer and `#[record]` declarations, and the decoders for the audio and video in them | | title | `crates/title/` | or-title | where the bytes live: editions, archives, DLC order, the VFS | -| domain | `crates/domain/` | or-addonped, or-content, or-depends, or-editor, or-interchange, or-maps, or-particle, or-particles, or-plugin, or-project, or-source, or-wardrobe, or-weapons, or-world, or-world-gta5, or-world-gta6, or-worlds | the models of what is edited | +| domain | `crates/domain/` | or-addonped, or-content, or-depends, or-editor, or-interchange, or-maps, or-particle-model, or-particles, or-plugin, or-project, or-source, or-wardrobe, or-weapons, or-world, or-world-gta5, or-world-gta6, or-world-registry | the models of what is edited | | runtime | `crates/runtime/` | or-anim, or-simulation, or-renderer | what is evaluated, simulated or drawn | | tools | `crates/tools/` | or-cli, or-loader, or-shader-front, or-shader-tool, xtask | programs over the lower layers, and the repository's own tasks | | app | `src/` | openrage | the desktop editor and the `openrage-cli` binary | @@ -32,7 +32,7 @@ lists the edges. `or-title`; code that needs only the bytes goes in `or-io`. Editing code goes below the app when a second application would want it; the YPT panels do not qualify. -- **Absent edges.** `or-anim` → `or-particle` (the previews share the clock in +- **Absent edges.** `or-anim` → `or-particle-model` (the previews share the clock in `or-transport`); and any dev-dependency pointing up, which is why `crates/title/or-title/tests/adding_a_title.rs` @@ -48,7 +48,7 @@ lists the edges. workspace plans and edits clothing through it (`src/state/workbench/wardrobe.rs`), and it reads `or-content` for the kinds of content to plan, adopt and start, so that it and `openrage-cli` list them once. It embeds `or-editor`, - `or-particle` and `or-plugin`, and shares `or-depends`, `or-interchange`, + `or-particle-model` and `or-plugin`, and shares `or-depends`, `or-interchange`, `or-world` and `or-project` with `openrage-cli`; it reads `or-project` for the keys of its project file and for the plan, the build and the clean of the Project workspace, where the CLI reads it for `openrage-cli project`. The app @@ -1314,9 +1314,9 @@ into several (`ImportReport::splits`). **or-maps, the store behind the world contract.** `store` is GTA V's edit store as the contract takes one ([R71i](../direction/Roadmap.md#r71i-one-edit-stack-for-every-title)): `Gta5Edits` is its `EditTitle`, opened over the folder of a project (`Project::in_folder` finds the one project file and its first maps content that is no link). An envelope of `PLACE` or `DELETE` names an entity as a pick names it, by the logical path of its map file, its place and the guid and archetype it states (`store::place`, `move_to`, `turn_to`, `delete`, over `or_world_gta5::entity_of_address`); `apply_in` holds every guard, holds the entity at that place against the guid and the archetype, and does the edit through `first_edit::apply_in`, the first edit over a `Session` that is not flushed. The inverse is an envelope of `OPERATIONS`, the session's own inverses, each stating the state it applies to. `guard_in` is the state of the map's source (`Session::state_of`), or one token for the game's file and for a source that holds it as the import made it, and a guard is held by every name the session knows that state by (`Session::stands_as`), so one taken before a flush still holds after it; `body_in` saves what the session holds of a source and has the adapter build its body (`Gta5World::body_from`), which the session answers for its map until the next apply. The adapter is found through the contract's `WorldInstall::own`, and what the store refuses in its own words is `EditError::Refused`. `first_edit` was split for it into the import (`bring_in`) and the operations, a deletion planning through the session's held maps (`plan_reaching_held`), and gained `Change::Place`, a whole pose. The pieces take a borrowed session so that the app applies through the session its Map screen holds (`src/state/workbench/world_edit.rs`). -⚠ The import of a map file is written at the apply, and the inverse leaves the source in place. ⚠ A place is a place in what the session holds once the map is a source, not in the game's file. ⚠ A map file that is not the copy the mount loads is refused by the first edit (`NotTheCopyLoaded`). ⚠ An entity of an interior has no envelope. It is held by the kit's edit rules in `crates/domain/or-worlds/tests/gta5_passes_the_kit.rs`, each seen failing with its part of the store broken: the guard of a source as imported, the guard unchecked, no body answered, the first body kept, and no base. What a flush writes is held in `crates/domain/or-worlds/tests/gta5_edits_are_written_at_a_flush.rs`: a move flushed is exactly that move against the game's file as `source_changes` compares them, a second move made for a state the source has left is refused, and the inverse applied after the flush and flushed leaves no change, which failed until a guard was held across a flush; an envelope of `PLACE` or `DELETE` whose guards leave out the map file its body names is refused as malformed, since a stale move applied through one until it was (`a_move_whose_envelope_guards_another_file_than_it_names_is_refused`); and a deletion with its chain, then each inverse, leaves every guard and, flushed, every byte of the two sources as the imports made them (`a_delete_with_its_chain_and_its_inverse_leave_the_sources_as_imported`). ⚠ `turn_to` and `move_to` keep the scales the file states, where `place` states a whole pose: a pose read back from where a thing is drawn has another scale in its last bits, and the World screen's Turn wrote a change of scale nobody made until it asked `turn_to` (`a_turn_typed_again_and_again_is_drawn_as_typed_and_written_as_a_turn_alone`). `crates/domain/or-worlds/tests/gta5_edits_with_a_schema_snapshot.rs` asks the same and the kit's edit rules with a metadata schema snapshot installed, in a binary of its own, and is skipped where none is staged. +⚠ The import of a map file is written at the apply, and the inverse leaves the source in place. ⚠ A place is a place in what the session holds once the map is a source, not in the game's file. ⚠ A map file that is not the copy the mount loads is refused by the first edit (`NotTheCopyLoaded`). ⚠ An entity of an interior has no envelope. It is held by the kit's edit rules in `crates/domain/or-world-registry/tests/gta5_passes_the_kit.rs`, each seen failing with its part of the store broken: the guard of a source as imported, the guard unchecked, no body answered, the first body kept, and no base. What a flush writes is held in `crates/domain/or-world-registry/tests/gta5_edits_are_written_at_a_flush.rs`: a move flushed is exactly that move against the game's file as `source_changes` compares them, a second move made for a state the source has left is refused, and the inverse applied after the flush and flushed leaves no change, which failed until a guard was held across a flush; an envelope of `PLACE` or `DELETE` whose guards leave out the map file its body names is refused as malformed, since a stale move applied through one until it was (`a_move_whose_envelope_guards_another_file_than_it_names_is_refused`); and a deletion with its chain, then each inverse, leaves every guard and, flushed, every byte of the two sources as the imports made them (`a_delete_with_its_chain_and_its_inverse_leave_the_sources_as_imported`). ⚠ `turn_to` and `move_to` keep the scales the file states, where `place` states a whole pose: a pose read back from where a thing is drawn has another scale in its last bits, and the World screen's Turn wrote a change of scale nobody made until it asked `turn_to` (`a_turn_typed_again_and_again_is_drawn_as_typed_and_written_as_a_turn_alone`). `crates/domain/or-world-registry/tests/gta5_edits_with_a_schema_snapshot.rs` asks the same and the kit's edit rules with a metadata schema snapshot installed, in a binary of its own, and is skipped where none is staged. -**or-maps, a map of the project's own.** A source that cooks to a map the install loads no map by the name of is no row of the index ([the project's own maps](../features/GTA_V_World_Viewer.md#the-projects-own-maps)). `store::Shown` is a map as the session holds it for a world to draw: its id, its body and, for such a map, the `OwnMap` row, which `Gta5World::own_body` builds from the cooked file (the box from the extents the file states, none where it places nothing; the parent where the game loads it). `Kept` gives each such source an id past the index's last row, once, in the order met, and never takes one back; `held_bodies`, `body_in` and `apply_in` answer `Shown`, and the store's session states the rows from its open (`EditSession::own_maps`). An address of such a map is the source's own path, so `PLACE` and `DELETE` reach it through `first_edit` with nothing imported. `store::ADD` (`store::add`) puts an entity of an archetype at a pose into such a source through `Operation::AddEntity`, as a copy of a donor where `donor_of` finds one (an entity of a source of the content with no far model and no child); `added_map` is the source added objects go to, named by the project file's name and `ADDED`, made empty with `or_world_gta5::create` and `import::add_one` where the content holds none, stating the content flag of objects of the highest detail from the start, since no operation states a flag. ⚠ After a `PLACE` or an `ADD` in a map of the project's own, `settle_extents` grows the extents by the box and the distance the install's type files state of each archetype the pack declares none for, as one more `SetExtents` of the same step: grown by the pack's boxes alone, the map would state a point the game does not stream it from, and the world here would not either. ⚠ A list an inverse states is not grown again. ⚠ A new entity takes one more than the largest guid of its map (`or_world_gta5::create::free_guid`), so the guid of the last entity deleted is given again; an envelope holds the place, the guid and the archetype together and an inverse names a place, so within the map nothing is confused by it. Held by the kit's rule of a session's own map over the hand-built install, and by `an_object_added_to_the_projects_own_map_ships_in_a_build_for_a_fivem_server` in `crates/domain/or-worlds/tests/gta5_edits_are_written_at_a_flush.rs`: the object flushed is in the map a FiveM resource of the project streams, the same envelope again is stale, and the extents hold it by the game's box. ⚠ A content that keeps no manifest of the game writes no `_manifest.ymf`, as before: what states the map to a server is the resource's own manifest, which declares it a map. +**or-maps, a map of the project's own.** A source that cooks to a map the install loads no map by the name of is no row of the index ([the project's own maps](../features/GTA_V_World_Viewer.md#the-projects-own-maps)). `store::Shown` is a map as the session holds it for a world to draw: its id, its body and, for such a map, the `OwnMap` row, which `Gta5World::own_body` builds from the cooked file (the box from the extents the file states, none where it places nothing; the parent where the game loads it). `Kept` gives each such source an id past the index's last row, once, in the order met, and never takes one back; `held_bodies`, `body_in` and `apply_in` answer `Shown`, and the store's session states the rows from its open (`EditSession::own_maps`). An address of such a map is the source's own path, so `PLACE` and `DELETE` reach it through `first_edit` with nothing imported. `store::ADD` (`store::add`) puts an entity of an archetype at a pose into such a source through `Operation::AddEntity`, as a copy of a donor where `donor_of` finds one (an entity of a source of the content with no far model and no child); `added_map` is the source added objects go to, named by the project file's name and `ADDED`, made empty with `or_world_gta5::create` and `import::add_one` where the content holds none, stating the content flag of objects of the highest detail from the start, since no operation states a flag. ⚠ After a `PLACE` or an `ADD` in a map of the project's own, `settle_extents` grows the extents by the box and the distance the install's type files state of each archetype the pack declares none for, as one more `SetExtents` of the same step: grown by the pack's boxes alone, the map would state a point the game does not stream it from, and the world here would not either. ⚠ A list an inverse states is not grown again. ⚠ A new entity takes one more than the largest guid of its map (`or_world_gta5::create::free_guid`), so the guid of the last entity deleted is given again; an envelope holds the place, the guid and the archetype together and an inverse names a place, so within the map nothing is confused by it. Held by the kit's rule of a session's own map over the hand-built install, and by `an_object_added_to_the_projects_own_map_ships_in_a_build_for_a_fivem_server` in `crates/domain/or-world-registry/tests/gta5_edits_are_written_at_a_flush.rs`: the object flushed is in the map a FiveM resource of the project streams, the same envelope again is stale, and the extents hold it by the game's box. ⚠ A content that keeps no manifest of the game writes no `_manifest.ymf`, as before: what states the map to a server is the resource's own manifest, which declares it a map. **or-maps, what changed.** `changes` says what a map or a type file changed of its base, by object and not by field: `map_changes` and `entity_changes` compare the entities of two typed roots (added, deleted, each one both hold with what it states differently, the unchanged as a count), `types_changes` the archetypes of two type files by name and member, with the entities of an interior, and `source_changes` cooks a metadata source and the base it keeps (`or_source::metadata::compile_base`) and compares the two. An entity is found by its guid where one entity of each file states it, else by its archetype at the same pose, else by its archetype with the nearest pose; two entities of one file with one archetype and one guid are twins, and a twin that moved is listed as ambiguous with the indexes of the entities it may be. The parent links are compared through the matching, since a deletion renumbers them. What a file states of itself beside them (its flags, its extents, the files it depends on) is compared member by member, the records a map types besides its entities are named by the member that holds each family that differs (`MapChanges::records`, such as `carGenerators`) and are not compared record by record, and what no typed member names is said to differ and is not listed. A link is the entity it names and not its number: an entity taken out of the middle of a map is one deletion though every later index shifted, a parent that counts one child fewer because the child is gone is unchanged, and a parent among twins is the same parent while the link stays among them. A link into the parent map is a position in that map's array, which a chain deletion renumbers: `map_changes_under` compares it by the entity it names where a `ParentMap` gives that map's entities, which `PackSources` does for the sources of a pack, so a chain deletion reads as what it took out and a removal alone in a parent map as each link it left on another entity (`a_link_into_the_parent_map_of_a_pack_is_the_entity_it_names_there_and_not_its_number`); `source_changes`, which reads one source, compares such a link as the number it is. A turn is said as the rotation that places the entity, which a `CEntityDef` stores conjugated and a `CMloInstanceDef` as it is. The nearest match needs each entity to be the nearest of the other with no second as near, and two entities of one archetype at one place whose guids both changed are ambiguous, since the order of the file does not tell them apart. Comparing in the other direction swaps what was added and what was deleted, a map compared with itself reports nothing, and four times the entities cost less than ten times the time (`several_thousand_entities_compare_in_time_that_does_not_grow_with_the_square_of_their_number`). The base of a source is cooked to its canonical form, so a source as it was imported reports nothing. `openrage-cli maps changes` prints it through `PackSources`, a name as its text where the reader or the names of the pack give one and as its hash where neither does; a source that cannot be compared, or is not there, is named with the reason and fails the command, and a model or a texture dictionary of the set is passed over ([R70y](../direction/Roadmap.md#r70y-what-a-project-changed-and-putting-it-back)). @@ -1350,9 +1350,9 @@ into several (`ImportReport::splits`). - An inverse states the digest of each source as its edit left it (`Restored::expects`), so `restore_sources` is refused over a later edit of the source, which would be discarded with no word, and edits are taken back the last first (`the_inverse_of_an_edit_is_refused_over_a_later_edit_of_the_same_source_and_taken_back_in_order`); a list a person writes may state none. ⚠ A source whose document was written and whose glb then could not be is not put back. - Left: the tool, with its pick, its rectangle and the game's list of materials; the proposal inside the preview of a deletion ([R70k](../direction/Roadmap.md#r70k-removing-what-the-game-placed)) and behind a move in the world ([R70i](../direction/Roadmap.md#r70i-selecting-and-moving-in-the-world)), which nothing calls yet, and its step of Undo; a bounds source as content of a maps module; the import of the game's bounds for an object, which the caller does; and the judgement on game files, where the thresholds are unmeasured, on bounds built by hand and on the staged bounds alone. -**or-particle** is the particle editor's half over the owned `.ypt` records in +**or-particle-model** is the particle editor's half over the owned `.ypt` records in `or_io::gta5::particle`: behaviours, domains, keyframes and evolutions as the -editor shows them, and `or_particle::list`, which finds rules by name, adds, +editor shows them, and `or_particle_model::list`, which finds rules by name, adds, renames and removes them, and lays a list out so each rule is held once before a save. @@ -1698,7 +1698,7 @@ the oriented box of a placed object are the object's own, as data a person edits **or-world-gta6.** GTA VI's adapter crate, which so far holds what left the app with no change of behaviour ([R71b](../direction/Roadmap.md#r71b-the-gta-vi-world-behind-the-contract), its second -part): it states no title yet, and `or-worlds` lists none for it. `index` is the index of an install the +part): it states no title yet, and `or-world-registry` lists none for it. `index` is the index of an install the World screen streams from (`WorldIndex`: the maps each pack registers with their boxes, each archetype by its word, where each model's body lies), with what the core's kept file holds of it (`crates/domain/or-world-gta6/src/index/install.rs`, `crates/domain/or-world-gta6/src/index/rows.rs` @@ -1723,7 +1723,7 @@ written before it, and failed with the key snapshot kept from `index::build`. Th and `land_and_water`) and every file of the viewer that names the renderer or the app. ⚠ A line a moved file logs below an error no longer reaches the terminal, and one below `info` no longer reaches the Log panel: both are filtered by crate (`src/diagnostics/mod.rs`). Left: the rest of part 4 and part 5; -the adapter's title and its line in `or-worlds`, which wait for the readers a title opens +the adapter's title and its line in `or-world-registry`, which wait for the readers a title opens with, since an `Entry` of the registry is a title and can state none without one; and the pool's workers keeping their open files in the contract's `Worker`. The contract as built changes the later parts: the world thread is rewritten around the core's driver, so GTA VI's rules go to its rows' gates, its body and its policy, and the kit, which opens a world @@ -2032,7 +2032,7 @@ Left for the rows that follow: the world thread around the driver and the reader - **A node's name.** `crates/domain/or-world-gta5/src/map/named.rs`. An entity of a map is named by the logical path of its map file, its place among the file's entities and its guid, as ` entity guid `: the words `openrage-cli world find` prints a placement by, and what `maps edit-game` takes as `--map` and `--entity`. An entity of an interior is named by its instance's address, then `interior entity` and its place among the interior's own, which no verb takes yet. Its archetype's name is the stem of its model's file where that file is the archetype's own and is called by it; an entry of a drawable dictionary has a hash alone (`a_node_is_named_by_the_path_of_its_map_file_its_place_and_its_guid_there`). `world_forest::read::Placed` carries the entity's guid for it. ⚠ An address is read back by its path and its places alone: no map file is opened to hold the guid against. A node of a map of a project's own (`Body::own`) is named `project entity guid `, the source being its path in the project's maps content; `entity_of_address` reads it back with `Addressed::project` set, `node_at` refuses it, having no row to give, and `WorldInstall::node_in` finds its node in a body it is handed. `model_search` is the names a search of the models reads from a linked index, and `find::models_typed` the models a text typed so far lists, each with its name. - **The look, the ground and the collision.** One switch for each map only a request lets in, all labelled alike, since a switch has no name of its own. Its day is its programs', so `WorldLook::frame` hands nothing by name. Its weathers are the names a group may state (`WEATHER_NAMES`), the clear day first, which is the one a session opens under, then any weather a gate of the index names that none of those names hashes to, listed by its number so that the map it gates can be seen (`a_weather_a_group_names_that_no_name_is_known_for_is_listed_by_its_number`). Its water is the level's water file through `or_io`'s `CWaterData`, each quad the game draws as a `WaterQuad`, the hidden and the left-out ones dropped and a cut one as the half that keeps its corner, which is where the file's own `covers` says it lies for every type (`a_cut_quad_of_any_type_is_water_where_the_file_says_it_covers_and_nowhere_else`); an install with no such file has no water, and a file that is no water file is refused (`the_water_file_of_an_install_reaches_the_world_as_sheets_at_their_heights`). ⚠ A pack's own water file is not read. Each ask about the ground, a ray or a box makes a `WorldCollision` and reads the bounds of its column afresh. -It is held by the kit over an install built by hand (`crates/domain/or-worlds/tests/gta5_passes_the_kit.rs`, in the registry's crate, which alone names the title and its edit store; the install in `crates/domain/or-world-gta5/src/test_fixtures/hand_built/mod.rs` over the fixtures of the world index's own suites), where the rule of a list holds nothing of it; by the comparison of `crates/domain/or-world-gta5/tests/compare/mod.rs`, which asks the core's driver over the adapter and `WorldForest` about one view, each from nothing, and names the first difference in the maps wanted, the interiors, each instance's archetype, level, fade, place and box, and the models waited for (`the_scene_of_the_kit_is_selected_as_the_forest_selects_it`, `boxes_orphans_an_interiors_own_ladder_and_a_lost_parent_are_selected_as_the_forest_selects_them`); and by the kept file's tests above. Each part of the adapter was broken once to see its check fail. What neither asks is held in `crates/domain/or-world-gta5/tests/what_no_rule_of_the_kit_asks_of_gta5.rs`, each test seen failing with its part broken: a group's weathers as the gate of its map (`a_map_its_group_gates_by_the_weather_comes_in_under_the_weathers_the_group_names`), a drawable's levels, distances, elements, vertex bytes and triangles (`a_drawable_of_its_own_file_reads_as_the_levels_the_vertices_and_the_triangles_it_states`), the box and what gives no model, the last copy of a drawable, a box overlap by the bound's name and a ray's reach, a placement row's archetype and place, the link of an interior's entity under its instance or its own parent (`an_entity_of_an_interior_stands_under_the_instance_or_under_its_own_parent_there`), an instance's sphere, the capabilities, a map that names itself, a pack the title update patches (`a_pack_the_title_update_patches_links_from_its_sections_as_or_depends_indexes_it`), the sun's side and the keys of an opening; what an option and a layer make of the mount is held beside `mount_of` in `crates/domain/or-world-gta5/src/streaming/title.rs`. Over the installs, in the slow tier (`crates/domain/or-world-gta5/tests/gta5_over_a_real_install.rs`, 2026-11-27, Legacy then Enhanced, with the keys of each executable): the rows joined from the kept sections are byte for byte the index `or-depends` builds, of 11076 and 11052 maps; at eight fixed cameras, each at noon and at midnight, with every model ready and with one in three loading, the driver over the adapter and `WorldForest` want the same maps for the same reason, bring in the same interiors and select the same instances, 16 of 16 views on each install, from 2661 to 8284 instances a view (`the_adapter_selects_as_the_forest_does_at_fixed_cameras_of_a_real_install`); a world at the pack in the middle of the DLC list keeps a file of its own and holds 10032 and 9996 maps, and a second start of either world reads no archive (`a_level_of_a_real_install_keeps_an_index_of_its_own_and_a_second_start_reads_no_archive`); and 12 of the kit's rules hold over a scene read off the index, the world opened with the keys of the executable (`the_rules_of_the_kit_that_take_no_built_scene_hold_over_a_real_install`, 2026-11-28): the policy, the frame, the slots, what streams, what draws, the columns, a child's parent, a held map, a map by the clock, and three more below. ⚠ The rule of the capabilities is no longer one of them: since GTA V states an edit store it wants that store beside the world, which this crate cannot name, so that suite asks the world itself for the ground, the highest of a fixed camera's column as `or-depends` finds it over a mount of its own, for a ray down to it, and for the placement rows, counted against the map as its reader reads it (passed on Legacy on 2026-11-28 after that change, not seen failing since it, and not run on Enhanced). The three more: the kept index, built afresh in a folder of its own; an interior, at a fixed camera whose selection holds instances inside one, counted as `WorldForest` selects them; and the lights and occluders, counted against the maps in the forest as `or_world_gta5::MapData` reads them, 80791 far lights and 1374 occluders at the first camera on Legacy and 79527 and 1374 on Enhanced. ⚠ The rule of the models is asked there and its answer printed, and it holds on neither install: it wants every texture of every model, and some do not read, as below. The others are not asked there: a parent that draws alone until its children load states a scene no real map is arranged as, a list has nothing laid out, and the capabilities and the four rules of an edit store want the store, which the registry's crate names. +It is held by the kit over an install built by hand (`crates/domain/or-world-registry/tests/gta5_passes_the_kit.rs`, in the registry's crate, which alone names the title and its edit store; the install in `crates/domain/or-world-gta5/src/test_fixtures/hand_built/mod.rs` over the fixtures of the world index's own suites), where the rule of a list holds nothing of it; by the comparison of `crates/domain/or-world-gta5/tests/compare/mod.rs`, which asks the core's driver over the adapter and `WorldForest` about one view, each from nothing, and names the first difference in the maps wanted, the interiors, each instance's archetype, level, fade, place and box, and the models waited for (`the_scene_of_the_kit_is_selected_as_the_forest_selects_it`, `boxes_orphans_an_interiors_own_ladder_and_a_lost_parent_are_selected_as_the_forest_selects_them`); and by the kept file's tests above. Each part of the adapter was broken once to see its check fail. What neither asks is held in `crates/domain/or-world-gta5/tests/what_no_rule_of_the_kit_asks_of_gta5.rs`, each test seen failing with its part broken: a group's weathers as the gate of its map (`a_map_its_group_gates_by_the_weather_comes_in_under_the_weathers_the_group_names`), a drawable's levels, distances, elements, vertex bytes and triangles (`a_drawable_of_its_own_file_reads_as_the_levels_the_vertices_and_the_triangles_it_states`), the box and what gives no model, the last copy of a drawable, a box overlap by the bound's name and a ray's reach, a placement row's archetype and place, the link of an interior's entity under its instance or its own parent (`an_entity_of_an_interior_stands_under_the_instance_or_under_its_own_parent_there`), an instance's sphere, the capabilities, a map that names itself, a pack the title update patches (`a_pack_the_title_update_patches_links_from_its_sections_as_or_depends_indexes_it`), the sun's side and the keys of an opening; what an option and a layer make of the mount is held beside `mount_of` in `crates/domain/or-world-gta5/src/streaming/title.rs`. Over the installs, in the slow tier (`crates/domain/or-world-gta5/tests/gta5_over_a_real_install.rs`, 2026-11-27, Legacy then Enhanced, with the keys of each executable): the rows joined from the kept sections are byte for byte the index `or-depends` builds, of 11076 and 11052 maps; at eight fixed cameras, each at noon and at midnight, with every model ready and with one in three loading, the driver over the adapter and `WorldForest` want the same maps for the same reason, bring in the same interiors and select the same instances, 16 of 16 views on each install, from 2661 to 8284 instances a view (`the_adapter_selects_as_the_forest_does_at_fixed_cameras_of_a_real_install`); a world at the pack in the middle of the DLC list keeps a file of its own and holds 10032 and 9996 maps, and a second start of either world reads no archive (`a_level_of_a_real_install_keeps_an_index_of_its_own_and_a_second_start_reads_no_archive`); and 12 of the kit's rules hold over a scene read off the index, the world opened with the keys of the executable (`the_rules_of_the_kit_that_take_no_built_scene_hold_over_a_real_install`, 2026-11-28): the policy, the frame, the slots, what streams, what draws, the columns, a child's parent, a held map, a map by the clock, and three more below. ⚠ The rule of the capabilities is no longer one of them: since GTA V states an edit store it wants that store beside the world, which this crate cannot name, so that suite asks the world itself for the ground, the highest of a fixed camera's column as `or-depends` finds it over a mount of its own, for a ray down to it, and for the placement rows, counted against the map as its reader reads it (passed on Legacy on 2026-11-28 after that change, not seen failing since it, and not run on Enhanced). The three more: the kept index, built afresh in a folder of its own; an interior, at a fixed camera whose selection holds instances inside one, counted as `WorldForest` selects them; and the lights and occluders, counted against the maps in the forest as `or_world_gta5::MapData` reads them, 80791 far lights and 1374 occluders at the first camera on Legacy and 79527 and 1374 on Enhanced. ⚠ The rule of the models is asked there and its answer printed, and it holds on neither install: it wants every texture of every model, and some do not read, as below. The others are not asked there: a parent that draws alone until its children load states a scene no real map is arranged as, a list has nothing laid out, and the capabilities and the four rules of an edit store want the store, which the registry's crate names. What a selection draws with is measured by `the_models_and_textures_a_selection_draws_with_read_at_fixed_cameras` of the same suite (2026-11-28), over the selections of the eight cameras at noon, each camera's asks read as one batch and summed, so a model two cameras see is counted twice. Every model reads: 11558 of 11558 on Legacy, all by the Legacy layout, 2799 from a drawable of its own file, 8191 from a drawable dictionary and 568 from a fragment; 11559 of 11559 on Enhanced, all by the Enhanced layout, 2799, 8192 and 568. Their surfaces ask for 18590 textures on Legacy, of which 18247 are answered, and 18592 on Enhanced, of which 18249 are. The 343 not answered are the same on both: 220 in a format the core's texture has no word for, DXT3, and 15 in another, A8; 22 bound by name on an archetype that states no texture dictionary; 56 that no dictionary of their chain holds; and 30 whose archetype names a dictionary the mount holds no file of. ⚠ Before a texture bound by name was looked for in the model's own dictionary, Enhanced answered 11499 of 17711: an Enhanced file binds by name what a Legacy file binds by its place in the dictionary the model carries (`a_texture_bound_by_name_that_the_models_own_dictionary_holds_is_asked_for_there`). The first camera's read, on one thread with the files in the system's cache: on Legacy 1880 models from 747 files of 122 MB in 2.4 s and 2938 textures from 478 files of 252 MB in 4.2 s, 431 MB held as vertex, index and level bytes; on Enhanced the same asks but one from 747 files of 108 MB in 3.5 s and 478 of 206 MB in 5.6 s, 450 MB held. The bodies of those selections state 277641 far lights on Legacy and 276874 on Enhanced with none left unread, 2668 box occluders and 645 occlude models on each with none unread, and 7560 and 7562 instance lists that are counted and not laid out. The hand-built checks are in `crates/domain/or-world-gta5/tests/gta5_reads_what_a_frame_draws_with.rs`: a drawable of each holding and each target, written by `or-io`'s own writers and its retargeting, reads to the vertex bytes, the layout, the levels and the surface built; a model that cannot be read states its reason and the contract's reader hands back the rest; a texture is found through its chain with each dictionary opened once, and one whose chain lacks a file or holds one that does not read says which; and a body states the far lights and occluders of a hand-built map. Sixteen breaks of the adapter, one at a time, each turned one of them or the kit's rule of the lights red. A second pass of 23 breaks (2026-11-28) left eleven green, and the same file now holds what they guard: a channel an Enhanced file keeps in a run of its own (`a_channel_an_enhanced_file_keeps_in_a_run_of_its_own_is_gathered_a_vertex_at_a_time`); the dictionary before the fragment before the loose drawable, and the blend by draw bucket; a model with no level, no drawable or no triangle list; each format the core's texture has a word for, with DXT3, a cube, a volume, a tiled texture, a store that holds no whole level and a chain that comes round on itself (`a_texture_reads_in_the_format_its_file_states_and_one_that_cannot_says_why`); an occlude model whose triangle names a point it lacks; and the count of a map's lists. A geometry `or-io`'s writer refuses, with an index past its vertices or part of a vertex, is built in memory beside `mesh_of` in `crates/domain/or-world-gta5/src/archetypes/models.rs`. ⚠ The install measure asserted only that something read. It now fails below 99 in 100 models or 19 in 20 textures, on a far light or an occlude model left unread, and on a mesh one of whose positions is no number within 10 km of its model's origin; it was seen failing on Enhanced with a texture bound by name never the model's own, and on Legacy with an element's offset one byte off. ⚠ No file states its colours as sRGB, 0 of the 18247 textures answered on Legacy and 0 of the 18249 on Enhanced (the same test, 2026-11-28), so a frame takes a colour texture's space from what its surface asks it as and never from the texture's own flag. ⚠ At these cameras no Enhanced file keeps a channel in a run of its own: with the gathering made to write wrong bytes the measure there does not change, so the file built by hand is all that holds it. @@ -2164,9 +2164,9 @@ script asks. ⚠ A new game's own script asks for some of them at its start, and index reads says which, so the screen can lack a place the game shows from its first minute; `WorldLook::switches` states a switch for each, and no screen shows them. -**or-worlds.** The titles whose world this build opens, listed once (`titles`), in the manner of `kinds` in `crates/domain/or-content/src/lib.rs`: an `Entry` is a title and, where its edits go through the contract, its edit store, which GTA V's do not yet. ⚠ GTA V's is the one title it lists: `or-world-gta6` states no title until its readers stand behind the contract, and an entry cannot be without one. `of_game` maps a registered `Game` of `or-title` onto the core's `GameId`, which the core cannot do, having no edge to `or-title`; `of_install` does it for the game a folder is detected as. Every game a title answers for is a registered one and finds that title, and no two titles share an id or a game (`every_game_a_title_answers_for_is_registered_and_finds_its_title`, `no_two_titles_share_an_id_or_a_game`). `crates/tools/or-cli/src/world/neutral.rs` is the world verbs any title answers through it: `openrage-cli world index`, `at`, `ground`, `find` and `select` with `--neutral` open the install through the title the registry gives for it, keep its index in the core's kept file under the configuration folder, and answer by capability, a verb whose capability the world lacks being refused with what it lacks (`a_verb_whose_capability_the_world_lacks_is_refused_with_what_it_lacks`). An option is `--option =` by the title's number of it, which `world index --neutral` lists, and its value is read as the option's kind takes it: `on` or `off`, the number of a choice or its label in any case, or a name as it stands, digits included. A weather is the title's number, in tens or in sixteens after `0x`. They are held over the fake title (`crates/tools/or-cli/src/world/neutral_tests.rs`) and, through `or_cli::run`, over a GTA V install built by hand that the registry finds and GTA V's title opens, where `select` draws what GTA V's own verb draws (`crates/tools/or-cli/tests/the_world_verbs_answer_for_gta5_through_its_title.rs`). ⚠ Without `--neutral` the five verbs are GTA V's own, over `or-depends`, and print what the contract does not state: the files a selection needs, the bound under a point. +**or-world-registry.** The titles whose world this build opens, listed once (`titles`), in the manner of `kinds` in `crates/domain/or-content/src/lib.rs`: an `Entry` is a title and, where its edits go through the contract, its edit store, which GTA V's do not yet. ⚠ GTA V's is the one title it lists: `or-world-gta6` states no title until its readers stand behind the contract, and an entry cannot be without one. `of_game` maps a registered `Game` of `or-title` onto the core's `GameId`, which the core cannot do, having no edge to `or-title`; `of_install` does it for the game a folder is detected as. Every game a title answers for is a registered one and finds that title, and no two titles share an id or a game (`every_game_a_title_answers_for_is_registered_and_finds_its_title`, `no_two_titles_share_an_id_or_a_game`). `crates/tools/or-cli/src/world/neutral.rs` is the world verbs any title answers through it: `openrage-cli world index`, `at`, `ground`, `find` and `select` with `--neutral` open the install through the title the registry gives for it, keep its index in the core's kept file under the configuration folder, and answer by capability, a verb whose capability the world lacks being refused with what it lacks (`a_verb_whose_capability_the_world_lacks_is_refused_with_what_it_lacks`). An option is `--option =` by the title's number of it, which `world index --neutral` lists, and its value is read as the option's kind takes it: `on` or `off`, the number of a choice or its label in any case, or a name as it stands, digits included. A weather is the title's number, in tens or in sixteens after `0x`. They are held over the fake title (`crates/tools/or-cli/src/world/neutral_tests.rs`) and, through `or_cli::run`, over a GTA V install built by hand that the registry finds and GTA V's title opens, where `select` draws what GTA V's own verb draws (`crates/tools/or-cli/tests/the_world_verbs_answer_for_gta5_through_its_title.rs`). ⚠ Without `--neutral` the five verbs are GTA V's own, over `or-depends`, and print what the contract does not state: the files a selection needs, the bound under a point. -**or-worlds.** The titles whose world this build opens, listed once (`titles`), in the manner of `kinds` in `crates/domain/or-content/src/lib.rs`: an `Entry` is a title and, where its edits go through the contract, its edit store, which is `or_maps::store::Gta5Edits` for GTA V: the registry depends on `or-maps`, which depends on GTA V's adapter, so the store is named here and no ring forms. The kit's test of GTA V lives in this crate for the same reason (`crates/domain/or-worlds/tests/gta5_passes_the_kit.rs`). ⚠ GTA V's is the one title it lists: `or-world-gta6` states no title until its readers stand behind the contract, and an entry cannot be without one. `of_game` maps a registered `Game` of `or-title` onto the core's `GameId`, which the core cannot do, having no edge to `or-title`; `of_install` does it for the game a folder is detected as. Every game a title answers for is a registered one and finds that title, and no two titles share an id or a game (`every_game_a_title_answers_for_is_registered_and_finds_its_title`, `no_two_titles_share_an_id_or_a_game`). `crates/tools/or-cli/src/world/neutral.rs` is the world verbs any title answers through it: `openrage-cli world index`, `at`, `ground`, `find` and `select` with `--neutral` open the install through the title the registry gives for it, keep its index in the core's kept file under the configuration folder, and answer by capability, a verb whose capability the world lacks being refused with what it lacks (`a_verb_whose_capability_the_world_lacks_is_refused_with_what_it_lacks`). An option is `--option =` by the title's number of it, which `world index --neutral` lists, and its value is read as the option's kind takes it: `on` or `off`, the number of a choice or its label in any case, or a name as it stands, digits included. A weather is the title's number, in tens or in sixteens after `0x`. They are held over the fake title (`crates/tools/or-cli/src/world/neutral_tests.rs`) and, through `or_cli::run`, over a GTA V install built by hand that the registry finds and GTA V's title opens, where `select` draws what GTA V's own verb draws (`crates/tools/or-cli/tests/the_world_verbs_answer_for_gta5_through_its_title.rs`). ⚠ Without `--neutral` the five verbs are GTA V's own, over `or-depends`, and print what the contract does not state: the files a selection needs, the bound under a point. +**or-world-registry.** The titles whose world this build opens, listed once (`titles`), in the manner of `kinds` in `crates/domain/or-content/src/lib.rs`: an `Entry` is a title and, where its edits go through the contract, its edit store, which is `or_maps::store::Gta5Edits` for GTA V: the registry depends on `or-maps`, which depends on GTA V's adapter, so the store is named here and no ring forms. The kit's test of GTA V lives in this crate for the same reason (`crates/domain/or-world-registry/tests/gta5_passes_the_kit.rs`). ⚠ GTA V's is the one title it lists: `or-world-gta6` states no title until its readers stand behind the contract, and an entry cannot be without one. `of_game` maps a registered `Game` of `or-title` onto the core's `GameId`, which the core cannot do, having no edge to `or-title`; `of_install` does it for the game a folder is detected as. Every game a title answers for is a registered one and finds that title, and no two titles share an id or a game (`every_game_a_title_answers_for_is_registered_and_finds_its_title`, `no_two_titles_share_an_id_or_a_game`). `crates/tools/or-cli/src/world/neutral.rs` is the world verbs any title answers through it: `openrage-cli world index`, `at`, `ground`, `find` and `select` with `--neutral` open the install through the title the registry gives for it, keep its index in the core's kept file under the configuration folder, and answer by capability, a verb whose capability the world lacks being refused with what it lacks (`a_verb_whose_capability_the_world_lacks_is_refused_with_what_it_lacks`). An option is `--option =` by the title's number of it, which `world index --neutral` lists, and its value is read as the option's kind takes it: `on` or `off`, the number of a choice or its label in any case, or a name as it stands, digits included. A weather is the title's number, in tens or in sixteens after `0x`. They are held over the fake title (`crates/tools/or-cli/src/world/neutral_tests.rs`) and, through `or_cli::run`, over a GTA V install built by hand that the registry finds and GTA V's title opens, where `select` draws what GTA V's own verb draws (`crates/tools/or-cli/tests/the_world_verbs_answer_for_gta5_through_its_title.rs`). ⚠ Without `--neutral` the five verbs are GTA V's own, over `or-depends`, and print what the contract does not state: the files a selection needs, the bound under a point. What [R71d](../direction/Roadmap.md#r71d-the-gta-v-world-behind-the-contract-and-one-kept-file)'s row leaves to this document, beside the two crates above. The contract gained, each with the kit and the fake title: the ground under a point, a ray and a box overlap as methods of `WorldInstall` that a capability gates; a look that lists its switches from the linked index, since GTA V's switches are its files'; a kit scene that states a place with ground under it and may state no list; and a fixture that may keep a scratch folder and name the executable whose keys open it. The fake title states its ground, and its twenty-sixth fault breaks the rule of the capabilities by answering a ground it does not state. For [R71e](../direction/Roadmap.md#r71e-the-gta-v-world-drawn-in-the-fallback-pass) the contract gained, each a provided method so that no other adapter changed: `WorldInstall::water`, level sheets of water as `WaterQuad` behind `Capability::Water`; `WorldLook::weathers`, the weathers a world is looked at under as `WeatherKind`, the first the one it opens under; and `MapBody::unlaid_lists`, how many lists a body states and lays out none of. `TextureFormat` gained `Bc2` and `A8`. The kit asks water of a world that states it and refuses an answer from one that does not, and holds a look to weathers listed once, the fixture's among them, with at least one where a weather gates what streams; the fake title has a pond (`POND`) and one weather, and its three newest faults (`WaterUnstated`, `WeatherTwice`, and `WaterAskew`, a sheet whose edges are the wrong way round) break those rules. `or-depends` changed in three places and in no behaviour: `world_forest::read` and six of its items are public, and `Kept::joined` is new. Left for the owner or a later row: whether those three changes stand or move in [R71n](../direction/Roadmap.md#r71n-the-gta-v-files-moved-into-the-adapter); a name for a switch and a shared reading of a weather's name, each a change of the contract; and whether a file of an archive that does not open is read again at the next start. @@ -2870,7 +2870,7 @@ and `presets` the three sets. (`the_occluders_are_the_boxes_and_the_triangles_their_map_states`). - **What holds it.** The install built by hand has an item or two of each layer by its yard (`crates/domain/or-world-gta5/src/test_fixtures/hand_built/layers.rs`); the kit's rule of the layers runs - over it in `crates/domain/or-worlds/tests/gta5_passes_the_kit.rs`, and + over it in `crates/domain/or-world-registry/tests/gta5_passes_the_kit.rs`, and `crates/domain/or-world-gta5/tests/the_layers_of_a_mount.rs` holds each layer's item to where its file puts it, inside the radius and not outside. - **Measured** by `the_layers_of_a_real_install_at_three_places` (slow tier, 2026-11-30) at a @@ -2916,7 +2916,7 @@ and opens the next. | Module | What it holds | |---|---| | `src/state/world_session/mod.rs` | `WorldSession`, what the screen and the panel ask (where it stands, its capabilities, its title's options, its camera and hour, what is waited for, what could not be read with its reason), and `WorldFeed`, what the bridge takes and tells back: the last selection, models and textures as plain data, the look's frame values, where a model stands on the device | -| `src/state/world_session/driven/mod.rs` | `DrivenSession`: a title of `or_worlds` opens the install, the core's `Driver` streams and selects on the session's thread, and maps, models and textures are read in three of the core's `Pool`s; an interior is read on that thread. Nothing is read on the thread that draws | +| `src/state/world_session/driven/mod.rs` | `DrivenSession`: a title of `or_world_registry` opens the install, the core's `Driver` streams and selects on the session's thread, and maps, models and textures are read in three of the core's `Pool`s; an interior is read on that thread. Nothing is read on the thread that draws | | `src/state/world_session/mesh.rs` | a core `Model`, the game's vertex bytes with their layout, handed on as they are with the maps each mesh's shader binds (`arrived`), its positions alone decoded on a reader to the `Shape` a pick tests | | `src/state/world_session/gta6.rs` | `Gta6Session`, a shell over GTA VI's viewer that hands the bridge no feed, answers a click on a thread of its own, draws a map as its document's tree places it (`lay_document`) and states `Capability::Pick` and `Capability::Edits` | | `src/state/gta6/world/gta6_world_edit.rs` | the World screen's edits of a GTA VI build: `edit_gta6_world_selection` stands, turns or scales the entity picked in the document of its map, opened behind the screen, as one step of that document; `world_follows_the_documents` lays each such map over the world by its document's revision; `world_edited_document` is the document the screen's Undo steps | diff --git a/src/render/meshes.rs b/src/render/meshes.rs index 311dc7179..8bc0103c1 100644 --- a/src/render/meshes.rs +++ b/src/render/meshes.rs @@ -544,7 +544,7 @@ pub fn build_meshes_from_ypt_drawable( asset: &or_io::gta5::PtxFxList, drawable_hash: u32, ) -> Vec { - or_particle::list::model(asset, drawable_hash) + or_particle_model::list::model(asset, drawable_hash) .map_or_else(Vec::new, |mesh| drawable_meshes(mesh, 0, None)) } diff --git a/src/render/particle_gizmos.rs b/src/render/particle_gizmos.rs index e76977b93..40bd95728 100644 --- a/src/render/particle_gizmos.rs +++ b/src/render/particle_gizmos.rs @@ -1,5 +1,5 @@ use glam::{Quat, Vec3, Vec4}; -use or_particle::behaviour::{Behaviour, LightBehaviour}; +use or_particle_model::behaviour::{Behaviour, LightBehaviour}; use or_renderer::LineVertex; use or_simulation::PtfxManager; diff --git a/src/render/particle_models.rs b/src/render/particle_models.rs index dc47d9660..2ebd98807 100644 --- a/src/render/particle_models.rs +++ b/src/render/particle_models.rs @@ -45,10 +45,11 @@ impl ParticleModelMeshCache { return Some(g.clone()); } // The box the engine divides a particle's dimensions by is the drawable's own, which every surface of it shares - let mut size = or_particle::list::model(asset, drawable_hash).map_or([0.0; 3], |model| { - let b = &model.lod_group.bounds_box; - [b.max.x - b.min.x, b.max.y - b.min.y, b.max.z - b.min.z] - }); + let mut size = + or_particle_model::list::model(asset, drawable_hash).map_or([0.0; 3], |model| { + let b = &model.lod_group.bounds_box; + [b.max.x - b.min.x, b.max.y - b.min.y, b.max.z - b.min.z] + }); let mut uploads = build_meshes_from_ypt_drawable(asset, drawable_hash); // A GTA VI list holds no drawable: the one its rule names is a search's find, if any. if uploads.is_empty() { @@ -153,8 +154,8 @@ pub(crate) fn build_model_batches( out } -fn find_camera_shrink(behaviours: &[or_particle::behaviour::Behaviour]) -> f32 { - use or_particle::behaviour::Behaviour; +fn find_camera_shrink(behaviours: &[or_particle_model::behaviour::Behaviour]) -> f32 { + use or_particle_model::behaviour::Behaviour; for b in behaviours { if let Behaviour::DrawModel(d) = b { return d.camera_shrink.max(0.0); diff --git a/src/render/particles/mod.rs b/src/render/particles/mod.rs index 1a428d03e..992bbed05 100644 --- a/src/render/particles/mod.rs +++ b/src/render/particles/mod.rs @@ -12,7 +12,7 @@ use or_io::decl::Gen8; use or_io::gta5::data::ptx_clip_regions::ClipRegionTable; use or_io::gta5::particle::{PtxEffectRule, PtxParticleRule, ShaderVar}; use or_io::gta5::PtxFxList; -use or_particle::behaviour::Behaviour; +use or_particle_model::behaviour::Behaviour; use or_renderer::particles::{ ParticleAlignment, ParticleBatch, ParticleBlendMode, ParticleCullMode, ParticleInstance, }; @@ -291,7 +291,7 @@ pub(crate) fn resolve_atlas_dims( clip_regions: &ClipRegionTable, ) -> (u32, u32) { if let Some(name) = diffuse_texture_name { - let hash = or_particle::rage::hash::string_hash(name.as_bytes()); + let hash = or_particle_model::rage::hash::string_hash(name.as_bytes()); if let Some(entry) = clip_regions.get_by_hash(hash) { trace_once_atlas_engine(&rule.name, name, entry.num_rows, entry.num_columns); return (entry.num_rows.max(1), entry.num_columns.max(1)); diff --git a/src/render/trails.rs b/src/render/trails.rs index 9d1080d98..4baaab60d 100644 --- a/src/render/trails.rs +++ b/src/render/trails.rs @@ -1,7 +1,7 @@ use glam::{Vec3, Vec4}; use or_io::gta5::particle::{PtxParticleRule, ShaderVar}; use or_io::gta5::PtxFxList; -use or_particle::behaviour::Behaviour; +use or_particle_model::behaviour::Behaviour; use or_renderer::trails::{ trail_tessellation_enabled, TrailBatch, TrailVertex, MAX_TRAIL_TESSELLATION, }; @@ -63,7 +63,7 @@ pub fn build_trail_batches( 0 }; let (wrap_length, tex_offset) = if let Some(d) = trail_data { - tex_info_at(d, 0.0, or_particle::list::code(&rules.rule.name)) + tex_info_at(d, 0.0, or_particle_model::list::code(&rules.rule.name)) } else { (1.0, 0.0) }; @@ -131,7 +131,7 @@ pub fn build_trail_batches( fn find_draw_trail( behaviours: &[Behaviour], -) -> Option<&or_particle::behaviour::DrawTrailBehaviour> { +) -> Option<&or_particle_model::behaviour::DrawTrailBehaviour> { for b in behaviours { if let Behaviour::DrawTrail(d) = b { return Some(d); @@ -141,7 +141,7 @@ fn find_draw_trail( } fn tex_info_at( - d: &or_particle::behaviour::DrawTrailBehaviour, + d: &or_particle_model::behaviour::DrawTrailBehaviour, time: f32, rand_seed: u32, ) -> (f32, f32) { diff --git a/src/state/capabilities.rs b/src/state/capabilities.rs index 219c37954..30792a798 100644 --- a/src/state/capabilities.rs +++ b/src/state/capabilities.rs @@ -624,7 +624,10 @@ use crate::ui::panels::inspector::rows as inspector; fn ypt_summary(payload: &DocPayload, _sel: SelectionKey) -> String { fn effects(list: &or_io::gta5::PtxFxList) -> String { - format!("{} effects", or_particle::list::effect_rules(list).count()) + format!( + "{} effects", + or_particle_model::list::effect_rules(list).count() + ) } match payload { DocPayload::Resource(or_io::Asset::Particles(list)) => effects(list), diff --git a/src/state/drivers/exposure.rs b/src/state/drivers/exposure.rs index ad45aa081..55e11e13f 100644 --- a/src/state/drivers/exposure.rs +++ b/src/state/drivers/exposure.rs @@ -1,4 +1,4 @@ -use or_particle::rules::EvolutionList; +use or_particle_model::rules::EvolutionList; pub const EXPOSURE_EVOLUTION_NAMES: &[&str] = &["exposure", "hdrexposure", "luminance"]; diff --git a/src/state/drivers/mod.rs b/src/state/drivers/mod.rs index f7d758b62..3783161dd 100644 --- a/src/state/drivers/mod.rs +++ b/src/state/drivers/mod.rs @@ -12,7 +12,7 @@ pub use weather::{WeatherDriver, WeatherState}; pub use world::{WorldEvolutionDriver, WorldPhysicsDriver}; pub use world_background::WorldBackgroundDriver; -use or_particle::rules::EvolutionList; +use or_particle_model::rules::EvolutionList; use or_simulation::{EffectInst, PtfxManager}; #[derive(Debug, Clone, Default)] diff --git a/src/state/drivers/time_of_day.rs b/src/state/drivers/time_of_day.rs index a867431b3..3383bb210 100644 --- a/src/state/drivers/time_of_day.rs +++ b/src/state/drivers/time_of_day.rs @@ -1,4 +1,4 @@ -use or_particle::rules::EvolutionList; +use or_particle_model::rules::EvolutionList; pub const TOD_EVOLUTION_NAMES: &[&str] = &["timeofday", "tod", "time_of_day", "hour"]; diff --git a/src/state/drivers/weather.rs b/src/state/drivers/weather.rs index 800487c8d..1e236d181 100644 --- a/src/state/drivers/weather.rs +++ b/src/state/drivers/weather.rs @@ -1,4 +1,4 @@ -use or_particle::rules::EvolutionList; +use or_particle_model::rules::EvolutionList; pub const WEATHER_EVOLUTION_NAMES: &[&str] = &["weather", "weathertype", "rain", "wetness"]; diff --git a/src/state/drivers/world.rs b/src/state/drivers/world.rs index 497a75b8f..ae23e9e6d 100644 --- a/src/state/drivers/world.rs +++ b/src/state/drivers/world.rs @@ -1,4 +1,4 @@ -use or_particle::rules::EvolutionList; +use or_particle_model::rules::EvolutionList; use or_simulation::{behaviours::ConstantWaterField, PtfxManager}; use std::sync::Arc; diff --git a/src/state/gta6/particles/gta6_particles/mod.rs b/src/state/gta6/particles/gta6_particles/mod.rs index 63450669c..d5de18dbc 100644 --- a/src/state/gta6/particles/gta6_particles/mod.rs +++ b/src/state/gta6/particles/gta6_particles/mod.rs @@ -64,7 +64,7 @@ pub(in crate::state) fn opened( let (virtual_section, physical) = resource.sections(bytes); let list = read_particle_effects(virtual_section, Some(physical)).ok()?; let mut ypt = as_ypt(&list); - or_particle::list::canonical(&mut ypt); + or_particle_model::list::canonical(&mut ypt); scanned(particles).insert(path.to_path_buf(), Arc::new(lines(&list))); sprites::keep(particles, path, &list); spawners::keep(particles, path, &list); diff --git a/src/state/gta6/particles/gta6_particles/tests/colour.rs b/src/state/gta6/particles/gta6_particles/tests/colour.rs index 4422a3e65..1e3f9fafe 100644 --- a/src/state/gta6/particles/gta6_particles/tests/colour.rs +++ b/src/state/gta6/particles/gta6_particles/tests/colour.rs @@ -23,7 +23,7 @@ fn coloured(colours_used: u32, max: &[([f32; 4], [f32; 4])]) -> ParticleEffects } fn enable(ypt: &mut PtxFxList) -> &mut Bool8 { - let rule = or_particle::list::particle_rules_mut(ypt) + let rule = or_particle_model::list::particle_rules_mut(ypt) .next() .expect("a particle rule"); (rule.all_behaviours.iter_mut()) @@ -42,7 +42,7 @@ fn a_colours_maximum_is_drawn_where_two_or_more_are_in_use_and_an_edit_saves_as_ for (used, drawn) in [(0, false), (1, false), (2, true), (3, true), (5, true)] { let stored = coloured(used, &MAX); let mut ypt = as_ypt(&stored); - or_particle::list::canonical(&mut ypt); + or_particle_model::list::canonical(&mut ypt); assert_eq!(enable(&mut ypt).get(), drawn, "{used} colours in use"); assert_eq!( from_ypt(&stored, &ypt), @@ -56,7 +56,7 @@ fn a_colours_maximum_is_drawn_where_two_or_more_are_in_use_and_an_edit_saves_as_ }; assert_eq!(colours_used >= 2, !drawn, "{used} edited"); let mut back = as_ypt(&edited); - or_particle::list::canonical(&mut back); + or_particle_model::list::canonical(&mut back); assert_eq!(enable(&mut back).get(), !drawn, "{used} read back"); } } diff --git a/src/state/gta6/particles/gta6_particles/tests/mod.rs b/src/state/gta6/particles/gta6_particles/tests/mod.rs index 6eee27188..26256bb6e 100644 --- a/src/state/gta6/particles/gta6_particles/tests/mod.rs +++ b/src/state/gta6/particles/gta6_particles/tests/mod.rs @@ -164,7 +164,7 @@ fn list() -> ParticleEffects { fn an_unedited_gta_v_form_gives_the_gta_vi_list_back() { let stored = list(); let mut ypt = as_ypt(&stored); - or_particle::list::canonical(&mut ypt); + or_particle_model::list::canonical(&mut ypt); let back = crate::state::gta6_particles_save::from_ypt(&stored, &ypt); assert_eq!(back, Ok(stored)); } @@ -172,10 +172,12 @@ fn an_unedited_gta_v_form_gives_the_gta_vi_list_back() { #[test] fn edits_of_the_shared_values_reach_the_gta_vi_list_and_any_other_is_refused() { use crate::state::gta6_particles_save::from_ypt; - use or_particle::list::{effect_rules_mut, emitter_rules_mut, events_mut, particle_rules_mut}; + use or_particle_model::list::{ + effect_rules_mut, emitter_rules_mut, events_mut, particle_rules_mut, + }; let stored = list(); let mut ypt = as_ypt(&stored); - or_particle::list::canonical(&mut ypt); + or_particle_model::list::canonical(&mut ypt); let effect = effect_rules_mut(&mut ypt).next().expect("an effect"); effect.duration_max = 9.0; effect.sort_events_by_distance = Bool8::new(false); diff --git a/src/state/gta6/particles/gta6_particles/tests/remove.rs b/src/state/gta6/particles/gta6_particles/tests/remove.rs index 01e1e64b7..480f7474c 100644 --- a/src/state/gta6/particles/gta6_particles/tests/remove.rs +++ b/src/state/gta6/particles/gta6_particles/tests/remove.rs @@ -1,7 +1,7 @@ //! A rule deleted from a scanned list's GTA V form and an event bound to another rule, as the //! removals and the values its save writes. -use or_particle::list::{canonical, effect_rules_mut, events_mut, remove_emitter_rule}; +use or_particle_model::list::{canonical, effect_rules_mut, events_mut, remove_emitter_rule}; use super::*; use crate::state::gta6_particles_save::{from_ypt, remove::removals}; diff --git a/src/state/gta6/particles/gta6_particles_save/copies.rs b/src/state/gta6/particles/gta6_particles_save/copies.rs index d7e3006d9..0fc81bf54 100644 --- a/src/state/gta6/particles/gta6_particles_save/copies.rs +++ b/src/state/gta6/particles/gta6_particles_save/copies.rs @@ -12,7 +12,9 @@ use or_io::gta6::headerless::{ copy_particle_behaviour, duplicate_particle_emitter, duplicate_particle_event, duplicate_particle_rule, read_particle_effects, Event, ParticleEffects, ParticleRule, }; -use or_particle::list::{effect_rules, emitter_rules, events, particle_rules, particle_rules_mut}; +use or_particle_model::list::{ + effect_rules, emitter_rules, events, particle_rules, particle_rules_mut, +}; use crate::state::gta6_particles::behaviour; diff --git a/src/state/gta6/particles/gta6_particles_save/mod.rs b/src/state/gta6/particles/gta6_particles_save/mod.rs index c69f074d3..c2a9bb08b 100644 --- a/src/state/gta6/particles/gta6_particles_save/mod.rs +++ b/src/state/gta6/particles/gta6_particles_save/mod.rs @@ -16,7 +16,7 @@ use or_io::gta6::headerless::{ remove_from_particle_effects, write_particle_effects, EffectRule, EmitterRule, Kfp, KfpEntry, ParticleEffects, SpawnedScalars, }; -use or_particle::list::{ +use or_particle_model::list::{ canonical, effect_rules, effect_rules_mut, emitter_rules, events, events_mut, particle_rules, }; diff --git a/src/state/gta6/particles/gta6_particles_save/remove.rs b/src/state/gta6/particles/gta6_particles_save/remove.rs index 8e03a6eaf..7c3386043 100644 --- a/src/state/gta6/particles/gta6_particles_save/remove.rs +++ b/src/state/gta6/particles/gta6_particles_save/remove.rs @@ -5,7 +5,7 @@ use std::collections::{BTreeSet, HashSet}; use or_io::gta5::particle::PtxFxList; use or_io::gta6::headerless::{ParticleEffects, ParticleRemovals}; -use or_particle::list::{effect_rules, emitter_rules, particle_rules}; +use or_particle_model::list::{effect_rules, emitter_rules, particle_rules}; /// The places in `held`'s order of the names `kept` lacks. fn gone<'a>(kept: &HashSet<&str>, held: impl Iterator) -> BTreeSet { diff --git a/src/state/models.rs b/src/state/models.rs index 64be72494..401f34c35 100644 --- a/src/state/models.rs +++ b/src/state/models.rs @@ -61,9 +61,9 @@ pub(crate) mod rows { fn models( list: &or_io::gta5::PtxFxList, ) -> Vec { - or_particle::list::models(list) + or_particle_model::list::models(list) .map(|(hash, _)| { - let name = or_particle::list::model_info(list, hash) + let name = or_particle_model::list::model_info(list, hash) .map(|d| d.name.clone()) .filter(|n| !n.is_empty()) .unwrap_or_else(|| format!("#{hash:08X}")); diff --git a/src/state/name_index.rs b/src/state/name_index.rs index 91a189a2b..ac375659b 100644 --- a/src/state/name_index.rs +++ b/src/state/name_index.rs @@ -151,10 +151,10 @@ pub type NameBatch = Vec<(NameIndexCategory, String)>; pub fn names_in(payload: &DocPayload) -> NameBatch { match payload { DocPayload::Resource(or_io::Asset::Particles(list)) => { - effect_rule_names(or_particle::list::effect_rules(list).map(|e| &e.name)) + effect_rule_names(or_particle_model::list::effect_rules(list).map(|e| &e.name)) } DocPayload::Resource(or_io::Asset::ParticlesGen9(list)) => { - effect_rule_names(or_particle::list::effect_rules(list).map(|e| &e.name)) + effect_rule_names(or_particle_model::list::effect_rules(list).map(|e| &e.name)) } _ => NameBatch::new(), } diff --git a/src/state/payload_handlers.rs b/src/state/payload_handlers.rs index b2a83c691..52f322d7a 100644 --- a/src/state/payload_handlers.rs +++ b/src/state/payload_handlers.rs @@ -269,8 +269,8 @@ fn save_ypt(payload: &DocPayload, repair: Repair) -> Result<(Vec, Vec or_particle::list::canonical(list), - Asset::ParticlesGen9(list) => or_particle::list::canonical(list), + Asset::Particles(list) => or_particle_model::list::canonical(list), + Asset::ParticlesGen9(list) => or_particle_model::list::canonical(list), _ => {} } } @@ -419,11 +419,11 @@ mod tests { let DocPayload::Resource(Asset::Particles(list)) = &mut payload else { return None; }; - let names: Vec = or_particle::list::emitter_rules(list) + let names: Vec = or_particle_model::list::emitter_rules(list) .map(|r| r.name.clone()) .collect(); - let event = or_particle::list::effect_rules_mut(list) - .flat_map(or_particle::list::events_mut) + let event = or_particle_model::list::effect_rules_mut(list) + .flat_map(or_particle_model::list::events_mut) .find(|e| names.iter().any(|n| *n != e.emitter_rule_name))?; event.emitter_rule_name = names.into_iter().find(|n| *n != event.emitter_rule_name)?; Some((path.clone(), payload)) diff --git a/src/state/reload_open_file.rs b/src/state/reload_open_file.rs index 180a6da5d..28b4866fc 100644 --- a/src/state/reload_open_file.rs +++ b/src/state/reload_open_file.rs @@ -83,7 +83,7 @@ impl AppState { }; match ::from_bytes(&bytes) { Ok(mut list) => { - or_particle::list::canonical(&mut list); + or_particle_model::list::canonical(&mut list); let resource = super::document_io::resource_image_for(DocumentKind::Ypt, &bytes); if let Some(doc) = self.document_mut(doc_id) { doc.payload = super::DocPayload::Resource(or_io::Asset::Particles(list)); diff --git a/src/state/rpf/rpf_archive_open/tree_verbs/headerless_tests/saves_per_kind/edits.rs b/src/state/rpf/rpf_archive_open/tree_verbs/headerless_tests/saves_per_kind/edits.rs index 0bd4966df..16175f0b9 100644 --- a/src/state/rpf/rpf_archive_open/tree_verbs/headerless_tests/saves_per_kind/edits.rs +++ b/src/state/rpf/rpf_archive_open/tree_verbs/headerless_tests/saves_per_kind/edits.rs @@ -392,7 +392,7 @@ pub(super) fn edit_height(state: &mut AppState, doc: DocumentId) -> Result<(), S fn first_effect(p: &mut DocPayload) -> Option<&mut PtxEffectRule> { match p { DocPayload::Resource(or_io::Asset::Particles(list)) => { - or_particle::list::effect_rules_mut(list).next() + or_particle_model::list::effect_rules_mut(list).next() } _ => None, } diff --git a/src/state/selection_lookup.rs b/src/state/selection_lookup.rs index e4a6fddab..4776469e2 100644 --- a/src/state/selection_lookup.rs +++ b/src/state/selection_lookup.rs @@ -130,7 +130,7 @@ pub fn ypt_drawable_for_selection( list: &PtxFxList, selection: SelectionKey, ) -> Option<&or_io::gta5::drawable::RmcDrawable> { - or_particle::list::model(list, selection.dict_hash()?) + or_particle_model::list::model(list, selection.dict_hash()?) } pub fn ydr_drawable_texture_name_for_selection( @@ -177,7 +177,7 @@ pub fn ypt_model_texture_names( ) -> Vec { let mut out: Vec = Vec::new(); let mut seen: std::collections::HashSet = std::collections::HashSet::new(); - let Some(mesh) = or_particle::list::model(asset, model_hash) else { + let Some(mesh) = or_particle_model::list::model(asset, model_hash) else { return out; }; let Some(group) = mesh.shader_group.as_deref() else { @@ -236,13 +236,13 @@ pub fn ypt_model_texture_lookup<'a, T: Lookup>( .and_then(|sg| sg.texture_dictionary.as_deref()), ) }; - if let Some(tex) = or_particle::list::model(asset, model_hash).and_then(of_model) { + if let Some(tex) = or_particle_model::list::model(asset, model_hash).and_then(of_model) { return Some(tex); } if let Some(tex) = lookup(asset.texture_dict.as_deref()) { return Some(tex); } - or_particle::list::models(asset) + or_particle_model::list::models(asset) .filter(|(h, _)| *h != model_hash) .find_map(|(_, model)| of_model(model)) } diff --git a/src/state/tests/a_pinned_inspector_shows_its_own_document.rs b/src/state/tests/a_pinned_inspector_shows_its_own_document.rs index b4c75b47c..d092ee091 100644 --- a/src/state/tests/a_pinned_inspector_shows_its_own_document.rs +++ b/src/state/tests/a_pinned_inspector_shows_its_own_document.rs @@ -73,7 +73,7 @@ impl Gesture { }) } (Gesture::Effect, DocPayload::Resource(Asset::Particles(list))) => { - or_particle::list::effect_rules(list).next()?; + or_particle_model::list::effect_rules(list).next()?; Some((SelectionKey::YptEffect(0), "duration_min".into())) } _ => None, diff --git a/src/state/tests/adding_particle_files_is_an_import.rs b/src/state/tests/adding_particle_files_is_an_import.rs index 47e41f0c3..2ceb1af30 100644 --- a/src/state/tests/adding_particle_files_is_an_import.rs +++ b/src/state/tests/adding_particle_files_is_an_import.rs @@ -46,7 +46,7 @@ fn sources_of(folder: &Path) -> Vec { fn one_undo_takes_the_added_files_out_of_the_pack_and_one_redo_puts_them_back() { let dir = tempfile::tempdir().unwrap(); let (mut state, folder) = a_particles_project(dir.path()); - let ypt = or_particle::sample::list_of("fx_test", &["fx_spark"]); + let ypt = or_particle_model::sample::list_of("fx_test", &["fx_spark"]); state.add_particles(vec![dropped(dir.path(), "fx_test.ypt", &ypt)]); until(&mut state, "the import", |s| { !s.workbench.imports.is_running() diff --git a/src/state/tests/every_viewer_path_takes_both_targets.rs b/src/state/tests/every_viewer_path_takes_both_targets.rs index 99fde6bcd..65f93bbee 100644 --- a/src/state/tests/every_viewer_path_takes_both_targets.rs +++ b/src/state/tests/every_viewer_path_takes_both_targets.rs @@ -284,7 +284,7 @@ fn the_gallery_lists_an_enhanced_files_models_as_a_legacy_ones() { /// The code of the first model in `list` whose first level of detail holds a geometry. fn a_model_with_geometry(list: &PtxFxList) -> Option { - or_particle::list::models(list).find_map(|(code, model)| { + or_particle_model::list::models(list).find_map(|(code, model)| { let lod = &model.lod_group.lods[0]; lod.models .iter() diff --git a/src/state/tests/the_default_views_in_a_modders_words.rs b/src/state/tests/the_default_views_in_a_modders_words.rs index 143276b22..ce8a9d908 100644 --- a/src/state/tests/the_default_views_in_a_modders_words.rs +++ b/src/state/tests/the_default_views_in_a_modders_words.rs @@ -109,7 +109,7 @@ fn geometry_selections(state: &AppState, id: DocumentId) -> Vec { }) .into_iter() .collect(), - Asset::Particles(list) => or_particle::list::models(list) + Asset::Particles(list) => or_particle_model::list::models(list) .find_map(|(code, model)| { let at = first_geometry(model)?; Some(SelectionKey::dict_part(code, lod(at))) diff --git a/src/state/tests/the_panels_around_the_viewer_take_both_targets.rs b/src/state/tests/the_panels_around_the_viewer_take_both_targets.rs index 8255eafb6..5ca545821 100644 --- a/src/state/tests/the_panels_around_the_viewer_take_both_targets.rs +++ b/src/state/tests/the_panels_around_the_viewer_take_both_targets.rs @@ -11,7 +11,7 @@ use or_io::gta5::{ gen8, gen9, DrawableTarget, FragDrawable, GrmShaderGroup, GtaFragType, PgDictionary, PtxFxList, RmcDrawable, }; -use or_particle::list; +use or_particle_model::list; use or_test_support::{skip_corpus, Corpus, TARGET_GEN9}; use crate::state::prefs::Prefs; diff --git a/src/state/tests/undo_and_the_sliders_follow_the_pinned_inspector.rs b/src/state/tests/undo_and_the_sliders_follow_the_pinned_inspector.rs index b11df57ce..7ecc2f91e 100644 --- a/src/state/tests/undo_and_the_sliders_follow_the_pinned_inspector.rs +++ b/src/state/tests/undo_and_the_sliders_follow_the_pinned_inspector.rs @@ -4,7 +4,7 @@ use or_io::gta5::particle::{PtxEvolution, PtxEvolutionList}; use or_io::Asset; -use or_particle::list; +use or_particle_model::list; use or_test_support::{skip_corpus, Corpus, TARGET_GEN8}; use winit::keyboard::{Key, KeyCode, PhysicalKey}; diff --git a/src/state/textures.rs b/src/state/textures.rs index 5a3d47c4c..115398d18 100644 --- a/src/state/textures.rs +++ b/src/state/textures.rs @@ -1003,11 +1003,11 @@ pub(crate) mod rows { name: &str, ) -> Option> { selected - .and_then(|hash| or_particle::list::model(asset, hash)) + .and_then(|hash| or_particle_model::list::model(asset, hash)) .map(drawable_textures) .into_iter() .chain( - or_particle::list::models(asset) + or_particle_model::list::models(asset) .filter(|(hash, _)| Some(*hash) != selected) .map(|(_, model)| drawable_textures(model)), ) diff --git a/src/state/world_session/driven/mod.rs b/src/state/world_session/driven/mod.rs index cd41643a0..4eba9054c 100644 --- a/src/state/world_session/driven/mod.rs +++ b/src/state/world_session/driven/mod.rs @@ -293,7 +293,7 @@ impl DrivenSession { /// The session of the install `key` names, opened by the title the registry lists for its game with the keys the app keeps for it. pub fn of_install(key: WorldKey, prefs: &Prefs) -> Self { - let Some((entry, game)) = or_worlds::of_game(key.game) else { + let Some((entry, game)) = or_world_registry::of_game(key.game) else { return Self::failed( key, sentence!("No world of this game is opened by this build of OpenRage"), diff --git a/src/state/world_session/mod.rs b/src/state/world_session/mod.rs index 430a68c0f..92fc5bbcb 100644 --- a/src/state/world_session/mod.rs +++ b/src/state/world_session/mod.rs @@ -384,7 +384,7 @@ impl Held { /// The world the World screen shows under `prefs`: the active game's where a title opens a world of it and its folder stands, else the first GTA VI build's with a folder set. pub fn wanted(prefs: &Prefs, held: &Held) -> Option { let active = prefs.active_game.and_then(|game| { - let opens = game.is_gta_vi() || or_worlds::of_game(game).is_some(); + let opens = game.is_gta_vi() || or_world_registry::of_game(game).is_some(); let install = prefs.game_paths.get(game)?; opens.then_some((game, install)) }); diff --git a/src/state/world_session/tests.rs b/src/state/world_session/tests.rs index 1145f430e..028e8344e 100644 --- a/src/state/world_session/tests.rs +++ b/src/state/world_session/tests.rs @@ -169,7 +169,7 @@ fn the_active_install_decides_whose_world_is_opened_and_another_drops_the_one_he ); assert_eq!(state.world.opened, 2); let kinds = state.world_session().map(|session| session.option_kinds()); - let title = or_worlds::of_game(Game::GtaVLegacy) + let title = or_world_registry::of_game(Game::GtaVLegacy) .expect("GTA V has a title") .0 .title; @@ -251,7 +251,7 @@ fn a_map_a_weather_gates_is_in_under_that_weather_and_out_under_the_one_the_worl ]; let install = install(&[("x64a.rpf", files)]); let scratch = tempfile::tempdir().expect("a scratch folder"); - let (entry, game) = or_worlds::of_game(Game::GtaVLegacy).expect("GTA V has a title"); + let (entry, game) = or_world_registry::of_game(Game::GtaVLegacy).expect("GTA V has a title"); let key = WorldKey { game: Game::GtaVLegacy, install: install.path().to_path_buf(), @@ -310,7 +310,7 @@ pub(crate) fn over_the_child() -> (DrivenSession, WorldKey, [tempfile::TempDir; use or_world::contract::WorldSpec; let install = crate::forest_fixture::install(&[("x64a.rpf", crate::hand_built::files())]); let scratch = tempfile::tempdir().expect("a scratch folder"); - let (entry, game) = or_worlds::of_game(Game::GtaVLegacy).expect("GTA V has a title"); + let (entry, game) = or_world_registry::of_game(Game::GtaVLegacy).expect("GTA V has a title"); let key = WorldKey { game: Game::GtaVLegacy, install: install.path().to_path_buf(), diff --git a/src/ui/panels/hierarchy/dispatch.rs b/src/ui/panels/hierarchy/dispatch.rs index 8761ff614..e32d494f7 100644 --- a/src/ui/panels/hierarchy/dispatch.rs +++ b/src/ui/panels/hierarchy/dispatch.rs @@ -164,7 +164,7 @@ pub(crate) mod children { pub(crate) fn ypt(payload: &DocPayload) -> bool { use crate::state::particle_target::{on_particle_target, ParticleTarget}; - use or_particle::list; + use or_particle_model::list; on_particle_target!(payload, T => T::list(payload).is_some_and(|asset| { list::effect_rules(asset).next().is_some() || list::emitter_rules(asset).next().is_some() diff --git a/src/ui/panels/hierarchy/mod.rs b/src/ui/panels/hierarchy/mod.rs index b30374884..9d8e396b0 100644 --- a/src/ui/panels/hierarchy/mod.rs +++ b/src/ui/panels/hierarchy/mod.rs @@ -59,7 +59,7 @@ use ytd::*; use or_io::codec::texture::GrcTextureFormat; use or_io::gta5::PhBoundAny; -use or_particle::domain::PtxDomainShape; +use or_particle_model::domain::PtxDomainShape; use crate::platform::file_dialogs; use crate::state::explorer::{self, SortKey, SortOrder}; diff --git a/src/ui/panels/hierarchy/ypt/menus.rs b/src/ui/panels/hierarchy/ypt/menus.rs index 1f0df0b69..6ffd8941e 100644 --- a/src/ui/panels/hierarchy/ypt/menus.rs +++ b/src/ui/panels/hierarchy/ypt/menus.rs @@ -127,7 +127,7 @@ pub(super) fn add_menu_for_event_emitter( ui.close_kind(egui::UiKind::Menu); } ui.menu_button("Bind emitter rule…", |ui| { - for rule in or_particle::list::emitter_rules(list) { + for rule in or_particle_model::list::emitter_rules(list) { let active = rule.name == current_emitter_name; let label = if active { format!("{} \u{2022} current", rule.name) @@ -143,12 +143,15 @@ pub(super) fn add_menu_for_event_emitter( ui.close_kind(egui::UiKind::Menu); } } - if or_particle::list::emitter_rules(list).next().is_none() { + if or_particle_model::list::emitter_rules(list) + .next() + .is_none() + { ui.add(detail_label("(no emitter rules in library)")); } }); ui.menu_button("Bind particle rule…", |ui| { - for rule in or_particle::list::particle_rules(list) { + for rule in or_particle_model::list::particle_rules(list) { let active = rule.name == current_particle_name; let label = if active { format!("{} \u{2022} current", rule.name) @@ -164,7 +167,10 @@ pub(super) fn add_menu_for_event_emitter( ui.close_kind(egui::UiKind::Menu); } } - if or_particle::list::particle_rules(list).next().is_none() { + if or_particle_model::list::particle_rules(list) + .next() + .is_none() + { ui.add(detail_label("(no particle rules in library)")); } }); @@ -229,11 +235,14 @@ pub(super) fn add_menu_for_behaviour( b_idx: usize, ops: &mut Vec, ) { - use or_particle::Behaviour as B; - let Some(rule) = or_particle::list::particle_rules(list).nth(rule_idx) else { + use or_particle_model::Behaviour as B; + let Some(rule) = or_particle_model::list::particle_rules(list).nth(rule_idx) else { return; }; - let Some(held) = or_particle::list::behaviours(rule).into_iter().nth(b_idx) else { + let Some(held) = or_particle_model::list::behaviours(rule) + .into_iter() + .nth(b_idx) + else { return; }; if matches!( @@ -245,8 +254,8 @@ pub(super) fn add_menu_for_behaviour( let class = std::mem::discriminant(&held); ui.menu_button(tr!("Copy to rule…"), |ui| { let mut offered = false; - for (into, other) in or_particle::list::particle_rules(list).enumerate() { - let behaviours = or_particle::list::behaviours(other); + for (into, other) in or_particle_model::list::particle_rules(list).enumerate() { + let behaviours = or_particle_model::list::behaviours(other); if into == rule_idx || behaviours .iter() diff --git a/src/ui/panels/hierarchy/ypt/mod.rs b/src/ui/panels/hierarchy/ypt/mod.rs index 0d6c94523..168e703ca 100644 --- a/src/ui/panels/hierarchy/ypt/mod.rs +++ b/src/ui/panels/hierarchy/ypt/mod.rs @@ -11,7 +11,7 @@ use ops::*; use super::*; use crate::state::particle_target::{on_particle_target, ParticleTarget}; use or_io::gta5::particle::{PtxDomainObj, PtxEffectRule, PtxEventEmitter, PtxFxList}; -use or_particle::list; +use or_particle_model::list; pub(super) fn draw_ypt(ui: &mut egui::Ui, state: &mut AppState, doc_id: DocumentId) { let Some(doc) = state.document(doc_id) else { @@ -873,8 +873,8 @@ fn link_chip( }); } -fn behaviour_name(behaviour: &or_particle::Behaviour) -> &'static str { - use or_particle::Behaviour; +fn behaviour_name(behaviour: &or_particle_model::Behaviour) -> &'static str { + use or_particle_model::Behaviour; match behaviour { Behaviour::Acceleration(_) => "Acceleration", Behaviour::Velocity(_) => "Velocity", diff --git a/src/ui/panels/hierarchy/ypt/models.rs b/src/ui/panels/hierarchy/ypt/models.rs index ace71f700..6abc79949 100644 --- a/src/ui/panels/hierarchy/ypt/models.rs +++ b/src/ui/panels/hierarchy/ypt/models.rs @@ -2,7 +2,7 @@ use super::*; use crate::state::particle_target::ParticleTarget; use or_io::gta5::drawable::RmcDrawable; use or_io::gta5::particle::{PtxDrawable, PtxFxList}; -use or_particle::list; +use or_particle_model::list; pub(super) fn ypt_section_models( ui: &mut egui::Ui, diff --git a/src/ui/panels/hierarchy/ypt/ops.rs b/src/ui/panels/hierarchy/ypt/ops.rs index 8d0639176..4cc651d86 100644 --- a/src/ui/panels/hierarchy/ypt/ops.rs +++ b/src/ui/panels/hierarchy/ypt/ops.rs @@ -395,8 +395,8 @@ fn event_mut( effect_idx: usize, event_idx: usize, ) -> Option<&mut PtxEventEmitter> { - let effect = or_particle::list::effect_rules_mut(asset).nth(effect_idx)?; - or_particle::list::events_mut(effect).nth(event_idx) + let effect = or_particle_model::list::effect_rules_mut(asset).nth(effect_idx)?; + or_particle_model::list::events_mut(effect).nth(event_idx) } fn next_unique_name<'a>(base: &str, existing: impl Iterator) -> String { diff --git a/src/ui/panels/inspector/mod.rs b/src/ui/panels/inspector/mod.rs index d73d03454..6f0caa252 100644 --- a/src/ui/panels/inspector/mod.rs +++ b/src/ui/panels/inspector/mod.rs @@ -788,7 +788,7 @@ fn check_bool8(ui: &mut egui::Ui, label: &str, value: &mut or_io::decl::Bool8, d fn drag_vec3( ui: &mut egui::Ui, label: &str, - value: &mut or_particle::domain::Vec3, + value: &mut or_particle_model::domain::Vec3, dirty: &mut bool, ) { ui.horizontal(|ui| { diff --git a/src/ui/panels/inspector/ypt/behaviour.rs b/src/ui/panels/inspector/ypt/behaviour.rs index 4bd5d8929..1d6d909e4 100644 --- a/src/ui/panels/inspector/ypt/behaviour.rs +++ b/src/ui/panels/inspector/ypt/behaviour.rs @@ -15,12 +15,13 @@ pub(super) fn draw_ypt_behaviour_mut( let Some(asset) = T::list_mut(&mut doc.payload) else { return; }; - let Some(rule) = or_particle::list::particle_rules_mut(asset).nth(particle_idx) else { + let Some(rule) = or_particle_model::list::particle_rules_mut(asset).nth(particle_idx) + else { empty(ui, tr!("Selection is no longer valid")); return; }; let rule_name = rule.name.clone(); - let mut behaviours = or_particle::list::behaviours(rule); + let mut behaviours = or_particle_model::list::behaviours(rule); let Some(behaviour) = behaviours.get_mut(behaviour_idx) else { empty(ui, tr!("Selection is no longer valid")); return; @@ -37,7 +38,7 @@ pub(super) fn draw_ypt_behaviour_mut( ui.add_space(crate::ui::theme::SPACING_TIGHT); if members(ui, behaviour, gta6) { before = Some(rule.clone()); - or_particle::list::set_behaviours(rule, &behaviours); + or_particle_model::list::set_behaviours(rule, &behaviours); } } if let Some(before) = before { @@ -46,8 +47,12 @@ pub(super) fn draw_ypt_behaviour_mut( } /// The members a scanned GTA VI list writes back, drawn editable above the rest. -fn written_members(ui: &mut egui::Ui, behaviour: &mut or_particle::Behaviour, dirty: &mut bool) { - use or_particle::Behaviour; +fn written_members( + ui: &mut egui::Ui, + behaviour: &mut or_particle_model::Behaviour, + dirty: &mut bool, +) { + use or_particle_model::Behaviour; match behaviour { Behaviour::Colour(d) => check_bool(ui, "rgba_max_enable", &mut d.rgba_max_enable, dirty), Behaviour::DrawSprite(d) => { @@ -61,8 +66,8 @@ fn written_members(ui: &mut egui::Ui, behaviour: &mut or_particle::Behaviour, di /// The behaviour's members drawn, where `gta6` only those its list writes back editable; whether /// one was edited. -fn members(ui: &mut egui::Ui, behaviour: &mut or_particle::Behaviour, gta6: bool) -> bool { - use or_particle::Behaviour; +fn members(ui: &mut egui::Ui, behaviour: &mut or_particle_model::Behaviour, gta6: bool) -> bool { + use or_particle_model::Behaviour; let mut dirty = false; if gta6 { written_members(ui, behaviour, &mut dirty); @@ -544,8 +549,8 @@ fn members(ui: &mut egui::Ui, behaviour: &mut or_particle::Behaviour, gta6: bool }); dirty } -fn behaviour_type_name(behaviour: &or_particle::Behaviour) -> &'static str { - use or_particle::Behaviour; +fn behaviour_type_name(behaviour: &or_particle_model::Behaviour) -> &'static str { + use or_particle_model::Behaviour; match behaviour { Behaviour::Acceleration(_) => "Acceleration", Behaviour::Velocity(_) => "Velocity", @@ -583,7 +588,7 @@ fn behaviour_type_name(behaviour: &or_particle::Behaviour) -> &'static str { mod tests { use super::*; use egui::epaint::ClippedShape; - use or_particle::Behaviour; + use or_particle_model::Behaviour; /// The members of a scanned GTA VI list's behaviour drawn frame by frame. #[derive(Default)] diff --git a/src/ui/panels/inspector/ypt/mod.rs b/src/ui/panels/inspector/ypt/mod.rs index 7ff8225ff..a666155a8 100644 --- a/src/ui/panels/inspector/ypt/mod.rs +++ b/src/ui/panels/inspector/ypt/mod.rs @@ -9,7 +9,7 @@ pub(super) use selected::draw_ypt; use super::*; use or_io::gta5::particle::PtxKeyframeProp; -use or_particle::list; +use or_particle_model::list; /// The live values of the effect the preview plays, a slider per evolution named from that effect, whichever one the inspector shows. pub(super) fn draw_ypt_evolution_sliders(ui: &mut egui::Ui, state: &mut AppState) { diff --git a/src/ui/panels/inspector/ypt/model.rs b/src/ui/panels/inspector/ypt/model.rs index 32c7e242c..59980d5d3 100644 --- a/src/ui/panels/inspector/ypt/model.rs +++ b/src/ui/panels/inspector/ypt/model.rs @@ -3,7 +3,7 @@ use crate::state::textures::Texture; use or_io::codec::mesh::VertexSource; use or_io::decl::{Gen8, Gen9}; use or_io::gta5::PtxFxList; -use or_particle::list; +use or_particle_model::list; /// What the Inspector states of a model's shader, which each target lays out its own way. pub(super) trait ShaderRows: ParticleTarget { diff --git a/src/ui/panels/inspector/ypt/selected.rs b/src/ui/panels/inspector/ypt/selected.rs index dfd47988d..d334afe36 100644 --- a/src/ui/panels/inspector/ypt/selected.rs +++ b/src/ui/panels/inspector/ypt/selected.rs @@ -1,7 +1,7 @@ //! The Inspector's body for a particle file: what the selection names, at either target. use super::*; -use or_particle::list; +use or_particle_model::list; pub(crate) fn draw_ypt( ui: &mut egui::Ui, diff --git a/src/ui/panels/inspector/ypt/steps.rs b/src/ui/panels/inspector/ypt/steps.rs index 64ffbe77f..fc99453f5 100644 --- a/src/ui/panels/inspector/ypt/steps.rs +++ b/src/ui/panels/inspector/ypt/steps.rs @@ -2,7 +2,7 @@ use or_io::gta5::particle::{PtxEffectRule, PtxEmitterRule, PtxParticleRule}; use or_io::gta5::PtxFxList; -use or_particle::list; +use or_particle_model::list; use crate::state::particle_target::ParticleTarget; use crate::state::{AppState, Change, DocPayload, DocumentId}; diff --git a/src/ui/panels/timeline.rs b/src/ui/panels/timeline.rs index 3248e7cc3..02aebb6cb 100644 --- a/src/ui/panels/timeline.rs +++ b/src/ui/panels/timeline.rs @@ -389,7 +389,7 @@ fn collect_curve_series_for_selection( selection: Option, ) -> Vec { use crate::state::SelectionKey; - use or_particle::list; + use or_particle_model::list; let particle_rule_name = match selection { Some(SelectionKey::YptEmitter { effect, emitter }) => list::effect_rules(asset) .nth(effect) @@ -435,13 +435,13 @@ fn collect_curve_series_for_selection( fn behaviour_kpd_curves( b_idx: usize, - b: &or_particle::behaviour::Behaviour, + b: &or_particle_model::behaviour::Behaviour, ) -> Vec<( String, ParticleKfpSlot, - &Option, + &Option, )> { - use or_particle::behaviour::Behaviour; + use or_particle_model::behaviour::Behaviour; let prefix = format!("[{b_idx}] "); match b { Behaviour::Acceleration(d) => vec![ @@ -651,11 +651,11 @@ fn authored_seconds( SelectionKey::YptDomain { effect, .. } => Some(effect), _ => None, }); - let all: Vec = (or_particle::list::effect_rules(asset)) + let all: Vec = (or_particle_model::list::effect_rules(asset)) .map(|effect| effect.duration_max) .filter(|seconds| seconds.is_finite()) .collect(); - let own = effect.and_then(|at| or_particle::list::effect_rules(asset).nth(at)); + let own = effect.and_then(|at| or_particle_model::list::effect_rules(asset).nth(at)); match own .map(|effect| effect.duration_max) .filter(|s| s.is_finite()) @@ -670,7 +670,7 @@ fn collect_track_rows( selection: Option, ) -> Vec { use crate::state::SelectionKey; - use or_particle::list; + use or_particle_model::list; let emitter_lib_name = match selection { Some(SelectionKey::YptEmitterLib(id)) => { @@ -763,19 +763,19 @@ fn apply_kfp_edits_to( let mut before = Vec::new(); if let Some(asset) = (state.document_mut(doc_id)).and_then(|d| T::list_mut(&mut d.payload)) { for edit in edits { - let Some(particle) = or_particle::list::particle_rules_mut(asset) + let Some(particle) = or_particle_model::list::particle_rules_mut(asset) .find(|p| p.name == edit.source.particle_name) else { continue; }; let was = particle.clone(); - let mut behaviours = or_particle::list::behaviours(particle); + let mut behaviours = or_particle_model::list::behaviours(particle); let Some(behaviour) = behaviours.get_mut(edit.source.behaviour_index) else { continue; }; if let Some(kpd) = kpd_for_slot_mut(behaviour, edit.source.slot) { if apply_single_edit(kpd, edit) { - or_particle::list::set_behaviours(particle, &behaviours); + or_particle_model::list::set_behaviours(particle, &behaviours); before.push(was); } } @@ -789,10 +789,10 @@ fn apply_kfp_edits_to( } fn kpd_for_slot_mut( - b: &mut or_particle::behaviour::Behaviour, + b: &mut or_particle_model::behaviour::Behaviour, slot: ParticleKfpSlot, -) -> Option<&mut or_particle::keyframe::KeyframePropData> { - use or_particle::behaviour::Behaviour; +) -> Option<&mut or_particle_model::keyframe::KeyframePropData> { + use or_particle_model::behaviour::Behaviour; use ParticleKfpSlot::*; match (b, slot) { (Behaviour::Acceleration(d), AccelMin) => d.xyz_min_keyframes.as_mut(), @@ -829,7 +829,7 @@ fn kpd_for_slot_mut( } pub(crate) fn apply_single_edit( - kpd: &mut or_particle::keyframe::KeyframePropData, + kpd: &mut or_particle_model::keyframe::KeyframePropData, edit: &KfpEdit, ) -> bool { if edit.entry_idx >= kpd.entries.len() { @@ -928,7 +928,7 @@ pub(crate) fn pin_label(state: &AppState, key: &crate::state::sim::SimBuildKey) }; let name = state.document(key.doc_id).and_then(|doc| { on_particle_target!(&doc.payload, T => T::list(&doc.payload).and_then(|asset| { - or_particle::list::effect_rules(asset).nth(idx).map(|e| e.name.clone()) + or_particle_model::list::effect_rules(asset).nth(idx).map(|e| e.name.clone()) }), else None) }); name.filter(|name| !name.is_empty()) @@ -940,8 +940,8 @@ mod tests { use super::*; use crate::state::DocPayload; use or_io::gta5::particle::RawKeyframeEntry; - use or_particle::behaviour::{AnimateTextureBehaviour, Behaviour}; - use or_particle::keyframe::KeyframePropData; + use or_particle_model::behaviour::{AnimateTextureBehaviour, Behaviour}; + use or_particle_model::keyframe::KeyframePropData; fn build_state_with_anim_kfp() -> (AppState, crate::state::DocumentId) { build_state_with_anim_kfp_at::(or_io::Asset::Particles) @@ -954,7 +954,7 @@ mod tests { state.documents.clear(); state.active_document = None; let mut asset = or_io::gta5::PtxFxList::::default(); - or_particle::list::add_particle_rule(&mut asset, "p"); + or_particle_model::list::add_particle_rule(&mut asset, "p"); let behaviours = vec![Behaviour::AnimateTexture(AnimateTextureBehaviour { anim_rate_min: 1.0, anim_rate_max: 1.0, @@ -973,8 +973,8 @@ mod tests { }), ..Default::default() })]; - if let Some(particle) = or_particle::list::particle_rules_mut(&mut asset).next() { - or_particle::list::set_behaviours(particle, &behaviours); + if let Some(particle) = or_particle_model::list::particle_rules_mut(&mut asset).next() { + or_particle_model::list::set_behaviours(particle, &behaviours); } let id: crate::state::DocumentId = crate::state::DocumentId(1); let doc = crate::state::Document::new( @@ -990,7 +990,7 @@ mod tests { #[test] fn a_list_nothing_simulates_is_scaled_to_the_effect_it_selects_else_the_longest() { use crate::state::SelectionKey; - use or_particle::list; + use or_particle_model::list; // The seconds taken with nothing selected, with the short effect and with an event of the long one. fn authored() -> [f32; 3] { @@ -1032,7 +1032,10 @@ mod tests { let rule = |state: &AppState| { let payload = &state.document(id).expect("open").payload; let asset = T::list(payload).expect("not a YPT doc"); - format!("{:?}", or_particle::list::particle_rules(asset).next()) + format!( + "{:?}", + or_particle_model::list::particle_rules(asset).next() + ) }; let opened = rule(&state); let drag = |time: f32| KfpEdit { @@ -1084,10 +1087,10 @@ mod tests { let DocPayload::Resource(or_io::Asset::Particles(asset)) = &doc.payload else { panic!("not a YPT doc") }; - let particle = or_particle::list::particle_rules(asset) + let particle = or_particle_model::list::particle_rules(asset) .next() .expect("the rule is there"); - let behaviours = or_particle::list::behaviours(particle); + let behaviours = or_particle_model::list::behaviours(particle); let Behaviour::AnimateTexture(at) = &behaviours[0] else { panic!("not an animate-texture behaviour") }; diff --git a/src/ui/tests/every_context_menu_draws_from_the_registry.rs b/src/ui/tests/every_context_menu_draws_from_the_registry.rs index b4044fe7a..9786bd5aa 100644 --- a/src/ui/tests/every_context_menu_draws_from_the_registry.rs +++ b/src/ui/tests/every_context_menu_draws_from_the_registry.rs @@ -831,7 +831,7 @@ fn a_command_acts_on_the_row_clicked_in_a_menu_and_on_the_selection_from_the_pal /// A particle file with an effect, an emitter rule and a particle rule, in the Particle workspace. fn particles(state: &mut AppState) -> DocumentId { - use or_particle::list; + use or_particle_model::list; let id = state.new_empty_document(crate::state::DocumentKind::Ypt); let Some(DocPayload::Resource(or_io::Asset::Particles(fx))) = state.document_mut(id).map(|d| &mut d.payload) diff --git a/src/ui/tests/the_particle_screen_on_screen.rs b/src/ui/tests/the_particle_screen_on_screen.rs index ac4c5358a..c88906ef3 100644 --- a/src/ui/tests/the_particle_screen_on_screen.rs +++ b/src/ui/tests/the_particle_screen_on_screen.rs @@ -20,7 +20,7 @@ use crate::ui::panels::registry::ids; /// A `.ypt` that holds the effects `effects`, each firing one emitter rule and one particle rule of its own. pub(super) fn a_ypt(name: &str, effects: &[&str]) -> Vec { - or_particle::sample::list_of(name, effects) + or_particle_model::sample::list_of(name, effects) } /// Draw frames, polling what the workers left and the loads and saves the window finishes between frames, until `done`.