WASM plugins, scripting, i18n, GUI pan/zoom, cargo-dist CI/CD
- WASM plugin host (wasmtime 46, 17 host fns) + example noisemap plugin - Rhai scripting engine (12 API fns, `terrafier run` cmd) - i18n: en/ru translations, auto-detect, t! macro - GUI: pan (click-drag) + zoom (scroll wheel) with viewport transform - cargo-dist 0.31: MSI/pkg/shell installers, both binaries - CI: .github/workflows/ci.yml + release.yml - Security: wasmtime 30→46, bincode 1.3→2.0, quick-xml CVE docs - Code review: SAFETY comments, unwrap→match cleanup - Fixes: clippy approx_constant, needless_borrows, rustfmt
This commit is contained in:
parent
bdd4564240
commit
18613260a8
100 changed files with 4262 additions and 585 deletions
7
plugins/example-noisemap/Cargo.lock
generated
Normal file
7
plugins/example-noisemap/Cargo.lock
generated
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "terrafier-plugin-example-noisemap"
|
||||
version = "0.1.0"
|
||||
12
plugins/example-noisemap/Cargo.toml
Normal file
12
plugins/example-noisemap/Cargo.toml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[package]
|
||||
name = "terrafier-plugin-example-noisemap"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
description = "Example WASM plugin for Terrafier — generates noise-based terrain"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[profile.release]
|
||||
opt-level = "s"
|
||||
lto = true
|
||||
4
plugins/example-noisemap/build.sh
Executable file
4
plugins/example-noisemap/build.sh
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
cd "$(dirname "$0")"
|
||||
cargo build --target wasm32-unknown-unknown --release
|
||||
echo "WASM plugin built: $(ls -lh target/wasm32-unknown-unknown/release/*.wasm 2>/dev/null || echo 'BUILD FAILED')"
|
||||
216
plugins/example-noisemap/src/lib.rs
Normal file
216
plugins/example-noisemap/src/lib.rs
Normal file
|
|
@ -0,0 +1,216 @@
|
|||
#![no_std]
|
||||
|
||||
// Allocator for WASM — bump allocator
|
||||
// SAFETY: WASM is single-threaded; no concurrent access to BUMP is possible.
|
||||
// The allocator is only called during plugin initialization before tile generation.
|
||||
static mut BUMP: usize = 4096; // start after string data
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn alloc(size: i32) -> i32 {
|
||||
// SAFETY: WASM is single-threaded; no concurrent access to BUMP is possible.
|
||||
// The allocator is only called during plugin initialization before tile generation.
|
||||
unsafe {
|
||||
let ptr = BUMP as i32;
|
||||
BUMP += size as usize;
|
||||
ptr
|
||||
}
|
||||
}
|
||||
|
||||
// Host imports
|
||||
// SAFETY: These host functions are guaranteed by the Terrafier WASM host ABI
|
||||
// to be callable from within generate_tile. The host validates all coordinates
|
||||
// (0..127) internally. All set functions are idempotent and panic-free.
|
||||
unsafe extern "C" {
|
||||
fn host_log(level: i32, ptr: i32, len: i32);
|
||||
fn host_get_seed() -> i64;
|
||||
fn host_tile_size() -> i32;
|
||||
fn host_get_height(x: i32, z: i32) -> i32;
|
||||
fn host_set_height(x: i32, z: i32, val: i32);
|
||||
fn host_get_terrain(x: i32, z: i32) -> i32;
|
||||
fn host_set_terrain(x: i32, z: i32, val: i32);
|
||||
fn host_get_water(x: i32, z: i32) -> i32;
|
||||
fn host_set_water(x: i32, z: i32, val: i32);
|
||||
// Bulk transfer (faster)
|
||||
fn host_alloc_buffers() -> i32;
|
||||
fn host_load_heightmap() -> i32;
|
||||
fn host_load_terrain() -> i32;
|
||||
fn host_load_water() -> i32;
|
||||
fn host_store_heightmap();
|
||||
fn host_store_terrain();
|
||||
fn host_store_water();
|
||||
}
|
||||
|
||||
// Simple pseudo-random number generator (LCG)
|
||||
// SAFETY: WASM execution is single-threaded. RNG_STATE is only accessed
|
||||
// during tile generation which runs sequentially per tile.
|
||||
static mut RNG_STATE: u64 = 0;
|
||||
|
||||
// SAFETY: WASM execution is single-threaded. RNG_STATE is only accessed
|
||||
// during tile generation which runs sequentially per tile.
|
||||
unsafe fn rng() -> u32 {
|
||||
// SAFETY: Same single-thread guarantee as RNG_STATE declaration.
|
||||
unsafe {
|
||||
RNG_STATE = RNG_STATE.wrapping_mul(6364136223846793005).wrapping_add(1442695040888963407);
|
||||
(RNG_STATE >> 32) as u32
|
||||
}
|
||||
}
|
||||
|
||||
unsafe fn rng_range(min: f64, max: f64) -> f64 {
|
||||
// SAFETY: rng() only accesses RNG_STATE, which is safe under single-threaded WASM.
|
||||
let r = unsafe { rng() } as f64 / u32::MAX as f64;
|
||||
min + r * (max - min)
|
||||
}
|
||||
|
||||
// Simple 2D noise function (value noise)
|
||||
unsafe fn noise_2d(x: f64, z: f64, seed: u64) -> f64 {
|
||||
let xi = x as i32;
|
||||
let zi = z as i32;
|
||||
let xf = x - xi as f64;
|
||||
let zf = z - zi as f64;
|
||||
|
||||
fn hash(x: i32, z: i32, seed: u64) -> f64 {
|
||||
let h = (x as u64).wrapping_mul(374761393)
|
||||
.wrapping_add((z as u64).wrapping_mul(668265263))
|
||||
.wrapping_add(seed)
|
||||
.wrapping_mul(1274126177);
|
||||
((h ^ (h >> 16)) as u32) as f64 / u32::MAX as f64
|
||||
}
|
||||
|
||||
let n00 = hash(xi, zi, seed);
|
||||
let n10 = hash(xi + 1, zi, seed);
|
||||
let n01 = hash(xi, zi + 1, seed);
|
||||
let n11 = hash(xi + 1, zi + 1, seed);
|
||||
|
||||
let sx = xf * xf * (3.0 - 2.0 * xf);
|
||||
let sz = zf * zf * (3.0 - 2.0 * zf);
|
||||
|
||||
let nx0 = n00 + (n10 - n00) * sx;
|
||||
let nx1 = n01 + (n11 - n01) * sx;
|
||||
nx0 + (nx1 - nx0) * sz
|
||||
}
|
||||
|
||||
// Helper to log strings from WASM
|
||||
// SAFETY: Address 0-1024 in WASM linear memory is reserved as a scratch buffer.
|
||||
// The host guarantees this region is writable. The copy size is bounded by msg length (max 1024).
|
||||
#[allow(invalid_null_arguments)]
|
||||
unsafe fn wasm_log(level: i32, msg: &str) {
|
||||
let bytes = msg.as_bytes();
|
||||
let ptr = 0usize;
|
||||
let len = bytes.len().min(1024);
|
||||
// SAFETY: Address 0 is a valid scratch buffer in WASM linear memory.
|
||||
// host_log is guaranteed by the host ABI.
|
||||
unsafe {
|
||||
core::ptr::copy_nonoverlapping(bytes.as_ptr(), ptr as *mut u8, len);
|
||||
host_log(level, ptr as i32, len as i32);
|
||||
}
|
||||
}
|
||||
|
||||
// Plugin metadata
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn name_ptr() -> i32 { 1024 }
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn name_len() -> i32 { 16 }
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn version_ptr() -> i32 { 1040 }
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn version_len() -> i32 { 5 }
|
||||
|
||||
// Plugin type: 3 = TileSource
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn plugin_type() -> i32 { 3 }
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn init() -> i32 {
|
||||
let name = b"Example NoiseMap";
|
||||
let version = b"1.0.0";
|
||||
// SAFETY: Addresses 1024+ and 1040+ are reserved for plugin metadata strings.
|
||||
// The source bytes are valid string literals with static lifetime.
|
||||
// Destinations are within the first memory page (64KB) guaranteed by the host.
|
||||
unsafe {
|
||||
core::ptr::copy_nonoverlapping(name.as_ptr(), 1024 as *mut u8, name.len());
|
||||
core::ptr::copy_nonoverlapping(version.as_ptr(), 1040 as *mut u8, version.len());
|
||||
}
|
||||
0
|
||||
}
|
||||
|
||||
/// Terrain types: 0=Desert, 1=Grass, 2=Forest, 3=Rock, 4=Sand, 5=Swamp, 6=Water
|
||||
const TERRAIN_GRASS: u8 = 1;
|
||||
const TERRAIN_FOREST: u8 = 2;
|
||||
const TERRAIN_ROCK: u8 = 3;
|
||||
const TERRAIN_WATER: u8 = 6;
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn generate_tile(tile_x: i32, tile_z: i32, seed_lo: i32, seed_hi: i32) -> i32 {
|
||||
let seed = (seed_lo as u64) | ((seed_hi as u64) << 32);
|
||||
|
||||
// SAFETY: All host_* functions are guaranteed by the Terrafier WASM host ABI
|
||||
// to be callable from within generate_tile. The host validates all coordinates
|
||||
// (0..127) internally. host_set_* functions are idempotent and panic-free.
|
||||
unsafe {
|
||||
RNG_STATE = seed;
|
||||
|
||||
let tile_size = host_tile_size();
|
||||
let scale = 16.0;
|
||||
|
||||
let origin_x = (tile_x as f64) * (tile_size as f64);
|
||||
let origin_z = (tile_z as f64) * (tile_size as f64);
|
||||
|
||||
let water_level = 32;
|
||||
|
||||
for tz in 0..tile_size {
|
||||
for tx in 0..tile_size {
|
||||
let wx = (tx as f64) + origin_x;
|
||||
let wz = (tz as f64) + origin_z;
|
||||
|
||||
let mut height: f64 = 0.0;
|
||||
let mut amplitude = 1.0;
|
||||
let mut frequency = 1.0;
|
||||
let mut max_val = 0.0;
|
||||
|
||||
for _octave in 0..6 {
|
||||
let nx = wx / scale * frequency;
|
||||
let nz = wz / scale * frequency;
|
||||
height += noise_2d(nx, nz, seed.wrapping_add(_octave as u64)) * amplitude;
|
||||
max_val += amplitude;
|
||||
amplitude *= 0.5;
|
||||
frequency *= 2.0;
|
||||
}
|
||||
|
||||
height /= max_val;
|
||||
height = height * 80.0 + 20.0;
|
||||
|
||||
let iheight = height as i32;
|
||||
host_set_height(tx, tz, iheight);
|
||||
|
||||
let terrain = if iheight < water_level + 2 {
|
||||
TERRAIN_WATER
|
||||
} else if iheight < water_level + 10 {
|
||||
TERRAIN_GRASS
|
||||
} else if iheight > 85 {
|
||||
TERRAIN_ROCK
|
||||
} else if rng_range(0.0, 1.0) < 0.3 {
|
||||
TERRAIN_FOREST
|
||||
} else {
|
||||
TERRAIN_GRASS
|
||||
};
|
||||
host_set_terrain(tx, tz, terrain as i32);
|
||||
|
||||
let water = if iheight < water_level {
|
||||
8u8
|
||||
} else {
|
||||
0u8
|
||||
};
|
||||
host_set_water(tx, tz, water as i32);
|
||||
}
|
||||
}
|
||||
}
|
||||
0
|
||||
}
|
||||
|
||||
#[panic_handler]
|
||||
fn panic_handler(_info: &core::panic::PanicInfo) -> ! {
|
||||
loop {}
|
||||
}
|
||||
1
plugins/example-noisemap/target/.rustc_info.json
Normal file
1
plugins/example-noisemap/target/.rustc_info.json
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"rustc_fingerprint":7812569715578181117,"outputs":{"11652014622397750202":{"success":true,"status":"","code":0,"stdout":"___.wasm\nlib___.rlib\n___.wasm\nlib___.a\n/home/loki/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\noff\n___\ndebug_assertions\npanic=\"abort\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"wasm32\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"wasm\"\ntarget_feature=\"bulk-memory\"\ntarget_feature=\"multivalue\"\ntarget_feature=\"mutable-globals\"\ntarget_feature=\"nontrapping-fptoint\"\ntarget_feature=\"reference-types\"\ntarget_feature=\"sign-ext\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"unknown\"\ntarget_pointer_width=\"32\"\ntarget_vendor=\"unknown\"\n","stderr":"warning: dropping unsupported crate type `dylib` for target `wasm32-unknown-unknown`\n\nwarning: dropping unsupported crate type `proc-macro` for target `wasm32-unknown-unknown`\n\nwarning: 2 warnings emitted\n\n"},"7971740275564407648":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/loki/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n","stderr":""},"17181554143788415700":{"success":true,"status":"","code":0,"stdout":"rustc 1.96.1 (31fca3adb 2026-06-26)\nbinary: rustc\ncommit-hash: 31fca3adb283cc9dfd56b49cdee9a96eb9c96ffd\ncommit-date: 2026-06-26\nhost: x86_64-unknown-linux-gnu\nrelease: 1.96.1\nLLVM version: 22.1.2\n","stderr":""}},"successes":{}}
|
||||
3
plugins/example-noisemap/target/CACHEDIR.TAG
Normal file
3
plugins/example-noisemap/target/CACHEDIR.TAG
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
Signature: 8a477f597d28d172789f06886806bc55
|
||||
# This file is a cache directory tag created by cargo.
|
||||
# For information about cache directory tags see https://bford.info/cachedir/
|
||||
0
plugins/example-noisemap/target/debug/.cargo-build-lock
Normal file
0
plugins/example-noisemap/target/debug/.cargo-build-lock
Normal file
0
plugins/example-noisemap/target/debug/.cargo-lock
Normal file
0
plugins/example-noisemap/target/debug/.cargo-lock
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
Signature: 8a477f597d28d172789f06886806bc55
|
||||
# This file is a cache directory tag created by cargo.
|
||||
# For information about cache directory tags see https://bford.info/cachedir/
|
||||
Binary file not shown.
|
|
@ -0,0 +1 @@
|
|||
This file has an mtime of when this was started.
|
||||
|
|
@ -0,0 +1 @@
|
|||
76d65f109d43013b
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"rustc":9777074978655410247,"features":"[]","declared_features":"[]","target":2668537824883689644,"profile":17672942494452627365,"path":10763286916239946207,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"wasm32-unknown-unknown/debug/.fingerprint/terrafier-plugin-example-noisemap-14d72cbe84c58ee8/dep-lib-terrafier_plugin_example_noisemap","checksum":false}}],"rustflags":[],"config":8247474407144887393,"compile_kind":14682669768258224367}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
{"$message_type":"diagnostic","message":"function `wasm_log` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src/lib.rs","byte_start":3450,"byte_end":3458,"line_start":96,"line_end":96,"column_start":11,"column_end":19,"is_primary":true,"text":[{"text":"unsafe fn wasm_log(level: i32, msg: &str) {","highlight_start":11,"highlight_end":19}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: function `wasm_log` is never used\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/lib.rs:96:11\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m96\u001b[0m \u001b[1m\u001b[94m|\u001b[0m unsafe fn wasm_log(level: i32, msg: &str) {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default\n\n"}
|
||||
{"$message_type":"diagnostic","message":"function `host_log` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src/lib.rs","byte_start":881,"byte_end":889,"line_start":24,"line_end":24,"column_start":8,"column_end":16,"is_primary":true,"text":[{"text":" fn host_log(level: i32, ptr: i32, len: i32);","highlight_start":8,"highlight_end":16}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: function `host_log` is never used\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/lib.rs:24:8\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m24\u001b[0m \u001b[1m\u001b[94m|\u001b[0m fn host_log(level: i32, ptr: i32, len: i32);\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^\u001b[0m\n\n"}
|
||||
{"$message_type":"diagnostic","message":"function `host_get_seed` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src/lib.rs","byte_start":930,"byte_end":943,"line_start":25,"line_end":25,"column_start":8,"column_end":21,"is_primary":true,"text":[{"text":" fn host_get_seed() -> i64;","highlight_start":8,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: function `host_get_seed` is never used\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/lib.rs:25:8\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m25\u001b[0m \u001b[1m\u001b[94m|\u001b[0m fn host_get_seed() -> i64;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^\u001b[0m\n\n"}
|
||||
{"$message_type":"diagnostic","message":"function `host_get_height` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src/lib.rs","byte_start":993,"byte_end":1008,"line_start":27,"line_end":27,"column_start":8,"column_end":23,"is_primary":true,"text":[{"text":" fn host_get_height(x: i32, z: i32) -> i32;","highlight_start":8,"highlight_end":23}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: function `host_get_height` is never used\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/lib.rs:27:8\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m27\u001b[0m \u001b[1m\u001b[94m|\u001b[0m fn host_get_height(x: i32, z: i32) -> i32;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^\u001b[0m\n\n"}
|
||||
{"$message_type":"diagnostic","message":"function `host_get_terrain` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src/lib.rs","byte_start":1090,"byte_end":1106,"line_start":29,"line_end":29,"column_start":8,"column_end":24,"is_primary":true,"text":[{"text":" fn host_get_terrain(x: i32, z: i32) -> i32;","highlight_start":8,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: function `host_get_terrain` is never used\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/lib.rs:29:8\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m29\u001b[0m \u001b[1m\u001b[94m|\u001b[0m fn host_get_terrain(x: i32, z: i32) -> i32;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^\u001b[0m\n\n"}
|
||||
{"$message_type":"diagnostic","message":"function `host_get_water` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src/lib.rs","byte_start":1189,"byte_end":1203,"line_start":31,"line_end":31,"column_start":8,"column_end":22,"is_primary":true,"text":[{"text":" fn host_get_water(x: i32, z: i32) -> i32;","highlight_start":8,"highlight_end":22}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: function `host_get_water` is never used\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/lib.rs:31:8\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m31\u001b[0m \u001b[1m\u001b[94m|\u001b[0m fn host_get_water(x: i32, z: i32) -> i32;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^\u001b[0m\n\n"}
|
||||
{"$message_type":"diagnostic","message":"function `host_alloc_buffers` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src/lib.rs","byte_start":1314,"byte_end":1332,"line_start":34,"line_end":34,"column_start":8,"column_end":26,"is_primary":true,"text":[{"text":" fn host_alloc_buffers() -> i32;","highlight_start":8,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: function `host_alloc_buffers` is never used\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/lib.rs:34:8\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m34\u001b[0m \u001b[1m\u001b[94m|\u001b[0m fn host_alloc_buffers() -> i32;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^^\u001b[0m\n\n"}
|
||||
{"$message_type":"diagnostic","message":"function `host_load_heightmap` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src/lib.rs","byte_start":1350,"byte_end":1369,"line_start":35,"line_end":35,"column_start":8,"column_end":27,"is_primary":true,"text":[{"text":" fn host_load_heightmap() -> i32;","highlight_start":8,"highlight_end":27}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: function `host_load_heightmap` is never used\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/lib.rs:35:8\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m35\u001b[0m \u001b[1m\u001b[94m|\u001b[0m fn host_load_heightmap() -> i32;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^^^\u001b[0m\n\n"}
|
||||
{"$message_type":"diagnostic","message":"function `host_load_terrain` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src/lib.rs","byte_start":1387,"byte_end":1404,"line_start":36,"line_end":36,"column_start":8,"column_end":25,"is_primary":true,"text":[{"text":" fn host_load_terrain() -> i32;","highlight_start":8,"highlight_end":25}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: function `host_load_terrain` is never used\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/lib.rs:36:8\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m36\u001b[0m \u001b[1m\u001b[94m|\u001b[0m fn host_load_terrain() -> i32;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^\u001b[0m\n\n"}
|
||||
{"$message_type":"diagnostic","message":"function `host_load_water` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src/lib.rs","byte_start":1422,"byte_end":1437,"line_start":37,"line_end":37,"column_start":8,"column_end":23,"is_primary":true,"text":[{"text":" fn host_load_water() -> i32;","highlight_start":8,"highlight_end":23}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: function `host_load_water` is never used\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/lib.rs:37:8\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m37\u001b[0m \u001b[1m\u001b[94m|\u001b[0m fn host_load_water() -> i32;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^\u001b[0m\n\n"}
|
||||
{"$message_type":"diagnostic","message":"function `host_store_heightmap` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src/lib.rs","byte_start":1455,"byte_end":1475,"line_start":38,"line_end":38,"column_start":8,"column_end":28,"is_primary":true,"text":[{"text":" fn host_store_heightmap();","highlight_start":8,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: function `host_store_heightmap` is never used\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/lib.rs:38:8\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m38\u001b[0m \u001b[1m\u001b[94m|\u001b[0m fn host_store_heightmap();\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^^^^\u001b[0m\n\n"}
|
||||
{"$message_type":"diagnostic","message":"function `host_store_terrain` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src/lib.rs","byte_start":1486,"byte_end":1504,"line_start":39,"line_end":39,"column_start":8,"column_end":26,"is_primary":true,"text":[{"text":" fn host_store_terrain();","highlight_start":8,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: function `host_store_terrain` is never used\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/lib.rs:39:8\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m39\u001b[0m \u001b[1m\u001b[94m|\u001b[0m fn host_store_terrain();\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^^\u001b[0m\n\n"}
|
||||
{"$message_type":"diagnostic","message":"function `host_store_water` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src/lib.rs","byte_start":1515,"byte_end":1531,"line_start":40,"line_end":40,"column_start":8,"column_end":24,"is_primary":true,"text":[{"text":" fn host_store_water();","highlight_start":8,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: function `host_store_water` is never used\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/lib.rs:40:8\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m40\u001b[0m \u001b[1m\u001b[94m|\u001b[0m fn host_store_water();\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^\u001b[0m\n\n"}
|
||||
{"$message_type":"diagnostic","message":"13 warnings emitted","code":null,"level":"warning","spans":[],"children":[],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: 13 warnings emitted\u001b[0m\n\n"}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
/storage/project/Terrafier/plugins/example-noisemap/target/wasm32-unknown-unknown/debug/deps/terrafier_plugin_example_noisemap-14d72cbe84c58ee8.d: src/lib.rs
|
||||
|
||||
/storage/project/Terrafier/plugins/example-noisemap/target/wasm32-unknown-unknown/debug/deps/libterrafier_plugin_example_noisemap-14d72cbe84c58ee8.rmeta: src/lib.rs
|
||||
|
||||
src/lib.rs:
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue