()
| 2 | use std::sync::OnceLock; |
| 3 | |
| 4 | pub fn base_path() -> &'static PathBuf { |
| 5 | static BASE_PATH: OnceLock<PathBuf> = OnceLock::new(); |
| 6 | |
| 7 | // TODO: Make this use SDL_GetBaseDir when packaging for release |
| 8 | BASE_PATH.get_or_init(|| std::env::current_dir().unwrap()) |
| 9 | } |
| 10 | |
| 11 | pub fn asset_path(path: &str) -> PathBuf { |
| 12 | base_path().join(path) |