summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/.Frame.cpp.swpbin12288 -> 0 bytes
-rw-r--r--src/Frame.cpp32
-rw-r--r--src/main.cpp2
3 files changed, 14 insertions, 20 deletions
diff --git a/src/.Frame.cpp.swp b/src/.Frame.cpp.swp
deleted file mode 100644
index 1e3e507..0000000
--- a/src/.Frame.cpp.swp
+++ /dev/null
Binary files differ
diff --git a/src/Frame.cpp b/src/Frame.cpp
index fa9adae..274ad20 100644
--- a/src/Frame.cpp
+++ b/src/Frame.cpp
@@ -24,13 +24,21 @@ Frame::Frame(string location, int nRow, int nCol)
if(file.is_open())
{
+ getline(file,line);
+ m.append(line);
+ i=line.length();
while(getline(file,line))
{
m.append(line);
j++;
}
- i=line.length();
}
+
+ w = newwin(j,i,nRow,nCol);
+ height = j;
+ width = i;
+ row = nRow;
+ col = nCol;
}
@@ -128,24 +136,10 @@ void Frame::move(int nRow, int nCol)
void Frame::fillWindow()
{
- int maxX = width/2;
- int maxY = height/2;
-
- for(int y = 0; y < maxY; ++y)
- for(int x = 0; x < maxX; ++x)
- mvwaddch(w, y, x, '0');
-
- for(int y = 0; y < maxY; ++y)
- for(int x = maxX; x < width; ++x)
- mvwaddch(w, y, x, '1');
-
- for(int y = maxY; y < height; ++y)
- for(int x = 0; x < maxX; ++x)
- mvwaddch(w, y, x, '2');
-
- for(int y = maxY; y < height; ++y)
- for(int x = maxX; x < width; ++x)
- mvwaddch(w, y, x, '3');
+ for(int i = 0; i < width;i++ )
+ for(int j = 0; j < height;j++)
+ mvwaddch(w,j,i,'.');
+
for(int y = 0; y < height; ++y)
{
diff --git a/src/main.cpp b/src/main.cpp
index d6b26ea..9dc48a4 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -5,7 +5,7 @@ int main()
Screen s;
//Frame map(2*s.getHeight(),2*s.getWidth(),0,0);
- Frame map("../scripts/map",0,0);
+ Frame map("scripts/map.txt",0,0);
Frame view(map,s.getHeight(),s.getWidth(),0,0);
Character cursor('X',map.getHeight()/2,map.getWidth()/2);