|
1 | 1 | const std = @import("std"); |
2 | 2 |
|
| 3 | +const build_options = @import("build_options"); |
| 4 | + |
3 | 5 | const main = @import("main"); |
4 | 6 | const Array2D = main.utils.Array2D; |
5 | 7 | const random = main.random; |
@@ -34,18 +36,20 @@ pub fn generateMapFragment(map: *ClimateMapFragment, worldSeed: u64) void { |
34 | 36 | generator.toMap(map, ClimateMapFragment.mapSize, ClimateMapFragment.mapSize, worldSeed); |
35 | 37 |
|
36 | 38 | // TODO: Remove debug image: |
37 | | - const image = main.graphics.Image.init(main.stackAllocator, @intCast(map.map.len), @intCast(map.map[0].len)); |
38 | | - defer image.deinit(main.stackAllocator); |
39 | | - var x: u31 = 0; |
40 | | - while(x < map.map.len) : (x += 1) { |
41 | | - var y: u31 = 0; |
42 | | - while(y < map.map[0].len) : (y += 1) { |
43 | | - const bp = map.map[x][y]; |
44 | | - seed = std.hash.Adler32.hash(bp.biome.id) ^ 4371741; |
45 | | - image.setRGB(x, y, @bitCast(0xff000000 | main.random.nextInt(u32, &seed))); |
| 39 | + if(!build_options.isTaggedRelease) { |
| 40 | + const image = main.graphics.Image.init(main.stackAllocator, @intCast(map.map.len), @intCast(map.map[0].len)); |
| 41 | + defer image.deinit(main.stackAllocator); |
| 42 | + var x: u31 = 0; |
| 43 | + while(x < map.map.len) : (x += 1) { |
| 44 | + var y: u31 = 0; |
| 45 | + while(y < map.map[0].len) : (y += 1) { |
| 46 | + const bp = map.map[x][y]; |
| 47 | + seed = std.hash.Adler32.hash(bp.biome.id) ^ 4371741; |
| 48 | + image.setRGB(x, y, @bitCast(0xff000000 | main.random.nextInt(u32, &seed))); |
| 49 | + } |
46 | 50 | } |
| 51 | + image.exportToFile("test.png") catch {}; |
47 | 52 | } |
48 | | - image.exportToFile("test.png") catch {}; |
49 | 53 | } |
50 | 54 |
|
51 | 55 | const BiomePoint = struct { |
|
0 commit comments