Expand description
§Lcf-rs
Lcf is the file format used by the RPG Maker 2000/2003 game engine.
Each of the different file types is in a module with its extension as the name:
crate::ldb::LcfDataBasee.g.RPG_RT.ldbcrate::lmt::LcfMapTreee.g.RPG_RT.lmtcrate::lmu::LcfMapUnite.g.MapXXXX.lmucrate::lsd::LcfSaveDatae.g.SaveXX.lsd
The crate::Lcf enum contains all of the above 4 types as variants and can be used if the exact one is not known ahead of time.
The above 5 types are wrappers around their corresponding structs in the crate::raw module:
crate::raw::RawLcfcrate::raw::ldb::RawLcfDataBasecrate::raw::lmt::RawLcfMapTreecrate::raw::lmu::RawLcfMapUnitcrate::raw::lsd::RawLcfSaveData
All of the raw structs implement binrw::BinRead and binrw::BinWrite.
§Example
let bytes = std::fs::read("RPG_RT.ldb").expect("file exists");
let mut reader = std::io::Cursor::new(bytes);
let database = lcf::Lcf::read(&mut reader).expect("valid lcf file");
assert!(matches!(database, lcf::Lcf::DataBase(_)))JavaScript bindings are available with lcf-js.
Additionally see lcf-explorer and d2k for full examples.