fix ellipse alignment within visible tiles

This commit is contained in:
2024-11-30 13:50:22 -06:00
committed by Celtic Minstrel
parent dbdb1fc3f3
commit 79c295127a

View File

@@ -152,7 +152,7 @@ void apply_unseen_mask() {
void apply_light_mask(bool onWindow) { void apply_light_mask(bool onWindow) {
static Region dark_mask_region; static Region dark_mask_region;
rectangle temp = {0,0,108,84},paint_rect,base_rect = {0,0,36,28}; rectangle base_ellipse = {0,0,106,84},paint_rect,base_rect = {0,0,36,28};
// I correct the values to make the display ok // I correct the values to make the display ok
// but I am not sure what are the correct values // but I am not sure what are the correct values
rectangle big_to = {13+2,13+14,337+3,265+15}; rectangle big_to = {13+2,13+14,337+3,265+15};
@@ -214,9 +214,9 @@ void apply_light_mask(bool onWindow) {
for(short i = 1; i < 12; i++) for(short i = 1; i < 12; i++)
for(short j = 1; j < 12; j++) { for(short j = 1; j < 12; j++) {
if(light_area[i][j] == 2) { if(light_area[i][j] == 2) {
int xOffset = 28 + 28 * (i - 3), yOffset = 18 + 36 * (j - 3); int xOffset = 28 + 28 * (i - 3), yOffset = 16 + 36 * (j - 3);
Region oval_region; Region oval_region;
oval_region.addEllipse(temp); oval_region.addEllipse(base_ellipse);
oval_region.offset(xOffset, yOffset); oval_region.offset(xOffset, yOffset);
dark_mask_region -= oval_region; dark_mask_region -= oval_region;
} }