- int w2;
- int h2;
-
- image_size(&w2, &h2, src->w, src->h);
-
- if (w) *w = src->w;
- if (h) *h = src->h;
-
- /* Create a new destination surface. */
-
- if ((dst = SDL_CreateRGBSurface(SDL_SWSURFACE, w2, h2, 32,
- RMASK, GMASK, BMASK, AMASK)))
- {
- /* Copy source pixels to the center of the destination. */
-
- rect.x = (Sint16) (w2 - src->w) / 2;
- rect.y = (Sint16) (h2 - src->h) / 2;
-
- SDL_SetAlpha(src, 0, 0);
- SDL_BlitSurface(src, NULL, dst, &rect);
-
- o = make_image_from_surf(W, H, dst);
-
- SDL_FreeSurface(dst);
- }
- SDL_FreeSurface(src);
+ o = make_texture(p, w, h, b);
+ free(p);