help fixing a drawbitmap from sd function

hi guys

im working on a draw bitmap from sd command for gaming library project and I cant seem to get it to work with my drawpixel function. I think part of the problem might be that it uses byte instead of integer. I don’t know but ive been trying to fix it and its above me. it uses petitfatfs to open the bitmaps and display them using a simple drawfrombitmapfromsd.

here are the actual errors

C:\Users\duhjoker\Documents\Arduino\libraries\gamebuinoduhjokercolorMAINSD\DisplayRGB.cpp: In function 'void drawBitmapA(byte, byte, char*, uint8_t, uint8_t, uint8_t, uint8_t, uint16_t)':

C:\Users\duhjoker\Documents\Arduino\libraries\gamebuinoduhjokercolorMAINSD\DisplayRGB.cpp:741:27: error: 'drawPixel' was not declared in this scope

      drawPixel(x, y, color);

                           ^

C:\Users\duhjoker\Documents\Arduino\libraries\gamebuinoduhjokercolorMAINSD\DisplayRGB.cpp: In function 'void drawBitmapB(byte, byte, char*, uint16_t)':

C:\Users\duhjoker\Documents\Arduino\libraries\gamebuinoduhjokercolorMAINSD\DisplayRGB.cpp:756:101: error: 'drawPixel' was not declared in this scope

    if (!((bitmap[2 + j*byteWidth + byteNum]) & (B10000000 >> bitNum))) drawPixel(x + i, y + j, color);

the drawpixel commands are written in their lil brackets the same way that all my bitmap commands have it written

// Draw inverted-color bitmap from SRAM char array
void drawBitmapA(byte x, byte y, char *bitmap, uint8_t dx, uint8_t dy, uint8_t dw, uint8_t dh, uint16_t color) { // where bitmap[] is the char array containing bitmap data
	byte w = bitmap[0];
	byte h = bitmap[1];
	byte i, j, byteNum, bitNum, byteWidth = (w + 7) >> 3;
	dw += dx;
	dh += dy;
	for (i = 0; i<w; i++) {
		byteNum = i / 8; bitNum = i % 8;
		for (j = 0; j<h; j++) {
			if (!((bitmap[2 + j*byteWidth + byteNum]) & (B10000000 >> bitNum))) {
				int8_t drawX = x + i;
				int8_t drawY = y + j;

				if (drawX >= dx && drawX < dw && drawY >= dy && drawY < dh) {
					drawPixel(x, y, color);
				}
		   }
		}
	}
}

// Draw inverted-color bitmap from SRAM char array
void drawBitmapB(byte x, byte y, char *bitmap, uint16_t color) { // where bitmap[] is the char array containing bitmap data
	byte w = bitmap[0];
	byte h = bitmap[1];
	byte i, j, byteNum, bitNum, byteWidth = (w + 7) >> 3;
	for (i = 0; i<w; i++) {
		byteNum = i / 8; bitNum = i % 8;
		for (j = 0; j<h; j++) {
			if (!((bitmap[2 + j*byteWidth + byteNum]) & (B10000000 >> bitNum))) {
				drawPixel(x + i, y + j, color);
		}
	}
}


// Draw bitmap from SD at position x0, y0
int drawBitmapFromSd(byte x0, byte y0, char *bitmap, uint16_t color) { // where bitmap[] is the name of the bitmap file on SD
	char buf[13]; // max 2 bytes for W/H + 11 bytes of data to cover the 84 pixel width of the  Gamebuino screen
	// 1. open bitmap file
    // open real bitmap on SD
	(pf_open(bitmap)); return BMP_NO_FILE;
	// 2a. read information from bitmap header > identifier
	readNCharsAt(2, 0, buf); // BMP.wIdentifier
	buf[2] = NULL;
	if (strcmp(buf, "BM")) return BMP_NOT_WBM;
	// 2b. read information from bitmap header > bpp, compression and data size
	readNCharsAt(10, 28, buf); // BMP.wBitsPerPixel + BMP.dwCompression + BMP.dwDataSize
	if (WORD(buf, 0) != 1) return BMP_NOT_1BPP; // not a 1bpp bitmap
	if (LONG(buf, 2)) return BMP_ERR_CMP; // not an UNcompressed bitmap
	word datasize = WORD(buf, 6);
	// 2c. read information from bitmap header > data offset
	readNCharsAt(4, 10, buf); // BMP.dwDataOffset
	word offset = WORD(buf, 0);
	// 2d. read information from bitmap header > dimensions
	readNCharsAt(8, 18, buf); // BMP.dwWidth + BMP.dwHeight
	byte w = (byte)buf[0];
	if (w>LCDWIDTH) return BMP_TOO_BIG;
	byte h = (byte)buf[4];
	byte datalen = datasize / h;
	// 3. read and draw bitmap data
	buf[0] = w; buf[1] = 1; // get bitmap data line by line
	for (byte y = 0; y<h; y++) {
		readNCharsAt(datalen, offset + y*datalen, buf + 2);
		drawBitmapB(x0, y0 + (h - 1) - y, buf, color); // and draw it!
	}
	return BMP_OK;
}

gamebuinoduhjokercolorMAINSD.zip (34.2 KB)

petit_fatfs.zip (17.5 KB)

im including the original sketch that the commands are drawn from

also the test folder has the working test sketch to use with the gamebuino library and the files in question are the displayrgb files

drawBitmapFromSd.ino (37.9 KB)