paden wisselen
This commit is contained in:
+5
-5
@@ -56,7 +56,7 @@ def trace_river(start_tile, edge_steps):
|
||||
path.append((curr, in_edge, None))
|
||||
return path
|
||||
|
||||
def build_rivermap(output_path="/home/bart/project/tiletest/images/rivermap.png", preview_path="/home/bart/project/tiletest/images/rivermap_preview.png"):
|
||||
def build_rivermap(output_path="/home/bart/git/Ascent-of-Man/images/rivermap.png", preview_path="/home/bart/git/Ascent-of-Man/images/rivermap_preview.png"):
|
||||
river_img = Image.new('RGB', (WIDTH, HEIGHT), (0, 0, 0))
|
||||
draw = ImageDraw.Draw(river_img)
|
||||
|
||||
@@ -93,7 +93,7 @@ def build_rivermap(output_path="/home/bart/project/tiletest/images/rivermap.png"
|
||||
|
||||
# Build an overlay preview on top of typemap.png
|
||||
try:
|
||||
type_img = Image.open("/home/bart/project/tiletest/images/typemap.png").convert("RGBA")
|
||||
type_img = Image.open("/home/bart/git/Ascent-of-Man/images/typemap.png").convert("RGBA")
|
||||
r_arr = np.array(river_img)
|
||||
t_arr = np.array(type_img)
|
||||
mask = (r_arr[:, :, 2] > 120) & (r_arr[:, :, 0] < 100)
|
||||
@@ -103,7 +103,7 @@ def build_rivermap(output_path="/home/bart/project/tiletest/images/rivermap.png"
|
||||
print(f"Saved preview to {preview_path}")
|
||||
|
||||
# Build orthographic hex-tile minimap.png
|
||||
h_arr = np.array(Image.open("/home/bart/project/tiletest/images/heightmap.jpg"))
|
||||
h_arr = np.array(Image.open("/home/bart/git/Ascent-of-Man/images/heightmap.jpg"))
|
||||
R = 8.0
|
||||
W = 3608
|
||||
H = 1740
|
||||
@@ -169,8 +169,8 @@ def build_rivermap(output_path="/home/bart/project/tiletest/images/rivermap.png"
|
||||
hdraw.line([(mpx, mpy), (cx, cy)], fill=(0, 220, 255), width=3)
|
||||
hdraw.ellipse([mpx - 2, mpy - 2, mpx + 2, mpy + 2], fill=(0, 240, 255))
|
||||
|
||||
hex_img.save("/home/bart/project/tiletest/images/minimap.png")
|
||||
print("Saved orthographic hex minimap to /home/bart/project/tiletest/images/minimap.png")
|
||||
hex_img.save("/home/bart/git/Ascent-of-Man/images/minimap.png")
|
||||
print("Saved orthographic hex minimap to /home/bart/git/Ascent-of-Man/images/minimap.png")
|
||||
except Exception as ex:
|
||||
print(f"Minimap/preview generation skipped: {ex}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user