From f2638e74c212a3d28a943350ed500440cb706074 Mon Sep 17 00:00:00 2001 From: dooglus Date: Mon, 3 Dec 2007 18:25:49 +0000 Subject: [PATCH] Cache each image file only once, even if it is used multiple times. git-svn-id: http://svn.voria.com/code@1175 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/synfig/listimporter.cpp | 6 +++--- synfig-core/trunk/src/synfig/listimporter.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/synfig-core/trunk/src/synfig/listimporter.cpp b/synfig-core/trunk/src/synfig/listimporter.cpp index 11b59ea..30bb899 100644 --- a/synfig-core/trunk/src/synfig/listimporter.cpp +++ b/synfig-core/trunk/src/synfig/listimporter.cpp @@ -112,10 +112,10 @@ ListImporter::get_frame(Surface &surface,Time time, ProgressCallback *cb) // DEBUGPOINT(); // See if that frame is cached - std::list >::iterator iter; + std::list >::iterator iter; for(iter=frame_cache.begin();iter!=frame_cache.end();++iter) { - if(iter->first==frame) + if(iter->first==filename_list[frame]) { // DEBUGPOINT(); surface.mirror(iter->second); @@ -150,7 +150,7 @@ ListImporter::get_frame(Surface &surface,Time time, ProgressCallback *cb) // DEBUGPOINT(); - frame_cache.push_back(std::pair(frame,surface)); + frame_cache.push_back(std::pair(filename_list[frame],surface)); // DEBUGPOINT(); diff --git a/synfig-core/trunk/src/synfig/listimporter.h b/synfig-core/trunk/src/synfig/listimporter.h index 5cd1b2b..84d5179 100644 --- a/synfig-core/trunk/src/synfig/listimporter.h +++ b/synfig-core/trunk/src/synfig/listimporter.h @@ -50,7 +50,7 @@ class ListImporter : public Importer { float fps; std::vector filename_list; - std::list > frame_cache; + std::list > frame_cache; protected: ListImporter(const String &filename); -- 2.7.4