Răsfoiți Sursa

resource: cleanup

Daniele Bartolini 8 ani în urmă
părinte
comite
6c8fb5867f

+ 1 - 15
src/resource/resource_loader.cpp

@@ -36,21 +36,6 @@ ResourceLoader::~ResourceLoader()
 	_thread.stop();
 }
 
-bool ResourceLoader::can_load(StringId64 type, StringId64 name)
-{
-	StringId64 mix;
-	mix._id = type._id ^ name._id;
-
-	TempAllocator128 ta;
-	DynamicString res_path(ta);
-	mix.to_string(res_path);
-
-	DynamicString path(ta);
-	path::join(path, CROWN_DATA_DIRECTORY, res_path.c_str());
-
-	return _data_filesystem.exists(path.c_str());
-}
-
 void ResourceLoader::add_request(const ResourceRequest& rr)
 {
 	ScopedMutex sm(_mutex);
@@ -114,6 +99,7 @@ s32 ResourceLoader::run()
 		path::join(path, CROWN_DATA_DIRECTORY, res_path.c_str());
 
 		File* file = _data_filesystem.open(path.c_str(), FileOpenMode::READ);
+		CE_ASSERT(file->is_open(), "Can't load resource #ID(%s)", res_path.c_str());
 
 		if (rr.load_function)
 		{

+ 0 - 3
src/resource/resource_loader.h

@@ -53,9 +53,6 @@ struct ResourceLoader
 	///
 	~ResourceLoader();
 
-	/// Returns whether the resource (type, name) can be loaded.
-	bool can_load(StringId64 type, StringId64 name);
-
 	/// Adds a request for loading the resource described by @a rr.
 	void add_request(const ResourceRequest& rr);
 

+ 0 - 9
src/resource/resource_manager.cpp

@@ -43,15 +43,6 @@ void ResourceManager::load(StringId64 type, StringId64 name)
 
 	if (entry == ResourceEntry::NOT_FOUND)
 	{
-		StringId64 mix;
-		mix._id = type._id ^ name._id;
-
-		TempAllocator64 ta;
-		DynamicString path(ta);
-		mix.to_string(path);
-
-		CE_ASSERT(_loader->can_load(type, name), "Can't load resource #ID(%s)", path.c_str());
-
 		ResourceTypeData rtd;
 		rtd.version = UINT32_MAX;
 		rtd.load = NULL;