Beispiel #1
0
void XMapLayerTile::Load( XResFile *pRes, LPCTSTR szPath )
{
	//
	DWORD w, h;
	pRes->Read( &w, 4 );
	pRes->Read( &h, 4 );
	XBREAK( w <= 0 );
	XBREAK( h <= 0 );
//	m_sizeMapTile.Set( w, h );
	m_wMapTile = w;
	m_hMapTile = h;
	// 
	int size;
	TCHAR szTPK[ 1024 ];
	UNICHAR szBuff[ 1024 ];
	pRes->Read( &size, 4 );
	XBREAK( size < 0 );
	XBREAK( size >= sizeof( szBuff ) );
	pRes->Read( szBuff, size );		// tpk filename
#ifdef WIN32
	_tcscpy_s( szTPK, szBuff );
#else
	_tcscpy_s( szTPK, _ConvertUTF16ToUTF8( szBuff ) );
#endif
	// tpk load
	TCHAR szFullPath[ 1024 ];
	_tcscpy_s( szFullPath, XE::Format( _T("%s%s"), XE::GetFilePath( pRes->GetszResName() ), szTPK ) );
	XBREAK( TILEPACK_MNG == NULL );
#ifdef _XTOOL
	m_pTilePack = TILEPACK_MNG->Load( szFullPath, TRUE );
#else
	m_pTilePack = TILEPACK_MNG->Load( szFullPath, FALSE );
#endif
	CreateVertexBuffer( m_prefMap );
	DWORD reserved[4];
	pRes->Read( reserved, sizeof(DWORD), 4 );
	// 타일 맵 데이타 로드
	m_pMapDat = new short[ w * h ];
	pRes->Read( m_pMapDat, w * h * sizeof(short) );

}
Beispiel #2
0
void XMapLayerImage::Load( XResFile *pRes, LPCTSTR szPath )
{
    int size;
    pRes->Read( &size, 4 );
    UNICHAR szBuff[ 32 ];
    pRes->Read( szBuff, size );
#ifdef WIN32
    _tcscpy_s( m_szFilename, szBuff );
#else
    strcpy_s( m_szFilename, _ConvertUTF16ToUTF8( szBuff ) );
#endif
    DWORD dw;
    pRes->Read( &dw, 4 );
    m_DrawType = (xtType)dw;
    pRes->Read( &m_wSize, 4 );
    pRes->Read( &m_hSize, 4 );
    //
    TCHAR szFullPath[ 1024 ];
    _tcscpy_s( szFullPath, XE::Format( _T("%s%s"), szPath, m_szFilename ) );
    LoadImg( szFullPath );
}