comparison engine/core/video/video.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 90005975cdbb
children 376b8afc9a18
comparison
equal deleted inserted replaced
149:823544621b5b 150:6e7d228def30
87 87
88 class Animation: public ResourceClass { 88 class Animation: public ResourceClass {
89 public: 89 public:
90 explicit Animation(); 90 explicit Animation();
91 ~Animation(); 91 ~Animation();
92 void addFrame(Image* image, unsigned int duration); 92 void addFrame(ResourcePtr image, unsigned int duration);
93 int getFrameIndex(unsigned int timestamp); 93 int getFrameIndex(unsigned int timestamp);
94 Image* getFrame(int index); 94 Image* getFrame(int index);
95 Image* getFrameByTimestamp(unsigned int timestamp); 95 Image* getFrameByTimestamp(unsigned int timestamp);
96 int getFrameDuration(int index); 96 int getFrameDuration(int index);
97 unsigned int getNumFrames() const; 97 unsigned int getNumFrames() const;