mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 14:18:37 +00:00
Readd openNewStream function for gzdopen() via SMUSH
This commit is contained in:
parent
135bea3ba8
commit
ea93407848
10
lab.cpp
10
lab.cpp
@ -90,6 +90,16 @@ Block *Lab::getFileBlock(const char *filename) const {
|
||||
return new Block(data, i->second.len);
|
||||
}
|
||||
|
||||
std::FILE *Lab::openNewStream(const char *filename) const {
|
||||
file_map_type::const_iterator i = find_filename(filename);
|
||||
if (i == file_map_.end())
|
||||
return NULL;
|
||||
|
||||
std::fseek(f_, i->second.offset, SEEK_SET);
|
||||
|
||||
return f_;
|
||||
}
|
||||
|
||||
int Lab::fileLength(const char *filename) const {
|
||||
file_map_type::const_iterator i = find_filename(filename);
|
||||
if (i == file_map_.end())
|
||||
|
15
resource.cpp
15
resource.cpp
@ -113,13 +113,14 @@ Block *ResourceLoader::getFileBlock(const char *filename) const {
|
||||
return l->getFileBlock(filename);
|
||||
}
|
||||
|
||||
//std::FILE *ResourceLoader::openNewStream(const char *filename) const {
|
||||
// const Lab *l = findFile(filename);
|
||||
// if (l == NULL)
|
||||
// return NULL;
|
||||
// else
|
||||
// return l->openNewStream(filename);
|
||||
//}
|
||||
std::FILE *ResourceLoader::openNewStream(const char *filename) const {
|
||||
const Lab *l = findFile(filename);
|
||||
|
||||
if (l == NULL)
|
||||
return NULL;
|
||||
else
|
||||
return l->openNewStream(filename);
|
||||
}
|
||||
|
||||
int ResourceLoader::fileLength(const char *filename) const {
|
||||
const Lab *l = findFile(filename);
|
||||
|
Loading…
Reference in New Issue
Block a user