/* SPDX-License-Identifier: GPL-3.0-or-later */ /* Copyright (C) 2021 KikooDX */ #include "conf.h" #include "mainmenu.h" #include "zxcolors.h" #include void mainmenu_draw(struct MainMenu mainmenu) { int i = MENU_ENTRIES; while (i-- > 0) { const int selected = mainmenu.cursor == i; const color_t foreground_color = selected ? ZX_WHITE : ZX_GRAY; const color_t background_color = selected ? ZX_DARK_BLUE : ZX_BLACK; dprint_opt(DWIDTH / 2, DHEIGHT / 2 + 16 + i * 16, foreground_color, background_color, DTEXT_CENTER, DTEXT_MIDDLE, menu_entries[i], selected ? '[' : ' ', selected ? ']' : ' '); } }