finished with rework

This commit is contained in:
2026-03-16 14:59:05 -07:00
parent 704f624f25
commit 5e8a6685dc
3 changed files with 114 additions and 51 deletions

View File

@@ -39,9 +39,9 @@ int tart_create_buffer(tart_window* w) {
#else
"\e[38;2;%03hhu;%03hhu;%03hhum%c\e[0m",
#endif
w->pallet[0].forground.r,
w->pallet[0].forground.g,
w->pallet[0].forground.b,
w->palette[0].forground.r,
w->palette[0].forground.g,
w->palette[0].forground.b,
#ifdef TART_UTF8
L' '
#else
@@ -97,12 +97,12 @@ int flush_buffer(tart_window* w) {
#else
"\e[38;2;%03hhu;%03hhu;%03hhum%c\e[0m",
#endif
w->pallet[0].background.r,
w->pallet[0].background.g,
w->pallet[0].background.b,
w->pallet[0].forground.r,
w->pallet[0].forground.g,
w->pallet[0].forground.b,
w->palette[0].background.r,
w->palette[0].background.g,
w->palette[0].background.b,
w->palette[0].forground.r,
w->palette[0].forground.g,
w->palette[0].forground.b,
#ifdef TART_UTF8
L' '
#else
@@ -121,12 +121,12 @@ int flush_buffer(tart_window* w) {
void flush_palets(tart_window* w) {
for(int i = 0; i < TART_PALET_SIZE; i++) {
w->pallet[i].background.r = 0;
w->pallet[i].background.g = 0;
w->pallet[i].background.b = 0;
w->pallet[i].forground.r = 254;
w->pallet[i].forground.g = 254;
w->pallet[i].forground.b = 254;
w->palette[i].background.r = 0;
w->palette[i].background.g = 0;
w->palette[i].background.b = 0;
w->palette[i].forground.r = 254;
w->palette[i].forground.g = 254;
w->palette[i].forground.b = 254;
}
}
@@ -151,10 +151,10 @@ int tart_init(tart_window* w) {
}
void tart_disable_cusor() {
write(STDOUT_FILENO, "\e[?25l", 8);
write(STDOUT_FILENO, "\e[?25l", 6);
}
void tart_enable_cusor() {
write(STDOUT_FILENO, "\e[?25h", 8);
write(STDOUT_FILENO, "\e[?25h", 6);
}
int tart_close(tart_window* w) {
@@ -220,12 +220,12 @@ int tart_insert_cell(tart_window* w, tart_byte p, t_char c) {
#else
"\e[48;2;%03hhu;%03hhu;%03hhum\e[38;2;%03hhu;%03hhu;%03hhum%c\e[0m",
#endif
w->pallet[p].background.r,
w->pallet[p].background.g,
w->pallet[p].background.b,
w->pallet[p].forground.r,
w->pallet[p].forground.g,
w->pallet[p].forground.b,
w->palette[p].background.r,
w->palette[p].background.g,
w->palette[p].background.b,
w->palette[p].forground.r,
w->palette[p].forground.g,
w->palette[p].forground.b,
c
);