Fix some typos (#7763)
# Objective Stumbled on a typo and went on a typo hunt. ## Solution Fix em
This commit is contained in:
parent
17d1fa4a8b
commit
b39f83640f
@ -19,7 +19,7 @@ pub struct ReflectAsset {
|
||||
|
||||
get: fn(&World, HandleUntyped) -> Option<&dyn Reflect>,
|
||||
// SAFETY:
|
||||
// - may only be called with a [`IteriorMutableWorld`] which can be used to access the corresponding `Assets<T>` resource mutably
|
||||
// - may only be called with an [`UnsafeWorldCell`] which can be used to access the corresponding `Assets<T>` resource mutably
|
||||
// - may only be used to access **at most one** access at once
|
||||
get_unchecked_mut: unsafe fn(UnsafeWorldCell<'_>, HandleUntyped) -> Option<&mut dyn Reflect>,
|
||||
add: fn(&mut World, &dyn Reflect) -> HandleUntyped,
|
||||
@ -144,7 +144,7 @@ impl<A: Asset + FromReflect> FromType<A> for ReflectAsset {
|
||||
asset.map(|asset| asset as &dyn Reflect)
|
||||
},
|
||||
get_unchecked_mut: |world, handle| {
|
||||
// SAFETY: `get_unchecked_mut` must be callied with `UnsafeWorldCell` having access to `Assets<A>`,
|
||||
// SAFETY: `get_unchecked_mut` must be called with `UnsafeWorldCell` having access to `Assets<A>`,
|
||||
// and must ensure to only have at most one reference to it live at all times.
|
||||
let assets = unsafe { world.get_resource_mut::<Assets<A>>().unwrap().into_inner() };
|
||||
let asset = assets.get_mut(&handle.typed());
|
||||
|
@ -33,7 +33,7 @@ use std::path::PathBuf;
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
use bevy_tasks::tick_global_task_pools_on_main_thread;
|
||||
|
||||
/// Registration of default types to the `TypeRegistry` reesource.
|
||||
/// Registration of default types to the `TypeRegistry` resource.
|
||||
#[derive(Default)]
|
||||
pub struct TypeRegistrationPlugin;
|
||||
|
||||
|
@ -779,17 +779,17 @@ mod tests {
|
||||
assert_eq!(
|
||||
world.removed::<A>().collect::<Vec<_>>(),
|
||||
&[],
|
||||
"clearning trackers clears removals"
|
||||
"clearing trackers clears removals"
|
||||
);
|
||||
assert_eq!(
|
||||
world.removed::<SparseStored>().collect::<Vec<_>>(),
|
||||
&[],
|
||||
"clearning trackers clears removals"
|
||||
"clearing trackers clears removals"
|
||||
);
|
||||
assert_eq!(
|
||||
world.removed::<B>().collect::<Vec<_>>(),
|
||||
&[],
|
||||
"clearning trackers clears removals"
|
||||
"clearing trackers clears removals"
|
||||
);
|
||||
|
||||
// TODO: uncomment when world.clear() is implemented
|
||||
|
@ -14,7 +14,7 @@ pub use state::*;
|
||||
|
||||
/// A debug checked version of [`Option::unwrap_unchecked`]. Will panic in
|
||||
/// debug modes if unwrapping a `None` or `Err` value in debug mode, but is
|
||||
/// equivalent to `Option::unwrap_uncheched` or `Result::unwrap_unchecked`
|
||||
/// equivalent to `Option::unwrap_unchecked` or `Result::unwrap_unchecked`
|
||||
/// in release mode.
|
||||
pub(crate) trait DebugCheckedUnwrap {
|
||||
type Item;
|
||||
|
@ -1223,7 +1223,7 @@ mod tests {
|
||||
|
||||
// It's best to test get_many_unchecked_manual directly,
|
||||
// as it is shared and unsafe
|
||||
// We don't care about aliased mutabilty for the read-only equivalent
|
||||
// We don't care about aliased mutability for the read-only equivalent
|
||||
|
||||
// SAFETY: mutable access is not checked, but we own the world and don't use the query results
|
||||
assert!(unsafe {
|
||||
|
@ -281,7 +281,7 @@ impl Schedule {
|
||||
}
|
||||
}
|
||||
|
||||
/// A directed acylic graph structure.
|
||||
/// A directed acyclic graph structure.
|
||||
#[derive(Default)]
|
||||
pub struct Dag {
|
||||
/// A directed graph.
|
||||
@ -1379,7 +1379,7 @@ impl ScheduleGraph {
|
||||
/// Get topology sorted [`NodeId`], also ensures the graph contains no cycle
|
||||
/// returns Err(()) if there are cycles
|
||||
fn topsort_graph(&self, graph: &DiGraphMap<NodeId, ()>) -> Result<Vec<NodeId>, ()> {
|
||||
// tarjon_scc's run order is reverse topological order
|
||||
// tarjan_scc's run order is reverse topological order
|
||||
let mut rev_top_sorted_nodes = Vec::<NodeId>::with_capacity(graph.node_count());
|
||||
let mut tarjan_scc = bevy_utils::petgraph::algo::TarjanScc::new();
|
||||
let mut sccs_with_cycle = Vec::<Vec<NodeId>>::new();
|
||||
@ -1547,7 +1547,7 @@ pub enum ScheduleBuildError {
|
||||
/// Specifies how schedule construction should respond to detecting a certain kind of issue.
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum LogLevel {
|
||||
/// Occurences are completely ignored.
|
||||
/// Occurrences are completely ignored.
|
||||
Ignore,
|
||||
/// Occurrences are logged only.
|
||||
Warn,
|
||||
|
@ -17,7 +17,7 @@ pub use bevy_ecs_macros::States;
|
||||
/// You can access the current state of type `T` with the [`State<T>`] resource,
|
||||
/// and the queued state with the [`NextState<T>`] resource.
|
||||
///
|
||||
/// State transitions typically occur in the [`OnEnter<T::Variant>`] and [`OnExit<T:Varaitn>`] schedules,
|
||||
/// State transitions typically occur in the [`OnEnter<T::Variant>`] and [`OnExit<T:Variant>`] schedules,
|
||||
/// which can be run via the [`apply_state_transition::<T>`] system.
|
||||
/// Systems that run each frame in various states are typically stored in the main schedule,
|
||||
/// and are conventionally part of the [`OnUpdate(T::Variant)`] system set.
|
||||
@ -75,7 +75,7 @@ pub struct State<S: States>(pub S);
|
||||
/// The next state of [`State<S>`].
|
||||
///
|
||||
/// To queue a transition, just set the contained value to `Some(next_state)`.
|
||||
/// Note that these transitions can be overriden by other systems:
|
||||
/// Note that these transitions can be overridden by other systems:
|
||||
/// only the actual value of this resource at the time of [`apply_state_transition`] matters.
|
||||
#[derive(Resource, Default, Debug)]
|
||||
pub struct NextState<S: States>(pub Option<S>);
|
||||
|
@ -1742,7 +1742,7 @@ impl World {
|
||||
.remove_entry(label)
|
||||
.unwrap_or_else(|| panic!("The schedule with the label {label:?} was not found."));
|
||||
|
||||
// TODO: move this span to Schdule::run
|
||||
// TODO: move this span to Schedule::run
|
||||
#[cfg(feature = "trace")]
|
||||
let _span = bevy_utils::tracing::info_span!("schedule", name = ?extracted_label).entered();
|
||||
schedule.run(self);
|
||||
|
@ -299,7 +299,7 @@ impl<'w> UnsafeWorldCell<'w> {
|
||||
// caller ensures that no mutable reference exists to `R`
|
||||
unsafe {
|
||||
self.get_non_send_resource_by_id(component_id)
|
||||
// SAEFTY: `component_id` was obtained from `TypeId::of::<R>()`
|
||||
// SAFETY: `component_id` was obtained from `TypeId::of::<R>()`
|
||||
.map(|ptr| ptr.deref::<R>())
|
||||
}
|
||||
}
|
||||
@ -592,7 +592,7 @@ impl<'w> UnsafeEntityCell<'w> {
|
||||
|
||||
// SAFETY:
|
||||
// - entity location is valid
|
||||
// - proper world acess is promised by caller
|
||||
// - proper world access is promised by caller
|
||||
unsafe {
|
||||
get_ticks(
|
||||
self.world,
|
||||
|
@ -53,7 +53,7 @@ pub struct EnvironmentMapLight {
|
||||
}
|
||||
|
||||
impl EnvironmentMapLight {
|
||||
/// Whether or not all textures neccesary to use the environment map
|
||||
/// Whether or not all textures necessary to use the environment map
|
||||
/// have been loaded by the asset server.
|
||||
pub fn is_loaded(&self, images: &RenderAssets<Image>) -> bool {
|
||||
images.get(&self.diffuse_map).is_some() && images.get(&self.specular_map).is_some()
|
||||
|
@ -277,7 +277,7 @@ fn calculate_cascade_bounds(
|
||||
/// Builder for [`CascadeShadowConfig`].
|
||||
pub struct CascadeShadowConfigBuilder {
|
||||
/// The number of shadow cascades.
|
||||
/// More cascades increases shadow quality by mitigating perspective aliasing - a phenomenom where areas
|
||||
/// More cascades increases shadow quality by mitigating perspective aliasing - a phenomenon where areas
|
||||
/// nearer the camera are covered by fewer shadow map texels than areas further from the camera, causing
|
||||
/// blocky looking shadows.
|
||||
///
|
||||
@ -393,7 +393,7 @@ pub struct Cascade {
|
||||
pub(crate) view_transform: Mat4,
|
||||
/// The orthographic projection for this cascade.
|
||||
pub(crate) projection: Mat4,
|
||||
/// The view-projection matrix for this cacade, converting world space into light clip space.
|
||||
/// The view-projection matrix for this cascade, converting world space into light clip space.
|
||||
/// Importantly, this is derived and stored separately from `view_transform` and `projection` to
|
||||
/// ensure shadow stability.
|
||||
pub(crate) view_projection: Mat4,
|
||||
|
@ -72,7 +72,7 @@ pub struct RenderPlugin {
|
||||
/// These can be useful for ordering, but you almost never want to add your systems to these sets.
|
||||
#[derive(Debug, Hash, PartialEq, Eq, Clone, SystemSet)]
|
||||
pub enum RenderSet {
|
||||
/// The copy of [`apply_system_buffers`] that runs at the begining of this schedule.
|
||||
/// The copy of [`apply_system_buffers`] that runs at the beginning of this schedule.
|
||||
/// This is used for applying the commands from the [`ExtractSchedule`]
|
||||
ExtractCommands,
|
||||
/// Prepare render resources from the extracted data for the GPU.
|
||||
|
@ -220,7 +220,7 @@ impl Plane {
|
||||
|
||||
impl From<Plane> for Mesh {
|
||||
fn from(plane: Plane) -> Self {
|
||||
// here this is split in the z and x directions if one ever needs asymetrical subdivision
|
||||
// here this is split in the z and x directions if one ever needs asymmetrical subdivision
|
||||
// two Plane struct fields would need to be added instead of the single subdivisions field
|
||||
let z_vertex_count = plane.subdivisions + 2;
|
||||
let x_vertex_count = plane.subdivisions + 2;
|
||||
|
@ -127,7 +127,7 @@ pub struct FallbackImageMsaaCache(HashMap<u32, GpuImage>);
|
||||
/// A Cache of fallback depth textures that uses the sample count as a key
|
||||
///
|
||||
/// # WARNING
|
||||
/// Detph images are never initialized with data, therefore,
|
||||
/// Depth images are never initialized with data, therefore,
|
||||
/// you shouldn't sample them before writing data to them first.
|
||||
#[derive(Resource, Deref, DerefMut, Default)]
|
||||
pub struct FallbackImageDepthCache(HashMap<u32, GpuImage>);
|
||||
|
@ -168,7 +168,7 @@ impl Image {
|
||||
)
|
||||
}
|
||||
|
||||
/// Convert a [`Image`] to a [`DynamicImage`]. Usefull for editing image
|
||||
/// Convert a [`Image`] to a [`DynamicImage`]. Useful for editing image
|
||||
/// data. Not all [`TextureFormat`] are covered, therefore it will return an
|
||||
/// error if the format is unsupported. Supported formats are:
|
||||
/// - `TextureFormat::R8Unorm`
|
||||
|
@ -286,7 +286,7 @@ impl TaskPool {
|
||||
///
|
||||
/// When `tick_task_pool_executor` is set to `true`, the multithreaded task stealing executor is ticked on the scope
|
||||
/// thread. Disabling this can be useful when finishing the scope is latency sensitive. Pulling tasks from
|
||||
/// global excutor can run tasks unrelated to the scope and delay when the scope returns.
|
||||
/// global executor can run tasks unrelated to the scope and delay when the scope returns.
|
||||
///
|
||||
/// See [`Self::scope`] for more details in general about how scopes work.
|
||||
pub fn scope_with_executor<'env, F, T>(
|
||||
|
@ -27,7 +27,7 @@ use bevy_ecs::{system::Resource, world::World};
|
||||
use bevy_utils::Duration;
|
||||
use thiserror::Error;
|
||||
|
||||
/// The amount of time that must pass before the fixed timstep schedule is run again.
|
||||
/// The amount of time that must pass before the fixed timestep schedule is run again.
|
||||
#[derive(Resource, Debug)]
|
||||
pub struct FixedTime {
|
||||
accumulated: Duration,
|
||||
|
@ -47,5 +47,5 @@ impl<T: ?Sized> SyncCell<T> {
|
||||
|
||||
// SAFETY: `Sync` only allows multithreaded access via immutable reference.
|
||||
// As `SyncCell` requires an exclusive reference to access the wrapped value for `!Sync` types,
|
||||
// marking this type as `Sync` does not actually allow unsychronized access to the inner value.
|
||||
// marking this type as `Sync` does not actually allow unsynchronized access to the inner value.
|
||||
unsafe impl<T: ?Sized> Sync for SyncCell<T> {}
|
||||
|
Loading…
Reference in New Issue
Block a user