- [NEW] tilemap.new(x,y)

- [CHG] tilemap.new i tilemap.load alliberen la surface anterior (si hi havia) del mapa
This commit is contained in:
2025-02-19 10:40:14 +01:00
parent 5306e82897
commit 45d31579d2
3 changed files with 20 additions and 2 deletions

View File

@@ -1022,11 +1022,13 @@ void tvline(int x, int y0, int y1, float mx, float my, float mdx, float mdy) {
}
uint8_t mget(int celx, int cely) {
if (!map_surface) return 0;
if (celx < 0 || celx > (map_surface->w-1) || cely < 0 || cely > (map_surface->h-1)) return 0;
return TILES(celx, cely);
}
void mset(int celx, int cely, uint8_t snum) {
if (!map_surface) return;
if (celx < 0 || celx > (map_surface->w-1) || cely < 0 || cely > (map_surface->h-1)) return;
TILES(celx, cely) = snum;
}