This utility program, known as "What," is an essential tool for working with the Rusty-Bear-Engine. It helps identify assets and converts them into a format that the engine can easily read.
Note: I will extend this format on-demand when RustyBear-Engine development progresses.
- Texture Conversion: Convert textures and texture arrays to the .fur file format, which is the main asset format for the Rusty-Bear-Engine. This format stores everything neatly in a single file. Currently, it stores textures as PNG binary blobs within the .fur file.
- Texture Loading: Load textures and texture arrays from a .fur file.
- Command-Line Interface (CLI): A user-friendly CLI for straightforward asset conversion.
You can interact with the Rusty-Bear-Engine Asset Utility via the command-line interface (CLI). Here are some examples of how to use it:
- Converting Assets: To convert assets into the .fur format, use the following command:
$ ./what convert [INPUT file paths]... -o output.fur
- Options:
[INPUT file paths]
: Provide the file paths of the assets you want to convert. You can specify multiple input files.-o output.fur
: Specify the name of the output .fur file.--overwrite
: Use this option if you want to overwrite an existing output file.
Note: If you don't specify an output file name using -o, the utility will use the input file's name with a .fur extension. However, please be aware that this won't work if you specified multiple input files (e.g. for cubemaps).
pub fn read_texture(path: &Path) -> Result<(Vec<u8>, (u32, u32)), String>
returns the texture data of a .fur file together with width and height.
pub fn read_cubemap(path: &Path) -> Result<(Vec<(String, Vec<u8>)>, u32), String>
returns a cubemap (6 textures) of a .fur file together with the dimension of each of them. (Cubemap textures have to be quadratic.)
pub fn write_texture(
output: &Path,
texture: Vec<u8>,
width: u32,
format: Option<String>,
height: u32,
overwrite: bool,
) -> Result<(), String>
writes a texture to a .fur file.
pub fn write_cubemap(
output: &Path,
textures: &[Vec<u8>],
size: u32,
format: Option<String>,
overwrite: bool,
) -> Result<(), String>
writes a cubemap to a .fur file.