test avoid bulled game

Dependencies:   C12832_lcd LCD_fonts mbed mbed-rtos

Committer:
kaku_jyoko
Date:
Tue Dec 13 02:02:50 2016 +0000
Revision:
37:f5d98f22b6bd
Parent:
27:afdaee781efa
Child:
38:63b99151e218
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 23:33d7efd62537 5 #define CHAR_SIZE 8
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 27:afdaee781efa 9 char char_map[len];
th_mbed 27:afdaee781efa 10 for(int i = 0; i < len; i++ ){
th_mbed 27:afdaee781efa 11 char_map[i] = 0;
th_mbed 27:afdaee781efa 12 }
th_mbed 23:33d7efd62537 13 for(int i = 0; i < LCD_Y; i++){
th_mbed 23:33d7efd62537 14 for(int j = 0; j < LCD_X; j++){
th_mbed 27:afdaee781efa 15 char_map[(i*LCD_X+j)/CHAR_SIZE] |= map[i][j] << ((CHAR_SIZE - 1) - i % CHAR_SIZE);
th_mbed 23:33d7efd62537 16 }
th_mbed 23:33d7efd62537 17 }
pypy_o8o 25:a08a1f5fbb6a 18 Bitmap bitmap_converted = {
th_mbed 27:afdaee781efa 19 LCD_X,
th_mbed 27:afdaee781efa 20 LCD_Y,
th_mbed 27:afdaee781efa 21 LCD_X/CHAR_SIZE,
th_mbed 27:afdaee781efa 22 char_map,
th_mbed 27:afdaee781efa 23 };
kaku_jyoko 37:f5d98f22b6bd 24 //return bitmap_converted;
kaku_jyoko 37:f5d98f22b6bd 25 return char_map;
pypy_o8o 25:a08a1f5fbb6a 26 }