This repository has been archived on 2022-04-04. You can view files and clone it, but cannot push or open issues or pull requests.
2022-04-02 19:37:07 -04:00

27 lines
1.5 KiB
Rust

//! Embedded asset management.
//!
//! ## Overview
//!
//! `asset_manager` is one of the most important modules in this project. It handles loading and packaging of in-game resources.
//! Generally in a game, you might distribute an executable along with a zip of everything needed to run,
//! but we have had some issues with this before on systems with restrictive file permissions (cough OSX).
//!
//! To make the game distribution process easier, we embed our resources directly into the executable's data section using
//! [`rust-embed`](https://github.com/pyros2097/rust-embed). This means we only have to distribute one single file to players.
//!
//! ## Debug vs. Release mode
//!
//! When the game is built in debug mode (with `cargo build`), the resources are *not* packaged into the game.
//! Instead, they are read from disk, allowing us to modify them while the game is running, and speeding up the compile times.
//!
//! When the game is built in release mode (with `cargo build --release`), the resources are packaged into the game as described above.
//! This means the game will load faster, but also use more RAM.
mod datastore;
pub use datastore::InternalData;
mod json;
pub use json::{InternalJsonLoadError, load_json_structure};
mod sprite_types;
pub use sprite_types::{KnownSpriteType, load_known_sprite_types};
mod texture;
pub use texture::{load_texture_from_internal_data, ResourceLoadError, load_music_from_internal_data, load_sound_from_internal_data};