summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-06-06 21:12:07 +0200
committermetamuffin <metamuffin@disroot.org>2025-06-06 21:12:10 +0200
commit1a64e614b72e1635986c7e8d406a9a9727f52984 (patch)
tree417cea1e7c6ec4f69679945e0a8c318687d213b0
parentdd9e180163fbfb8bb95bb77906b984a122576e0f (diff)
downloadhurrycurry-1a64e614b72e1635986c7e8d406a9a9727f52984.tar
hurrycurry-1a64e614b72e1635986c7e8d406a9a9727f52984.tar.bz2
hurrycurry-1a64e614b72e1635986c7e8d406a9a9727f52984.tar.zst
enable index buffer and opt for floor mesher
-rw-r--r--client/map/tiles/floor_mesher.gd17
1 files changed, 14 insertions, 3 deletions
diff --git a/client/map/tiles/floor_mesher.gd b/client/map/tiles/floor_mesher.gd
index d3a66c89..79521795 100644
--- a/client/map/tiles/floor_mesher.gd
+++ b/client/map/tiles/floor_mesher.gd
@@ -19,11 +19,19 @@ extends Object
const H := 0.25
const RECTANGLE: Array[Vector3] = [
- Vector3.ZERO, Vector3.RIGHT, Vector3.BACK + Vector3.RIGHT, Vector3.BACK, Vector3.ZERO, Vector3.BACK + Vector3.RIGHT,
+ Vector3.ZERO,
+ Vector3.RIGHT,
+ Vector3.BACK + Vector3.RIGHT,
+ Vector3.BACK, Vector3.ZERO,
+ Vector3.BACK + Vector3.RIGHT,
]
-
const UV: Array[Vector2] = [
- Vector2.ZERO, Vector2.RIGHT, Vector2.DOWN + Vector2.RIGHT, Vector2.DOWN, Vector2.ZERO, Vector2.DOWN + Vector2.RIGHT,
+ Vector2.ZERO,
+ Vector2.RIGHT,
+ Vector2.DOWN + Vector2.RIGHT,
+ Vector2.DOWN,
+ Vector2.ZERO,
+ Vector2.DOWN + Vector2.RIGHT,
]
var tiles: Dictionary
@@ -107,4 +115,7 @@ func flush() -> ArrayMesh:
for x in range(rectangle_origin.x, rectangle_origin.x + rectangle.x):
for y in range(rectangle_origin.y, rectangle_origin.y + rectangle.y):
tiles_queue.erase(str(Vector2i(x, y)))
+
+ st.index()
+ st.optimize_indices_for_cache()
return st.commit()