test avoid bulled game

Dependencies:   C12832_lcd LCD_fonts mbed mbed-rtos

Committer:
kaku_jyoko
Date:
Tue Dec 13 07:34:07 2016 +0000
Revision:
38:63b99151e218
Parent:
36:b88fa8ff0be9
Parent:
37:f5d98f22b6bd
Child:
39:e8d6dd3c75c7
change

Who changed what in which revision?

UserRevisionLine numberNew contents of line
th_mbed 23:33d7efd62537 1 #include "convert.h"
th_mbed 23:33d7efd62537 2 #include "models.h"
th_mbed 23:33d7efd62537 3 #include "point.h"
pypy_o8o 25:a08a1f5fbb6a 4 #include "C12832_lcd.h"
th_mbed 36:b88fa8ff0be9 5 #include <math.h>
th_mbed 23:33d7efd62537 6
kaku_jyoko 37:f5d98f22b6bd 7 char* Converter::convert(int map[][LCD_X]){
th_mbed 27:afdaee781efa 8 int len = LCD_Y*LCD_X/CHAR_SIZE;
th_mbed 36:b88fa8ff0be9 9 int count = 0;
th_mbed 36:b88fa8ff0be9 10 int tmp = 0;
th_mbed 27:afdaee781efa 11 char char_map[len];
th_mbed 27:afdaee781efa 12 for(int i = 0; i < len; i++ ){
th_mbed 27:afdaee781efa 13 char_map[i] = 0;
th_mbed 27:afdaee781efa 14 }
th_mbed 23:33d7efd62537 15 for(int i = 0; i < LCD_Y; i++){
th_mbed 23:33d7efd62537 16 for(int j = 0; j < LCD_X; j++){
th_mbed 36:b88fa8ff0be9 17 int index = (i*LCD_X + j)/CHAR_SIZE;
kaku_jyoko 38:63b99151e218 18 char_map[index] |= map[i][j] << ((CHAR_SIZE - 1) - index % CHAR_SIZE);
th_mbed 23:33d7efd62537 19 }
th_mbed 23:33d7efd62537 20 }
th_mbed 36:b88fa8ff0be9 21 //return char_map;
pypy_o8o 25:a08a1f5fbb6a 22 Bitmap bitmap_converted = {
th_mbed 27:afdaee781efa 23 LCD_X,
th_mbed 27:afdaee781efa 24 LCD_Y,
th_mbed 27:afdaee781efa 25 LCD_X/CHAR_SIZE,
th_mbed 27:afdaee781efa 26 char_map,
th_mbed 27:afdaee781efa 27 };
kaku_jyoko 37:f5d98f22b6bd 28 //return bitmap_converted;
kaku_jyoko 37:f5d98f22b6bd 29 return char_map;
pypy_o8o 25:a08a1f5fbb6a 30 }