Skip to content
Snippets Groups Projects
Commit d5d7762c authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Fix double-height drawing

Top/bottom detection was somewhat broken.
Interestingly, now the previous commit isn't working anymore.
So issue 172 is not quite fixed yet.
parent 9ab3cfcb
Branches
Tags
No related merge requests found
......@@ -605,24 +605,18 @@ static int bitmap_draw_one_char(struct vmem_cell *vc, unsigned int xpos, unsigne
struct vstat_vmem *vmem_ptr = get_vmem(&vstat);
unsigned char lattr = vc->legacy_attr;
if (ypos > 1) {
for (y = 0; y < ypos; y++) {
if (top) {
bottom = true;
top = false;
}
else {
if (bottom)
bottom = false;
else {
if (y == ypos - 1)
break;
for (x = 0; x < vstat.cols; x++) {
if (vmem_ptr->vmem[y * vstat.cols + x].bg & 0x01000000) {
top = true;
break;
}
}
for (y = 0; y < ypos; y++) {
if (top) {
bottom = true;
top = false;
}
else {
if (bottom)
bottom = false;
for (x = 0; x < vstat.cols; x++) {
if (vmem_ptr->vmem[y * vstat.cols + x].bg & 0x01000000) {
top = true;
break;
}
}
}
......
......@@ -4956,7 +4956,7 @@ static void prestel_fix_line(struct cterminal *cterm, int x, int y, bool restore
unsigned char attr = cterm->attr;
uint8_t prestel_last_mosaic = cterm->prestel_last_mosaic;
bool fixed = false;
bool fixedheight = false;
bool dblheight = false;
coord_conv_xy(cterm, CTERM_COORD_TERM, CTERM_COORD_SCREEN, &sy, &sx);
ex = sx + TERM_MAXX - 1;
......@@ -4978,13 +4978,13 @@ static void prestel_fix_line(struct cterminal *cterm, int x, int y, bool restore
// Should be double-high
line[i].bg |= 0x01000000;
fixed = true;
fixedheight = true;
dblheight = true;
}
if (((cterm->extattr & CTERM_EXTATTR_PRESTEL_DOUBLE_HEIGHT) == 0) && (line[i].bg & 0x01000000)) {
// Should not be double-high
line[i].bg &= ~0x01000000;
fixed = true;
fixedheight = true;
dblheight = true;
}
if (line[i].fg != (cterm->fg_color | (ch << 24))
|| line[i].bg != cterm->bg_color
......@@ -5014,6 +5014,8 @@ static void prestel_fix_line(struct cterminal *cterm, int x, int y, bool restore
prestel_last_mosaic = cterm->prestel_last_mosaic;
}
prestel_apply_ctrl_after(cterm, ch);
if (cterm->extattr & CTERM_EXTATTR_PRESTEL_DOUBLE_HEIGHT)
dblheight = true;
}
else {
// This is displayable
......@@ -5021,13 +5023,13 @@ static void prestel_fix_line(struct cterminal *cterm, int x, int y, bool restore
// Should be double-high
line[i].bg |= 0x01000000;
fixed = true;
fixedheight = true;
dblheight = true;
}
if (((cterm->extattr & CTERM_EXTATTR_PRESTEL_DOUBLE_HEIGHT) == 0) && (line[i].bg & 0x01000000)) {
// Should not be double-high
line[i].bg &= ~0x01000000;
fixed = true;
fixedheight = true;
dblheight = true;
}
if (line[i].fg != cterm->fg_color
|| line[i].bg != cterm->bg_color
......@@ -5085,7 +5087,7 @@ static void prestel_fix_line(struct cterminal *cterm, int x, int y, bool restore
if (force || fixed)
vmem_puttext(sx, sy, ex, sy, line);
free(line);
if (fixedheight) {
if (dblheight) {
prestel_fix_line(cterm, x, y+1, false, true);
}
if (restore) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment