if (remaining_x < 42 || remaining_y < 42)
return 0;
while (TRUE) {
while (TRUE) { // do horizontal pass first
if (remaining_x > 0) {
dlg->AddItem(_DlgStaticPcx8_::Create(current_x, horizontal_row * 256, min(remaining_x, 256), min(remaining_y, 256), 0, "DlgBluBk.bmp"));
current_x += 256;
remaining_x -= 256;
}
else break;
}
current_x = 0; // reset x position to 0
remaining_x = dlg->width; // reset length of horizontal line
remaining_y = remaining_y - 256; // update remaining y since we're done with horizontal pass
horizontal_row = horizontal_row + 1; // we might be working on a new row soon if condition below is met
if (remaining_y <= 0)
break; // no more rows to add
}
int top_left = 0;
int top_right = 1;
int bottom_left = 2;
int bottom_right = 3;
int left_middle = 4;
int right_middle = 5;
int top_middle = 6;
int bottom_middle = 7;