diff --git a/doomsday/engine/portable/include/file.h b/doomsday/engine/portable/include/file.h index b67a5d382c..96dccf7788 100644 --- a/doomsday/engine/portable/include/file.h +++ b/doomsday/engine/portable/include/file.h @@ -69,12 +69,12 @@ class File1 public: /** - * @param path Path to this file in the virtual file system. * @param hndl Handle to the file. Ownership of the handle is given to this instance. + * @param path Path to this file in the virtual file system. * @param info Info descriptor for the file. A copy is made. * @param container Container of this file. Can be @c NULL. */ - File1(char const* _path, FileHandle& hndl, FileInfo const& _info, File1* container = 0); + File1(FileHandle& hndl, char const* _path, FileInfo const& _info, File1* container = 0); /** * Release all memory acquired for objects linked with this resource. diff --git a/doomsday/engine/portable/include/fs_main.h b/doomsday/engine/portable/include/fs_main.h index 6f52fb40c2..55146f060e 100644 --- a/doomsday/engine/portable/include/fs_main.h +++ b/doomsday/engine/portable/include/fs_main.h @@ -260,7 +260,7 @@ namespace de * * @return Number of files found. */ - int findAll(bool (*predicate)(FileHandle* hndl, void* parameters), void* parameters, + int findAll(bool (*predicate)(File1& file, void* parameters), void* parameters, FileList& found) const; /** @@ -276,7 +276,7 @@ namespace de * @return Number of files found. */ template - int findAll(bool (*predicate)(FileHandle* hndl, void* parameters), void* parameters, + int findAll(bool (*predicate)(File1& file, void* parameters), void* parameters, FileList& found) const { findAll(predicate, parameters, found); diff --git a/doomsday/engine/portable/src/file.cpp b/doomsday/engine/portable/src/file.cpp index 64c3e672c3..d7c1ae10c2 100644 --- a/doomsday/engine/portable/src/file.cpp +++ b/doomsday/engine/portable/src/file.cpp @@ -30,7 +30,7 @@ namespace de { -File1::File1(char const* _path, FileHandle& hndl, FileInfo const& _info, File1* _container) +File1::File1(FileHandle& hndl, char const* _path, FileInfo const& _info, File1* _container) : handle_(&hndl), info_(_info), container_(_container), flags(DefaultFlags) { // Used to favor newer files when duplicates are pruned. diff --git a/doomsday/engine/portable/src/fs_main.cpp b/doomsday/engine/portable/src/fs_main.cpp index 7486b44224..31de90bf51 100644 --- a/doomsday/engine/portable/src/fs_main.cpp +++ b/doomsday/engine/portable/src/fs_main.cpp @@ -931,14 +931,14 @@ int FS1::findAll(FS1::FileList& found) const return numFound; } -int FS1::findAll(bool (*predicate)(de::FileHandle* hndl, void* parameters), void* parameters, +int FS1::findAll(bool (*predicate)(de::File1& file, void* parameters), void* parameters, FS1::FileList& found) const { int numFound = 0; DENG2_FOR_EACH(i, d->loadedFiles, FS1::FileList::const_iterator) { // Interested in this file? - if(predicate && !predicate(*i, parameters)) continue; // Nope. + if(predicate && !predicate((*i)->file(), parameters)) continue; // Nope. found.push_back(*i); numFound += 1; @@ -1110,7 +1110,7 @@ de::File1& FS1::interpret(de::FileHandle& hndl, char const* path, FileInfo const } else { - interpretedFile = new File1(path, hndl, info); + interpretedFile = new File1(hndl, path, info); } } @@ -1971,9 +1971,8 @@ static ddstring_t* composeFilePathString(FS1::FileList& files, int flags = DEFAU return str; } -static bool findCustomFilesPredicate(de::FileHandle* hndl, void* /*parameters*/) +static bool findCustomFilesPredicate(de::File1& file, void* /*parameters*/) { - de::File1& file = hndl->file(); if(file.hasCustom()) { ddstring_t const* path = file.path(); diff --git a/doomsday/engine/portable/src/lumpfileadaptor.cpp b/doomsday/engine/portable/src/lumpfileadaptor.cpp index 78cf3e0026..edd1a4a919 100644 --- a/doomsday/engine/portable/src/lumpfileadaptor.cpp +++ b/doomsday/engine/portable/src/lumpfileadaptor.cpp @@ -27,7 +27,7 @@ namespace de { LumpFileAdaptor::LumpFileAdaptor(FileHandle& hndl, char const* path, FileInfo const& info, File1* container) - : File1(path, hndl, info, container) + : File1(hndl, path, info, container) {} LumpFileAdaptor::~LumpFileAdaptor() diff --git a/doomsday/engine/portable/src/wad.cpp b/doomsday/engine/portable/src/wad.cpp index c31ae9ae7b..2f1f9b599a 100644 --- a/doomsday/engine/portable/src/wad.cpp +++ b/doomsday/engine/portable/src/wad.cpp @@ -59,7 +59,7 @@ class WadFile : public File1 { public: WadFile::WadFile(FileHandle& hndl, char const* path, FileInfo const& info, File1* container) - : File1(path, hndl, info, container), crc_(0) + : File1(hndl, path, info, container), crc_(0) {} uint crc() const { return crc_; } @@ -289,7 +289,7 @@ struct Wad::Instance }; Wad::Wad(FileHandle& hndl, char const* path, FileInfo const& info, File1* container) - : File1(path, hndl, info, container) + : File1(hndl, path, info, container) { d = new Instance(this, hndl, path); } diff --git a/doomsday/engine/portable/src/zip.cpp b/doomsday/engine/portable/src/zip.cpp index 8e3fd1cfaf..f15f2de2d3 100644 --- a/doomsday/engine/portable/src/zip.cpp +++ b/doomsday/engine/portable/src/zip.cpp @@ -142,7 +142,7 @@ class ZipFile : public File1 { public: ZipFile::ZipFile(FileHandle& hndl, char const* path, FileInfo const& info, File1* container) - : File1(path, hndl, info, container) + : File1(hndl, path, info, container) {} }; @@ -458,7 +458,7 @@ struct Zip::Instance }; Zip::Zip(FileHandle& hndl, char const* path, FileInfo const& info, File1* container) - : File1(path, hndl, info, container) + : File1(hndl, path, info, container) { d = new Instance(this); }