shithub: cstory

Download patch

ref: 0403f26f6638ec0701a3fba8fe1bb125cf9c41bd
parent: c44186d93a83aa912b96347fbefa606c28bee8c9
author: Clownacy <[email protected]>
date: Fri Feb 15 15:52:03 EST 2019

Two fixes

Made InitBack work with .bmp backgrounds, and fixed a file not being
closed in Draw.cpp

--- a/src/Back.cpp
+++ b/src/Back.cpp
@@ -20,8 +20,13 @@
 	
 	SDL_Surface *temp = SDL_LoadBMP(path);
 	if (!temp)
-		return false;
-	
+	{
+		sprintf(path, "%s/%s.bmp", gDataPath, fName);
+		temp = SDL_LoadBMP(path);
+		if (!temp)
+			return false;
+	}
+
 	gBack.partsW = temp->w;
 	gBack.partsH = temp->h;
 	
--- a/src/Draw.cpp
+++ b/src/Draw.cpp
@@ -305,6 +305,7 @@
 		if (!IsEnableBitmap(fp))
 		{
 			printf("Tried to load bitmap to surface %d, but it's missing the '(C)Pixel' string\n", surf_no);
+			fp->close(fp);
 		}
 		else
 		{