There must be something I'm not seeing here. All I want to do is remove a single object in my vector, and it does do this, but all of the pointers in the objects AFTER the deleted one is set to NULL.
Hopefully this'll explain it better:
That is how I erase the single texture. Each object in the Texture vector is one of these babys:Code:bool TEXTURE::RemoveTexture( UINT32 Location ) { if ( Location >= 1 && Location < Texture.size() - 1 ) { Texture.erase( Texture.begin() + Location ); return true; } return false; };
Now, suppose I try to remove an object in the 10th position in the vector, it will get rid of it fine. The only problem is that the Tex member in the above struct will go to NULL for everything that is after the one I just deleted. I figure that it may be calling the destructor for all of these... but why? How do I get around this?Code:struct TEXTUREINFO { TEXTUREINFO() : Tex( NULL ), Name( "DefaultTextureName" ), Filename( "DefaultTextureFilename" ) {}; TEXTUREINFO( IDirect3DTexture9* tTex, std::string tName, std::string tFilename ) : Tex( tTex ), Name( tName ), Filename( tFilename ) {}; TEXTUREINFO( const TEXTUREINFO& copy ); ~TEXTUREINFO(); TEXTUREINFO& operator=( const TEXTUREINFO& other ); IDirect3DTexture9* Tex; std::string Name; std::string Filename; };
Thanks.



LinkBack URL
About LinkBacks




