Panagiotis Christopoulos Charitos 15 ani în urmă
părinte
comite
1893f32b6a

Fișier diff suprimat deoarece este prea mare
+ 0 - 1
build/debug/Makefile


+ 5 - 13
src/Resources/Core/ResourceManager.h

@@ -2,11 +2,12 @@
 #define RESOURCE_MANAGER_H
 
 #include <list>
-#include <boost/ptr_container/ptr_list.hpp>
+#include <boost/ptr_container/ptr_vector.hpp>
 #include <string>
 #include "Singleton.h"
 #include "AsyncLoader.h"
 #include "Properties.h"
+#include "RsrcHook.h"
 
 
 class Texture;
@@ -23,16 +24,6 @@ class Skin;
 class DummyRsrc;
 
 
-/// Holds information about a resource
-template<typename Type>
-struct RsrcHook
-{
-	std::string uuid; ///< Unique identifier
-	int referenceCounter;
-	Type* resource;
-};
-
-
 /// Responsible of loading and unloading resources
 class ResourceManager
 {
@@ -102,13 +93,14 @@ class ResourceManager
 		struct LoadingRequest: public LoadingRequestBase
 		{
 			public:
-				GETTER_RW(Type, object, getObject)
+				//LoadingRequestBase
+				//GETTER_RW(Type, object, getObject)
 
 			private:
 				Type object; ///< The object to load
 		};
 
-		boost::ptr_list<LoadingRequestBase> loadingRequests; ///< Loading requests
+		boost::ptr_vector<LoadingRequestBase> loadingRequests; ///< Loading requests
 
 		AsyncLoader al; ///< Asynchronous loader
 

+ 2 - 8
src/Resources/Core/ResourceManager.inl.h

@@ -37,16 +37,10 @@ typename ResourceManager::Types<Type>::Hook& ResourceManager::load(const char* f
 			}
 		}
 
-		c.push_back(typename Types<Type>::Hook());
-		it = c.end();
-		--it;
-
-		it->uuid = filename;
-		it->referenceCounter = 1;
-		it->resource = newInstance;
+		c.push_back(typename Types<Type>::Hook(filename, 1, newInstance));
 	}
 
-	return *it;
+	return c.back();
 }
 
 

+ 27 - 0
src/Resources/Core/RsrcHook.h

@@ -0,0 +1,27 @@
+#ifndef RSRC_HOOK_H
+#define RSRC_HOOK_H
+
+#include <string>
+
+
+/// Holds information about a resource
+template<typename Type>
+struct RsrcHook
+{
+	RsrcHook(const char* uuid, int reference, Type* resource);
+
+	std::string uuid; ///< Unique identifier
+	int referenceCounter;
+	Type* resource;
+};
+
+
+template<typename Type>
+RsrcHook<Type>::RsrcHook(const char* uuid_, int referenceCounter_, Type* resource_): 
+	uuid(uuid_),
+	referenceCounter(referenceCounter_),
+	resource(resource_)
+{}
+
+
+#endif

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff