Skip to content

Commit

Permalink
Merge branch 'dev' into egui-image-api
Browse files Browse the repository at this point in the history
  • Loading branch information
melody-rs committed Dec 3, 2023
2 parents 498157b + 016409a commit 5988e7c
Show file tree
Hide file tree
Showing 76 changed files with 12,434 additions and 2,592 deletions.
584 changes: 464 additions & 120 deletions Cargo.lock

Large diffs are not rendered by default.

29 changes: 21 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,19 @@ egui = "0.23.0"
egui_extras = { version = "0.23.0", features = ["svg", "image"] }
epaint = "0.23.0"

eframe = { version = "0.23.0", features = [
luminol-eframe = { version = "0.23.0", path = "crates/eframe/", features = [
"wgpu",
"accesskit",
"persistence",
"default_fonts",
"x11",
"wayland",
], default-features = false }
egui-wgpu = "0.23.0"
luminol-egui-wgpu = { version = "0.23.0", path = "crates/egui-wgpu/" }
egui_glow = "0.23.0"
egui-winit = "0.23.0"

wgpu = { version = "0.17.2", features = ["naga"] }
wgpu = { version = "0.18.0", features = ["naga"] }
glam = { version = "0.24.2", features = ["bytemuck"] }
image = "0.24.7"

Expand Down Expand Up @@ -119,7 +121,6 @@ rand = "0.8.5"
getrandom = { version = "0.2", features = ["js"] }

luminol-audio = { version = "0.4.0", path = "crates/audio/" }
luminol-app = { version = "0.4.0", path = "crates/app/" }
luminol-components = { version = "0.4.0", path = "crates/components/" }
luminol-config = { version = "0.4.0", path = "crates/config/" }
luminol-core = { version = "0.4.0", path = "crates/core/" }
Expand All @@ -134,11 +135,14 @@ luminol-ui = { version = "0.4.0", path = "crates/ui/" }
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
eframe.workspace = true
luminol-eframe.workspace = true
luminol-egui-wgpu.workspace = true
egui.workspace = true
egui_extras.workspace = true
epaint.workspace = true

wgpu.workspace = true

rfd.workspace = true

parking_lot.workspace = true
Expand All @@ -151,7 +155,6 @@ crc = { version = "3.0.1", optional = true }
tracing-subscriber = "0.3.17"
color-backtrace = "0.6.0"

luminol-app.workspace = true
luminol-audio.workspace = true
luminol-core.workspace = true
luminol-config.workspace = true
Expand Down Expand Up @@ -209,7 +212,12 @@ tracing-wasm = "0.2"
tracing-log = "0.1.3"
tracing.workspace = true

web-sys = { version = "0.3", features = ["Window"] }
web-sys = { version = "0.3", features = [
"Window",
"Worker",
"WorkerOptions",
"WorkerType",
] }

# Enable wgpu's `webgl` feature if Luminol's `webgl` feature is enabled,
# enabling its WebGL backend and disabling its WebGPU backend
Expand Down Expand Up @@ -246,7 +254,7 @@ opt-level = 1
[profile.dev.package.egui]
opt-level = 3

[profile.dev.package.eframe]
[profile.dev.package.luminol-eframe]
opt-level = 3

# Audio
Expand Down Expand Up @@ -275,6 +283,11 @@ opt-level = 3
# is merged.
cpal = { git = "https://github.com/DouglasDwyer/cpal.git", rev = "91aeb4d6b02c25791f636fdf92a73637597c077a" }

# flume's global spinlock uses `thread::sleep` which doesn't work in the main thread in WebAssembly.
# This is a patched version with `thread::sleep` removed in WebAssembly builds.
# See https://github.com/zesterer/flume/issues/137.
flume = { git = "https://github.com/Astrabit-ST/flume", rev = "d323799efea329c87a3a5a5b45cc76f46da278c2" }

# If you want to use the bleeding edge version of egui and eframe:
# egui = { git = "https://github.com/emilk/egui", branch = "master" }
# eframe = { git = "https://github.com/emilk/egui", branch = "master" }
Expand Down
20 changes: 0 additions & 20 deletions crates/app/Cargo.toml

This file was deleted.

42 changes: 0 additions & 42 deletions crates/app/src/lib.rs

This file was deleted.

2 changes: 1 addition & 1 deletion crates/components/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ luminol-filesystem.workspace = true
egui.workspace = true
strum.workspace = true

egui-wgpu.workspace = true
luminol-egui-wgpu.workspace = true

wgpu.workspace = true
glam.workspace = true
Expand Down
21 changes: 11 additions & 10 deletions crates/components/src/tilepicker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ unsafe impl Send for Callback {}
#[allow(unsafe_code)]
unsafe impl Sync for Callback {}

impl egui_wgpu::CallbackTrait for Callback {
impl luminol_egui_wgpu::CallbackTrait for Callback {
fn paint<'a>(
&'a self,
_info: egui::PaintCallbackInfo,
render_pass: &mut wgpu::RenderPass<'a>,
_callback_resources: &'a egui_wgpu::CallbackResources,
_callback_resources: &'a luminol_egui_wgpu::CallbackResources,
) {
self.resources
.tiles
Expand Down Expand Up @@ -234,14 +234,15 @@ impl Tilepicker {
),
);
// FIXME: move this into graphics
ui.painter().add(egui_wgpu::Callback::new_paint_callback(
absolute_scroll_rect,
Callback {
resources: self.resources.clone(),
graphics_state: graphics_state.clone(),
coll_enabled,
},
));
ui.painter()
.add(luminol_egui_wgpu::Callback::new_paint_callback(
absolute_scroll_rect,
Callback {
resources: self.resources.clone(),
graphics_state: graphics_state.clone(),
coll_enabled,
},
));

let rect = egui::Rect::from_x_y_ranges(
(self.selected_tiles_left * 32) as f32..=((self.selected_tiles_right + 1) * 32) as f32,
Expand Down
Loading

0 comments on commit 5988e7c

Please sign in to comment.