diff --git a/Docs/codeStyleGide.rtf b/Docs/codeStyleGide.rtf index 001d657..d73ac31 100644 Binary files a/Docs/codeStyleGide.rtf and b/Docs/codeStyleGide.rtf differ diff --git a/src/3D/SEMaterial.cpp b/src/3D/SEMaterial.cpp index c2c41b3..2b7b71f 100644 --- a/src/3D/SEMaterial.cpp +++ b/src/3D/SEMaterial.cpp @@ -28,7 +28,7 @@ void SEMaterial::ParseData( SESceneLoader* loader ) }else if( streq( loader->dataType(), "texture") ) { - SETexturePtr texture = SETexturePtr( new SETexture ); + SETexturePtr texture = SETexturePtr( SENewObject() ); SetTexture( texture ); loader->AddDelegate( texture ); diff --git a/src/3D/SEMesh.cpp b/src/3D/SEMesh.cpp index da40c90..0003969 100644 --- a/src/3D/SEMesh.cpp +++ b/src/3D/SEMesh.cpp @@ -16,7 +16,7 @@ SEMesh::~SEMesh(void) BREAKPOINTPLACE; } -SEVertexArrayPtr SEMesh::vertexArray() +SEVertexNativeArrayPtr SEMesh::vertexArray() { return mVertexArray; } @@ -35,13 +35,9 @@ void SEMesh::SetVertexArrayCount( int count ) { SEAssert( mVertexArray.get() == 0, "not allocated check" ); mVertexArraySize = count*3; - mVertexArray = SEVertexArrayPtr( new float[count*3] ); - mNormalArray = SENormalArrayPtr( new float[count*3] ); - - float* uvArr = new float[count*3]; - memset( uvArr, 0, sizeof(float)*count*3); - - mUVArray = SEUVArrayPtr( uvArr ); + mVertexArray = SEVertexNativeArrayPtr( SENewArray(count*3) ); + mNormalArray = SENormalNativeArrayPtr( SENewArray(count*3) ); + mUVArray = SEUVNativeArrayPtr( SENewArray(count*3) ); } void SEMesh::SetVertex( int index, float x, float y, float z) @@ -103,8 +99,7 @@ void SEMesh::ParseData( SESceneLoader* loader ) }else if( streq( loader->dataType(), "vertexGroup" ) ) { - SEVertexGroupPtr vertexGroup( new SEVertexGroup( loader->value1() ) ); - //vertexGroup->SetName( loader->value1() ); + SEVertexGroupPtr vertexGroup( SENewObject( loader->value1() ) ); AddVertexGroup( vertexGroup ); loader->AddDelegate( vertexGroup ); @@ -145,7 +140,7 @@ void SEMesh::Draw() SEVertexGroupArray::iterator start = mVertexGroupArray.begin(); SEVertexGroupArray::iterator end = mVertexGroupArray.end(); - SEIndexArrayPtr indexArrayPtr; + SEIndexNativeArrayPtr indexArrayPtr; //FIXME: move that part or reorganize glEnable( GL_LIGHTING ); diff --git a/src/3D/SEMesh.h b/src/3D/SEMesh.h index 98b5853..38d75cf 100644 --- a/src/3D/SEMesh.h +++ b/src/3D/SEMesh.h @@ -15,18 +15,18 @@ class SESceneLoader; typedef shared_ptr SEMeshPtr; typedef vector< SEMeshPtr, SEAllocator > SEMeshArray; -typedef shared_array SEVertexArrayPtr; -typedef shared_array SENormalArrayPtr; -typedef shared_array SEUVArrayPtr; +typedef shared_array SEVertexNativeArrayPtr; +typedef shared_array SENormalNativeArrayPtr; +typedef shared_array SEUVNativeArrayPtr; class SEMesh: public SESceneLoaderDelegate { SEString mName; int mVertexArraySize; - SEVertexArrayPtr mVertexArray; - SENormalArrayPtr mNormalArray; - SEUVArrayPtr mUVArray; + SEVertexNativeArrayPtr mVertexArray; + SENormalNativeArrayPtr mNormalArray; + SEUVNativeArrayPtr mUVArray; SEVertexGroupArray mVertexGroupArray; @@ -34,7 +34,7 @@ class SEMesh: public SESceneLoaderDelegate SEMesh(void); ~SEMesh(void); - SEVertexArrayPtr vertexArray(); + SEVertexNativeArrayPtr vertexArray(); void SetName( const char* name ); const SEString& name(); diff --git a/src/3D/SEVertexGroup.cpp b/src/3D/SEVertexGroup.cpp index 8ec167f..0db4032 100644 --- a/src/3D/SEVertexGroup.cpp +++ b/src/3D/SEVertexGroup.cpp @@ -13,7 +13,7 @@ SEVertexGroup::~SEVertexGroup(void) BREAKPOINTPLACE; } -void SEVertexGroup::Init( SEIndexArrayPtr indexArray, int size ) +void SEVertexGroup::Init( SEIndexNativeArrayPtr indexArray, int size ) { SEAssert( mIndexArraySize == -1, "Object already inited" ); @@ -21,7 +21,7 @@ void SEVertexGroup::Init( SEIndexArrayPtr indexArray, int size ) mIndexArraySize = size; } -SEIndexArrayPtr SEVertexGroup::indexArray() +SEIndexNativeArrayPtr SEVertexGroup::indexArray() { return mIndexArray; } @@ -31,7 +31,7 @@ int SEVertexGroup::indexArraySize() return mIndexArraySize; } -void SEVertexGroup::SetFace( int index, float v1, float v2, float v3) +void SEVertexGroup::SetFace( int index, SEIndexType v1, SEIndexType v2, SEIndexType v3) { SEAssert( index*3 < mIndexArraySize, "Vertex index bound check" ); @@ -64,12 +64,12 @@ void SEVertexGroup::ParseData( SESceneLoader* loader ) int size = atoi( loader->value1() ); SEAssert( size > 0, "vertexIndexCount value check" ); - SEIndexArrayPtr arrayPtr( new unsigned short[ size*3 ] ); + SEIndexNativeArrayPtr arrayPtr( SENewArray( size*3 ) ); Init( arrayPtr, size*3 ); }else if( streq( loader->dataType(), "material" ) ) { - SEMaterialPtr material( new SEMaterial( loader->value1() ) ); + SEMaterialPtr material( SENewObject( loader->value1() ) ); SetMaterial( material ); loader->AddDelegate( material ); diff --git a/src/3D/SEVertexGroup.h b/src/3D/SEVertexGroup.h index f24ff46..e3834ac 100644 --- a/src/3D/SEVertexGroup.h +++ b/src/3D/SEVertexGroup.h @@ -11,7 +11,8 @@ class SEVertexGroup; -typedef shared_array SEIndexArrayPtr; +typedef unsigned short SEIndexType; +typedef shared_array SEIndexNativeArrayPtr; typedef shared_ptr SEVertexGroupPtr; typedef vector< SEVertexGroupPtr, SEAllocator > SEVertexGroupArray; @@ -19,18 +20,18 @@ class SEVertexGroup: public SESceneLoaderDelegate { SEString mName; int mIndexArraySize; - SEIndexArrayPtr mIndexArray; + SEIndexNativeArrayPtr mIndexArray; SEMaterialPtr mMaterial; public: SEVertexGroup(const char* name); ~SEVertexGroup(void); - void Init( SEIndexArrayPtr indexArray, int size ); - SEIndexArrayPtr indexArray(); + void Init( SEIndexNativeArrayPtr indexArray, int size ); + SEIndexNativeArrayPtr indexArray(); int indexArraySize(); - void SetFace( int index, float v1, float v2, float v3); + void SetFace( int index, SEIndexType v1, SEIndexType v2, SEIndexType v3); void SetMaterial( SEMaterialPtr material ); SEMaterialPtr material(); diff --git a/src/Images/SEJpegImage.cpp b/src/Images/SEJpegImage.cpp index 7f4c9e3..871e586 100644 --- a/src/Images/SEJpegImage.cpp +++ b/src/Images/SEJpegImage.cpp @@ -59,7 +59,7 @@ void SEJpegImage::Load( const sechar* filePath ) jpeg_read_scanlines( &cinfo, &row, 1 ); - printf("%d %d %d %d", row[0], row[1], row[2], row[3] ); + //printf("%d %d %d %d", row[0], row[1], row[2], row[3] ); } mData = SEImageDataPtr( buffer ); diff --git a/src/Tools/SEAllocator.h b/src/Tools/SEAllocator.h index 3a93390..5155345 100644 --- a/src/Tools/SEAllocator.h +++ b/src/Tools/SEAllocator.h @@ -62,9 +62,9 @@ class SEAllocator SEAllocator& operator=(const SEAllocator&) { return *this; } }; -//operators ( ==, != ) added to resolve iPhone compiler error: //basic_string.h:213: error: no match for 'operator==' in '__alloc1 == __alloc2 +//operators ( ==, != ) added to resolve iPhone compiler error: template inline bool operator==(const SEAllocator<_T1>&, const SEAllocator<_T2>&) @@ -75,4 +75,5 @@ inline bool operator!=(const SEAllocator<_T1>&, const SEAllocator<_T2>&) { return false; } + #endif SEAllocator_H \ No newline at end of file diff --git a/src/Tools/SEDefinition.h b/src/Tools/SEDefinition.h index ecae444..e4c2ec1 100644 --- a/src/Tools/SEDefinition.h +++ b/src/Tools/SEDefinition.h @@ -25,4 +25,4 @@ typedef basic_string , SEAllocator > SEStrin typedef shared_ptr SEStringPtr; typedef vector> SEStringArray; -typedef shared_array SEStringNativeArray; +typedef shared_array SEStringNativeArrayPtr; diff --git a/src/Tools/SEFileLineReader.cpp b/src/Tools/SEFileLineReader.cpp index 7cd7d17..1e64d99 100644 --- a/src/Tools/SEFileLineReader.cpp +++ b/src/Tools/SEFileLineReader.cpp @@ -1,39 +1,39 @@ -#include "SEFileLineReader.h" - -SEFileLineReader::SEFileLineReader(void) -{ - lastEndOfLineIndex = 0; -} - -SEFileLineReader::~SEFileLineReader(void) -{ -} - -void SEFileLineReader::HandleString(const sechar* string, bool isEndOfFile) -{ - //split string - stringBuffer.append( string ); - - int currentEndOfLineIndex = lastEndOfLineIndex; - SEString substring; - - while( true ) - { - currentEndOfLineIndex = stringBuffer.find( "\n", currentEndOfLineIndex+1 ); - if( currentEndOfLineIndex == string::npos && !isEndOfFile ) - { - //substring = stringBuffer.substr( lastEndOfLineIndex, stringBuffer.length() - 1 - lastEndOfLineIndex ); - //mHandler->HandleString( substring.c_str(), isEndOfFile ); - break; - - }else if( currentEndOfLineIndex != string::npos ) - { - substring = stringBuffer.substr( lastEndOfLineIndex, currentEndOfLineIndex-lastEndOfLineIndex ); - - lastEndOfLineIndex = currentEndOfLineIndex; - mHandler->HandleString( substring.c_str(), isEndOfFile ); - - }else - break; - } +#include "SEFileLineReader.h" + +SEFileLineReader::SEFileLineReader(void) +{ + lastEndOfLineIndex = 0; +} + +SEFileLineReader::~SEFileLineReader(void) +{ +} + +void SEFileLineReader::HandleString(const sechar* string, bool isEndOfFile) +{ + //split string + stringBuffer.append( string ); + + int currentEndOfLineIndex = lastEndOfLineIndex; + SEString substring; + + while( true ) + { + currentEndOfLineIndex = stringBuffer.find( "\n", currentEndOfLineIndex+1 ); + if( currentEndOfLineIndex == string::npos && !isEndOfFile ) + { + //substring = stringBuffer.substr( lastEndOfLineIndex, stringBuffer.length() - 1 - lastEndOfLineIndex ); + //mHandler->HandleString( substring.c_str(), isEndOfFile ); + break; + + }else if( currentEndOfLineIndex != string::npos ) + { + substring = stringBuffer.substr( lastEndOfLineIndex, currentEndOfLineIndex-lastEndOfLineIndex ); + + lastEndOfLineIndex = currentEndOfLineIndex; + mDelegate->HandleString( substring.c_str(), isEndOfFile ); + + }else + break; + } } \ No newline at end of file diff --git a/src/Tools/SEFileReaderBase.cpp b/src/Tools/SEFileReaderBase.cpp index 763d9ee..f2710a8 100644 --- a/src/Tools/SEFileReaderBase.cpp +++ b/src/Tools/SEFileReaderBase.cpp @@ -1,59 +1,61 @@ -#include "SEFileReaderBase.h" -#include "SEPathBase.h" - -#define SEFILEREADER_BUFFER_LENGHT 1024 - -SEFileReaderBase::SEFileReaderBase(void) -{ -} - -SEFileReaderBase::~SEFileReaderBase(void) -{ - Close(); -} - -void SEFileReaderBase::Load(const SEPathBase* filePath) -{ - Close(); - mCurrentFile = filePath; - - sechar buffer[SEFILEREADER_BUFFER_LENGHT]; - TRACE( filePath->cString() ); - - FILE* file = fopen(filePath->cString(), "r"); - int feofFlag = feof(file); - - while( feofFlag == 0 ) - { - memset(buffer,0,sizeof(buffer)); - - //fgets( buffer, SEWindowsFileReader_BUFFER_LENGHT-1, file ); - fread(buffer, SEFILEREADER_BUFFER_LENGHT-1, 1, file); - - feofFlag = feof(file); - HandleString( buffer, static_cast( feofFlag != 0 ) ); - } - - fclose(file); -} - -void SEFileReaderBase::Close() -{ - mCurrentFile = NULL; -} - -void SEFileReaderBase::HandleString(const sechar* string, bool isEndOfFile) -{ - if( mHandler ) - mHandler->HandleString(string, isEndOfFile); -} - -void SEFileReaderBase::SetHandler( SEFileReaderHandlerInterface* _handler ) -{ - mHandler = _handler; -} - -SEFileReaderHandlerInterface* SEFileReaderBase::handler() -{ - return mHandler; -} +#include "SEFileReaderBase.h" +#include "SEPathBase.h" + +#define SEFILEREADER_BUFFER_LENGHT 1024 + +SEFileReaderBase::SEFileReaderBase(void) +{ +} + +SEFileReaderBase::~SEFileReaderBase(void) +{ + Close(); +} + +void SEFileReaderBase::Load(const SEPathBase* filePath) +{ + Close(); + mCurrentFile = filePath; + + sechar buffer[SEFILEREADER_BUFFER_LENGHT]; + TRACE( filePath->cString() ); + + FILE* file = fopen(filePath->cString(), "r"); + SEAssert(file!=0, "file not open"); + + int feofFlag = feof(file); + + while( feofFlag == 0 ) + { + memset(buffer,0,sizeof(buffer)); + + //fgets( buffer, SEWindowsFileReader_BUFFER_LENGHT-1, file ); + fread(buffer, SEFILEREADER_BUFFER_LENGHT-1, 1, file); + + feofFlag = feof(file); + HandleString( buffer, static_cast( feofFlag != 0 ) ); + } + + fclose(file); +} + +void SEFileReaderBase::Close() +{ + mCurrentFile = NULL; +} + +void SEFileReaderBase::HandleString(const sechar* string, bool isEndOfFile) +{ + if( mDelegate ) + mDelegate->HandleString(string, isEndOfFile); +} + +void SEFileReaderBase::SetDelegate( SEFileReaderDelegate* _delegate ) +{ + mDelegate = _delegate; +} + +SEFileReaderDelegate* SEFileReaderBase::delegate() +{ + return mDelegate; +} diff --git a/src/Tools/SEFileReaderBase.h b/src/Tools/SEFileReaderBase.h index 29ae149..20e73f3 100644 --- a/src/Tools/SEFileReaderBase.h +++ b/src/Tools/SEFileReaderBase.h @@ -9,17 +9,17 @@ class SEPathBase; -class SEFileReaderHandlerInterface +class SEFileReaderDelegate { public: virtual void HandleString(const sechar* string, bool isEndOfFile)=0; }; -typedef shared_ptr SEFileReaderHandlerInterfacePtr; -typedef vector< SEFileReaderHandlerInterfacePtr, SEAllocator > SEFileReaderHandlerInterfaceArray; +typedef shared_ptr SEFileReaderDelegatePtr; +typedef vector< SEFileReaderDelegatePtr, SEAllocator > SEFileReaderDelegateArray; -class SEFileReaderBase: public SEFileReaderHandlerInterface, public SEErrorInterface +class SEFileReaderBase: public SEFileReaderDelegate, public SEErrorInterface { protected: SEError error; @@ -27,7 +27,7 @@ class SEFileReaderBase: public SEFileReaderHandlerInterface, public SEErrorInter sechar* mCurrentType; const SEPathBase* mCurrentFile; - SEFileReaderHandlerInterface* mHandler; + SEFileReaderDelegate* mDelegate; public: SEFileReaderBase(void); @@ -37,8 +37,8 @@ class SEFileReaderBase: public SEFileReaderHandlerInterface, public SEErrorInter virtual void Close(); virtual void HandleString(const sechar* string, bool isEndOfFile); - void SetHandler( SEFileReaderHandlerInterface* _handler ); - SEFileReaderHandlerInterface* handler(); + void SetDelegate( SEFileReaderDelegate* _delegate ); + SEFileReaderDelegate* delegate(); }; typedef SEFileReaderBase SEFileReader; diff --git a/src/Tools/SEImageLoader.cpp b/src/Tools/SEImageLoader.cpp index fbbfe94..ad3cf7b 100644 --- a/src/Tools/SEImageLoader.cpp +++ b/src/Tools/SEImageLoader.cpp @@ -41,7 +41,7 @@ SEImagePtr SEImageLoader::Load(const SEPath& filePath) if( ext == ".jpg" ) { - SEJpegImage* jpegImage = new SEJpegImage; + SEJpegImage* jpegImage = SENewObject(); jpegImage->Load( filePath.cString() ); returnImagePtr = SEImagePtr( jpegImage ); diff --git a/src/Tools/SEIncludeLibrary.h b/src/Tools/SEIncludeLibrary.h index 2984a06..5e47282 100644 --- a/src/Tools/SEIncludeLibrary.h +++ b/src/Tools/SEIncludeLibrary.h @@ -1,19 +1,20 @@ - -#include - -#include -#include -#include -#include -using namespace std; - -#include -#include -using namespace boost; - -#define BOOST_FILESYSTEM_NO_DEPRECATED -#include -using namespace boost::filesystem; - - -#include "SEAllocator.h" \ No newline at end of file + +#include + +#include +#include +#include +#include +using namespace std; + +#include +#include +using namespace boost; + +#define BOOST_FILESYSTEM_NO_DEPRECATED +#include +using namespace boost::filesystem; + + +#include "SEAllocator.h" +#include "SEMemory.h" \ No newline at end of file diff --git a/src/Tools/SEMemory.h b/src/Tools/SEMemory.h new file mode 100644 index 0000000..7cd4c98 --- /dev/null +++ b/src/Tools/SEMemory.h @@ -0,0 +1,74 @@ + +#ifndef SESharedAllocator_H +#define SESharedAllocator_H + +#include "SEAllocator.h" + +template +T* SENewObject() +{ + void* mem = malloc(sizeof(T)); + return new(mem)T; +} + +template +T* SENewObject( ARG1 arg1) +{ + void* mem = malloc(sizeof(T)); + return new(mem)T(arg1); +} + +template +T* SENewObject( ARG1 arg1, ARG2 arg2) +{ + void* mem = malloc(sizeof(T)); + return new(mem)T(arg1, arg2); +} + +template +T* SENewArray( size_t itemCount ) +{ + T* arr = (T*)calloc( itemCount, sizeof(T) ); + return new(arr) T[itemCount]; +} + + +template +void SEDeleteObject(T* p) +{ + delete p; +} + +template +void SEDeleteArray(T* p) +{ + delete[] p; +} + + + +/* +class SESharedAllocator +{ + static SESharedAllocatorPtr mAllocator; + + SESharedAllocator(void); + +public: + ~SESharedAllocator(void); + + static SESharedAllocatorPtr allocator(); + + template + static T* NewObject( ) + { + void* mem = SESharedAllocator::allocator()-> + } + + template + static T* NewObject( A arg ); +}; + +*/ + +#endif SESharedAllocator_H \ No newline at end of file diff --git a/src/Tools/SEObjectStore.cpp b/src/Tools/SEObjectStore.cpp index d479c75..e3f33cd 100644 --- a/src/Tools/SEObjectStore.cpp +++ b/src/Tools/SEObjectStore.cpp @@ -1,45 +1,45 @@ -#include "SEObjectStore.h" -#include "SETools.h" - -SEObjectStorePtr SEObjectStore::mInstance; - -SEObjectStore::SEObjectStore(void) -{ -} - -SEObjectStore::~SEObjectStore(void) -{ - BREAKPOINTPLACE; -} - -SEObjectStorePtr SEObjectStore::sharedInstance() -{ - if( mInstance.get() == 0 ) - { - mInstance = SEObjectStorePtr( new SEObjectStore ); - } - - return mInstance; -} - -void SEObjectStore::AddMesh( SEMeshPtr mesh ) -{ - mMeshArray.push_back( mesh ); -} - -SEMeshPtr SEObjectStore::GetMesh( const char* name ) -{ - SEMeshArray::iterator start = mMeshArray.begin(); - SEMeshArray::iterator end = mMeshArray.end(); - - while( start != end ) - { - if( streq( (*start)->name().c_str(), name) ) - return *start; - - ++start; - } - - SEAssert(false, "Mesh not found"); - return SEMeshPtr(); +#include "SEObjectStore.h" +#include "SETools.h" + +SEObjectStorePtr SEObjectStore::mInstance; + +SEObjectStore::SEObjectStore(void) +{ +} + +SEObjectStore::~SEObjectStore(void) +{ + BREAKPOINTPLACE; +} + +SEObjectStorePtr SEObjectStore::sharedInstance() +{ + if( mInstance.get() == 0 ) + { + mInstance = SEObjectStorePtr( SENewObject() ); + } + + return mInstance; +} + +void SEObjectStore::AddMesh( SEMeshPtr mesh ) +{ + mMeshArray.push_back( mesh ); +} + +SEMeshPtr SEObjectStore::GetMesh( const char* name ) +{ + SEMeshArray::iterator start = mMeshArray.begin(); + SEMeshArray::iterator end = mMeshArray.end(); + + while( start != end ) + { + if( streq( (*start)->name().c_str(), name) ) + return *start; + + ++start; + } + + SEAssert(false, "Mesh not found"); + return SEMeshPtr(); } \ No newline at end of file diff --git a/src/Tools/SEObjectStore.h b/src/Tools/SEObjectStore.h index 6fd8c5b..3f0589a 100644 --- a/src/Tools/SEObjectStore.h +++ b/src/Tools/SEObjectStore.h @@ -1,22 +1,21 @@ - - -#include "SEMesh.h" - -class SEObjectStore; - -typedef shared_ptr SEObjectStorePtr; - -class SEObjectStore -{ - static SEObjectStorePtr mInstance; - SEMeshArray mMeshArray; - - SEObjectStore(void); - -public: - ~SEObjectStore(void); - - static SEObjectStorePtr sharedInstance(); - void AddMesh( SEMeshPtr mesh ); - SEMeshPtr GetMesh( const char* name ); -}; + + +#include "SEMesh.h" + +class SEObjectStore; + +typedef shared_ptr SEObjectStorePtr; + +class SEObjectStore +{ + static SEObjectStorePtr mInstance; + SEMeshArray mMeshArray; + +public: + SEObjectStore(void); + ~SEObjectStore(void); + + static SEObjectStorePtr sharedInstance(); + void AddMesh( SEMeshPtr mesh ); + SEMeshPtr GetMesh( const char* name ); +}; diff --git a/src/Tools/SEPathBase.cpp b/src/Tools/SEPathBase.cpp index 697942e..0de8e05 100644 --- a/src/Tools/SEPathBase.cpp +++ b/src/Tools/SEPathBase.cpp @@ -1,4 +1,5 @@ +#include "SEMemory.h" #include "SEPathBase.h" @@ -84,10 +85,7 @@ void SEPathBase::ChildArray(SEPathArray* pathArray) const directory_iterator end_itr; for ( directory_iterator itr( mPath ); itr != end_itr; ++itr ) { - void* memory = malloc( sizeof( SEPath) ); - SEPath* path = new(memory) SEPath(); - - SEPathPtr pathPtr( path ); + SEPathPtr pathPtr( SENewObject() ); pathPtr->Init( itr->path().string().c_str() ); pathArray->push_back( pathPtr ); } diff --git a/src/Tools/SESceneLoader.cpp b/src/Tools/SESceneLoader.cpp index f685b95..75099ba 100644 --- a/src/Tools/SESceneLoader.cpp +++ b/src/Tools/SESceneLoader.cpp @@ -3,7 +3,7 @@ SESceneLoader::SESceneLoader(void) { - mFileReader.SetHandler( this ); + mFileReader.SetDelegate( this ); mCurrentIndex = 0; } @@ -76,7 +76,7 @@ void SESceneLoader::HandleString(const sechar* string, bool isEndOfFile) { if( streq( mValue1, "Mesh" ) ) { - SEMeshPtr mesh( new SEMesh ); + SEMeshPtr mesh( SENewObject() ); mDelegateStack.push( mesh ); SEObjectStore::sharedInstance()->AddMesh( mesh ); diff --git a/src/Tools/SESceneLoader.h b/src/Tools/SESceneLoader.h index 21cb1fc..52fbcd1 100644 --- a/src/Tools/SESceneLoader.h +++ b/src/Tools/SESceneLoader.h @@ -11,7 +11,7 @@ //executing string from file export in subclass -class SESceneLoader: public SEFileReaderHandlerInterface +class SESceneLoader: public SEFileReaderDelegate { SEFileLineReader mFileReader; SESceneLoaderDelegateStack mDelegateStack; diff --git a/vs/GLUT_Window_Template.cpp b/vs/GLUT_Window_Template.cpp index 160e425..46c7a60 100644 --- a/vs/GLUT_Window_Template.cpp +++ b/vs/GLUT_Window_Template.cpp @@ -91,7 +91,7 @@ void display (void) void drawObject () { // Show when are displaying an object - printf ("Displaying object...\n"); + //printf ("Displaying object...\n"); // Draw Icosahedron //glutWireIcosahedron (); diff --git a/vs/GLUT_Window_Template.suo b/vs/GLUT_Window_Template.suo index d1a09be..8c93d87 100644 Binary files a/vs/GLUT_Window_Template.suo and b/vs/GLUT_Window_Template.suo differ diff --git a/vs/GLUT_Window_Template.vcproj b/vs/GLUT_Window_Template.vcproj index a835f1e..25d2fbc 100644 --- a/vs/GLUT_Window_Template.vcproj +++ b/vs/GLUT_Window_Template.vcproj @@ -240,10 +240,6 @@ - - @@ -279,6 +275,10 @@ RelativePath="..\src\Tools\SEMain.h" > + +