Skip to content

Commit

Permalink
Update rustfmt.toml and reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
vE5li committed Feb 12, 2024
1 parent f972d98 commit 93ac980
Showing 4 changed files with 112 additions and 111 deletions.
11 changes: 6 additions & 5 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
condense_wildcard_suffixes = true
edition = "2021"
version = "Two"
max_width = 140
fn_call_width = 80
condense_wildcard_suffixes = true
format_macro_matchers = true
format_strings = true
group_imports = "StdExternalCrate"
hex_literal_case = "Upper"
imports_granularity = "Module"
max_width = 140
overflow_delimited_expr = true
reorder_impl_items = true
group_imports = "StdExternalCrate"
use_field_init_shorthand = true
overflow_delimited_expr = true
version = "Two"
wrap_comments = true
20 changes: 10 additions & 10 deletions src/graphics/renderers/picker/target.rs
Original file line number Diff line number Diff line change
@@ -46,27 +46,27 @@ impl From<u32> for PickerTarget {

#[cfg(feature = "debug")]
if data >> 24 == MarkerEncoding::Object as u32 {
return Self::Marker(MarkerIdentifier::Object(data as usize & 0xfff));
return Self::Marker(MarkerIdentifier::Object(data as usize & 0xFFF));
}

#[cfg(feature = "debug")]
if data >> 24 == MarkerEncoding::LightSource as u32 {
return Self::Marker(MarkerIdentifier::LightSource(data as usize & 0xfff));
return Self::Marker(MarkerIdentifier::LightSource(data as usize & 0xFFF));
}

#[cfg(feature = "debug")]
if data >> 24 == MarkerEncoding::SoundSource as u32 {
return Self::Marker(MarkerIdentifier::SoundSource(data as usize & 0xfff));
return Self::Marker(MarkerIdentifier::SoundSource(data as usize & 0xFFF));
}

#[cfg(feature = "debug")]
if data >> 24 == MarkerEncoding::EffectSource as u32 {
return Self::Marker(MarkerIdentifier::EffectSource(data as usize & 0xfff));
return Self::Marker(MarkerIdentifier::EffectSource(data as usize & 0xFFF));
}

#[cfg(feature = "debug")]
if data >> 24 == MarkerEncoding::Entity as u32 {
return Self::Marker(MarkerIdentifier::Entity(data as usize & 0xfff));
return Self::Marker(MarkerIdentifier::Entity(data as usize & 0xFFF));
}

Self::Entity(EntityId(data))
@@ -84,11 +84,11 @@ impl From<PickerTarget> for u32 {
PickerTarget::Entity(EntityId(entity_id)) => entity_id,
#[cfg(feature = "debug")]
PickerTarget::Marker(marker_identifier) => match marker_identifier {
MarkerIdentifier::Object(index) => ((MarkerEncoding::Object as u32) << 24) | (index as u32 & 0xfff),
MarkerIdentifier::LightSource(index) => ((MarkerEncoding::LightSource as u32) << 24) | (index as u32 & 0xfff),
MarkerIdentifier::SoundSource(index) => ((MarkerEncoding::SoundSource as u32) << 24) | (index as u32 & 0xfff),
MarkerIdentifier::EffectSource(index) => ((MarkerEncoding::EffectSource as u32) << 24) | (index as u32 & 0xfff),
MarkerIdentifier::Entity(index) => ((MarkerEncoding::Entity as u32) << 24) | (index as u32 & 0xfff),
MarkerIdentifier::Object(index) => ((MarkerEncoding::Object as u32) << 24) | (index as u32 & 0xFFF),
MarkerIdentifier::LightSource(index) => ((MarkerEncoding::LightSource as u32) << 24) | (index as u32 & 0xFFF),
MarkerIdentifier::SoundSource(index) => ((MarkerEncoding::SoundSource as u32) << 24) | (index as u32 & 0xFFF),
MarkerIdentifier::EffectSource(index) => ((MarkerEncoding::EffectSource as u32) << 24) | (index as u32 & 0xFFF),
MarkerIdentifier::Entity(index) => ((MarkerEncoding::Entity as u32) << 24) | (index as u32 & 0xFFF),
_ => panic!(),
},
}
2 changes: 1 addition & 1 deletion src/loaders/texture/mod.rs
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ impl TextureLoader {
// These numbers are taken from https://github.com/Duckwhale/RagnarokFileFormats
image_buffer
.pixels_mut()
.filter(|pixel| pixel.0[0] > 0xf0 && pixel.0[1] < 0x10 && pixel.0[2] > 0x0f)
.filter(|pixel| pixel.0[0] > 0xF0 && pixel.0[1] < 0x10 && pixel.0[2] > 0x0F)
.for_each(|pixel| *pixel = Rgba([0; 4]));
}

Loading

0 comments on commit 93ac980

Please sign in to comment.