#sapiens #ffi #api-bindings

sys sapiens-sys

Raw FFI bindings to the Sapiens C modding API

2 unstable releases

0.2.0 Sep 10, 2019
0.1.0 Sep 10, 2019

#783 in #ffi


Used in sapiens-rs

MIT license

395KB
3K SLoC

C 2K SLoC // 0.0% comments C++ 873 SLoC // 0.1% comments Visual Studio Project 232 SLoC Lua 74 SLoC Visual Studio Solution 66 SLoC Rust 17 SLoC // 0.3% comments Shell 6 SLoC // 0.2% comments

Contains (DOS exe, 95KB) CMakeCXXCompilerId.exe, (DOS exe, 95KB) CMakeCCompilerId.exe, (DOS exe, 50KB) CMakeDetermineCompilerABI_C.bin, (DOS exe, 50KB) CMakeDetermineCompilerABI_CXX.bin, (DOS exe, 53KB) feature_tests.bin, (Windows DLL, 25KB) SPCommon.dll and 4 more.

Unofficial Sapiens Rust API

This repo provides a Rust API, along with cargo-generate templates, which allow one to develop mods for the upcoming video game Sapiens using the Rust programming language

Quickstart

  • Install cargo
  • Install cargo-generate
    • cargo install cargo-generate --features vendored-openssl
  • Download the project template
    • cargo generate --git https://github.com/DethRaid/sapiens-rust-mod-template.git
  • Edit the default features in Cargo.toml for the type of mod you're making
    • biome for a biome mod, particles for a particles mod, etc
  • Write your mod
    • TODO: Wiki page about doing just that
  • Build and upload your mod
    • TODO: Custom cargo command to build, package, and upload a mod
  • Enjoy!

Overview

This repo has two main components: a Rust wrapper for the Sapiens API available to mods, and some cargo-generate project templates so that your mod can start with all relevant entry points already defined

Rust API wrapper

The Rust wrapper for Sapiens' modding API lives in this project. It provides a safe, Rusty interface for using Sapiens' random number generator, noise generator, and vector math library

No runtime deps

~0–2.1MB
~42K SLoC