Migrate to Bevy 0.18 (#13)
* update: enable message loop work for Windows and Linux * update: upgrade Bevy to version 0.18 and adjust asset loader for path handling * update: rename bevy_picking to picking in Cargo.toml * update: remove pull_request trigger from CI and change AmbientLight to GlobalAmbientLight * update: remove demo example from workspace and exclude it from tests * update: remove demo package from Cargo.lock --------- Co-authored-by: not-elm <elmgameinfo@gmail.com>
This commit is contained in:
@@ -20,7 +20,7 @@ impl Plugin for LocalSchemeAssetLoaderPlugin {
|
||||
#[reflect(Component, Debug)]
|
||||
pub struct CefResponseHandle(pub Handle<CefResponse>);
|
||||
|
||||
#[derive(Default)]
|
||||
#[derive(Default, TypePath)]
|
||||
pub struct CefResponseAssetLoader;
|
||||
|
||||
impl AssetLoader for CefResponseAssetLoader {
|
||||
@@ -35,7 +35,7 @@ impl AssetLoader for CefResponseAssetLoader {
|
||||
load_context: &mut LoadContext<'_>,
|
||||
) -> std::result::Result<Self::Asset, Self::Error> {
|
||||
let mut body = Vec::new();
|
||||
let mime_type = get_mime_type(load_context.path())
|
||||
let mime_type = get_mime_type(load_context.path().path())
|
||||
.unwrap_or("text/html")
|
||||
.to_string();
|
||||
reader.read_to_end(&mut body).await?;
|
||||
|
||||
@@ -19,10 +19,8 @@ pub struct MessageLoopPlugin {
|
||||
impl Plugin for MessageLoopPlugin {
|
||||
fn build(&self, app: &mut App) {
|
||||
app.insert_non_send_resource(RunOnMainThread)
|
||||
.add_systems(Main, cef_do_message_loop_work)
|
||||
.add_systems(Update, cef_shutdown.run_if(on_message::<AppExit>));
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
app.add_systems(Main, cef_do_message_loop_work);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,8 +60,8 @@ impl Default for MessageLoopPlugin {
|
||||
#[cfg(all(target_os = "macos", feature = "debug"))]
|
||||
no_sandbox: true as _,
|
||||
windowless_rendering_enabled: true as _,
|
||||
#[cfg(any(target_os = "windows", target_os = "linux"))]
|
||||
multi_threaded_message_loop: true as _,
|
||||
// #[cfg(any(target_os = "windows", target_os = "linux"))]
|
||||
// multi_threaded_message_loop: true as _,
|
||||
#[cfg(target_os = "macos")]
|
||||
external_message_pump: true as _,
|
||||
..Default::default()
|
||||
@@ -85,7 +83,6 @@ impl Default for MessageLoopPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
fn cef_do_message_loop_work(_: NonSend<RunOnMainThread>) {
|
||||
cef::do_message_loop_work();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user