Skip to content

Commit c0cc34f

Browse files
Merge branch 'main' into radio_button_improvement
2 parents 1ecf910 + af5f307 commit c0cc34f

File tree

30 files changed

+1912
-353
lines changed

30 files changed

+1912
-353
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ jobs:
336336
steps:
337337
- uses: actions/checkout@v5
338338
- name: Check for typos
339-
uses: crate-ci/typos@v1.37.2
339+
uses: crate-ci/typos@v1.38.1
340340
- name: Typos info
341341
if: failure()
342342
run: |

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040

4141
# Initializes the CodeQL tools for scanning.
4242
- name: Initialize CodeQL
43-
uses: github/codeql-action/init@v3
43+
uses: github/codeql-action/init@v4
4444
with:
4545
languages: ${{ matrix.language }}
4646
build-mode: ${{ matrix.build-mode }}
@@ -68,6 +68,6 @@ jobs:
6868
exit 1
6969
7070
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@v3
71+
uses: github/codeql-action/analyze@v4
7272
with:
7373
category: "/language:${{matrix.language}}"

Cargo.toml

Lines changed: 138 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -125,65 +125,149 @@ unsafe_op_in_unsafe_fn = "warn"
125125
unused_qualifications = "warn"
126126

127127
[features]
128-
default = [
129-
"std",
128+
default = ["2d", "3d", "ui"]
129+
130+
# PROFILE: The default 2D Bevy experience. This includes the core Bevy framework, 2D functionality, Bevy UI, scenes, audio, and picking.
131+
2d = [
132+
"default_app",
133+
"default_platform",
134+
"2d_api",
135+
"2d_bevy_render",
136+
"ui",
137+
"scene",
138+
"audio",
139+
"picking",
140+
]
141+
142+
# PROFILE: The default 3D Bevy experience. This includes the core Bevy framework, 3D functionality, Bevy UI, scenes, audio, and picking.
143+
3d = [
144+
"default_app",
145+
"default_platform",
146+
"3d_api",
147+
"3d_bevy_render",
148+
"ui",
149+
"scene",
150+
"audio",
151+
"picking",
152+
]
153+
154+
# PROFILE: The default Bevy UI experience. This includes the core Bevy framework, Bevy UI, scenes, audio, and picking.
155+
ui = [
156+
"default_app",
157+
"default_platform",
158+
"ui_api",
159+
"ui_bevy_render",
160+
"scene",
161+
"audio",
162+
"picking",
163+
]
164+
165+
# COLLECTION: Enable this feature during development to improve the development experience. This adds features like asset hot-reloading and debugging tools. This should not be enabled for published apps!
166+
dev = [
167+
"debug", # TODO: rename this to something more specific ... this is a "debug ECS names" feature
168+
"bevy_dev_tools",
169+
"file_watcher",
170+
]
171+
172+
# COLLECTION: Features used to build audio Bevy apps.
173+
audio = ["bevy_audio", "vorbis"]
174+
175+
# COLLECTION: Features used to compose Bevy scenes.
176+
scene = ["bevy_scene"]
177+
178+
# COLLECTION: Enables picking functionality
179+
picking = ["bevy_picking", "mesh_picking", "sprite_picking", "ui_picking"]
180+
181+
# COLLECTION: The core pieces that most apps need. This serves as a baseline feature set for other higher level feature collections (such as "2d" and "3d"). It is also useful as a baseline feature set for scenarios like headless apps that require no rendering (ex: command line tools, servers, etc).
182+
default_app = [
130183
"async_executor",
184+
"bevy_asset",
185+
"bevy_input_focus",
186+
"bevy_log",
187+
"bevy_state",
188+
"bevy_window",
189+
"custom_cursor",
190+
"reflect_auto_register",
191+
]
192+
193+
# COLLECTION: These are platform support features, such as OS support/features, windowing and input backends, etc.
194+
default_platform = [
195+
"std",
131196
"android-game-activity",
132197
"android_shared_stdcxx",
133-
"gltf_animation",
134-
"bevy_asset",
135-
"bevy_audio",
136-
"bevy_color",
137-
"bevy_core_pipeline",
138-
"bevy_post_process",
139-
"bevy_anti_alias",
140198
"bevy_gilrs",
199+
"bevy_winit",
200+
"default_font",
201+
"multi_threaded",
202+
"webgl2",
203+
"x11",
204+
"wayland",
205+
"sysinfo_plugin",
206+
]
207+
208+
# COLLECTION: Default scene definition features. Note that this does not include an actual renderer, such as bevy_render (Bevy's default render backend).
209+
common_api = [
210+
"bevy_animation",
211+
"bevy_camera",
212+
"bevy_color",
141213
"bevy_gizmos",
142-
"bevy_gltf",
143-
"bevy_input_focus",
144-
"bevy_log",
145-
"bevy_pbr",
146-
"bevy_picking",
147-
"bevy_render",
148-
"bevy_scene",
149214
"bevy_image",
150215
"bevy_mesh",
151-
"bevy_mikktspace",
152-
"bevy_camera",
153-
"bevy_light",
154216
"bevy_shader",
155-
"bevy_sprite",
156-
"bevy_sprite_render",
157-
"bevy_state",
158217
"bevy_text",
159-
"bevy_ui",
160-
"bevy_ui_render",
161-
"bevy_window",
162-
"bevy_winit",
163-
"custom_cursor",
164-
"default_font",
165218
"hdr",
219+
"png",
220+
]
221+
222+
# COLLECTION: Features used to build 2D Bevy apps (does not include a render backend). You generally don't need to worry about this unless you are using a custom renderer.
223+
2d_api = ["common_api", "bevy_sprite"]
224+
225+
# COLLECTION: Bevy's built-in 2D renderer, built on top of `bevy_render`
226+
2d_bevy_render = [
227+
"2d_api",
228+
"bevy_render",
229+
"bevy_core_pipeline",
230+
"bevy_post_process",
231+
"bevy_sprite_render",
232+
]
233+
234+
# COLLECTION: Features used to build 3D Bevy apps (does not include a render backend). You generally don't need to worry about this unless you are using a custom renderer.
235+
3d_api = [
236+
"common_api",
237+
"bevy_light",
238+
"bevy_mikktspace",
166239
"ktx2",
167-
"mesh_picking",
168-
"morph",
169240
"morph_animation",
170-
"multi_threaded",
171-
"png",
172-
"reflect_auto_register",
241+
"morph",
173242
"smaa_luts",
174-
"sprite_picking",
175-
"sysinfo_plugin",
176243
"tonemapping_luts",
177-
"ui_picking",
178-
"vorbis",
179-
"webgl2",
180-
"x11",
181-
"wayland",
182-
"debug",
183244
"zstd_rust",
184245
]
185246

186-
# Recommended defaults for no_std applications
247+
# COLLECTION: Bevy's built-in 3D renderer, built on top of `bevy_render`
248+
3d_bevy_render = [
249+
"3d_api",
250+
"bevy_render",
251+
"bevy_core_pipeline",
252+
"bevy_anti_alias",
253+
"bevy_gltf",
254+
"bevy_pbr",
255+
"bevy_post_process",
256+
"gltf_animation",
257+
]
258+
259+
# COLLECTION: Features used to build UI Bevy apps (does not include a render backend). You generally don't need to worry about this unless you are using a custom renderer.
260+
ui_api = ["default_app", "common_api", "bevy_ui"]
261+
262+
# COLLECTION: Bevy's built-in UI renderer, built on top of `bevy_render`
263+
ui_bevy_render = [
264+
"ui_api",
265+
"bevy_render",
266+
"bevy_core_pipeline",
267+
"bevy_ui_render",
268+
]
269+
270+
# COLLECTION: Recommended defaults for no_std applications
187271
default_no_std = ["libm", "critical-section", "bevy_color", "bevy_state"]
188272

189273
# Provides an implementation for picking meshes
@@ -4127,6 +4211,18 @@ description = "A first-person camera that uses a world model and a view model wi
41274211
category = "Camera"
41284212
wasm = true
41294213

4214+
[[example]]
4215+
name = "free_cam_controller"
4216+
path = "examples/camera/free_cam_controller.rs"
4217+
doc-scrape-examples = true
4218+
required-features = ["free_cam"]
4219+
4220+
[package.metadata.example.free_cam_controller]
4221+
name = "Free cam camera controller"
4222+
description = "Shows the default free cam camera controller."
4223+
category = "Camera"
4224+
wasm = true
4225+
41304226
[[example]]
41314227
name = "projection_zoom"
41324228
path = "examples/camera/projection_zoom.rs"

crates/bevy_asset/src/lib.rs

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,9 @@ mod tests {
716716
AssetWatcher, Reader,
717717
},
718718
loader::{AssetLoader, LoadContext},
719+
processor::{
720+
AssetProcessor, LogEntry, ProcessorTransactionLog, ProcessorTransactionLogFactory,
721+
},
719722
saver::AssetSaver,
720723
transformer::{AssetTransformer, TransformedAsset},
721724
Asset, AssetApp, AssetEvent, AssetId, AssetLoadError, AssetLoadFailedEvent, AssetMode,
@@ -741,6 +744,7 @@ mod tests {
741744
sync::Mutex,
742745
};
743746
use bevy_reflect::TypePath;
747+
use bevy_tasks::BoxedFuture;
744748
use core::{marker::PhantomData, time::Duration};
745749
use crossbeam_channel::Sender;
746750
use futures_lite::AsyncWriteExt;
@@ -2289,6 +2293,52 @@ mod tests {
22892293
},
22902294
));
22912295

