Direct image overlap

I was wrong, there doesn’t seem to be an issue with single lines, I was calling the function wrong. I keep forgetting that the second coordinates are locations rather than lengths.

There does seem to be an issue with using directPixel routines when using my function. I had to replace the directPixel with the following to work…

void Pokitto::lcdPixel(int16_t x, int16_t y, uint16_t color) {
    if ((x < 0) || (x >= POK_LCD_W) || (y < 0) || (y >= POK_LCD_H))
	return;
 	setWindow(y, x, y, x);
    write_command(0x22);
    write_data(color);
}

I assume something I’m doing is leaving the LCD in the wrong state for other functions to work correctly.

[edit]

I’m an idiot, I forgot to reset the window back to full screen!

void Pokitto::lcdTile(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t* gfx){

	int width=x1-x0;
	int height=y1-y0;

	if (x0 > POK_LCD_W) return;
	if (y0 > POK_LCD_H) return;
	if (x0 < 0) x0=0;
	if (y0 < 0) y0=0;

	setWindow(y0, x0, y1-1, x1-1);

    write_command(0x22);

    for (int x=0; x<=width*height-1;x++) {
        write_data(gfx[x]);
    }
	setWindow(0, 0, 175, 219);
}