Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc990123

Browse files
committed
cleanup top down camera stuff; add debug capabilities for web for now; add check-web make; actually track current mood
1 parentd9b44aa commitc990123

File tree

8 files changed

+36
-39
lines changed

8 files changed

+36
-39
lines changed

‎.github/workflows/ci.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,5 +168,5 @@ jobs:
168168
run:sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev
169169

170170
-name:Check web
171-
run:cargo check --config 'profile.web.inherits="dev"' --profile ci --no-default-features --features web --target wasm32-unknown-unknown
171+
run:cargo check --profile ci --no-default-features --features web --target wasm32-unknown-unknown
172172

‎Cargo.lock‎

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,15 @@ resolver = "3"
3939

4040
[features]
4141
default = ["dev_native" ]
42-
dev = [
42+
debug = [
4343
"bevy/bevy_dev_tools",
4444
"bevy/bevy_ui_debug",
45+
]
46+
dev = [
47+
"debug",
4548
"bevy/dynamic_linking",# Improve compile times for dev builds by linking Bevy as a dynamic library.
4649
"bevy/track_location",# Improve error messages coming from Bevy
4750
]
48-
web = []
4951
dev_native = [
5052
"dev",
5153
"enhanced",
@@ -58,6 +60,8 @@ enhanced = [
5860
"bevy/bevy_pbr",# PBR
5961
"bevy/pbr_specular_textures",# PBR specular maps
6062
]
63+
# TODO: find a proper config to not have these in release
64+
web = ["debug"]
6165

6266
[workspace.dependencies.bevy]
6367
# version = "0.17.0-dev"
@@ -152,6 +156,13 @@ features = ["dev"]
152156

153157
# BUILD
154158

159+
[profile.dev]# Less optimization in the dev profile.
160+
opt-level =1
161+
[profile.dev.package."*"]# More optimization in the dev profile for dependencies.
162+
opt-level =3
163+
[profile.dev.package.wgpu-types]# Remove expensive debug assertions due to <https://github.com/bevyengine/bevy/issues/14291>
164+
debug-assertions =false
165+
155166
[profile.ci]# Optimize for build time in CI.
156167
inherits ="dev"
157168
opt-level =0
@@ -160,22 +171,16 @@ codegen-units = 4
160171
[profile.ci.package."*"]
161172
opt-level =0
162173

163-
[profile.dev]# Less optimization in the dev profile.
164-
opt-level =1
165-
[profile.dev.package."*"]# More optimization in the dev profile for dependencies.
166-
opt-level =3
167-
168-
[profile.dev.package.wgpu-types]# Remove expensive debug assertions due to <https://github.com/bevyengine/bevy/issues/14291>
169-
debug-assertions =false
170-
171174
[profile.release]
172175
# Do a second optimization pass over the entire program, including dependencies.
173176
# Slows compile times, marginal improvements.
174177
lto ="thin"
175178
# Optimize with size in mind (also try "z", sometimes it is better).
176179
# Slightly slows compile times, great improvements to file size and runtime performance.
177180
opt-level ="s"
178-
codegen-units =1# Compile the entire crate as one unit. Slows compile times, marginal improvements.
181+
# Compile the entire crate as one unit. Slows compile times to less size.
182+
# Default is 16 or 256(incremental builds). This template f.e. 18Mb -> 24Mb
183+
codegen-units =1
179184
strip =true
180185

181186

‎Makefile‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
.PHONY: clean-build docs lint buildbuild-webhot run run-web
1+
.PHONY: clean-build docs lint buildcheck-webbuild-web run run-web
22

33
.ONESHELL:# Use one shell per target
44
SHELL := /bin/bash
55
# Stop excecution on any error
66
.SHELLFLAGS = -ec
77

88
clean-build:
9-
cargo clean&& make build&& make lint
9+
cargo clean&& make build&& make lint&& make check-web
1010

1111
docs:
1212
cargo doc --open --no-deps --workspace
@@ -19,6 +19,9 @@ lint:
1919
build:
2020
bevy build --locked --release
2121

22+
check-web:
23+
cargo check --profile ci --no-default-features --features web --target wasm32-unknown-unknown
24+
2225
build-web:
2326
cargo binstall --locked -y --force wasm-bindgen-cli
2427
cargo binstall --locked -y --force wasm-opt

‎assets/models/rock.glb‎

-1010 KB
Binary file not shown.

‎crates/game/src/lib.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use models::*;
66
use scene::*;
77

88
mod camera;
9-
#[cfg(feature ="dev_native")]
9+
#[cfg(debug_assertions)]
1010
mod dev_tools;
1111
mod mood;
1212

@@ -20,7 +20,7 @@ pub fn plugin(app: &mut App) {
2020
scene::plugin,
2121
player::plugin,
2222
mood::plugin,
23-
#[cfg(feature ="dev_native")]
23+
#[cfg(debug_assertions)]
2424
dev_tools::plugin,
2525
));
2626
}

‎crates/game/src/mood.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ fn change_mood(
5454
on:Trigger<ChangeMood>,
5555
settings:Res<Settings>,
5656
sources:Res<AudioSources>,
57+
mutstate:ResMut<GameState>,
5758
music:Query<Entity,(With<SamplerPool<Music>>,Without<SamplerPool<Sfx>>)>,
5859
mutcommands:Commands,
5960
){
@@ -89,6 +90,7 @@ fn change_mood(
8990
));
9091
}
9192
}
93+
state.current_mood = mood.clone();
9294
}
9395

9496
// Fades in the audio of entities that has the FadeIn component. Removes the FadeIn component once

‎crates/models/src/states.rs‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ pub struct GameState {
1414
publast_screen:Screen,
1515
pubcurrent_mood:MoodType,
1616

17-
/// Only relevant in top_down camera mode
18-
/// Track if we should move or rotate camera on mouse move
19-
pubcamera_mode:CameraMode,
20-
2117
pubdiagnostics:bool,
2218
pubdebug_ui:bool,
2319
pubpaused:bool,
@@ -29,7 +25,6 @@ impl Default for GameState {
2925
Self{
3026
modals:vec![],
3127
last_screen:Screen::Title,
32-
camera_mode:CameraMode::Move,
3328
current_mood:MoodType::Exploration,
3429
diagnostics:true,
3530
debug_ui:false,
@@ -78,11 +73,3 @@ pub enum MoodType {
7873
Exploration,
7974
Combat,
8075
}
81-
82-
// #[cfg(feature = "top_down")]
83-
#[derive(Default,Clone,Eq,PartialEq,Debug,Hash,Reflect)]
84-
pubenumCameraMode{
85-
#[default]
86-
Move,
87-
Rotate,
88-
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp