X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Flistimporter.cpp;h=6245b997d5329995ce002f0b0f688de6b5b379a7;hb=63e709f66d50c124cc0ece2325f4773ac4ae7b20;hp=11b59ea4418b24887607ca2f1e1930f0ea7a3bc2;hpb=4ec81d053bf1d0cbcd9f0bf048914ec8eca08f4c;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/listimporter.cpp b/synfig-core/trunk/src/synfig/listimporter.cpp index 11b59ea..6245b99 100644 --- a/synfig-core/trunk/src/synfig/listimporter.cpp +++ b/synfig-core/trunk/src/synfig/listimporter.cpp @@ -95,9 +95,7 @@ ListImporter::~ListImporter() bool ListImporter::get_frame(Surface &surface,Time time, ProgressCallback *cb) { -// DEBUGPOINT(); - int frame=static_cast(time*fps); -// DEBUGPOINT(); + int frame=round_to_int(time*fps); if(!filename_list.size()) { @@ -106,18 +104,15 @@ ListImporter::get_frame(Surface &surface,Time time, ProgressCallback *cb) return false; } -// DEBUGPOINT(); if(frame<0)frame=0; if(frame>=(signed)filename_list.size())frame=filename_list.size()-1; -// 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); return static_cast(surface); } @@ -125,8 +120,6 @@ ListImporter::get_frame(Surface &surface,Time time, ProgressCallback *cb) Importer::Handle importer(Importer::open(filename_list[frame])); -// DEBUGPOINT(); - if(!importer) { if(cb)cb->error(_("Unable to open ")+filename_list[frame]); @@ -134,8 +127,6 @@ ListImporter::get_frame(Surface &surface,Time time, ProgressCallback *cb) return false; } -// DEBUGPOINT(); - if(!importer->get_frame(surface,0,cb)) { if(cb)cb->error(_("Unable to get frame from ")+filename_list[frame]); @@ -143,21 +134,13 @@ ListImporter::get_frame(Surface &surface,Time time, ProgressCallback *cb) return false; } -// DEBUGPOINT(); - if(frame_cache.size()>=LIST_IMPORTER_CACHE_SIZE) frame_cache.pop_front(); -// DEBUGPOINT(); - - frame_cache.push_back(std::pair(frame,surface)); - -// DEBUGPOINT(); + frame_cache.push_back(std::pair(filename_list[frame],surface)); surface.mirror(frame_cache.back().second); -// DEBUGPOINT(); - return static_cast(surface); }