X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Flistimporter.cpp;h=6245b997d5329995ce002f0b0f688de6b5b379a7;hb=64591d2bbceaf68a64008a0044e2fef3454e44ac;hp=7dcd277d78ec194ec2def2719890f40821493b9b;hpb=cc54c38609ee9745ad678e5e9b9d7d2912be9c95;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/listimporter.cpp b/synfig-core/trunk/src/synfig/listimporter.cpp index 7dcd277..6245b99 100644 --- a/synfig-core/trunk/src/synfig/listimporter.cpp +++ b/synfig-core/trunk/src/synfig/listimporter.cpp @@ -63,7 +63,7 @@ ListImporter::ListImporter(const String &filename) return; } String line; - String prefix=etl::dirname(filename)+ETL_DIRECTORY_SEPERATOR; + String prefix=etl::dirname(filename)+ETL_DIRECTORY_SEPARATOR; while(!stream.eof()) { getline(stream,line); @@ -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); }