make 640x480 default screen resolution

This commit is contained in:
Alula 2021-01-16 23:48:11 +01:00
parent 41307ccbc7
commit c5b058014a
No known key found for this signature in database
GPG Key ID: 3E00485503A1D8BA
1 changed files with 19 additions and 13 deletions

View File

@ -31,6 +31,7 @@ use crate::builtin_fs::BuiltinFS;
use crate::scene::loading_scene::LoadingScene;
use crate::scene::Scene;
use crate::shared_game_state::{SharedGameState, TimingMode};
use crate::texture_set::G_MAG;
use crate::ui::UI;
mod bmfont;
@ -152,8 +153,11 @@ impl Game {
}
let n1 = (elapsed - self.last_tick) as f64;
let n2 = (self.next_tick - self.last_tick) as f64;
state_ref.frame_time = n1 / n2;
state_ref.frame_time = if state_ref.settings.motion_interpolation {
n1 / n2
} else { 1.0 };
}
unsafe { G_MAG = if state_ref.settings.subpixel_coords { state_ref.scale } else { 1.0 } };
self.loops = 0;
graphics::clear(ctx, [0.0, 0.0, 0.0, 1.0].into());
@ -182,6 +186,8 @@ impl Game {
let state = unsafe { &mut *self.state.get() };
match key_code {
KeyCode::F5 => { state.settings.subpixel_coords = !state.settings.subpixel_coords }
KeyCode::F6 => { state.settings.motion_interpolation = !state.settings.motion_interpolation }
KeyCode::F7 => { state.set_speed(1.0) }
KeyCode::F8 => {
if state.settings.speed > 0.2 {
@ -286,7 +292,7 @@ fn init_ctx<P: Into<path::PathBuf> + Clone>(event_loop: &winit::event_loop::Even
.window_mode(WindowMode::default()
.resizable(true)
.min_dimensions(320.0, 240.0)
.dimensions(854.0, 480.0))
.dimensions(640.0, 480.0))
.add_resource_path(resource_dir.clone())
.backend(*backend)
.build(event_loop);