summaryrefslogtreecommitdiffstats
path: root/CRT.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-11-21 21:40:08 +0100
committercgzones <cgzones@googlemail.com>2020-11-25 20:46:27 +0100
commit267014cbfe584ff9a1bc74d671f8aaa27251fd49 (patch)
treec49c5efc511a93722052084b78a735962db46b91 /CRT.c
parentadf918520976a5f06181c1c05392a0da6e4bbaa5 (diff)
Add support to change numeric options in settings screen
Like delay or highlightDelaySecs
Diffstat (limited to 'CRT.c')
-rw-r--r--CRT.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/CRT.c b/CRT.c
index 31c94cbd..c1fcb0df 100644
--- a/CRT.c
+++ b/CRT.c
@@ -72,7 +72,7 @@ bool CRT_utf8 = false;
const char* const* CRT_treeStr = CRT_treeStrAscii;
-int CRT_delay;
+static const int* CRT_delay;
const char* CRT_degreeSign;
@@ -654,10 +654,10 @@ static struct sigaction old_sig_handler[32];
// TODO: pass an instance of Settings instead.
-void CRT_init(int delay, int colorScheme, bool allowUnicode) {
+void CRT_init(const int* delay, int colorScheme, bool allowUnicode) {
initscr();
noecho();
- CRT_delay = CLAMP(delay, 1, 255);
+ CRT_delay = delay;
CRT_colors = CRT_colorSchemes[colorScheme];
CRT_colorScheme = colorScheme;
@@ -666,7 +666,7 @@ void CRT_init(int delay, int colorScheme, bool allowUnicode) {
CRT_colorSchemes[COLORSCHEME_BROKENGRAY][i] = color == (A_BOLD | ColorPairGrayBlack) ? ColorPair(White, Black) : color;
}
- halfdelay(CRT_delay);
+ halfdelay(*CRT_delay);
nonl();
intrflush(stdscr, false);
keypad(stdscr, true);
@@ -774,7 +774,7 @@ int CRT_readKey() {
cbreak();
nodelay(stdscr, FALSE);
int ret = getch();
- halfdelay(CRT_delay);
+ halfdelay(*CRT_delay);
return ret;
}
@@ -785,7 +785,7 @@ void CRT_disableDelay() {
}
void CRT_enableDelay() {
- halfdelay(CRT_delay);
+ halfdelay(*CRT_delay);
}
void CRT_setColors(int colorScheme) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy