test avoid bulled game

Dependencies:   C12832_lcd LCD_fonts mbed mbed-rtos

Files at this revision

API Documentation at this revision

Comitter:
pypy_o8o
Date:
Mon Dec 12 10:58:04 2016 +0000
Parent:
23:33d7efd62537
Child:
26:6fe1d95b2b79
Commit message:
converter

Changed in this revision

Converter.cpp Show annotated file Show diff for this revision Revisions of this file
GraphicBuilder.cpp Show diff for this revision Revisions of this file
convert.h Show annotated file Show diff for this revision Revisions of this file
integrate_graphics.h Show diff for this revision Revisions of this file
--- a/Converter.cpp	Mon Dec 12 10:19:12 2016 +0000
+++ b/Converter.cpp	Mon Dec 12 10:58:04 2016 +0000
@@ -1,15 +1,21 @@
 #include "convert.h"
 #include "models.h"
 #include "point.h"
-
+#include "C12832_lcd.h" 
 #define CHAR_SIZE 8
 
-Bitmap Converter::convert(int[LCD_Y][] map){
+Bitmap Converter::convert(int map[][LCD_X]){
     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] << ;
+            char_map[(i*LCD_X+j)/CHAR_SIZE + 1] |= map[i][j] << ((CHAR_SIZE - 1) - i % CHAR_SIZE);
         }
     }
-    
-}
\ No newline at end of file
+    Bitmap bitmap_converted = {
+    LCD_X,
+    LCD_Y,
+    LCD_X/CHAR_SIZE,
+    char_map,
+};
+    return bitmap_converted;
+}
--- a/GraphicBuilder.cpp	Mon Dec 12 10:19:12 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-#include "integrate_graphics.h"
-#include "point.h"
-#include "graphics.h"
-#include "C12832_lcd.h"
-#include "models.h"
-
-Bitmap GraphicBuilder::integrateBitmap(point pe, point bu, point st[])
-{
-  int cnt;
-  for(int i=0;i<bitmPlayer.ySize;i++)
-    map[pe.x+(pe.y+i)*LCD_X]=Player[i];
-  for(int i=0;i<bitmBullet_graphics.ySize;i++)
-    map[bu.x+(bu.y+i)*LCD_X]=Bullet_graphics[i];
-  
-//    map = lcd.buffer;
-    
-    return bitmap_all;
-}
-void GraphicBuilder::init(){
-    for (int i=0;i<LCD_X*LCD_Y;i++)
-        map[i]=0;
-}
--- a/convert.h	Mon Dec 12 10:19:12 2016 +0000
+++ b/convert.h	Mon Dec 12 10:58:04 2016 +0000
@@ -1,10 +1,11 @@
 #ifndef CONVERT_H
 #define CONVERT_H
-
+#include "C12832_lcd.h" 
 #include "models.h"
 class Converter
 {
 public:
-    Bitmap convert(int[LCD_Y][] map);
-}
+    Bitmap convert(int map[][LCD_X]);
+};
+
 #endif
\ No newline at end of file
--- a/integrate_graphics.h	Mon Dec 12 10:19:12 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-#ifndef integrate_H
-#define integrate_H
-#include "C12832_lcd.h"
-#include "models.h"
-
-
-class GraphicBuilder
-{
-private:
-    point pe;
-    point bu;
-    point st[];
-    Bitmap bitmap_all;
-   // char map[];
-public:
-    Bitmap integrateBitmap(point pe, point bu, point st[]);
-    void init();
-   // char map[];
-};
-
-static char map[] = {
-    };
-
-Bitmap bitmap_all = {
-    LCD_X,
-    LCD_Y,
-    LCD_X/8,
-    map,
-};
-
-#endif
\ No newline at end of file