Vectorize UV initialization with numpy broadcasting

This commit is contained in:
Jared Miller 2026-02-12 21:08:33 -05:00
parent 8c4def54af
commit 14b032eae1
Signed by: shmup
GPG key ID: 22B5C6D66A38B06C

View file

@ -535,11 +535,7 @@ class Art:
shape = (layers, self.height, self.width, UV_STRIDE) shape = (layers, self.height, self.width, UV_STRIDE)
array = np.zeros(shape, dtype=np.float32) array = np.zeros(shape, dtype=np.float32)
# default new layer of UVs to "normal" transform # default new layer of UVs to "normal" transform
uvs = uv_types[UV_NORMAL] array[:] = uv_types[UV_NORMAL]
for layer in range(layers):
for y in range(self.height):
for x in range(self.width):
array[layer][y][x] = uvs
return array return array
def is_tile_inside(self, x, y): def is_tile_inside(self, x, y):