2296+
/// A dummy transaction log factory that just creates [`FakeTransactionLog`].
2297+
struct FakeTransactionLogFactory;
2298+
2299+
impl ProcessorTransactionLogFactory for FakeTransactionLogFactory {
2300+
fn read(&self) -> BoxedFuture<'_, Result<Vec<LogEntry>, BevyError>> {
2301+
Box::pin(async move { Ok(vec![]) })
2302+
}
2303+
2304+
fn create_new_log(
2305+
&self,
2306+
) -> BoxedFuture<'_, Result<Box<dyn ProcessorTransactionLog>, BevyError>> {
2307+
Box::pin(async move { Ok(Box::new(FakeTransactionLog) as _) })
2308+
}
2309+
}
2310+
2311+
/// A dummy transaction log that just drops every log.
2312+
// TODO: In the future it's possible for us to have a test of the transaction log, so making
2313+
// this more complex may be necessary.
2314+
struct FakeTransactionLog;
2315+
2316+
impl ProcessorTransactionLog for FakeTransactionLog {
2317+
fn begin_processing<'a>(
2318+
&'a mut self,
2319+
asset: &'a AssetPath<'_>,
2320+
) -> BoxedFuture<'a, Result<(), BevyError>> {
2321+
Box::pin(async move { Ok(()) })
2322+
}
2323+
2324+
fn end_processing<'a>(
2325+
&'a mut self,
2326+
asset: &'a AssetPath<'_>,
2327+
) -> BoxedFuture<'a, Result<(), BevyError>> {
2328+
Box::pin(async move { Ok(()) })
2329+
}
2330+
2331+
fn unrecoverable(&mut self) -> BoxedFuture<'_, Result<(), BevyError>> {
2332+
Box::pin(async move { Ok(()) })
2333+
}
2334+
}
2335+
2336+
app.world()
2337+
.resource::<AssetProcessor>()
2338+
.data()
2339+
.set_log_factory(Box::new(FakeTransactionLogFactory))
2340+
.unwrap();
2341+
22922342
AppWithProcessor {
22932343
app,
22942344
source_dir,
@@ -2379,7 +2429,7 @@ mod tests {
23792429
}
23802430

23812431
#[cfg(feature = "multi_threaded")]
2382-
use crate::processor::{AssetProcessor, LoadTransformAndSave};
2432+
use crate::processor::LoadTransformAndSave;
23832433

23842434
// The asset processor currently requires multi_threaded.
23852435
#[cfg(feature = "multi_threaded")]

0 commit comments

Comments
 (0)