implement copy ctor. fixes assertion failure after gameplay, due to
a RageTexturePreloader being inside an Actor which is copied
This commit is contained in:
@@ -9,6 +9,22 @@
|
|||||||
#include "RageTexturePreloader.h"
|
#include "RageTexturePreloader.h"
|
||||||
#include "RageTextureManager.h"
|
#include "RageTextureManager.h"
|
||||||
|
|
||||||
|
RageTexturePreloader &RageTexturePreloader::operator=( const RageTexturePreloader &rhs )
|
||||||
|
{
|
||||||
|
if( &rhs == this )
|
||||||
|
return *this;
|
||||||
|
|
||||||
|
UnloadAll();
|
||||||
|
|
||||||
|
for( unsigned i = 0; i < rhs.m_apTextures.size(); ++i )
|
||||||
|
{
|
||||||
|
RageTexture *pTexture = TEXTUREMAN->CopyTexture( rhs.m_apTextures[i] );
|
||||||
|
m_apTextures.push_back( pTexture );
|
||||||
|
}
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
void RageTexturePreloader::Load( const RageTextureID &ID )
|
void RageTexturePreloader::Load( const RageTextureID &ID )
|
||||||
{
|
{
|
||||||
ASSERT( TEXTUREMAN );
|
ASSERT( TEXTUREMAN );
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ struct RageTextureID;
|
|||||||
class RageTexturePreloader
|
class RageTexturePreloader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
RageTexturePreloader() { }
|
||||||
|
RageTexturePreloader( const RageTexturePreloader &cpy ) { *this = cpy; }
|
||||||
|
RageTexturePreloader &operator=( const RageTexturePreloader &rhs );
|
||||||
~RageTexturePreloader();
|
~RageTexturePreloader();
|
||||||
void Load( const RageTextureID &ID );
|
void Load( const RageTextureID &ID );
|
||||||
void UnloadAll();
|
void UnloadAll();
|
||||||
|
|||||||
Reference in New Issue
Block a user