Can now add lines to ui and draw.

This commit is contained in:
Sheldon Lee
2020-07-09 23:58:17 +01:00
parent 41db31e121
commit 3df203c588
4 changed files with 31 additions and 12 deletions
+4 -3
View File
@@ -4,6 +4,7 @@
#include "grid.h"
#include "vect.h"
#include "log.h"
#include "ui.h"
static Grid* grid = 0;
@@ -47,6 +48,9 @@ void initGame()
int height = 0;
// stdscr is screen created by initscr()
getmaxyx(stdscr, height, width);
addLinei("x:", &cursor.x);
addLinei("y:", &cursor.y);
grid = initGrid(width, height);
//randomizeGrid(grid);
@@ -143,9 +147,6 @@ void drawLastPressed(char ch)
void drawCurPos()
{
attron(COLOR_PAIR(2));
mvprintw(1, 0, "curpos: %i, %i", cursor.x, cursor.y);
attroff(COLOR_PAIR(2));
attron(COLOR_PAIR(3));
mvaddch(cursor.y, cursor.x, ' ');
attroff(COLOR_PAIR(3));