6 printf_surface(SDL_Surface *s, char *name)
8 printf("SDL_Surface *%s = {\n", name);
9 printf("\tflags = 0x%x;\n", s->flags);
10 printf("\tformat = {\n");
11 printf("\t\tBitsPerPixel = %d;\n", s->format->BitsPerPixel);
12 printf("\t\tBytesPerPixel = %d;\n", s->format->BytesPerPixel);
13 printf("\t\tmasks = 0x%x, 0x%x, 0x%x, 0x%x;\n", s->format->Rmask, s->format->Gmask,
14 s->format->Bmask, s->format->Amask);
15 printf("\t\tshifts = %d, %d, %d, %d;\n", s->format->Rshift, s->format->Gshift,
16 s->format->Bshift, s->format->Ashift);
17 printf("\t\tlosses = %d, %d, %d, %d;\n", s->format->Rloss, s->format->Gloss,
18 s->format->Bloss, s->format->Aloss);
19 printf("\t\tcolorkey = %d;\n", s->format->colorkey);
20 printf("\t\talpha = %d;\n", s->format->alpha);
22 printf("\tw, h = %d, %d;\n", s->w, s->h);
23 printf("\tpitch = %d;\n", s->pitch);
28 printb(uint32_t n, int bits)
32 for(i=0; i<bits; i++) {
33 if(n & 0x80000000) putchar('1'); else putchar('0');
39 print_mask(struct shape *s)
43 for(i=0; i<s->h; i++) {
44 for(j=0; j<s->mw-1; j++) printb(s->mask[s->mw*i+j], 32);
45 printb(s->mask[s->mw*i+j], s->w % 32);