tilemap render

This commit is contained in:
2025-07-10 18:10:55 -05:00
parent a9b59750e3
commit 2b7b3985d5
6 changed files with 40 additions and 12 deletions

View File

@@ -867,8 +867,11 @@ JSC_CCALL(geometry_tilemap_to_data,
JSValue tile = JS_GetPropertyUint32(js, col, y);
if (!JS_IsNull(tile) && !JS_IsNull(tile)) {
// Calculate world position
float world_x = (x + offset_x) * size_x;
float world_y = (y + offset_y) * size_y;
// x and y are array indices, need to convert to logical coordinates
float logical_x = x + offset_x;
float logical_y = y + offset_y;
float world_x = logical_x * size_x;
float world_y = logical_y * size_y;
// Set vertex positions (4 corners of the tile)
int base = vertex_idx * 2;