diff engine/core/util/resource/resource.i @ 150:6e7d228def30

Lazy loading for animations. Uses a Resource-Pointer class that behaves like a pointer to an IResource, but only loads the resource on demand. There's a slight change of API, which is already adapted to in the XML loaders. If you use Animation.addFrame directly, either adapt to the change or wait a few hours for a backwards compatibility solution.
author phoku@33b003aa-7bff-0310-803a-e67f0ece8222
date Sat, 11 Oct 2008 12:03:59 +0000
parents 72c25cc27d8b
children 679ed3e15513
line wrap: on
line diff
--- a/engine/core/util/resource/resource.i	Sat Oct 11 06:23:45 2008 +0000
+++ b/engine/core/util/resource/resource.i	Sat Oct 11 12:03:59 2008 +0000
@@ -22,6 +22,7 @@
 
 %{
 #include "util/resource/resource.h"
+#include "util/resource/resource_ptr.h"
 #include "util/resource/resource_location.h"
 #include "util/resource/pool.h"
 %}
@@ -96,4 +97,14 @@
 	private:
 		Pool();
 	};	
+
+	class ResourcePtr {
+	public:
+		ResourcePtr(IResource* ptr = 0);
+		ResourcePtr(Pool* pool,int index);
+		ResourcePtr(const ResourcePtr& r);
+		void release();
+		void load();
+		void unload();
+	};
 }