Two fixes

Made InitBack work with .bmp backgrounds, and fixed a file not being
closed in Draw.cpp
This commit is contained in:
Clownacy 2019-02-15 20:52:03 +00:00
parent c44186d93a
commit 0403f26f66
2 changed files with 8 additions and 2 deletions

View file

@ -20,7 +20,12 @@ bool InitBack(char *fName, int type)
SDL_Surface *temp = SDL_LoadBMP(path); SDL_Surface *temp = SDL_LoadBMP(path);
if (!temp) if (!temp)
return false; {
sprintf(path, "%s/%s.bmp", gDataPath, fName);
temp = SDL_LoadBMP(path);
if (!temp)
return false;
}
gBack.partsW = temp->w; gBack.partsW = temp->w;
gBack.partsH = temp->h; gBack.partsH = temp->h;

View file

@ -305,6 +305,7 @@ static bool LoadBitmap_File(const char *name, int surf_no, bool create_surface)
if (!IsEnableBitmap(fp)) if (!IsEnableBitmap(fp))
{ {
printf("Tried to load bitmap to surface %d, but it's missing the '(C)Pixel' string\n", surf_no); printf("Tried to load bitmap to surface %d, but it's missing the '(C)Pixel' string\n", surf_no);
fp->close(fp);
} }
else else
{ {