get max row/col from ncurses
This commit is contained in:
parent
aea9a53762
commit
9669b96e47
1 changed files with 5 additions and 2 deletions
|
@ -9,8 +9,11 @@
|
|||
#define MAX_C 80
|
||||
|
||||
void xy2rc(float x, float y, int *r, int *c) {
|
||||
*c = (x / MAX_X) * MAX_C;
|
||||
*r = MAX_R - ((y / MAX_Y) * MAX_R);
|
||||
int mrow, mcol;
|
||||
getmaxyx(stdscr, mrow, mcol);
|
||||
|
||||
*c = (x / MAX_X) * mcol;
|
||||
*r = mrow - ((y / MAX_Y) * mrow);
|
||||
}
|
||||
|
||||
float lerp(float from, float to, float t) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue