mirror of
https://github.com/m5stack/M5Stack.git
synced 2026-05-20 10:06:46 -07:00
update Tetris example jpg to data
This commit is contained in:
@@ -36,6 +36,7 @@ Block blocks[7] = {
|
||||
{{{{-1,0},{0,0},{1,0},{0,-1}},{{0,-1},{0,0},{0,1},{-1,0}},
|
||||
{{-1,0},{0,0},{1,0},{0,1}},{{0,-1},{0,0},{0,1},{1,0}}},4,7}
|
||||
};
|
||||
extern uint8_t tetris_img[];
|
||||
//========================================================================
|
||||
void setup(void) {
|
||||
Serial.begin(115200); // SERIAL
|
||||
@@ -53,7 +54,8 @@ void setup(void) {
|
||||
make_block( 6, 0xF00F); // _DD,DD_ LIGHT GREEN
|
||||
make_block( 7, 0xF8FC); // _D_,DDD PINK
|
||||
//----------------------------------------------------------------------
|
||||
M5.Lcd.drawJpgFile(SD, "/tetris.jpg"); // Load background from SD
|
||||
// M5.Lcd.drawJpgFile(SD, "/tetris.jpg"); // Load background from SD
|
||||
M5.Lcd.drawJpg(tetris_img, 34215); // Load background from file data
|
||||
PutStartPos(); // Start Position
|
||||
for (int i = 0; i < 4; ++i) screen[pos.X +
|
||||
block.square[rot][i].X][pos.Y + block.square[rot][i].Y] = block.color;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
-1999
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -14,7 +14,7 @@ file_size = os.path.getsize(in_name)
|
||||
|
||||
with open(in_name, 'rb') as infile:
|
||||
with open(out_name, 'wb+') as outfile:
|
||||
arrary_name = 'unsigned char ' + out_name[0:out_name.find('.')] + '[' +str(file_size)+'] = {\n'
|
||||
arrary_name = 'const unsigned char ' + out_name[0:out_name.find('.')] + '[' +str(file_size)+'] = {\n'
|
||||
outfile.write(arrary_name.encode('utf-8'))
|
||||
while True:
|
||||
data = infile.read(20)
|
||||
|
||||
Reference in New Issue
Block a user