From 6dba60f6bdebef740c7ddc916cd0c5f6837601ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Wed, 27 Jan 2021 17:14:15 +0100 Subject: Pass Settings to CRT_init Resolve todo --- CRT.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'CRT.c') diff --git a/CRT.c b/CRT.c index e3b1a20a..6191fca9 100644 --- a/CRT.c +++ b/CRT.c @@ -687,14 +687,12 @@ void CRT_restorePrivileges() { static struct sigaction old_sig_handler[32]; -// TODO: pass an instance of Settings instead. - -void CRT_init(const int* delay, int colorScheme, bool allowUnicode) { +void CRT_init(const Settings* settings, bool allowUnicode) { initscr(); noecho(); - CRT_delay = delay; - CRT_colors = CRT_colorSchemes[colorScheme]; - CRT_colorScheme = colorScheme; + CRT_delay = &(settings->delay); + CRT_colors = CRT_colorSchemes[settings->colorScheme]; + CRT_colorScheme = settings->colorScheme; for (int i = 0; i < LAST_COLORELEMENT; i++) { unsigned int color = CRT_colorSchemes[COLORSCHEME_DEFAULT][i]; -- cgit v1.2.3