ELEC2645 (2018/19) / Mbed 2 deprecated el17ttds

Dependencies:   mbed N5110_tf

Revision:
9:3a0194c87afe
Parent:
6:e8c03f264ffc
--- a/Map/Map.cpp	Sat May 11 08:23:54 2019 +0000
+++ b/Map/Map.cpp	Sun May 12 16:21:08 2019 +0000
@@ -13,11 +13,10 @@
     _h = 0;
 }
 
-void Map::write(int x1, int y1) {  // uses origin of top left corner to create the map
-
-    _x1 = x1;
+void Map::write(int x1, int y1) {  // uses top left corner as origin to create the map
+    _x1 = x1 - 5;
     _x2 = _x1 + _width + (_swidth / 2);
-    _y1 = y1;
+    _y1 = y1 - 5;
     _y2 = _y1 + _height + (_sheight / 2);
     map_parameters();
 }
@@ -28,26 +27,26 @@
 }
 
 void Map::horizontal() {
-  if (_x1 < -(_swidth / 2)) {
+  if (_x1 < -(_swidth / 2) ) {
       _x1_pos = -1;
   } else if (_x1 < 0) {
       _x1_pos = 0;
       _w = (_swidth / 2) + _x1;
   } else {
       _x1_pos = 0;
-      _w = _swidth / 2;
+      _w = _swidth / 2 - 5;
   }
 }
 
 void Map::veritical() {
-  if (_y1 < -(_sheight / 2)) {
+  if (_y1 < -(_sheight / 2) ) {
       _y1_pos = -1;
   } else if (_y1 < 0) {
       _y1_pos = 0;
       _h = (_sheight / 2) + _y1;
   } else {
       _y1_pos = 0;
-      _h = _sheight / 2;
+      _h = _sheight / 2 - 5;
   }
 }
 
@@ -55,6 +54,6 @@
 
     lcd.drawRect(_x1_pos,0,_w,_sheight,FILL_BLACK);
     lcd.drawRect(0,_y1_pos,_swidth,_h,FILL_BLACK);
-    lcd.drawRect(0,_y2,_swidth,_sheight / 2,FILL_BLACK);
-    lcd.drawRect(_x2,0,_swidth / 2,_sheight,FILL_BLACK);
+    lcd.drawRect(0,_y2 + 11,_swidth,(_sheight / 2),FILL_BLACK);
+    lcd.drawRect(_x2 + 11,0,(_swidth / 2),_sheight,FILL_BLACK);
 }