changed EMSLoader to use ConstrainedDataStream

Changed the EMSLoader class to use the ConstrainedDataStream so that
future changes may benifit from its increased performance.
actorid
Nathan Jeffords 12 years ago
parent 278337116b
commit fec9a59237

@ -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)

Loading…
Cancel
Save