diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Frame.cpp | 19 | ||||
-rw-r--r-- | src/Screen.cpp | 3 |
2 files changed, 14 insertions, 8 deletions
diff --git a/src/Frame.cpp b/src/Frame.cpp index 274ad20..7da219c 100644 --- a/src/Frame.cpp +++ b/src/Frame.cpp @@ -25,11 +25,11 @@ Frame::Frame(string location, int nRow, int nCol) if(file.is_open()) { getline(file,line); - m.append(line); + m.push_back(line); i=line.length(); while(getline(file,line)) { - m.append(line); + m.push_back(line); j++; } } @@ -135,12 +135,15 @@ void Frame::move(int nRow, int nCol) } void Frame::fillWindow() -{ - for(int i = 0; i < width;i++ ) - for(int j = 0; j < height;j++) - mvwaddch(w,j,i,'.'); - - +{ + if(!colored) + for(int i = 0; i < width; i++) + for(int j = 0; j < height; j++) + { + attron(COLOR_PAIR(1)); + mvwaddch(w,j,i,m[j][i]); + } + for(int y = 0; y < height; ++y) { mvwaddch(w, y, 0, '-'); diff --git a/src/Screen.cpp b/src/Screen.cpp index c3977d6..40a31d1 100644 --- a/src/Screen.cpp +++ b/src/Screen.cpp @@ -9,6 +9,9 @@ Screen::Screen() keypad(stdscr,TRUE); curs_set(0); getmaxyx(stdscr,height,width); + + start_color(); + init_pair(1, COLOR_GREEN, COLOR_RED); } Screen::~Screen() |