Crate libgm

Crate libgm 

Source
Expand description

A data parsing and building library for GameMaker data files (data.win).

This library provides structs and functions to handle GameMaker game assets in a meaningful way.

For more information on the GameMaker specifics, check out the gamemaker module.

§Disclaimer

I, BioTomateDE, wrote this project myself. It is effectively my first Rust project ever. While I have been working on this project for almost a year now (😭), I’m still not the best Rust programmer.

This library is still in testing stages (SemVer major 0) and may have issues. Please report them to the attached GitHub repository.

If you have any questions or concerns about my code or documentation, please contact me via either:

§Panicking

This library should never panic. All malformed data files are caught into LibGM’s custom error type. However, since this library is not mature yet, there might still be a few bugs. For GUI applications, I would definitely recommend to set a panic catcher before calling any data parsing/building functions, just to be safe.

§Missing features

The following features are not yet supported by LibGM:

  • Null pointers. These typically occur in newer games compiled with GMAC (GameMaker Asset Compiler), which may null out pointers to unused elements. See Issue#2 for more information.
  • Special Vector Sprites
  • Only partial pre WAD version 15 support
  • Only partial/untested big endian support

§Breaking changes

Some things in this library are not considered “breaking changes” and may be modified in SemVer patch updates. These could bring unwanted change of behavior to your program if you don’t have a Cargo.lock set/commited. Some of these things include:

  • All log messages (using the log crate), including:
    • Timing
    • Code Origin/Location
    • Message string
  • All error contents:
    • Error message string
    • Context chain
  • All structs and enums marked with #[non_exhaustive]

There might be some other struct fields or type names with docstrings saying “this may change in the future”. These changes will still require a SemVer minor increment, though. In other words, they are definitely version-safe to use, but they might be renamed or reworked soon.

§Credits

Please note that this project is effectively a Rust port of UndertaleModTool (UndertaleModLib, to be exact). Most of the GameMaker elements’ docstrings and struct field (names) are taken from there.

Re-exports§

pub use error::Error;
pub use error::Result;
pub use gamemaker::deserialize::parse_bytes;
pub use gamemaker::deserialize::parse_file;
pub use gamemaker::serialize::build_bytes;
pub use gamemaker::serialize::build_file;

Modules§

error
LibGM’s custom error type is contained here, as well as a convenience type alias for Result.
gamemaker
Everything related to parsing and building of GameMaker data files.
gml
Everything related to GML (GameMaker language) bytecode.
prelude
The prelude contains commonly used items when working with LibGM. This includes error types, a result alias, traits and more. You can import it by using use libgm::prelude::*;.