src/gui/gui_patterntable.c
FrameInfo patterntable_frame(byte *mem_addr, unsigned int *buffer){
	static tile *tiles;
	static FrameInfo frameInfo = {};

	if (tiles == NULL) {
		tiles = calloc(TILES_PER_TABLE + 1, sizeof(tile));
	}

	encode_as_tiles(mem_addr, TILES_PER_TABLE, tiles);
	render_tiles(tiles, buffer);

	frameInfo.buffer = buffer;
	frameInfo.size = PATTERNTABLE_TEXTURE_WIDTH * PATTERNTABLE_TEXTURE_HEIGHT;
	frameInfo.width = PATTERNTABLE_TEXTURE_WIDTH;
	frameInfo.height = PATTERNTABLE_TEXTURE_HEIGHT;

	return frameInfo;
}
/**
 * Generic function to be called. It will encode the patterntable, fill in the colours, struct and return it
 */
Generic function to be called. It will encode the patterntable, fill in the colours, struct and return it
Generic function to be called . It will encode the patterntable fill in the colours struct and return it
FrameInfo patterntable_frame(byte *mem_addr, unsigned int *buffer){
	static tile *tiles;
	static FrameInfo frameInfo = {};
	if (tiles == NULL) {
		tiles = calloc(TILES_PER_TABLE + 1, sizeof(tile));
	}
	encode_as_tiles(mem_addr, TILES_PER_TABLE, tiles);
	render_tiles(tiles, buffer);
	frameInfo.buffer = buffer;
	frameInfo.size = PATTERNTABLE_TEXTURE_WIDTH * PATTERNTABLE_TEXTURE_HEIGHT;
	frameInfo.width = PATTERNTABLE_TEXTURE_WIDTH;
	frameInfo.height = PATTERNTABLE_TEXTURE_HEIGHT;
	return frameInfo;
}
FrameInfo patterntable_frame ( byte * mem_addr , unsigned int * buffer ) { static tile * tiles ; static FrameInfo frameInfo = { } ; if ( tiles == NULL ) { tiles = calloc ( TILES_PER_TABLE + 1 , sizeof ( tile ) ) ; } encode_as_tiles ( mem_addr , TILES_PER_TABLE , tiles ) ; render_tiles ( tiles , buffer ) ; frameInfo . buffer = buffer ; frameInfo . size = PATTERNTABLE_TEXTURE_WIDTH * PATTERNTABLE_TEXTURE_HEIGHT ; frameInfo . width = PATTERNTABLE_TEXTURE_WIDTH ; frameInfo . height = PATTERNTABLE_TEXTURE_HEIGHT ; return frameInfo ; }
Generic function to be called.
Generic function to be called .