99fc9f608e7e4c22b37ec9e2f27df67ee40b7277
Use raw Lua C API to store image handles in Lua userdata instead of using `mlua::UserData`. `mlua` wraps UserData in a special way to maintain Rust safety guarantees which prevents direct access of the underlying data from a raw Lua state. The `DrawImage` and `DrawImageQuad` API calls used a workaround to access the underlying image handle before which added significant overhead. The overhead is eliminated by manually constructing the userdata metatable for `ImageHandle` at the cost of weaker safety guarantees.
Rusty Path of Building
Rusty Path of Building is a cross-platform runtime environment for Path of Building and Path of Building 2. Like SimpleGraphic, PoB's official runtime environment, it implements the API functions required by PoB's Lua code, handles window management and input, and renders the UI.
The primary goal of this project is to provide native Linux support for Path of Building. It is written in Rust with cross-platform compatibility in mind and also runs on Windows, though testing there has been minimal.
Usage
rusty-path-of-building [poe1|poe2]
Installation
Flathub
Building from source
LuaJIT needs to be installed on your system for the mlua crate to compile.
cargo build --release
Runtime Dependencies
Path of Building's Lua code requires the following C libraries:
- Lua-cURLv3
- luautf8
- luasocket
lzip- The source is included in this repo underlua/libs/lzipand requires zlib to compile. Build it withmake LUA_IMPL=luajit.
Please refer to the Lua documentation to see how it locates libraries.
Known Issues
- If automatic updates fail, navigate to
~/.local/share/RustyPathOfBuilding{1,2}/and delete both therpob.versionfile and theUpdatedirectory. This will force a complete re-download of PoB's latest assets and Lua code on the next startup. (Note: Third-party backends, like this project, face challenges supporting PoB's update mechanism. To make it work, fragile workarounds had to be implemented that can break unexpectedly)