diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index b2ed0a7675..e1386d3c4f 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -246,7 +246,7 @@ void OMW::Engine::loadBSA() for (Files::MultiDirCollection::TIter iter (bsa.begin()); iter!=bsa.end(); ++iter) { std::cout << "Adding " << iter->second.string() << std::endl; - addBSA (iter->second.string()); + Bsa::addBSA (iter->second.string()); } } diff --git a/components/bsa/bsa_archive.cpp b/components/bsa/bsa_archive.cpp index 4691eb5468..937a21d0a9 100644 --- a/components/bsa/bsa_archive.cpp +++ b/components/bsa/bsa_archive.cpp @@ -29,8 +29,12 @@ #include "bsa_file.hpp" #include +namespace +{ + using namespace Ogre; using namespace Mangle::Stream; +using namespace Bsa; /// An OGRE Archive wrapping a BSAFile archive class BSAArchive : public Archive @@ -155,6 +159,11 @@ static void insertBSAFactory() } } +} + +namespace Bsa +{ + // The function below is the only publicly exposed part of this file void addBSA(const std::string& name, const std::string& group) @@ -163,3 +172,5 @@ void addBSA(const std::string& name, const std::string& group) ResourceGroupManager::getSingleton(). addResourceLocation(name, "BSA", group); } + +} diff --git a/components/bsa/bsa_archive.hpp b/components/bsa/bsa_archive.hpp index bde6d9c3b3..9054966db9 100644 --- a/components/bsa/bsa_archive.hpp +++ b/components/bsa/bsa_archive.hpp @@ -23,11 +23,16 @@ #include -#ifndef _BSA_ARCHIVE_H_ -#define _BSA_ARCHIVE_H_ +#ifndef BSA_BSA_ARCHIVE_H +#define BSA_BSA_ARCHIVE_H + +namespace Bsa +{ /// Add the given BSA file as an input archive in the Ogre resource /// system. void addBSA(const std::string& file, const std::string& group="General"); +} + #endif diff --git a/components/bsa/bsa_file.cpp b/components/bsa/bsa_file.cpp index e37d38bb2d..95358a3628 100644 --- a/components/bsa/bsa_file.cpp +++ b/components/bsa/bsa_file.cpp @@ -32,6 +32,7 @@ using namespace std; using namespace Mangle::Stream; +using namespace Bsa; /// Error handling void BSAFile::fail(const string &msg) diff --git a/components/bsa/bsa_file.hpp b/components/bsa/bsa_file.hpp index 7ec101b43b..f54a64d2af 100644 --- a/components/bsa/bsa_file.hpp +++ b/components/bsa/bsa_file.hpp @@ -21,8 +21,8 @@ */ -#ifndef _BSA_FILE_H_ -#define _BSA_FILE_H_ +#ifndef BSA_BSA_FILE_H +#define BSA_BSA_FILE_H #include #include @@ -31,6 +31,9 @@ #include #include +namespace Bsa +{ + /** This class is used to read "Bethesda Archive Files", or BSAs. */ @@ -131,4 +134,6 @@ class BSAFile { return files; } }; +} + #endif diff --git a/components/bsa/tests/bsa_file_test.cpp b/components/bsa/tests/bsa_file_test.cpp index ea3f9291c8..07ee73d17e 100644 --- a/components/bsa/tests/bsa_file_test.cpp +++ b/components/bsa/tests/bsa_file_test.cpp @@ -11,6 +11,7 @@ #include using namespace std; +using namespace Bsa; BSAFile bsa; diff --git a/components/bsa/tests/bsatool.cpp b/components/bsa/tests/bsatool.cpp index da96c2ed5a..df37e3827c 100644 --- a/components/bsa/tests/bsatool.cpp +++ b/components/bsa/tests/bsatool.cpp @@ -11,6 +11,7 @@ using namespace std; using namespace Mangle::Stream; +using namespace Bsa; int main(int argc, char** argv) { diff --git a/components/bsa/tests/ogre_archive_test.cpp b/components/bsa/tests/ogre_archive_test.cpp index 1a4334e60f..9cd57240f8 100644 --- a/components/bsa/tests/ogre_archive_test.cpp +++ b/components/bsa/tests/ogre_archive_test.cpp @@ -19,7 +19,7 @@ int main() Root *root = new Root("","",""); // Add the BSA - addBSA("../../data/Morrowind.bsa"); + Bsa::addBSA("../../data/Morrowind.bsa"); // Pick a sample file String tex = "textures\\tx_natural_cavern_wall13.dds";