- unsigned char * ptr = (unsigned char *) userdata;
- for (int i = 0; i < 32; i+=4) {
- /* fprintf(stdout, "userdata: pos: %d - %d\n", i, *ptr++); */
- for (int j = 0; j < 4; ++j) {
- for (int x = 0; x < 8; ++x) {
- buf[i + j] = ptr[x] << j;
- }
- /* printf("%d: %x\n", i+j, buf[i+j]); */
- }
- ptr += 8;
- }
+ gfx->width = img->w;
+ gfx->height = img->h;
+ gfx->bpp = img->format->BitsPerPixel;
+
+ /* set userdata to iterate */
+ SDL_LockSurface(img);
+ img->userdata = img->pixels;
+ SDL_UnlockSurface(img);