Diff

util/pluginloader.lua @ 4152:4d52812d018d

util.pluginloader: Remove unused support for custom loaders, to simplify further refactoring.
author Waqas Hussain <waqas20@gmail.com>
date Sun, 20 Feb 2011 20:11:52 +0500
parent 4150:2894ca33ec45
child 4154:3785a9bb7f11
line wrap: on
line diff
--- a/util/pluginloader.lua	Sun Feb 20 20:06:38 2011 +0500
+++ b/util/pluginloader.lua	Sun Feb 20 20:11:52 2011 +0500
@@ -32,28 +32,24 @@
 	return content, path;
 end
 
-function load_resource(plugin, resource, loader)
+function load_resource(plugin, resource)
 	local path, name = plugin:match("([^/]*)/?(.*)");
 	if name == "" then
 		if not resource then
 			resource = "mod_"..plugin..".lua";
 		end
-		loader = loader or load_file;
 
-		local content, err = loader(plugin.."/"..resource);
-		if not content then content, err = loader(resource); end
-		-- TODO add support for packed plugins
+		local content, err = load_file(plugin.."/"..resource);
+		if not content then content, err = load_file(resource); end
 		
 		return content, err;
 	else
 		if not resource then
 			resource = "mod_"..name..".lua";
 		end
-		loader = loader or load_file;
 
-		local content, err = loader(plugin.."/"..resource);
-		if not content then content, err = loader(path.."/"..resource); end
-		-- TODO add support for packed plugins
+		local content, err = load_file(plugin.."/"..resource);
+		if not content then content, err = load_file(path.."/"..resource); end
 		
 		return content, err;
 	end