This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Simple FPS watchcer | |
#[derive(Debug, Clone, Default)] | |
pub struct Fps { | |
/// Average duration per frame in seconds | |
avg: f64, | |
/// Square of spike FPS in seconds | |
spike: f64, | |
} | |
impl Fps { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
Cheat the borrow checker using raw pointer | |
*/ | |
pub fn cheat<T>(x: &T) -> Cheat<T> { | |
unsafe { Cheat::new(x) } | |
} | |
/// Lifetime-free mutable reference to type `T` | |
/// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::{ | |
env, | |
fmt::Write as _, | |
fs::{self, File}, | |
io::prelude::*, | |
path::{Path, PathBuf}, | |
}; | |
use convert_case::{Case, Casing}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//! Field of view for orthogonal grid maps | |
// pub struct Vec2i { x: i32, y: i32 } | |
// impl Vec2i { | |
// pub fn new(x: i32, y: i32) -> Self { Self { x, y } } | |
// pub fn len_king(&self) -> u32 { std::cmp::max(self.x, self.y) } | |
// } | |
use crate::utils::grid2d::Vec2i; | |
/// Refreshes FoV data or maybe bundle of FoV and FoW |