clamp juicestream heads beforehand (/b/17295+Catch)
This commit is contained in:
@@ -99,10 +99,13 @@ fn convert_object<'a>(
|
|||||||
attrs: &mut CatchDifficultyAttributesBuilder,
|
attrs: &mut CatchDifficultyAttributesBuilder,
|
||||||
bufs: &'a mut JuiceStreamBufs,
|
bufs: &'a mut JuiceStreamBufs,
|
||||||
) -> ObjectIter<'a> {
|
) -> ObjectIter<'a> {
|
||||||
|
let mut x = h.pos.x;
|
||||||
|
|
||||||
let state = match h.kind {
|
let state = match h.kind {
|
||||||
HitObjectKind::Circle => ObjectIterState::Fruit(Some(Fruit::new(attrs))),
|
HitObjectKind::Circle => ObjectIterState::Fruit(Some(Fruit::new(attrs))),
|
||||||
HitObjectKind::Slider(ref slider) => {
|
HitObjectKind::Slider(ref slider) => {
|
||||||
let stream = JuiceStream::new(h.pos.x, h.start_time, slider, converted, attrs, bufs);
|
x = JuiceStream::clamp_to_playfield(x);
|
||||||
|
let stream = JuiceStream::new(x, h.start_time, slider, converted, attrs, bufs);
|
||||||
|
|
||||||
ObjectIterState::JuiceStream(stream)
|
ObjectIterState::JuiceStream(stream)
|
||||||
}
|
}
|
||||||
@@ -113,7 +116,7 @@ fn convert_object<'a>(
|
|||||||
};
|
};
|
||||||
|
|
||||||
ObjectIter {
|
ObjectIter {
|
||||||
x: h.pos.x,
|
x,
|
||||||
start_time: h.start_time,
|
start_time: h.start_time,
|
||||||
state,
|
state,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ impl<'a> JuiceStream<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn clamp_to_playfield(value: f32) -> f32 {
|
pub fn clamp_to_playfield(value: f32) -> f32 {
|
||||||
value.clamp(0.0, PLAYFIELD_WIDTH)
|
value.clamp(0.0, PLAYFIELD_WIDTH)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user