Skip to content

Commit a3aa5a7

Browse files
authored
Merge branch 'main' into par-mesh-collection
2 parents 23c8f08 + 61dab10 commit a3aa5a7

File tree

176 files changed

+6024
-2003
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+6024
-2003
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ jobs:
331331
fetch-depth: 0
332332
persist-credentials: false
333333
- name: Run Markdown Lint
334-
uses: super-linter/super-linter/slim@47984f49b4e87383eed97890fe2dca6063bbd9c3 # v8.3.1
334+
uses: super-linter/super-linter/slim@d5b0a2ab116623730dd094f15ddc1b6b25bf7b99 # v8.3.2
335335
env:
336336
MULTI_STATUS: false
337337
VALIDATE_ALL_CODEBASE: false

.github/workflows/security-static-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
actions: read
8383
steps:
8484
- name: Checkout repository
85-
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
85+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
8686
with:
8787
persist-credentials: false
8888

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ assets/**/*.meta
2323
crates/bevy_asset/imported_assets
2424
imported_assets
2525
.web-asset-cache
26+
examples/large_scenes/bistro/assets/*
27+
examples/large_scenes/caldera_hotel/assets/*
2628

2729
# Bevy Examples
2830
example_showcase_config.ron
@@ -33,3 +35,6 @@ assets/scenes/load_scene_example-new.scn.ron
3335

3436
# Generated by "examples/window/screenshot.rs"
3537
**/screenshot-*.png
38+
39+
# Generated by "examples/large_scenes"
40+
compressed_texture_cache

