stb_tilemap_editor: Fix variable usage

This commit is contained in:
Rob Loach 2021-04-16 04:21:42 -04:00 committed by Fabian Giesen
parent 7e10880f53
commit b18c989dc2

View File

@ -2996,7 +2996,7 @@ static void stbte__tile_paint(stbte_tilemap *tm, int sx, int sy, int mapx, int m
i = layer; i = layer;
if (i == tm->solo_layer || (!tm->layerinfo[i].hidden && tm->solo_layer < 0)) if (i == tm->solo_layer || (!tm->layerinfo[i].hidden && tm->solo_layer < 0))
if (data[i] >= 0) if (data[i] >= 0)
STBTE_DRAW_TILE(x0,y0, (unsigned short) data[i], 0, tm->props[mapy][mapx]); STBTE_DRAW_TILE(sx,sy, (unsigned short) data[i], 0, tm->props[mapy][mapx]);
} }
} }
@ -3496,7 +3496,7 @@ static void stbte__tile_in_palette(stbte_tilemap *tm, int x, int y, int slot)
switch (stbte__ui.event) { switch (stbte__ui.event) {
case STBTE__paint: case STBTE__paint:
stbte__draw_rect(x,y,x+tm->palette_spacing_x-1,y+tm->palette_spacing_x-1, STBTE_COLOR_TILEPALETTE_BACKGROUND); stbte__draw_rect(x,y,x+tm->palette_spacing_x-1,y+tm->palette_spacing_x-1, STBTE_COLOR_TILEPALETTE_BACKGROUND);
STBTE_DRAW_TILE(x,y,t->id, slot == tm->cur_tile,0); STBTE_DRAW_TILE(x,y,id, slot == tm->cur_tile,0);
if (slot == tm->cur_tile) if (slot == tm->cur_tile)
stbte__draw_frame_delayed(x-1,y-1,x+tm->palette_spacing_x,y+tm->palette_spacing_y, STBTE_COLOR_TILEPALETTE_OUTLINE); stbte__draw_frame_delayed(x-1,y-1,x+tm->palette_spacing_x,y+tm->palette_spacing_y, STBTE_COLOR_TILEPALETTE_OUTLINE);
break; break;