summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortom <tom@ground-control>2015-11-18 21:24:43 -0600
committertom <tom@ground-control>2015-11-18 21:24:43 -0600
commit96038fbcb01261dfc4b786562b1ddb702c991483 (patch)
tree59d4a0fbb0956a750c592575b0ee03265a72c16f /src
parent0fc9844e4e81f9f78886a75eb15e3cf17d6adc36 (diff)
map successfully imports, need to do coloring next
Diffstat (limited to 'src')
-rw-r--r--src/Frame.cpp19
-rw-r--r--src/Screen.cpp3
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()