Cargo.toml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ members = [
3030
"examples/no_std/*",
3131
# Examples of compiling Bevy with automatic reflect type registration for platforms without `inventory` support.
3232
"examples/reflection/auto_register_static",
33+
# Examples of large bevy scenes.
34+
"examples/large_scenes/bistro",
35+
"examples/large_scenes/caldera_hotel",
36+
# Mipmap generator for testing large bevy scenes with mips and texture compression.
37+
"examples/large_scenes/mipmap_generator",
3338
# Benchmarks
3439
"benches",
3540
# Internal tools that are not published.
@@ -813,14 +818,26 @@ description = "Demonstrates how to use the `Camera::viewport_to_world_2d` method
813818
category = "2D Rendering"
814819
wasm = true
815820

821+
[[example]]
822+
name = "rotate_to_cursor"
823+
path = "examples/2d/rotate_to_cursor.rs"
824+
# Causes an ICE on docs.rs
825+
doc-scrape-examples = false
826+
827+
[package.metadata.example.rotate_to_cursor]
828+
name = "2D Rotation to Cursor"
829+
description = "Demonstrates rotating entities in 2D to follow the cursor"
830+
category = "2D Rendering"
831+
wasm = true
832+
816833
[[example]]
817834
name = "rotation"
818835
path = "examples/2d/rotation.rs"
819836
# Causes an ICE on docs.rs
820837
doc-scrape-examples = false
821838

822839
[package.metadata.example.rotation]
823-
name = "2D Rotation"
840+
name = "Generic 2D Rotation"
824841
description = "Demonstrates rotating entities in 2D with quaternions"
825842
category = "2D Rendering"
826843
wasm = true
@@ -3688,6 +3705,17 @@ description = "Demonstrates dragging and dropping UI nodes"
36883705
category = "UI (User Interface)"
36893706
wasm = true
36903707

3708+
[[example]]
3709+
name = "font_query"
3710+
path = "examples/ui/font_query.rs"
3711+
doc-scrape-examples = true
3712+
3713+
[package.metadata.example.font_query]
3714+
name = "Font Queries"
3715+
description = "Demonstrates font querying"
3716+
category = "UI (User Interface)"
3717+
wasm = true
3718+
36913719
[[example]]
36923720
name = "display_and_visibility"
36933721
path = "examples/ui/display_and_visibility.rs"

crates/bevy_app/src/app.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,6 +1225,9 @@ impl App {
12251225
}
12261226

12271227
/// Applies the provided [`ScheduleBuildSettings`] to all schedules.
1228+
///
1229+
/// This mutates all currently present schedules, but does not apply to any custom schedules
1230+
/// that might be added in the future.
12281231
pub fn configure_schedules(
12291232
&mut self,
12301233
schedule_build_settings: ScheduleBuildSettings,

crates/bevy_asset/src/io/android.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
use crate::io::{
2-
get_meta_path, AssetReader, AssetReaderError, PathStream, Reader, ReaderRequiredFeatures,
3-
VecReader,
4-
};
1+
use crate::io::{get_meta_path, AssetReader, AssetReaderError, PathStream, Reader, VecReader};
52
use alloc::{borrow::ToOwned, boxed::Box, ffi::CString, vec::Vec};
63
use futures_lite::stream;
74
use std::path::Path;
@@ -19,11 +16,7 @@ use std::path::Path;
1916
pub struct AndroidAssetReader;
2017

2118
impl AssetReader for AndroidAssetReader {
22-
async fn read<'a>(
23-
&'a self,
24-
path: &'a Path,
25-
_required_features: ReaderRequiredFeatures,
26-
) -> Result<impl Reader + 'a, AssetReaderError> {
19+
async fn read<'a>(&'a self, path: &'a Path) -> Result<impl Reader + 'a, AssetReaderError> {
2720
let asset_manager = bevy_android::ANDROID_APP
2821
.get()
2922
.expect("Bevy must be setup with the #[bevy_main] macro on Android")

crates/bevy_asset/src/io/file/file_asset.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::io::{
22
get_meta_path, AssetReader, AssetReaderError, AssetWriter, AssetWriterError, PathStream,
3-
Reader, ReaderRequiredFeatures, Writer,
3+
Reader, ReaderNotSeekableError, SeekableReader, Writer,
44
};
55
use async_fs::{read_dir, File};
66
use futures_lite::StreamExt;
@@ -10,14 +10,14 @@ use std::path::Path;
1010

1111
use super::{FileAssetReader, FileAssetWriter};
1212

13-
impl Reader for File {}
13+
impl Reader for File {
14+
fn seekable(&mut self) -> Result<&mut dyn SeekableReader, ReaderNotSeekableError> {
15+
Ok(self)
16+
}
17+
}
1418

1519
impl AssetReader for FileAssetReader {
16-
async fn read<'a>(
17-
&'a self,
18-
path: &'a Path,
19-
_required_features: ReaderRequiredFeatures,
20-
) -> Result<impl Reader + 'a, AssetReaderError> {
20+
async fn read<'a>(&'a self, path: &'a Path) -> Result<impl Reader + 'a, AssetReaderError> {
2121
let full_path = self.root_path.join(path);
2222
File::open(&full_path).await.map_err(|e| {
2323
if e.kind() == std::io::ErrorKind::NotFound {

crates/bevy_asset/src/io/file/sync_file_asset.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use futures_lite::Stream;
33

44
use crate::io::{
55
get_meta_path, AssetReader, AssetReaderError, AssetWriter, AssetWriterError, AsyncSeek,
6-
PathStream, Reader, ReaderRequiredFeatures, Writer,
6+
PathStream, Reader, ReaderNotSeekableError, SeekableReader, Writer,
77
};
88

99
use alloc::{borrow::ToOwned, boxed::Box, vec::Vec};
@@ -48,6 +48,10 @@ impl Reader for FileReader {
4848
{
4949
stackfuture::StackFuture::from(async { self.0.read_to_end(buf) })
5050
}
51+
52+
fn seekable(&mut self) -> Result<&mut dyn SeekableReader, ReaderNotSeekableError> {
53+
Ok(self)
54+
}
5155
}
5256

5357
struct FileWriter(File);
@@ -95,11 +99,7 @@ impl Stream for DirReader {
9599
}
96100

97101
impl AssetReader for FileAssetReader {
98-
async fn read<'a>(
99-
&'a self,
100-
path: &'a Path,
101-
_required_features: ReaderRequiredFeatures,
102-
) -> Result<impl Reader + 'a, AssetReaderError> {
102+
async fn read<'a>(&'a self, path: &'a Path) -> Result<impl Reader + 'a, AssetReaderError> {
103103
let full_path = self.root_path.join(path);
104104
match File::open(&full_path) {
105105
Ok(file) => Ok(FileReader(file)),

crates/bevy_asset/src/io/gated.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::io::{AssetReader, AssetReaderError, PathStream, Reader, ReaderRequiredFeatures};
1+
use crate::io::{AssetReader, AssetReaderError, PathStream, Reader};
22
use alloc::{boxed::Box, sync::Arc};
33
use async_channel::{Receiver, Sender};
44
use bevy_platform::{collections::HashMap, sync::RwLock};
@@ -55,11 +55,7 @@ impl<R: AssetReader> GatedReader<R> {
5555
}
5656

5757
impl<R: AssetReader> AssetReader for GatedReader<R> {
58-
async fn read<'a>(
59-
&'a self,
60-
path: &'a Path,
61-
required_features: ReaderRequiredFeatures,
62-
) -> Result<impl Reader + 'a, AssetReaderError> {
58+
async fn read<'a>(&'a self, path: &'a Path) -> Result<impl Reader + 'a, AssetReaderError> {
6359
let receiver = {
6460
let mut gates = self.gates.write().unwrap_or_else(PoisonError::into_inner);
6561
let gates = gates
@@ -68,7 +64,7 @@ impl<R: AssetReader> AssetReader for GatedReader<R> {
6864
gates.1.clone()
6965
};
7066
receiver.recv().await.unwrap();
71-
let result = self.reader.read(path, required_features).await?;
67+
let result = self.reader.read(path).await?;
7268
Ok(result)
7369
}
7470

crates/bevy_asset/src/io/memory.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::io::{
22
AssetReader, AssetReaderError, AssetWriter, AssetWriterError, PathStream, Reader,
3-
ReaderRequiredFeatures,
3+
ReaderNotSeekableError, SeekableReader,
44
};
55
use alloc::{borrow::ToOwned, boxed::Box, sync::Arc, vec, vec::Vec};
66
use bevy_platform::{
@@ -354,14 +354,14 @@ impl Reader for DataReader {
354354
) -> stackfuture::StackFuture<'a, std::io::Result<usize>, { super::STACK_FUTURE_SIZE }> {
355355
crate::io::read_to_end(self.data.value(), &mut self.bytes_read, buf)
356356
}
357+
358+
fn seekable(&mut self) -> Result<&mut dyn SeekableReader, ReaderNotSeekableError> {
359+
Ok(self)
360+
}
357361
}
358362

359363
impl AssetReader for MemoryAssetReader {
360-
async fn read<'a>(
361-
&'a self,
362-
path: &'a Path,
363-
_required_features: ReaderRequiredFeatures,
364-
) -> Result<impl Reader + 'a, AssetReaderError> {
364+
async fn read<'a>(&'a self, path: &'a Path) -> Result<impl Reader + 'a, AssetReaderError> {
365365
self.root
366366
.get_asset(path)
367367
.map(|data| DataReader {

0 commit comments

Comments
 (0)