diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2019-08-21 16:47:48 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2019-08-21 16:47:48 +0000 |
| commit | 631e0c0870d98a4b3f97c90a8f3d07d549fdf8fb (patch) | |
| tree | 9de02fa30d0ff9fe42e794ea4a036cc472726601 /main.c | |
| parent | osc: fix indexing into 'bright' color array (diff) | |
term: use colors256 array for *all* colors
That is, remove the 'regular' and 'bright' color arrays. This is
possible since the 256-color array is defined such that the first 16
colors map to the regular and bright colors.
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 25 |
1 files changed, 10 insertions, 15 deletions
@@ -445,7 +445,7 @@ main(int argc, char *const *argv) .colors = { .default_fg = conf.colors.fg, .default_bg = conf.colors.bg, - .default_regular = { + .default_colors256 = { conf.colors.regular[0], conf.colors.regular[1], conf.colors.regular[2], @@ -454,8 +454,7 @@ main(int argc, char *const *argv) conf.colors.regular[5], conf.colors.regular[6], conf.colors.regular[7], - }, - .default_bright = { + conf.colors.bright[0], conf.colors.bright[1], conf.colors.bright[2], @@ -493,6 +492,14 @@ main(int argc, char *const *argv) }, }; + LOG_INFO("using %zu rendering threads", term.render.workers.count); + + struct render_worker_context worker_context[term.render.workers.count]; + + /* Initialize 'current' colors from the default colors */ + term.colors.fg = term.colors.default_fg; + term.colors.bg = term.colors.default_bg; + /* Initialize the 256 gray-scale color cube */ { #if 0 /* pick colors from term struct instead, since they can be changed runtime */ @@ -517,18 +524,6 @@ main(int argc, char *const *argv) memcpy(term.colors.colors256, term.colors.default_colors256, sizeof(term.colors.colors256)); } - LOG_INFO("using %zu rendering threads", term.render.workers.count); - - struct render_worker_context worker_context[term.render.workers.count]; - - /* Initialize 'current' colors from the default colors */ - term.colors.fg = term.colors.default_fg; - term.colors.bg = term.colors.default_bg; - for (size_t i = 0; i < 8; i++) { - term.colors.regular[i] = term.colors.default_regular[i]; - term.colors.bright[i] = term.colors.default_bright[i]; - } - if (term.ptmx == -1) { LOG_ERR("failed to open pseudo terminal"); goto out; |
