pub struct App {Show 34 fields
pub cfg: Config,
pub res: Resources,
pub game: Game,
pub level_index: usize,
pub levels: Vec<String>,
luts: ShadeLuts,
luts_water: ShadeLuts,
luts_beast: ShadeLuts,
renderer: Renderer,
window: Option<Rc<Window>>,
surface: Option<Surface<Rc<Window>, Rc<Window>>>,
keys: HashSet<KeyCode>,
mouse_buttons: HashSet<MouseButton>,
mouse_dx: f64,
mouse_dy: f64,
last: Instant,
fps_time: Instant,
fps_frames: u32,
fps: f64,
grabbed: bool,
pub audio: Option<Audio>,
show_stats: bool,
audio_map: String,
pub menu: Menu,
pub menu_open: bool,
start_time: Instant,
out: Vec<u32>,
shot_pending: bool,
pace_next: Option<Instant>,
movie: Option<Movie>,
movie_queue: VecDeque<MovieFile>,
prof_log: Vec<String>,
last_switch: Instant,
message: Option<(String, Instant)>,
}Fields§
§cfg: Config§res: Resources§game: Game§level_index: usize§levels: Vec<String>§luts: ShadeLuts§luts_water: ShadeLuts§luts_beast: ShadeLuts§renderer: Renderer§window: Option<Rc<Window>>§surface: Option<Surface<Rc<Window>, Rc<Window>>>§keys: HashSet<KeyCode>§mouse_dx: f64§mouse_dy: f64§last: Instant§fps_time: Instant§fps_frames: u32§fps: f64§grabbed: bool§audio: Option<Audio>§show_stats: bool§audio_map: String§start_time: Instant§out: Vec<u32>Window-sized image (letterboxed modes) the HUD is drawn on before presenting.
shot_pending: boolF12 pressed: save the next presented frame.
pace_next: Option<Instant>When the next capped frame may start.
movie: Option<Movie>Cutscene playing, and those queued after it.
movie_queue: VecDeque<MovieFile>§prof_log: Vec<String>§last_switch: Instant§message: Option<(String, Instant)>Implementations§
Source§impl App
impl App
pub fn new( cfg: Config, res: Resources, game: Game, levels: Vec<String>, level_index: usize, ) -> Self
fn grab(&mut self, on: bool)
fn down(&self, k: KeyCode) -> bool
fn build_input(&mut self, dt: f64) -> Input
fn change_level(&mut self, delta: isize)
Sourcefn load_named(&mut self, name: &str, carry: bool)
fn load_named(&mut self, name: &str, carry: bool)
Loads a level; carry keeps the player’s weapons, health and armour.
fn level_exit(&mut self, secret: bool)
Sourcepub fn queue_movies(&mut self, files: Vec<MovieFile>)
pub fn queue_movies(&mut self, files: Vec<MovieFile>)
Queues cutscenes to play before the game continues.
Sourcefn queue_episode_movie(&mut self, map: &str, entering: bool)
fn queue_episode_movie(&mut self, map: &str, entering: bool)
Cutscene A of the episode when map is its cutscene level (entering), or the
episode’s ending cutscene B (when leaving its last map).
Sourcefn update_movie(&mut self) -> bool
fn update_movie(&mut self) -> bool
Starts the next queued cutscene if none is playing; advances the current one. Returns true while a cutscene is on screen.
Sourcefn skip_movie(&mut self)
fn skip_movie(&mut self)
Skips the current cutscene (any key or mouse button).
fn options_view(&self) -> OptionsView
fn save_dir(&self) -> PathBuf
fn save_slot(&mut self, slot: usize)
fn load_slot(&mut self, slot: usize)
fn flash(&mut self, m: String)
fn frame(&mut self)
Sourcefn draw_movie(&mut self)
fn draw_movie(&mut self)
Shows the current cutscene frame, fitted to 4:3 (as on the original’s screen).
Sourcefn pace_frame(&mut self)
fn pace_frame(&mut self)
Frame-rate cap: waits until this frame’s slot ends. Sleeps most of the way (Rust’s sleep uses a high-resolution timer on Windows) and spins the last moment for even frame spacing. Motion stays smooth through the tick interpolation.
fn toggle_fullscreen(&mut self)
Trait Implementations§
Source§impl ApplicationHandler for App
impl ApplicationHandler for App
Source§fn resumed(&mut self, el: &ActiveEventLoop)
fn resumed(&mut self, el: &ActiveEventLoop)
Source§fn window_event(
&mut self,
el: &ActiveEventLoop,
_id: WindowId,
event: WindowEvent,
)
fn window_event( &mut self, el: &ActiveEventLoop, _id: WindowId, event: WindowEvent, )
Source§fn device_event(
&mut self,
_el: &ActiveEventLoop,
_id: DeviceId,
event: DeviceEvent,
)
fn device_event( &mut self, _el: &ActiveEventLoop, _id: DeviceId, event: DeviceEvent, )
Source§fn about_to_wait(&mut self, _el: &ActiveEventLoop)
fn about_to_wait(&mut self, _el: &ActiveEventLoop)
§fn new_events(&mut self, event_loop: &ActiveEventLoop, cause: StartCause)
fn new_events(&mut self, event_loop: &ActiveEventLoop, cause: StartCause)
§fn user_event(&mut self, event_loop: &ActiveEventLoop, event: T)
fn user_event(&mut self, event_loop: &ActiveEventLoop, event: T)
EventLoopProxy::send_event.§fn suspended(&mut self, event_loop: &ActiveEventLoop)
fn suspended(&mut self, event_loop: &ActiveEventLoop)
§fn exiting(&mut self, event_loop: &ActiveEventLoop)
fn exiting(&mut self, event_loop: &ActiveEventLoop)
§fn memory_warning(&mut self, event_loop: &ActiveEventLoop)
fn memory_warning(&mut self, event_loop: &ActiveEventLoop)
Auto Trait Implementations§
impl !RefUnwindSafe for App
impl !Send for App
impl !Sync for App
impl !UnwindSafe for App
impl Freeze for App
impl Unpin for App
impl UnsafeUnpin for App
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more