1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 21:23:52 +00:00

changed EMSLoader to use ConstrainedDataStream

Changed the EMSLoader class to use the ConstrainedDataStream so that
future changes may benifit from its increased performance.
This commit is contained in:
Nathan Jeffords 2013-01-01 15:13:36 -08:00
parent 278337116b
commit fec9a59237

View file

@ -1,6 +1,8 @@
#include "esmreader.hpp"
#include <stdexcept>
#include "../files/constrainedfiledatastream.hpp"
namespace ESM
{
@ -108,16 +110,12 @@ void ESMReader::open(Ogre::DataStreamPtr _esm, const std::string &name)
void ESMReader::open(const std::string &file)
{
std::ifstream *stream = OGRE_NEW_T(std::ifstream, Ogre::MEMCATEGORY_GENERAL)(file.c_str(), std::ios_base::binary);
// Ogre will delete the stream for us
open(Ogre::DataStreamPtr(new Ogre::FileStreamDataStream(stream)), file);
open (openConstrainedFileDataStream (file.c_str ()), file);
}
void ESMReader::openRaw(const std::string &file)
{
std::ifstream *stream = OGRE_NEW_T(std::ifstream, Ogre::MEMCATEGORY_GENERAL)(file.c_str(), std::ios_base::binary);
// Ogre will delete the stream for us
openRaw(Ogre::DataStreamPtr(new Ogre::FileStreamDataStream(stream)), file);
openRaw (openConstrainedFileDataStream (file.c_str ()), file);
}
int64_t ESMReader::getHNLong(const char *name)