plazma_arrow_shot_snapshots/Shared.c
/*
 * Several functions have their interfaces explained as a comment commented in
 * the header file. Check it out.
 */
Several functions have their interfaces explained as a comment commented in
the header file. Check it out.
Several functions have their interfaces explained as a comment commented in the header file . Check it out .
int
SHR_LoadImage(SDL_Renderer *rend,
              const char *file_name,
              struct SHR_Image *out_img)
{
  SDL_Surface *surf = IMG_Load(file_name);
  if (!surf) {
    return -1;
  }
  SDL_Texture *tex = SDL_CreateTextureFromSurface(rend, surf);
  out_img->w = surf->w;
  out_img->h = surf->h;
  SDL_FreeSurface(surf);
  if (!tex) {
    return -1;
  }
  out_img->tex = tex;
  return 0;
}
int SHR_LoadImage ( SDL_Renderer * rend , const char * file_name , struct SHR_Image * out_img ) { SDL_Surface * surf = IMG_Load ( file_name ) ; if ( ! surf ) { return -1 ; } SDL_Texture * tex = SDL_CreateTextureFromSurface ( rend , surf ) ; out_img -> w = surf -> w ; out_img -> h = surf -> h ; SDL_FreeSurface ( surf ) ; if ( ! tex ) { return -1 ; } out_img -> tex = tex ; return 0 ; }
Several functions have their interfaces explained as a comment commented in
 the header file.
Several functions have their interfaces explained as a comment commented in the header file .