Appease clippy

This commit is contained in:
Joshua Barretto 2024-01-15 19:06:01 +00:00
parent 5bc60f2436
commit 3420e7a227
2 changed files with 11 additions and 41 deletions

View File

@ -284,13 +284,8 @@ impl PlayState for CharSelectionState {
Self::get_humanoid_body_inventory(&self.char_selection_ui, &client); Self::get_humanoid_body_inventory(&self.char_selection_ui, &client);
if let Some(mut first_pass) = drawer.first_pass() { if let Some(mut first_pass) = drawer.first_pass() {
self.scene.render( self.scene
&mut first_pass, .render(&mut first_pass, client.get_tick(), humanoid_body, loadout);
client.get_tick(),
humanoid_body,
loadout,
&client,
);
} }
if let Some(mut volumetric_pass) = drawer.volumetric_pass() { if let Some(mut volumetric_pass) = drawer.volumetric_pass() {

View File

@ -1,17 +1,11 @@
use crate::{ use crate::{
mesh::{greedy::GreedyMesh, segment::generate_mesh_base_vol_figure},
render::{ render::{
create_skybox_mesh, pipelines::FigureSpriteAtlasData, BoneMeshes, Consts, FigureModel, create_skybox_mesh, Consts, FirstPassDrawer, GlobalModel, Globals, GlobalsBindGroup, Light,
FirstPassDrawer, GlobalModel, Globals, GlobalsBindGroup, Light, Mesh, Model, Model, PointLightMatrix, RainOcclusionLocals, Renderer, Shadow, ShadowLocals, SkyboxVertex,
PointLightMatrix, RainOcclusionLocals, Renderer, Shadow, ShadowLocals, SkyboxVertex,
TerrainVertex,
}, },
scene::{ scene::{
camera::{self, Camera, CameraMode}, camera::{self, Camera, CameraMode},
figure::{ figure::{FigureAtlas, FigureModelCache, FigureState, FigureUpdateCommonParameters},
load_mesh, FigureAtlas, FigureModelCache, FigureModelEntry, FigureState,
FigureUpdateCommonParameters,
},
CloudsLocals, Lod, PostProcessLocals, CloudsLocals, Lod, PostProcessLocals,
}, },
window::{Event, PressState}, window::{Event, PressState},
@ -19,7 +13,6 @@ use crate::{
}; };
use anim::{ use anim::{
character::{CharacterSkeleton, IdleAnimation, SkeletonAttr}, character::{CharacterSkeleton, IdleAnimation, SkeletonAttr},
fixture::FixtureSkeleton,
Animation, Animation,
}; };
use client::Client; use client::Client;
@ -29,7 +22,6 @@ use common::{
inventory::{slot::EquipSlot, Inventory}, inventory::{slot::EquipSlot, Inventory},
item::ItemKind, item::ItemKind,
}, },
figure::Segment,
slowjob::SlowJobPool, slowjob::SlowJobPool,
terrain::{BlockKind, CoordinateConversions}, terrain::{BlockKind, CoordinateConversions},
vol::{BaseVol, ReadVol}, vol::{BaseVol, ReadVol},
@ -48,18 +40,6 @@ impl ReadVol for VoidVol {
fn get(&self, _pos: Vec3<i32>) -> Result<&'_ Self::Vox, Self::Error> { Ok(&()) } fn get(&self, _pos: Vec3<i32>) -> Result<&'_ Self::Vox, Self::Error> { Ok(&()) }
} }
fn generate_mesh(
greedy: &mut GreedyMesh<'_, FigureSpriteAtlasData>,
mesh: &mut Mesh<TerrainVertex>,
segment: Segment,
offset: Vec3<f32>,
bone_idx: u8,
) -> BoneMeshes {
let (opaque, _, /* shadow */ _, bounds) =
generate_mesh_base_vol_figure(segment, (greedy, mesh, offset, Vec3::one(), bone_idx));
(opaque /* , shadow */, bounds)
}
struct Skybox { struct Skybox {
model: Model<SkyboxVertex>, model: Model<SkyboxVertex>,
} }
@ -77,8 +57,7 @@ pub struct Scene {
figure_model_cache: FigureModelCache, figure_model_cache: FigureModelCache,
figure_state: Option<FigureState<CharacterSkeleton>>, figure_state: Option<FigureState<CharacterSkeleton>>,
//turning_camera: bool, turning_camera: bool,
turning_character: bool,
char_pos: Vec3<f32>, char_pos: Vec3<f32>,
} }
@ -109,7 +88,7 @@ impl Scene {
camera.set_distance(3.4); camera.set_distance(3.4);
camera.set_orientation(Vec3::new(start_angle, 0.1, 0.0)); camera.set_orientation(Vec3::new(start_angle, 0.1, 0.0));
let mut figure_atlas = FigureAtlas::new(renderer); let figure_atlas = FigureAtlas::new(renderer);
let data = GlobalModel { let data = GlobalModel {
globals: renderer.create_consts(&[Globals::default()]), globals: renderer.create_consts(&[Globals::default()]),
@ -150,8 +129,7 @@ impl Scene {
camera, camera,
//turning_camera: false, turning_camera: false,
turning_character: false,
char_pos, char_pos,
} }
} }
@ -173,16 +151,14 @@ impl Scene {
}, },
Event::MouseButton(button, state) => { Event::MouseButton(button, state) => {
if state == PressState::Pressed { if state == PressState::Pressed {
//self.turning_camera = button == MouseButton::Right; self.turning_camera = button == MouseButton::Left;
self.turning_character = button == MouseButton::Left;
} else { } else {
//self.turning_camera = false; self.turning_camera = false;
self.turning_character = false;
} }
true true
}, },
Event::CursorMove(delta) => { Event::CursorMove(delta) => {
if self.turning_character { if self.turning_camera {
self.camera.rotate_by(delta.with_z(0.0) * 0.01); self.camera.rotate_by(delta.with_z(0.0) * 0.01);
} }
true true
@ -341,7 +317,6 @@ impl Scene {
tick: u64, tick: u64,
body: Option<humanoid::Body>, body: Option<humanoid::Body>,
inventory: Option<&Inventory>, inventory: Option<&Inventory>,
client: &Client,
) { ) {
let mut figure_drawer = drawer.draw_figures(); let mut figure_drawer = drawer.draw_figures();
if let Some(body) = body { if let Some(body) = body {