// ------------------------------------------------------------------------------------------------
// Constructor to be privately used by Importer
SMDImporter::SMDImporter()
- : configFrameID(),
- mBuffer(),
- pScene(),
- iFileSize(),
- iSmallestFrame(),
- dLengthOfAnim(),
- bHasUVs(),
- iLineNumber()
-{}
+: configFrameID(),
+mBuffer(),
+pScene( nullptr ),
+iFileSize( 0 ),
+iSmallestFrame( -1 ),
+dLengthOfAnim( 0.0 ),
+bHasUVs(false ),
+iLineNumber(-1) {
+ // empty
+}
// ------------------------------------------------------------------------------------------------
// Destructor, private as well
-SMDImporter::~SMDImporter()
-{}
+SMDImporter::~SMDImporter() {
+ // empty
+}
// ------------------------------------------------------------------------------------------------
// Returns whether the class can handle the format of the given file.
// Allocate storage and copy the contents of the file to a memory buffer
this->pScene = pScene;
- std::vector<char> buff(iFileSize+1);
- TextFileToBuffer(file.get(),buff);
- mBuffer = &buff[0];
+ mBuffer.resize( iFileSize + 1 );
+ TextFileToBuffer(file.get(), mBuffer );
iSmallestFrame = (1 << 31);
bHasUVs = true;
// Parse the file
void SMDImporter::ParseFile()
{
- const char* szCurrent = mBuffer;
+ const char* szCurrent = &mBuffer[0];
// read line per line ...
for ( ;; )
unsigned int configFrameID;
/** Buffer to hold the loaded file */
- const char* mBuffer;
+ std::vector<char> mBuffer;
/** Output scene to be filled
*/