1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-10-04 21:34:41 +00:00

Fix ttvfs bugs, sync with dev repo

This commit is contained in:
fgenesis 2014-04-07 02:25:58 +02:00
commit b437a7cb2c
13 changed files with 84 additions and 108 deletions

View file

@ -107,18 +107,19 @@ InStream::InStream(const char *fn)
bool InStream::open(const char *fn)
{
ttvfs::File *vf = vfs->GetFile(fn);
if(vf && vf->open("r"))
if(!vf || !vf->open("r"))
{
size_t sz = (size_t)vf->size();
std::string s;
s.resize(sz);
vf->read(&s[0], sz);
str(s);
vf->close();
return true;
setstate(std::ios::failbit);
return false;
}
setstate(std::ios::failbit);
return false;
size_t sz = (size_t)vf->size();
std::string s;
s.resize(sz);
size_t bytes = vf->read(&s[0], sz);
s.resize(bytes);
str(s);
vf->close();
return true;
}
int ttvfs_stdio_fsize(VFILE *f, size_t *sizep)