added comments to main()
This commit is contained in:
parent
87b1a9d38d
commit
54139ec204
1 changed files with 8 additions and 0 deletions
|
@ -46,6 +46,7 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
cards = card_parse_csv(argv[1], &cards_ct);
|
cards = card_parse_csv(argv[1], &cards_ct);
|
||||||
|
|
||||||
|
// curses init
|
||||||
initscr();
|
initscr();
|
||||||
noecho();
|
noecho();
|
||||||
curs_set(0);
|
curs_set(0);
|
||||||
|
@ -55,6 +56,8 @@ int main(int argc, char **argv) {
|
||||||
(term_y * .5) - ((term_y * .75) * .5),
|
(term_y * .5) - ((term_y * .75) * .5),
|
||||||
(term_x * .5) - ((term_x * .75) * .5));
|
(term_x * .5) - ((term_x * .75) * .5));
|
||||||
refresh();
|
refresh();
|
||||||
|
|
||||||
|
// main loop
|
||||||
do {
|
do {
|
||||||
switch (k) {
|
switch (k) {
|
||||||
case 'j':
|
case 'j':
|
||||||
|
@ -79,9 +82,14 @@ int main(int argc, char **argv) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clear old card
|
||||||
wclear(main_card);
|
wclear(main_card);
|
||||||
wrefresh(main_card);
|
wrefresh(main_card);
|
||||||
|
|
||||||
|
// draw box
|
||||||
box(main_card, 0, 0);
|
box(main_card, 0, 0);
|
||||||
|
|
||||||
|
// print title + text
|
||||||
if (cf == 0) {
|
if (cf == 0) {
|
||||||
mvwprintw(main_card, 0, 10, " Card #%d/%d [front] \r", cc + 1, cards_ct);
|
mvwprintw(main_card, 0, 10, " Card #%d/%d [front] \r", cc + 1, cards_ct);
|
||||||
mvwprintw(main_card, (term_y * .75) * .5, (term_x * .75) * .5, "%s\r", cards[cc].obverse);
|
mvwprintw(main_card, (term_y * .75) * .5, (term_x * .75) * .5, "%s\r", cards[cc].obverse);
|
||||||
|
|
Loading…
Reference in a new issue