pnoise
This commit is contained in:
parent
6c7153e42d
commit
617d86276a
2 changed files with 29 additions and 0 deletions
|
|
@ -652,6 +652,8 @@ impl Transpiler {
|
||||||
"cos" => "cos",
|
"cos" => "cos",
|
||||||
"floor" => "floor",
|
"floor" => "floor",
|
||||||
// Perlin noise functions
|
// Perlin noise functions
|
||||||
|
"pnoise1d" => "pnoise1d",
|
||||||
|
"pnoise2d" => "pnoise2d",
|
||||||
"pnoise3d" => "pnoise3d",
|
"pnoise3d" => "pnoise3d",
|
||||||
// File I/O API
|
// File I/O API
|
||||||
"file_open" => "suic_file_open",
|
"file_open" => "suic_file_open",
|
||||||
|
|
|
||||||
|
|
@ -997,6 +997,33 @@ impl TypeChecker {
|
||||||
);
|
);
|
||||||
|
|
||||||
// Perlin noise functions
|
// Perlin noise functions
|
||||||
|
self.env.functions.insert(
|
||||||
|
"pnoise1d".to_string(),
|
||||||
|
FunctionType {
|
||||||
|
type_params: vec![],
|
||||||
|
params: vec![
|
||||||
|
Type::Float,
|
||||||
|
Type::Float,
|
||||||
|
Type::Int,
|
||||||
|
Type::Int,
|
||||||
|
], // x, persistence, octaves, seed
|
||||||
|
return_type: Type::Float,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
self.env.functions.insert(
|
||||||
|
"pnoise2d".to_string(),
|
||||||
|
FunctionType {
|
||||||
|
type_params: vec![],
|
||||||
|
params: vec![
|
||||||
|
Type::Float,
|
||||||
|
Type::Float,
|
||||||
|
Type::Float,
|
||||||
|
Type::Int,
|
||||||
|
Type::Int,
|
||||||
|
], // x, y, persistence, octaves, seed
|
||||||
|
return_type: Type::Float,
|
||||||
|
},
|
||||||
|
);
|
||||||
self.env.functions.insert(
|
self.env.functions.insert(
|
||||||
"pnoise3d".to_string(),
|
"pnoise3d".to_string(),
|
||||||
FunctionType {
|
FunctionType {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue