DragonNest/GameCommon/MAPlateUser.cpp
Cussrro 47f7895977 Revert "修复编码问题"
This reverts commit 9e69c01767.
2024-12-21 10:04:04 +08:00

45 lines
960 B
C++

#include "StdAfx.h"
#include "MAPlateUser.h"
MAPlateUser::MAPlateUser()
{
memset( m_bSelfDelete, 0, sizeof(m_bSelfDelete) );
}
MAPlateUser::~MAPlateUser()
{
for( DWORD i=0; i<CDnGlyph::GlyphSlotEnum_Amount; i++ ) {
DetachGlyph( (CDnGlyph::GlyphSlotEnum)i );
}
}
bool MAPlateUser::AttachGlyph( DnGlyphHandle hGlyph, CDnGlyph::GlyphSlotEnum Index, bool bDelete )
{
if( !hGlyph ) return false;
CDnGlyph::GlyphSlotEnum SlotIndex = Index;
if( m_hGlyph[SlotIndex] && m_hGlyph[SlotIndex] != hGlyph ) {
MAPlateUser::DetachGlyph( SlotIndex );
}
m_hGlyph[SlotIndex] = hGlyph;
m_bSelfDelete[SlotIndex] = bDelete;
return true;
}
bool MAPlateUser::DetachGlyph( CDnGlyph::GlyphSlotEnum Index )
{
if( !m_hGlyph[Index] ) return true;
if( m_bSelfDelete[Index] ) {
SAFE_RELEASE_SPTR( m_hGlyph[Index] );
m_bSelfDelete[Index] = false;
}
m_hGlyph[Index].Identity();
return true;
}
void MAPlateUser::Process( LOCAL_TIME LocalTime, float fDelta )
{
}