Hello, I'm working on this project that takes an input file with 3 shapes, and then prints out the shapes in an x,y list with their RGB values. For some reason, my program is doing something where it checks the x and y values, then reads a shape and sets its RGB values. Then it checks the other shapes and because they aren't in the same place, it just turns it back to black. I need to change this so that it prints all the shapes on the same image. Here is the section of my code. Any help is appreciated; thanks!
for (y = 0; y < imgHeight; y++){
for (x = 0; x < imgWidth; x++){
for (i = 0; i < numShapes; i++) {
newX = x - xOff[i];
newY = y - yOff[i];
if (InObject(shapeLetter[i], newX, newY, arg1[i], arg2[i], arg3[i])){
PixelPrint(color[i], &r, &g, &b);
}
else {
PixelPrint(0, &r, &g, &b);
}
}
printf("%d %d %d # %d, %d\n", r, g, b, x, y);
}
}