summaryrefslogtreecommitdiff
path: root/src/proc_gen/herringbone.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/proc_gen/herringbone.rs')
-rw-r--r--src/proc_gen/herringbone.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/proc_gen/herringbone.rs b/src/proc_gen/herringbone.rs
index 0a67b0c..a01c010 100644
--- a/src/proc_gen/herringbone.rs
+++ b/src/proc_gen/herringbone.rs
@@ -3,6 +3,8 @@ use glam::IVec2;
use crate::proc_gen::tileset_loader::TileOrientation;
+const SEED: u32 = 800;
+
pub fn split_position(pixel: IVec2, short: i32) -> (IVec2, IVec2, TileOrientation) {
let grid = pixel.div_euclid(IVec2::splat(short));
let local = pixel.rem_euclid(IVec2::splat(short));
@@ -31,5 +33,5 @@ fn reduce(h: u32, n: usize) -> usize {
}
pub fn variant_index(grid: IVec2, variants: usize) -> usize {
- reduce(hash32(&grid), variants)
+ reduce(hash32(&(grid, SEED)), variants)
}