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