projects
/
synfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Avoid warning.
[synfig.git]
/
synfig-core
/
trunk
/
src
/
synfig
/
listimporter.cpp
diff --git
a/synfig-core/trunk/src/synfig/listimporter.cpp
b/synfig-core/trunk/src/synfig/listimporter.cpp
index
7dcd277
..
6245b99
100644
(file)
--- 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;
return;
}
String line;
- String prefix=etl::dirname(filename)+ETL_DIRECTORY_SEP
E
RATOR;
+ String prefix=etl::dirname(filename)+ETL_DIRECTORY_SEP
A
RATOR;
while(!stream.eof())
{
getline(stream,line);
while(!stream.eof())
{
getline(stream,line);
@@
-95,9
+95,7
@@
ListImporter::~ListImporter()
bool
ListImporter::get_frame(Surface &surface,Time time, ProgressCallback *cb)
{
bool
ListImporter::get_frame(Surface &surface,Time time, ProgressCallback *cb)
{
-// DEBUGPOINT();
- int frame=static_cast<int>(time*fps);
-// DEBUGPOINT();
+ int frame=round_to_int(time*fps);
if(!filename_list.size())
{
if(!filename_list.size())
{
@@
-106,18
+104,15
@@
ListImporter::get_frame(Surface &surface,Time time, ProgressCallback *cb)
return false;
}
return false;
}
-// DEBUGPOINT();
if(frame<0)frame=0;
if(frame>=(signed)filename_list.size())frame=filename_list.size()-1;
if(frame<0)frame=0;
if(frame>=(signed)filename_list.size())frame=filename_list.size()-1;
-// DEBUGPOINT();
// See if that frame is cached
// See if that frame is cached
- std::list<std::pair<
int
,Surface> >::iterator iter;
+ std::list<std::pair<
String
,Surface> >::iterator iter;
for(iter=frame_cache.begin();iter!=frame_cache.end();++iter)
{
for(iter=frame_cache.begin();iter!=frame_cache.end();++iter)
{
- if(iter->first==f
rame
)
+ if(iter->first==f
ilename_list[frame]
)
{
{
-// DEBUGPOINT();
surface.mirror(iter->second);
return static_cast<bool>(surface);
}
surface.mirror(iter->second);
return static_cast<bool>(surface);
}
@@
-125,8
+120,6
@@
ListImporter::get_frame(Surface &surface,Time time, ProgressCallback *cb)
Importer::Handle importer(Importer::open(filename_list[frame]));
Importer::Handle importer(Importer::open(filename_list[frame]));
-// DEBUGPOINT();
-
if(!importer)
{
if(cb)cb->error(_("Unable to open ")+filename_list[frame]);
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;
}
return false;
}
-// DEBUGPOINT();
-
if(!importer->get_frame(surface,0,cb))
{
if(cb)cb->error(_("Unable to get frame from ")+filename_list[frame]);
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;
}
return false;
}
-// DEBUGPOINT();
-
if(frame_cache.size()>=LIST_IMPORTER_CACHE_SIZE)
frame_cache.pop_front();
if(frame_cache.size()>=LIST_IMPORTER_CACHE_SIZE)
frame_cache.pop_front();
-// DEBUGPOINT();
-
- frame_cache.push_back(std::pair<int,Surface>(frame,surface));
-
-// DEBUGPOINT();
+ frame_cache.push_back(std::pair<String,Surface>(filename_list[frame],surface));
surface.mirror(frame_cache.back().second);
surface.mirror(frame_cache.back().second);
-// DEBUGPOINT();
-
return static_cast<bool>(surface);
}
return static_cast<bool>(surface);
}