mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 20:19:57 +00:00
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>
This commit is contained in:
parent
a6e83f5b9b
commit
8a84201ba2
8 changed files with 30 additions and 6 deletions
|
@ -246,7 +246,7 @@ void OMW::Engine::loadBSA()
|
||||||
for (Files::MultiDirCollection::TIter iter (bsa.begin()); iter!=bsa.end(); ++iter)
|
for (Files::MultiDirCollection::TIter iter (bsa.begin()); iter!=bsa.end(); ++iter)
|
||||||
{
|
{
|
||||||
std::cout << "Adding " << iter->second.string() << std::endl;
|
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 "bsa_file.hpp"
|
||||||
#include <libs/mangle/stream/clients/ogre_datastream.hpp>
|
#include <libs/mangle/stream/clients/ogre_datastream.hpp>
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
|
||||||
using namespace Ogre;
|
using namespace Ogre;
|
||||||
using namespace Mangle::Stream;
|
using namespace Mangle::Stream;
|
||||||
|
using namespace Bsa;
|
||||||
|
|
||||||
/// An OGRE Archive wrapping a BSAFile archive
|
/// An OGRE Archive wrapping a BSAFile archive
|
||||||
class BSAArchive : public 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
|
// The function below is the only publicly exposed part of this file
|
||||||
|
|
||||||
void addBSA(const std::string& name, const std::string& group)
|
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().
|
ResourceGroupManager::getSingleton().
|
||||||
addResourceLocation(name, "BSA", group);
|
addResourceLocation(name, "BSA", group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -23,11 +23,16 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#ifndef _BSA_ARCHIVE_H_
|
#ifndef BSA_BSA_ARCHIVE_H
|
||||||
#define _BSA_ARCHIVE_H_
|
#define BSA_BSA_ARCHIVE_H
|
||||||
|
|
||||||
|
namespace Bsa
|
||||||
|
{
|
||||||
|
|
||||||
/// Add the given BSA file as an input archive in the Ogre resource
|
/// Add the given BSA file as an input archive in the Ogre resource
|
||||||
/// system.
|
/// system.
|
||||||
void addBSA(const std::string& file, const std::string& group="General");
|
void addBSA(const std::string& file, const std::string& group="General");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace Mangle::Stream;
|
using namespace Mangle::Stream;
|
||||||
|
using namespace Bsa;
|
||||||
|
|
||||||
/// Error handling
|
/// Error handling
|
||||||
void BSAFile::fail(const string &msg)
|
void BSAFile::fail(const string &msg)
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _BSA_FILE_H_
|
#ifndef BSA_BSA_FILE_H
|
||||||
#define _BSA_FILE_H_
|
#define BSA_BSA_FILE_H
|
||||||
|
|
||||||
#include <libs/mangle/stream/stream.hpp>
|
#include <libs/mangle/stream/stream.hpp>
|
||||||
#include <libs/platform/stdint.h>
|
#include <libs/platform/stdint.h>
|
||||||
|
@ -31,6 +31,9 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
namespace Bsa
|
||||||
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This class is used to read "Bethesda Archive Files", or BSAs.
|
This class is used to read "Bethesda Archive Files", or BSAs.
|
||||||
*/
|
*/
|
||||||
|
@ -131,4 +134,6 @@ class BSAFile
|
||||||
{ return files; }
|
{ return files; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
using namespace Bsa;
|
||||||
|
|
||||||
BSAFile bsa;
|
BSAFile bsa;
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace Mangle::Stream;
|
using namespace Mangle::Stream;
|
||||||
|
using namespace Bsa;
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,7 +19,7 @@ int main()
|
||||||
Root *root = new Root("","","");
|
Root *root = new Root("","","");
|
||||||
|
|
||||||
// Add the BSA
|
// Add the BSA
|
||||||
addBSA("../../data/Morrowind.bsa");
|
Bsa::addBSA("../../data/Morrowind.bsa");
|
||||||
|
|
||||||
// Pick a sample file
|
// Pick a sample file
|
||||||
String tex = "textures\\tx_natural_cavern_wall13.dds";
|
String tex = "textures\\tx_natural_cavern_wall13.dds";
|
||||||
|
|
Loading…
Reference in a new issue