Skip to content

Commit 6998d64

Browse files
authored
🚧 Split luminol into separate crates (#45)
* refactor: 🚧 Split luminol into separate crates * refactor: 🚧 Start working out dependencies * Sorta figure out dependencies * Sorta start getting somewhere * Move Luminol into crates folder * Move the filesystem trait out of luminol-core * refactor: 🚧 refactor luminol-graphics and it's a mess * refactor: * refactor: add UpdateState to luminol-core and move various traits * refactor(filesystem): ♻️ require FileSystem::File to be 'static * refactor: ♻️ don't take an &'static reference to graphics state * refactor: ♻️ refactor modals * refactor: ♻️ unify tabs and windows * refactor: ♻️ start to fix up windows * refactor: ♻️ hack together things so that they compile * refactor: ♻️ partially resolve async code issues * refactor: ♻️ it compiles (with a LOT of unfinished things) * refactor: ♻️ NOW it compiles * fix(graphics): 🐛 fix sprite shader compilation * fix(data cache): ♻️ get data cache semi-working * refactor(data cache): ♻️ actually load data cache * refactor(config): ♻️ store code theme in global state again * fix(ui): 🐛 fix windows and tabs not being added * refactor: ♻️ use workspace metadata for package metadata * refactor: ♻️ remove generic parameters on update state by using dynamic dispatch I couldn't get generics to allow adding tabs or windows inside tabs or windows * refactor(tabs): ♻️ pass update state when requesting tab name * fix(tabs): 🐛 fix tabs not adding properly * Update window.rs * fix: 🐛 get top bar loading projects * fix: 🐛 fix new project creation because reqwest requires tokio we need to spawn a tokio runtime. i do not think this scales well to web * refactor: 🚧 try splitting up the map tab * Enable -Zthreads compiler flag * Update nightly in workflows * revert: ⏪ Undo making cursor state an enum (will tackle this later) * Sorta resolve dependencies on wasm Still a mess (and is especially complicated by the fact that you can't specify workspace target specific dependencies) * Fix backing web filesystem implementation Still need to work on the project filesystem though! I'll be honest, I'm not sure how this will work, especially with the way I have the native filesystem set up * Fix native build * Remove jobs flag * Fix audio on wasm * Temporarily impl Send + Sync for wgpu callbacks In wgpu 0.17 wgpu types are not Send + Sync, because they reference things in the JS heap (meaning they cannot leave the thread they were created on) egui_wgpu's CallbackTrait requires Send + Sync even on wasm and we need to store wgpu types in callbacks. The callback_resources typemap passed to callbacks doesn't need to be Send + Sync.. but I can't find a simple way to add anything to the typemap. emilk/egui#1399 feels relevant * Fix winit not compiling in CI emilk/egui#3228 * Get wasm filesystem compiling * Get luminol compiling on wasm! * Fix missed rename * Dumb typo * Move luminol crate to be root package Trunk doesn't like virtual workspaces unfortunately :( * Run workspace tests * fix(audio): 🐛 Completely read audio file on wasm * perf(wasm): ⚡ Use oneshot crate for oneshot channels * fix(filesystem): 🐛 Pass idb key instead of path to Filesystem::from_idb_key * refactor(tilemap): ♻️ Use naga oil instead of const_format * fix(ui): 🐛 Fix top bar opening & closing projects * Bump nightly in trunk build * Remove luminol- in folder prefixes
1 parent 6c1dc04 commit 6998d64

File tree

185 files changed

+8821
-8346
lines changed

Some content is hidden

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

185 files changed

+8821
-8346
lines changed

.cargo/config.toml

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
1+
# Possibly enable -Zshare-generics=y?
2+
13
[target.x86_64-pc-windows-msvc]
24
linker = "rust-lld"
5+
rustflags = ["-Z", "threads=8"]
36

47
[target.x86_64-unknown-linux-gnu]
5-
rustflags = ["-C", "linker=clang", "-C", "link-arg=-fuse-ld=mold"]
8+
rustflags = [
9+
"-C",
10+
"linker=clang",
11+
"-C",
12+
"link-arg=-fuse-ld=mold",
13+
"-Z",
14+
"threads=8",
15+
]
616

717
[target.'cfg(target_arch = "wasm32")']
8-
rustflags = ["--cfg=web_sys_unstable_apis", "-C", "target-feature=+atomics,+bulk-memory,+mutable-globals"]
18+
rustflags = [
19+
"--cfg=web_sys_unstable_apis",
20+
"-C",
21+
"target-feature=+atomics,+bulk-memory,+mutable-globals",
22+
"-Z",
23+
"threads=8",
24+
]

.github/workflows/build-steam.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ jobs:
2323
sudo apt install libgtk-3-dev libatk1.0-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev libasound2-dev clang mold -y
2424
- uses: dtolnay/rust-toolchain@nightly
2525
with:
26-
toolchain: nightly-2023-09-12
26+
toolchain: nightly-2023-11-14
2727
- name: Rust Cache
2828
uses: Swatinem/rust-cache@v2
2929
- name: Build luminol (Release)
30-
run: cargo build --features steamworks --release --jobs 1
30+
run: cargo build --features steamworks --release
3131
- name: Setup artifact
3232
run: |
3333
mkdir -p ${{ github.workspace }}/artifact
@@ -48,11 +48,11 @@ jobs:
4848
submodules: true
4949
- uses: dtolnay/rust-toolchain@nightly
5050
with:
51-
toolchain: nightly-2023-09-12
51+
toolchain: nightly-2023-11-14
5252
- name: Rust Cache
5353
uses: Swatinem/rust-cache@v2
5454
- name: Build luminol (Release)
55-
run: cargo build --features steamworks --release --jobs 1
55+
run: cargo build --features steamworks --release
5656
- name: Setup artifact
5757
run: |
5858
mkdir -p ${{ github.workspace }}/artifact
@@ -73,11 +73,11 @@ jobs:
7373
submodules: true
7474
- uses: dtolnay/rust-toolchain@nightly
7575
with:
76-
toolchain: nightly-2023-09-12
76+
toolchain: nightly-2023-11-14
7777
- name: Rust Cache
7878
uses: Swatinem/rust-cache@v2
7979
- name: Build luminol (Release)
80-
run: cargo build --features steamworks --release --jobs 1
80+
run: cargo build --features steamworks --release
8181
- name: Setup artifact
8282
run: |
8383
mkdir -p ${{ github.workspace }}/artifact

.github/workflows/build.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ jobs:
2222
sudo apt install libgtk-3-dev libatk1.0-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev libasound2-dev clang mold -y
2323
- uses: dtolnay/rust-toolchain@nightly
2424
with:
25-
toolchain: nightly-2023-09-12
25+
toolchain: nightly-2023-11-14
2626
- name: Rust Cache
2727
uses: Swatinem/rust-cache@v2
2828
- name: Build luminol (Release)
29-
run: cargo build --release --jobs 1
29+
run: cargo build --release
3030
- name: Setup artifact
3131
run: |
3232
mkdir -p ${{ github.workspace }}/artifact
@@ -46,11 +46,11 @@ jobs:
4646
submodules: true
4747
- uses: dtolnay/rust-toolchain@nightly
4848
with:
49-
toolchain: nightly-2023-09-12
49+
toolchain: nightly-2023-11-14
5050
- name: Rust Cache
5151
uses: Swatinem/rust-cache@v2
5252
- name: Build luminol (Release)
53-
run: cargo build --release --jobs 1
53+
run: cargo build --release
5454
- name: Setup artifact
5555
run: |
5656
mkdir -p ${{ github.workspace }}/artifact
@@ -70,11 +70,11 @@ jobs:
7070
submodules: true
7171
- uses: dtolnay/rust-toolchain@nightly
7272
with:
73-
toolchain: nightly-2023-09-12
73+
toolchain: nightly-2023-11-14
7474
- name: Rust Cache
7575
uses: Swatinem/rust-cache@v2
7676
- name: Build luminol (Release)
77-
run: cargo build --release --jobs 1
77+
run: cargo build --release
7878
- name: Setup artifact
7979
run: |
8080
mkdir -p ${{ github.workspace }}/artifact
@@ -98,7 +98,7 @@ jobs:
9898
sudo apt install libgtk-3-dev libatk1.0-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev libasound2-dev clang mold -y
9999
- uses: dtolnay/rust-toolchain@nightly
100100
with:
101-
toolchain: nightly-2023-09-12
101+
toolchain: nightly-2023-11-14
102102
targets: wasm32-unknown-unknown
103103
components: rust-src
104104
- name: Download and install Trunk binary

.github/workflows/checks.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
sudo apt install libgtk-3-dev libatk1.0-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev libasound2-dev clang mold -y
2424
- uses: dtolnay/rust-toolchain@nightly
2525
with:
26-
toolchain: nightly-2023-09-12
26+
toolchain: nightly-2023-11-14
2727
- name: Rust Cache
2828
uses: Swatinem/rust-cache@v2
29-
- run: cargo check --all-features --jobs 1
29+
- run: cargo check --all-features
3030

3131
check-wasm32:
3232
name: Check wasm32
@@ -41,12 +41,12 @@ jobs:
4141
sudo apt install libgtk-3-dev libatk1.0-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev libasound2-dev clang mold -y
4242
- uses: dtolnay/rust-toolchain@nightly
4343
with:
44-
toolchain: nightly-2023-09-12
44+
toolchain: nightly-2023-11-14
4545
targets: wasm32-unknown-unknown
4646
components: rust-src
4747
- name: Rust Cache
4848
uses: Swatinem/rust-cache@v2
49-
- run: cargo check --jobs 1 --target wasm32-unknown-unknown -Z build-std=std,panic_abort
49+
- run: cargo check --target wasm32-unknown-unknown -Z build-std=std,panic_abort
5050

5151
test:
5252
name: Test Suite
@@ -60,10 +60,10 @@ jobs:
6060
sudo apt install libgtk-3-dev libatk1.0-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev libasound2-dev clang mold -y
6161
- uses: dtolnay/rust-toolchain@nightly
6262
with:
63-
toolchain: nightly-2023-09-12
63+
toolchain: nightly-2023-11-14
6464
- name: Rust Cache
6565
uses: Swatinem/rust-cache@v2
66-
- run: cargo test --lib --jobs 1
66+
- run: cargo test --workspace
6767

6868
fmt:
6969
name: Rustfmt
@@ -78,7 +78,7 @@ jobs:
7878
sudo apt install libgtk-3-dev libatk1.0-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev libasound2-dev clang mold -y
7979
- uses: dtolnay/rust-toolchain@nightly
8080
with:
81-
toolchain: nightly-2023-09-12
81+
toolchain: nightly-2023-11-14
8282
components: rustfmt
8383
- name: Rust Cache
8484
uses: Swatinem/rust-cache@v2
@@ -97,8 +97,8 @@ jobs:
9797
sudo apt install libgtk-3-dev libatk1.0-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev libasound2-dev clang mold -y
9898
- uses: dtolnay/rust-toolchain@nightly
9999
with:
100-
toolchain: nightly-2023-09-12
100+
toolchain: nightly-2023-11-14
101101
components: clippy
102102
- name: Rust Cache
103103
uses: Swatinem/rust-cache@v2
104-
- run: cargo clippy --jobs 1 -- # -D warnings
104+
- run: cargo clippy -- # -D warnings

.vscode/settings.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"licenser.customHeaderFile": "${workspaceFolder}/.vscode/header.txt",
66
"licenser.disableAutoHeaderInsertion": false,
77
"rust-analyzer.cargo.features": [
8-
"steamworks"
8+
// "steamworks"
99
],
1010
"editor.formatOnSave": true,
1111
"rust-analyzer.check.command": "clippy",
@@ -22,7 +22,8 @@
2222
"image cache",
2323
"tilemap",
2424
"config",
25-
"audio"
25+
"audio",
26+
"graphics"
2627
],
2728
"rust-analyzer.showUnlinkedFileNotification": false,
2829
"rust-analyzer.cargo.extraEnv": {

.wakatime-project

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Luminol

0 commit comments

Comments
 (0)