Sprite copy ctor, same reason (refcounted textures)
this is the sort of thing HiddenPtr is meant to avoid, but I'm not ready to start using it on refcounted objects just yet ...
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include "Foreach.h"
|
||||
#include "LuaBinding.h"
|
||||
#include "LuaManager.h"
|
||||
#include "RageUtil_AutoPtr.h"
|
||||
|
||||
REGISTER_ACTOR_CLASS( Sprite )
|
||||
|
||||
@@ -40,6 +41,26 @@ Sprite::~Sprite()
|
||||
UnloadTexture();
|
||||
}
|
||||
|
||||
Sprite::Sprite( const Sprite &cpy )
|
||||
{
|
||||
#define CPY(a) a = cpy.a
|
||||
CPY( m_sSpritePath );
|
||||
CPY( m_bDrawIfTextureNull );
|
||||
CPY( m_States );
|
||||
CPY( m_iCurState );
|
||||
CPY( m_fSecsIntoState );
|
||||
CPY( m_bUsingCustomTexCoords );
|
||||
CPY( m_bSkipNextUpdate );
|
||||
memcpy( m_CustomTexCoords, cpy.m_CustomTexCoords, sizeof(m_CustomTexCoords) );
|
||||
CPY( m_fRememberedClipWidth );
|
||||
CPY( m_fRememberedClipHeight );
|
||||
CPY( m_fTexCoordVelocityX );
|
||||
CPY( m_fTexCoordVelocityY );
|
||||
#undef CPY
|
||||
|
||||
m_pTexture = TEXTUREMAN->CopyTexture( cpy.m_pTexture );
|
||||
}
|
||||
|
||||
RageTextureID Sprite::SongBGTexture( RageTextureID ID )
|
||||
{
|
||||
ID.bMipMaps = true;
|
||||
|
||||
@@ -12,6 +12,7 @@ class Sprite: public Actor
|
||||
{
|
||||
public:
|
||||
Sprite();
|
||||
Sprite( const Sprite &cpy );
|
||||
virtual ~Sprite();
|
||||
|
||||
void LoadFromNode( const CString& sDir, const XNode* pNode );
|
||||
|
||||
Reference in New Issue
Block a user