I don't know if it's already included, but the drawPixel function is a bit false.
I tried it and the x and y position were not right.
I change the function for v a little bit and now it is:
Code:
u32 v=(height-1-y+x*height)*(x/100);
No it draws the specified Pixel at the right position.
Don't know if it's relevant.
And with that rewrote function I could finish my drawCell function:
Code:
//draw a Cell from start_x/y to end_x/y with the color r/g/b
void DrawCell (int start_x, int start_y, int end_x, int end_y char r, char g, char b, u8* screen) {
int i,j;
for (i=0+start_y;i<=end_y;i++) {
for (j=0+start_x;j<=end_x;j++) {
drawPixel(j,i,r,g,b,screen);
}
}
}
u8* screen is one of three variables defined in the main loop:
Code:
u8* screenBottom=gfyGetFramebuffer(GFX_BOTTOM, GFX_BOTTOM, NULL, NULL);
u8* screenTopLeft=gfyGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL);
u8* screenTopRight=gfyGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL);
And the variables r, g, b have to be in this format, where ?? is one Hexvalue from 0 to 255:
Any additions to that?