mirror of
https://github.com/doukutsu-rs/doukutsu-rs
synced 2025-01-07 19:46:53 +00:00
fix cs+switch scrolling
This commit is contained in:
parent
f3a87259a1
commit
23f0feaae0
|
@ -36,7 +36,7 @@ impl Frame {
|
|||
|
||||
pub fn immediate_update(&mut self, state: &mut SharedGameState, stage: &Stage) {
|
||||
let mut screen_width = state.canvas_size.0;
|
||||
if state.constants.is_switch {
|
||||
if state.constants.is_switch && stage.map.width <= 54 {
|
||||
screen_width += 10.0; // hack for scrolling
|
||||
}
|
||||
|
||||
|
@ -78,9 +78,10 @@ impl Frame {
|
|||
|
||||
pub fn update(&mut self, state: &mut SharedGameState, stage: &Stage) {
|
||||
let mut screen_width = state.canvas_size.0;
|
||||
if state.constants.is_switch {
|
||||
if state.constants.is_switch && stage.map.width <= 54 {
|
||||
screen_width += 10.0;
|
||||
}
|
||||
|
||||
let tile_size = state.tile_size.as_int();
|
||||
|
||||
if (stage.map.width as usize).saturating_sub(1) * (tile_size as usize) < screen_width as usize {
|
||||
|
|
|
@ -398,7 +398,7 @@ impl GameScene {
|
|||
|
||||
for y in 0..(state.canvas_size.1 as i32 / 16 + 1) {
|
||||
if direction == FadeDirection::Left {
|
||||
batch.add_rect(state.canvas_size.0 - x as f32 * 16.0, y as f32 * 16.0, &rect);
|
||||
batch.add_rect(state.canvas_size.0 - x as f32 * 16.0 - 16.0, y as f32 * 16.0, &rect);
|
||||
} else {
|
||||
batch.add_rect(x as f32 * 16.0, y as f32 * 16.0, &rect);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue