Two fixes
Made InitBack work with .bmp backgrounds, and fixed a file not being closed in Draw.cpp
This commit is contained in:
parent
c44186d93a
commit
0403f26f66
2 changed files with 8 additions and 2 deletions
|
@ -19,8 +19,13 @@ bool InitBack(char *fName, int type)
|
||||||
sprintf(path, "%s/%s.pbm", gDataPath, fName);
|
sprintf(path, "%s/%s.pbm", gDataPath, fName);
|
||||||
|
|
||||||
SDL_Surface *temp = SDL_LoadBMP(path);
|
SDL_Surface *temp = SDL_LoadBMP(path);
|
||||||
|
if (!temp)
|
||||||
|
{
|
||||||
|
sprintf(path, "%s/%s.bmp", gDataPath, fName);
|
||||||
|
temp = SDL_LoadBMP(path);
|
||||||
if (!temp)
|
if (!temp)
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
gBack.partsW = temp->w;
|
gBack.partsW = temp->w;
|
||||||
gBack.partsH = temp->h;
|
gBack.partsH = temp->h;
|
||||||
|
|
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue