Fix slotinfo for binary save slots

This commit is contained in:
Ilari Liusvaara 2013-08-25 17:44:57 +03:00
parent bf0d0b7ac0
commit 0ac78762a2
2 changed files with 9 additions and 7 deletions

View file

@ -125,13 +125,9 @@ namespace
if(!slotinfo_cache.count(filename)) {
std::ostringstream out;
try {
std::string projid = vector_to_string(read_file_relative(filename + "/projectid",
""));
std::string rerecords = vector_to_string(read_file_relative(filename + "/rerecords",
""));
std::string frame = vector_to_string(read_file_relative(filename + "/saveframe", ""));
if(our_movie.projectid == projid)
out << rerecords << "R/" << frame << "F";
moviefile::brief_info info(filename);
if(our_movie.projectid == info.projectid)
out << info.rerecords << "R/" << info.current_frame << "F";
else
out << "Wrong movie";
} catch(...) {

View file

@ -688,6 +688,12 @@ void moviefile::brief_info::binary_io(std::istream& stream)
case TAG_SAVESTATE:
this->current_frame = s.binary_read_number();
break;
case TAG_RRDATA: {
std::vector<char> c_rrdata;
s.binary_read_blob(c_rrdata);
this->rerecords = rrdata::count(c_rrdata);
break;
}
default:
break;
}