- struct base_sprite *spr = &sprite->sprite;
- spr->image = load_image(filename);
- if(!spr->image) return;
- if(!spr->shape) {
- spr->shape = malloc(sizeof(struct shape));
- if(!spr->shape) {
- fprintf(stderr, "load_sprite(): can't allocate shape structure.\n");
- exit(1);
- }
- get_shape(spr->image, spr->shape);
- }