debugging stuff

main
Henri Vasserman 2021-04-11 21:13:59 +03:00
parent 5d088a00d4
commit 9d5ce88926
1 changed files with 17 additions and 16 deletions

View File

@ -202,25 +202,27 @@ int main() {
}
Field_scroll(&f, rend);
Field_draw(&f, rend);
//char buf[72];
//SDL_SetRenderDrawColor(rend, 0, 0, 0, 255);
//SDL_RenderFillRect(rend, &(SDL_Rect) { 0, 0, sizeof(buf)*font_w, 7*font_h });
char buf[72];
SDL_SetRenderDrawColor(rend, 0, 0, 0, 255);
SDL_RenderFillRect(rend, &(SDL_Rect) {
0, 0, sizeof(buf)*font_w, 8*font_h
});
//size_t len = snprintf(buf, sizeof(buf), "off.x: %d, off.y: %d", off.x, off.y);
//draw_text(rend, font, buf, len, RC(1, 1), 255, 255, 255);
draw_text(rend, font, ACCEL_PLATFORM_STR, sizeof(ACCEL_PLATFORM_STR), RC(1,1), 255, 255, 255);
//char *q[] = {"TL", "TR", "BL", "BR"};
//for (int i = 0; i < 4; i++) {
// Picture *p = pictures[i];
// len = snprintf(buf, sizeof(buf), "%s| x1: %05d, x2: %05d, y1: %05d, y2: %05d, p: %p",
// q[i], p->x1, p->x2, p->y1, p->y2, p);
// draw_text(rend, font, buf, len, RC(2+i, 1), 255, 255, 255);
//}
//draw_text(rend, font, ACCEL_PLATFORM_STR, sizeof(ACCEL_PLATFORM_STR), RC(1,1), 255, 255, 255);
size_t len = snprintf(buf, sizeof(buf),
"off.x: %d, off.y: %d", f.offset.x, f.offset.y);
draw_text(rend, font, buf, len, RC(2, 1), 255, 255, 255);
char *q[] = {"TL", "TR", "BL", "BR"};
for (int i = 0; i < 4; i++) {
Picture *p = f.pics[i];
len = snprintf(buf, sizeof(buf), "%s| x1: %05d, x2: %05d, y1: %05d, y2: %05d, p: %p",
q[i], p->x1, p->x2, p->y1, p->y2, p);
draw_text(rend, font, buf, len, RC(3+i, 1), 255, 255, 255);
}
SDL_RenderPresent(rend);
@ -237,5 +239,4 @@ int main() {
SDL_Quit();
return 0;
}