Răsfoiți Sursa

Return a const pointer to resource data to prevent external modifications

Daniele Bartolini 12 ani în urmă
părinte
comite
8aee1a47be

+ 1 - 1
engine/resource/ResourceManager.cpp

@@ -82,7 +82,7 @@ void ResourceManager::unload(ResourceId name)
 }
 
 //-----------------------------------------------------------------------------
-void* ResourceManager::lookup(const char* type, const char* name)
+const void* ResourceManager::lookup(const char* type, const char* name) const
 {
 	ResourceId id = resource_id(type, name);
 	ResourceEntry* entry = find(id);

+ 1 - 1
engine/resource/ResourceManager.h

@@ -74,7 +74,7 @@ public:
 	void					unload(ResourceId name);
 
 	/// Returns the resource instance associated to the given @a type and @a name.
-	void*					lookup(const char* type, const char* name);
+	const void*				lookup(const char* type, const char* name) const;
 
 	/// Returns whether the manager has the @a name resource into
 	/// its list of resources.