test avoid bulled game

Dependencies:   C12832_lcd LCD_fonts mbed mbed-rtos

Files at this revision

API Documentation at this revision

Comitter:
th_mbed
Date:
Mon Dec 12 10:19:12 2016 +0000
Parent:
22:5a7399899fe6
Child:
24:88968d1fc9cb
Child:
25:a08a1f5fbb6a
Commit message:
add converter

Changed in this revision

Converter.cpp Show annotated file Show diff for this revision Revisions of this file
convert.h Show annotated file Show diff for this revision Revisions of this file
models.h Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Converter.cpp	Mon Dec 12 10:19:12 2016 +0000
@@ -0,0 +1,15 @@
+#include "convert.h"
+#include "models.h"
+#include "point.h"
+
+#define CHAR_SIZE 8
+
+Bitmap Converter::convert(int[LCD_Y][] map){
+    char char_map[LCD_Y*LCD_X/CHAR_SIZE];
+    for(int i = 0; i < LCD_Y; i++){
+        for(int j = 0; j < LCD_X; j++){
+            char_map[(i*LCD_X+j)/CHAR_SIZE + 1] |= map[i][j] << ;
+        }
+    }
+    
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/convert.h	Mon Dec 12 10:19:12 2016 +0000
@@ -0,0 +1,10 @@
+#ifndef CONVERT_H
+#define CONVERT_H
+
+#include "models.h"
+class Converter
+{
+public:
+    Bitmap convert(int[LCD_Y][] map);
+}
+#endif
\ No newline at end of file
--- a/models.h	Mon Dec 12 09:48:23 2016 +0000
+++ b/models.h	Mon Dec 12 10:19:12 2016 +0000
@@ -1,7 +1,8 @@
-#include "point.h"
 #ifndef models_h
 #define models_h
 
+#include "point.h"
+#include "mbed.h"
 //LCD params
 #define LCD_X 128
 #define LCD_Y 32