Mantis: #18 - Move components from global namespace into their own namespace.

Moving classes from components/bsa into Bsa namespace.

Signed-off-by: Lukasz Gromanowski <lgromanowski@gmail.com>
actorid
Lukasz Gromanowski 14 years ago
parent a6e83f5b9b
commit 8a84201ba2

@ -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());
}
}

@ -29,8 +29,12 @@
#include "bsa_file.hpp"
#include <libs/mangle/stream/clients/ogre_datastream.hpp>
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);
}
}

@ -23,11 +23,16 @@
#include <string>
#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

@ -32,6 +32,7 @@
using namespace std;
using namespace Mangle::Stream;
using namespace Bsa;
/// Error handling
void BSAFile::fail(const string &msg)

@ -21,8 +21,8 @@
*/
#ifndef _BSA_FILE_H_
#define _BSA_FILE_H_
#ifndef BSA_BSA_FILE_H
#define BSA_BSA_FILE_H
#include <libs/mangle/stream/stream.hpp>
#include <libs/platform/stdint.h>
@ -31,6 +31,9 @@
#include <vector>
#include <map>
namespace Bsa
{
/**
This class is used to read "Bethesda Archive Files", or BSAs.
*/
@ -131,4 +134,6 @@ class BSAFile
{ return files; }
};
}
#endif

@ -11,6 +11,7 @@
#include <iostream>
using namespace std;
using namespace Bsa;
BSAFile bsa;

@ -11,6 +11,7 @@
using namespace std;
using namespace Mangle::Stream;
using namespace Bsa;
int main(int argc, char** argv)
{

@ -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";

Loading…
Cancel
Save