git @ Cat's Eye Technologies linapple / 7badcdf
Logging in Asset_LoadBMP. Chris Pressey 3 years ago
1 changed file(s) with 8 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
4444 SDL_Surface *surf;
4545 char *path = (char *)SDL_malloc(sizeof(char[PATH_MAX]));
4646 if (NULL == path) {
47 fprintf(stderr, "Asset_Init: Allocating path: %s\n", SDL_GetError());
47 fprintf(stderr, "Asset_LoadBMP: Allocating path: %s\n", SDL_GetError());
4848 return NULL;
4949 }
5050
5353 if (NULL == surf) {
5454 snprintf(path, PATH_MAX, "%s%s", system_exedir, filename);
5555 surf = SDL_LoadBMP(path);
56 if (NULL == surf) {
57 fprintf(stderr, "Asset_LoadBMP: Couldn't load %s in either %s or %s!\n",
58 filename, system_assets, system_exedir);
59 }
56 }
57
58 if (NULL != surf) {
59 fprintf(stderr, "Asset_LoadBMP: Loaded %s from %s\n", filename, path);
60 } else {
61 fprintf(stderr, "Asset_LoadBMP: Couldn't load %s in either %s or %s!\n",
62 filename, system_assets, system_exedir);
6063 }
6164
6265 SDL_free(path);