void ILI9341_t3n::writeRect2BPP(int16_t x, int16_t y, int16_t w, int16_t h, const uint8_t *pixels, const uint16_t * palette )
{
// Simply call through our helper
writeRectNBPP(x, y, w, h, 2, pixels, palette );
}
//////// a bitmap
const byte paul_front[] = {14,16,
0x00,0x00,0x33,0x77,0x33,0x00,0x00,
0x00,0x03,0x43,0x33,0x34,0x30,0x00,
0x00,0x37,0x33,0x77,0x33,0x73,0x00,
0x07,0x33,0x66,0x33,0x66,0x33,0x70,
0x03,0x76,0x66,0x66,0x66,0x67,0x30,
0x16,0x36,0x33,0x66,0x33,0x63,0x61,
0x16,0x66,0x62,0x66,0x26,0x66,0x61,
0x01,0x16,0x62,0x66,0x26,0x61,0x10,
0x01,0x11,0x66,0x66,0x66,0x11,0x10,
0x16,0x61,0x16,0x66,0x61,0x16,0x61,
0x16,0x61,0x66,0x66,0x66,0x16,0x61,
0x01,0x11,0x22,0x11,0x44,0x11,0x10,
0x00,0x15,0x11,0x22,0x11,0x51,0x00,
0x00,0x15,0x22,0x11,0x22,0x51,0x00,
0x00,0x02,0x21,0x00,0x12,0x20,0x00,
0x00,0x01,0x11,0x00,0x11,0x10,0x00};
///////now we add the palettes in the void loop
palette[1] = BLACK;
palette[2] = BLUE;
palette[3] = BROWN;
palette[4] = DARKGREEN;
palette[5] = GREY;
palette[6] = PINK;
palette[7] = RED;
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
palette[8] = LIGHTBROWN;
palette[9] = GREEN;
palette[a]= DARKGREY;
palette[b]= LIGHTGREY;
palette[c]= YELLOW;
palette[d]= PURPLE;
palette[e]= WHITE;
////////now we call it
if (ButtonDown.fallingEdge()){
tft.writeRectNBPP(player_x, player_y,16,16,4,paul_frontwalk1,palette);
player_direction = 2;
player_y = player_y + 5;}
// if(checkcolision())player_y++;}
if(player_y >= 216){
player_y = 216;}
TS_BUTTON mybuttons2[] = { {(char *)"Rot", 5, 5, 50, 50, 65535, 15, TS_FBUTN, 0, 0, 2, 1, 0} ,
{(char *)"P_2", 65, 5, 50, 50, 65535, 992, TS_FBUTN, 0, 0, 2, 2, 0} ,
{(char *)"P_3", 125, 5, 50, 50, 65535, 1007, TS_FBUTN, 0, 0, 2, 3, 0} ,
{(char *)"P_4", 15, 85, 70, 60, 65535, 30720, TS_FBUTN, 0, 0, 2, 4, 0} ,
{(char *)"5", 95, 85, 70, 60, 65535, 30735, TS_FBUTN, 0, 0, 3, 5, 0} ,
{(char *)"6", 175, 85, 70, 60, 65535, 31712, TS_FBUTN, 0, 0, 3, 6, 0} ,
{(char *)"7", 15, 155, 70, 60, 0, 50712, TS_FBUTN, 0, 0, 3, 7, 0} ,
{(char *)"8", 95, 155, 70, 60, 65535, 31727, TS_FBUTN, 0, 0, 3, 8, 0} ,
{(char *)"9", 175, 155, 70, 60, 65535, 31, TS_FBUTN, 0, 0, 3, 9, 0} ,
{(char *)".", -1, 0, 0, 0, 0, 0, TS_FBUTN, 0, 0, 0, 0, 0}
};
void GrafxT3::writeRect4BPPtm(int16_t x, int16_t y, int16_t w, int16_t h, const uint8_t *pixels, uint16_t dx, uint16_t dy, uint16_t dw, uint16_t dh, const uint16_t * palette )
{
dw += dx;
dh += dy;{
// int32_t largest = 0;
// int32_t largesty = 0;
int32_t drawX = x;
int32_t drawY = y;
if (drawX >= dx && drawX < dw && drawY >= dy && drawY < dh){
// Simply call through our helper
writeRectNBPP(x, y, w, h, 4, pixels, palette );
}
}
}
void GrafxT3::drawBitmapTM(int32_t x, int32_t y, int32_t w, int32_t h, const uint8_t *bitmap, uint32_t dx, uint32_t dy, uint32_t dw, uint32_t dh, uint16_t color) {
int32_t i, j, byteWidth = (w + 7) / 8;
dw += dx;
dh += dy;
// int32_t largest = 0;
// int32_t largesty = 0;
for (j = 0; j < h; j++) {
for (i = 0; i < w; i++) {
if (pgm_read_byte(bitmap + j * byteWidth + i / 8) & (B10000000 >> (i % 8))) {
int32_t drawX = x + i;
int32_t drawY = y + j;
if (drawX >= dx && drawX < dw && drawY >= dy && drawY < dh){
drawPixel(drawX, drawY, color);
}
}
}
}
}
uint32_t tilemap_width = pgm_read_byte(tilemap);
uint32_t tilemap_height = pgm_read_byte(tilemap + 1);
uint32_t tile_width = pgm_read_byte(tilemap + 2);
uint32_t tile_height = pgm_read_byte(tilemap + 3);
tilemap += 4; // now the first tiyleis at tilemap
uint32_t ddw = dw + dx;
uint32_t ddh = dh + dy;
uint32_t maxDdx = (dw - x + tile_width - 1) / tile_width;
uint32_t maxDdy = (dh - y + tile_height - 1) / tile_height;
if (tilemap_width < maxDdx){
maxDdx = tilemap_width;
}
if (tilemap_height < maxDdy){
maxDdy = tilemap_height;
}
int32_t startDdx = (-x) / tile_width;
int32_t startDdy = (-y) / tile_height;
if (startDdx < 0){
startDdx = 0;
}
if (startDdy < 0){
startDdy = 0;
}
if (flagcollision)numcolision = 0; //Line 735 - clear numcolision - ADD by Summoner123
for (uint32_t ddy = startDdy; ddy < maxDdy; ddy++){
for (uint32_t ddx = startDdx; ddx < maxDdx; ddx++){
int32_t drawX = ddx*tile_width + x + dx;
int32_t drawY = ddy*tile_height + y + dy;
uint32_t tile = pgm_read_byte(tilemap + ddy*tilemap_width + ddx);
if (drawX >= dx && drawY >= dy && drawX <= (ddw - tile_width) && drawY <= (ddh - tile_height)){
writeRectNBPP(drawX, drawY,tile_width, tile_height, spritesheet[tile],4, const uint16_t * palette );
if (flagcollision){
solid[numcolision].x = drawX; //Save X coordinate - ADD by Summoner123
solid[numcolision].y = drawY; //Save Y coordinate - ADD by Summoner123
solid[numcolision].spritecol = spritesheet[tile]; //Save Sprite of tile - ADD by Summoner123
numcolision++; //Increment numcolision - ADD by Summoner123
}
}
else{ // we need to draw a partial bitmap
writeRect4BPPtm(drawX, drawY, tile_width, tile_height, spritesheet[tile], 4, dx, dy, dw, dh, palette);
}
}
}
}
Arduino: 1.8.2 (Windows 7), TD: 1.36, Board: "Teensy 3.6, Serial, 180 MHz, Faster, US English"
C:\Users\Duhjoker\Desktop\GameR-Iot_4bpp_splitfile\GameR-Iot_4bpp_splitfile.ino: In function 'void loop()':
C:\Users\Duhjoker\Desktop\GameR-Iot_4bpp_splitfile\GameR-Iot_4bpp_splitfile.ino:166:48: warning: large integer implicitly truncated to unsigned type [-Woverflow]
palette[6] = PINK;
^
C:\Users\Duhjoker\Documents\Arduino\libraries\GameRIot_T3_only\GrafxT3.cpp: In member function 'void GrafxT3::drawBitmapTM(int32_t, int32_t, int32_t, int32_t, const uint8_t*, uint32_t, uint32_t, uint32_t, uint32_t, uint16_t)':
C:\Users\Duhjoker\Documents\Arduino\libraries\GameRIot_T3_only\GrafxT3.cpp:1244:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (drawX >= dx && drawX < dw && drawY >= dy && drawY < dh){
^
C:\Users\Duhjoker\Documents\Arduino\libraries\GameRIot_T3_only\GrafxT3.cpp:1244:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (drawX >= dx && drawX < dw && drawY >= dy && drawY < dh){
^
C:\Users\Duhjoker\Documents\Arduino\libraries\GameRIot_T3_only\GrafxT3.cpp:1244:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (drawX >= dx && drawX < dw && drawY >= dy && drawY < dh){
^
C:\Users\Duhjoker\Documents\Arduino\libraries\GameRIot_T3_only\GrafxT3.cpp:1244:59: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (drawX >= dx && drawX < dw && drawY >= dy && drawY < dh){
^
C:\Users\Duhjoker\Documents\Arduino\libraries\GameRIot_T3_only\GrafxT3.cpp: In member function 'void GrafxT3::drawTilemap(int, int, const uint8_t*, const uint8_t**, uint32_t, uint32_t, uint32_t, uint32_t, uint16_t)':
C:\Users\Duhjoker\Documents\Arduino\libraries\GameRIot_T3_only\GrafxT3.cpp:1290:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (drawX >= dx && drawY >= dy && drawX <= (ddw - tile_width) && drawY <= (ddh - tile_height)){
^
C:\Users\Duhjoker\Documents\Arduino\libraries\GameRIot_T3_only\GrafxT3.cpp:1290:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (drawX >= dx && drawY >= dy && drawX <= (ddw - tile_width) && drawY <= (ddh - tile_height)){
^
C:\Users\Duhjoker\Documents\Arduino\libraries\GameRIot_T3_only\GrafxT3.cpp:1290:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (drawX >= dx && drawY >= dy && drawX <= (ddw - tile_width) && drawY <= (ddh - tile_height)){
^
C:\Users\Duhjoker\Documents\Arduino\libraries\GameRIot_T3_only\GrafxT3.cpp:1290:75: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (drawX >= dx && drawY >= dy && drawX <= (ddw - tile_width) && drawY <= (ddh - tile_height)){
^
C:\Users\Duhjoker\Documents\Arduino\libraries\GameRIot_T3_only\GrafxT3.cpp:1291:78: error: expected primary-expression before 'const'
writeRectNBPP(drawX, drawY,tile_width, tile_height, spritesheet[tile],4, const uint16_t * palette );
^
C:\Users\Duhjoker\Documents\Arduino\libraries\GameRIot_T3_only\GrafxT3.cpp:1301:98: error: 'palette' was not declared in this scope
writeRect4BPPtm(drawX, drawY, tile_width, tile_height, spritesheet[tile], 4, dx, dy, dw, dh, palette);
^
Error compiling for board Teensy 3.6.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
byte may be used uninitialized in this function
if (i & 7) byte <<= 1;
void GrafxT3::drawBitmap1(int16_t x, int16_t y,
const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color) {
int16_t i, j, byteWidth = (w + 7) / 8;
uint16_t byte;
for (j = 0; j<h; j++) {
for (i = 0; i<w; i++) {
if (i & 7) byte <<= 1;
else byte = pgm_read_byte(bitmap + j * byteWidth + i / 8);
if (byte & 0x80) drawPixel(x + i, y + j, color);
}
}
}
palette[0] = 0;
palette[1] = BLACK;
palette[2] = BLUE;
palette[3] = BROWN;
palette[4] = DARKGREEN;
palette[5] = GREY;
palette[6] = PINK;
palette[7] = RED;
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
palette[8] = LIGHTBROWN;
palette[9] = GREEN;
palette[a ]= DARKGREY;
palette[b] = LIGHTGREY;
palette[c] = YELLOW;
palette[d] = PURPLE;
palette[e] = WHITE;
palette[f] = NAVY;
uint16_t palette[16]; // Should probably be 256, but I don't use many colors...
uint16_t pixel_data[2500];
#include <GrafxT3.h>
#include <SPIN.h>
#include "SPI.h"
#include <Bounce.h>
#include "bitmaps.h"
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#define TFT_DC 9
#define TFT_CS 10
#define TFT_RST 7
#define TFT_SCK 13
#define TFT_MISO 12
#define TFT_MOSI 11
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
uint8_t use_fb = 0;
uint8_t use_clip_rect = 0;
uint8_t use_set_origin = 0;
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
GrafxT3 tft = GrafxT3(TFT_CS, TFT_DC, TFT_RST, TFT_MOSI, TFT_SCK, TFT_MISO, &SPIN);
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
int player_x = 100;
int player_y = 70;
int player_direction = 2;
int x=-0,y=0;
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
int camerax = 216 ;
int cameray = 90 ;
int xmax = 216;
///////////////////////////////////////////////////////////////////////////////
///////////////////////////Pixel Color Includes////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
uint16_t palette[16]; // Should probably be 256, but I don't use many colors...
uint16_t pixel_data[2500];
//Extra integers for color palette
int a; int b; int c;
int d; int e;int f;
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////Button assignments//////////////////////////////
/////////////////////////////////////////////////////////////////////////////
//////dpad + select buttons
const int buttonUp = 33; //up button
Bounce ButtonUp = Bounce(buttonUp, 10); // 10 ms debounce
const int buttonDown = 38; //down_button
Bounce ButtonDown = Bounce(buttonDown, 10); // 10 ms debounce
const int buttonLeft = 35; //left button
Bounce ButtonLeft = Bounce(buttonLeft, 10); // 10 ms debounce
const int buttonRight = 17; //right button
Bounce ButtonRight = Bounce(buttonRight, 10); // 10 ms debounce
const int buttonS = 21; //select button
Bounce ButtonS = Bounce(buttonS, 10); // 10 ms debounce
//////action + start buttons
const int buttonX = 32; // X button up
Bounce ButtonX = Bounce(buttonX, 10); // 10 ms debounce
const int buttonY = 26; // Y button left
Bounce ButtonY = Bounce(buttonY, 10); // 10 ms debounce
const int buttonA = 21; // A button right
Bounce ButtonA = Bounce(buttonA, 10); // 10 ms debounce
const int buttonB = 28; // B buttun down
Bounce ButtonB = Bounce(buttonB, 10); // 10 ms debounce
const int buttonT = 4; // Start button
Bounce ButtonT = Bounce(buttonT, 10); // 10 ms debounce
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////Set-up//////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
void setup() {
while (!Serial && (millis() < 4000)) ;
Serial.begin(115200);
tft.begin();
tft.setRotation(1);
tft.fillScreen(BLACK);
//tft.setFrameRate(60);
tft.persistence = false;
pinMode(buttonUp, INPUT_PULLUP);
pinMode(buttonDown, INPUT_PULLUP);
pinMode(buttonLeft, INPUT_PULLUP);
pinMode(buttonRight, INPUT_PULLUP);
pinMode(buttonS, INPUT_PULLUP);
pinMode(buttonX, INPUT_PULLUP);
pinMode(buttonY, INPUT_PULLUP);
pinMode(buttonA, INPUT_PULLUP);
pinMode(buttonB, INPUT_PULLUP);
pinMode(buttonT, INPUT_PULLUP);
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////Loop////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
void loop(void) {
//updates the GameRIot (the display, the sound, the buttons, everyyhing)
//returns true when it's time to render a new frame (20 times/second)
// if(tft.updateAll()){
///////////////////////////////////////////////////////////////////////////////
////////////////////////////////camera controls////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// if(player_x > 216 && camerax < 0 && camerax > -216) {player_x = 216;camerax--;}
//value 59 equals player position on right when camera will start to follow
//value 0 and -52 equals camers boundary positions
// else if(player_x < 216 && camerax < 0 && camerax > -216){player_x = 216;camerax++;}
//value 15 equals player position on left when camera will start to follow
//value 0 and -52 equals camera boundary positions
// else if(player_x > 216 && camerax <= 0 && camerax >= -216)camerax--;
// else if(player_x < 216 && camerax <= 0 && camerax >= -216)camerax++;
// if(player_y > 216 && cameray < 0 && cameray > -216){player_y = 216;cameray--;}
//value 28 equals player position on right when camera will start to folow
//value 0 and -40 equals camera boundary positions
// else if(player_y < 90 && cameray < 0 && cameray > -90){player_y = 90;cameray++;}
//value 15 equals player position on left when camera will start to follow
//value 0 and -40 equals camera boundary positions
// else if(player_y > 90 && cameray <= 0 && cameray >= -90)cameray--;
// else if(player_y < 90 && cameray <= 0 && cameray >= -90)cameray++;
// if(camerax > 0)camerax= 0;
// else if(camerax < -216) camerax = -216;
//value 0 and -52 equals camera boundary positions
// if(cameray > 0)cameray= 0;
// else if(cameray < -90) cameray = -90;
//value 0 and -40 equals camera boundary positions
/////////////////////////////////////////////////////////////////
///////////////////////Tilemap///////////////////////////////////
/////////////////////////////////////////////////////////////////
//if(tft.useFrameBuffer(use_fb));{
// tft.setFrameRate(60);
// tft.drawTilemap(x, y, tilemap1, spritesheet1, BLACK);
// tft.drawTilemap(x, y, tilemap2, spritesheet2, BROWN);
// tft.drawTilemap(x, y, tilemap3, spritesheet3, LIGHTBROWN);
// tft.updateScreen();
// tft.freeFrameBuffer(); //clear the buffer
//}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////Buttons/////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
if (ButtonUp.update());
if (ButtonDown.update());
if (ButtonLeft.update());
if (ButtonRight.update());
if (ButtonA.update());
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
ButtonUp.rebounce(10);
ButtonDown.rebounce(10);
ButtonLeft.rebounce(10);
ButtonRight.rebounce(10);
ButtonA.rebounce(10);
//////////////////////////////////////////////////////////////////////////////
///////////////////////////////Palette////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
palette[0] = 0;
palette[1] = BLACK;
palette[2] = BLUE;
palette[3] = BROWN;
palette[4] = DARKGREEN;
palette[5] = GREY;
palette[6] = PINK;
palette[7] = RED;
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
palette[8] = LIGHTBROWN;
palette[9] = GREEN;
palette[a ]= DARKGREY;
palette[b] = LIGHTGREY;
palette[c] = YELLOW;
palette[d] = PURPLE;
palette[e] = WHITE;
palette[f] = NAVY;
///////////////////////////////////////////////////////////////////////////////
//////////////////////////Down/////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
if (ButtonUp.fallingEdge()){
tft.writeRectNBPP(player_x, player_y,16,16,4,paul_rearwalk1,palette);
player_direction = 1;
player_y = player_y - 5;}
// if(checkcolision())player_y--;}
if(player_y <= 16){
player_y = 16;}
//////////////////////////////////////////////////////////////////////////////
/////////////////////////////////Up///////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
if (ButtonDown.fallingEdge()){
tft.writeRectNBPP(player_x, player_y,16,16,4,paul_frontwalk1,palette);
player_direction = 2;
player_y = player_y + 5;}
// if(checkcolision())player_y++;}
if(player_y >= 216){
player_y = 216;}
//////////////////////////////////////////////////////////////////////////////
//////////////////////////Left////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
if (ButtonLeft.fallingEdge()){
tft.writeRectNBPP(player_x, player_y,16,16,4,paul_leftwalk,palette);
player_direction = 3;
player_x = player_x - 5;}
// if(checkcolision())player_x--;}
if(player_x >= 288){
player_x = 288;}
//////////////////////////////////////////////////////////////////////////////
////////////////////////////Right////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
if (ButtonRight.fallingEdge()){
tft.writeRectNBPP(player_x, player_y,16,16,4,paul_rightwalk,palette);
player_direction = 4;
player_x = player_x + 5;}
// if(checkcolision())player_x++;}
if(player_x <= 16){
player_x = 16;}
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////PLAYER DIRECTION/////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
if (player_direction == 1){
tft.writeRectNBPP(player_x, player_y,16,16,4,paul_rear,palette);
}
/////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////
else if (player_direction == 2){
tft.writeRectNBPP(player_x, player_y,16,16,4,paul_front,palette);
}
/////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////
else if (player_direction == 3){
tft.writeRectNBPP(player_x, player_y,16,16,4,paul_left,palette);
}
/////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////
else if (player_direction == 4){
tft.writeRectNBPP(player_x, player_y,16,16,4,paul_right,palette);
}
}
//}
/////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////collision/////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////
bool checkcolision() { // Transformed it into a function
uint16_t i;
for(i=0; i < tft.numcolision + 1; i++)
{
if(tft.collideRectRect(player_x, player_y,16,16,tft.solid[i].x,tft.solid[i].y,16,16))
{
if(tft.solid[i].spritecol == blank_tile)return false; //Do nothing because it's floor - this line not needed
else if(tft.solid[i].spritecol == rock)return true;
else if(tft.solid[i].spritecol == sand)return false;
else if(tft.solid[i].spritecol == tree)return true;
else if(tft.solid[i].spritecol == grass)return false;
else if(tft.solid[i].spritecol == grasstl)return false;
else if(tft.solid[i].spritecol == grasstr)return false;
else if(tft.solid[i].spritecol == grassbl)return false;
else if(tft.solid[i].spritecol == grassbr)return false;
else if(tft.solid[i].spritecol == rocktl)return true;
else if(tft.solid[i].spritecol == rocktr)return true;
else if(tft.solid[i].spritecol == rockbl)return true;
else if(tft.solid[i].spritecol == rockbr)return true;
else if(tft.solid[i].spritecol == stairsl)return true;
else if(tft.solid[i].spritecol == stairsr)return true;
else if(tft.solid[i].spritecol == cave)return true;
else if(tft.solid[i].spritecol == seitch)return true;
}
}
return false; // Return false if don't touch anything
}
//////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////
int16_t i, j, byteWidth = (w + 7) / 8;
uint16_t byte;
for (j = 0; j<h; j++) {
for (i = 0; i<w; i++) {
if (i & 7) byte <<= 1;
else byte = pgm_read_byte(bitmap + j * byteWidth + i / 8);
if (byte & 0x80) drawPixel(x + i, y + j, color);
}
}
}
//Extra integers for color palette
int a=0xA; int b=0xB; int c=0xC;
int d=0xD; int e=0xE; int f=0xF;
*pfbPixel++ = palette[((*pixels)>>pixel_shift) & pixel_bit_mask];
#define TRANSPARENT_INDEX 0
...
uint8_t palette_index = (*pixels)>>pixel_shift) & pixel_bit_mask];
if (palette_index != TRANSPARENT_INDEX)
*pfbPixel = palette[palette_index];
*pfbPixel++;
writedata16_cont(palette[((*pixels)>>pixel_shift) & pixel_bit_mask]);