Commits

Bart van Strien committed f772a42

Drop old require syntax (no more .lua extension)

Comments (0)

Files changed (3)

src/modules/filesystem/physfs/wrap_Filesystem.cpp

 		const char * filename = lua_tostring(L, -1);
 
 		std::string tmp(filename);
+		tmp += ".lua";
 
 		int size = tmp.size();
 
-		if(size <= 4 || strcmp(filename + (size-4), ".lua") != 0)
-		{
-			tmp.append(".lua");
-			size = tmp.size();
-		}
-
 		for(int i=0;i<size-4;i++)
 		{
 			if(tmp[i] == '.')
 			}
 		}
 
-		lua_pushfstring(L, "\n\tno file \"%s\" in LOVE game directories.\n", tmp.c_str());
+		lua_pushfstring(L, "\n\tno file \"%s\" in LOVE game directories.\n", (tmp + ".lua").c_str());
 		return 1;
 	}
 

src/scripts/boot.lua

 
 	-- If config file exists, load it and allow it to update config table.
 	if not love.conf and love.filesystem and love.filesystem.exists("conf.lua") then
-		require("conf.lua")
+		require("conf")
 	end
 
 	-- Yes, conf.lua might not exist, but there are other ways of making
 	if love.filesystem then
 		love.filesystem.setRelease(c.release and is_fused_game)
 		if c.identity then love.filesystem.setIdentity(c.identity) end
-		if love.filesystem.exists("main.lua") then require("main.lua") end
+		if love.filesystem.exists("main.lua") then require("main") end
 	end
 
 	if no_game_code then

src/scripts/boot.lua.h

 	0x6d, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 
 	0x74, 0x65, 0x6d, 0x2e, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x28, 0x22, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x6c, 
 	0x75, 0x61, 0x22, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
-	0x09, 0x09, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x28, 0x22, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x6c, 0x75, 
-	0x61, 0x22, 0x29, 0x0a,
+	0x09, 0x09, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x28, 0x22, 0x63, 0x6f, 0x6e, 0x66, 0x22, 0x29, 0x0a,
 	0x09, 0x65, 0x6e, 0x64, 0x0a,0x0a,
 	0x09, 0x2d, 0x2d, 0x20, 0x59, 0x65, 0x73, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x6c, 0x75, 0x61, 0x20, 
 	0x6d, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, 0x2c, 0x20, 0x62, 
 	0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 
 	0x65, 0x6d, 0x2e, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x28, 0x22, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x6c, 0x75, 
 	0x61, 0x22, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x28, 0x22, 
-	0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x6c, 0x75, 0x61, 0x22, 0x29, 0x20, 0x65, 0x6e, 0x64, 0x0a,
+	0x6d, 0x61, 0x69, 0x6e, 0x22, 0x29, 0x20, 0x65, 0x6e, 0x64, 0x0a,
 	0x09, 0x65, 0x6e, 0x64, 0x0a,0x0a,
 	0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x5f, 0x67, 0x61, 0x6d, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x74, 
 	0x68, 0x65, 0x6e, 0x0a,