Mercurial > fife-parpg
comparison 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 |
comparison
equal
deleted
inserted
replaced
149:823544621b5b | 150:6e7d228def30 |
---|---|
20 ***************************************************************************/ | 20 ***************************************************************************/ |
21 %module fife | 21 %module fife |
22 | 22 |
23 %{ | 23 %{ |
24 #include "util/resource/resource.h" | 24 #include "util/resource/resource.h" |
25 #include "util/resource/resource_ptr.h" | |
25 #include "util/resource/resource_location.h" | 26 #include "util/resource/resource_location.h" |
26 #include "util/resource/pool.h" | 27 #include "util/resource/pool.h" |
27 %} | 28 %} |
28 | 29 |
29 namespace FIFE { | 30 namespace FIFE { |
94 virtual void printStatistics(); | 95 virtual void printStatistics(); |
95 | 96 |
96 private: | 97 private: |
97 Pool(); | 98 Pool(); |
98 }; | 99 }; |
100 | |
101 class ResourcePtr { | |
102 public: | |
103 ResourcePtr(IResource* ptr = 0); | |
104 ResourcePtr(Pool* pool,int index); | |
105 ResourcePtr(const ResourcePtr& r); | |
106 void release(); | |
107 void load(); | |
108 void unload(); | |
109 }; | |
99 } | 110 } |