NcLooper/ui/ncfuncs.c

39 lines
715 B
C
Raw Normal View History

2019-10-30 05:31:38 +01:00
/*
* NcLooper--- interface curses, fonctions de base
*/
2019-11-03 18:58:21 +01:00
#include "ncfuncs.h"
2019-10-30 05:31:38 +01:00
/* --------------------------------------------------------------------- */
2019-12-23 17:55:31 +01:00
int init_ecran(const char *txt)
2019-10-30 05:31:38 +01:00
{
initscr();
standout();
2019-11-03 18:58:21 +01:00
// border('o', 'o', 'o', 'o', 'X', 'X', 'X', 'X');
2019-10-30 05:31:38 +01:00
standend();
mvaddstr(1, 5, txt);
refresh();
return -1;
}
/* --------------------------------------------------------------------- */
int fin_ecran(void)
{
endwin();
return 0;
}
/* --------------------------------------------------------------------- */
2019-11-03 18:58:21 +01:00
int idx2position(int idx, int *prow, int *pcol)
{
*prow = 6 + (idx % 13);
*pcol = 4 + (40*(idx/13));
return 0;
}
/* --------------------------------------------------------------------- */