Ejemplo n.º 1
0
//---------------------------------------------------------------------------
STATIC BitmapFont* BitmapFont::CreateAndGetFont( ZipFile* zipFile, const char* metaDataFilePath )
{
	BitmapFont* result = new BitmapFont();
	bool didLoad = result->LoadMetaDataWithTinyXML( zipFile, metaDataFilePath );
	if ( !didLoad )
	{
		delete result;
		result = nullptr;
	}
	
	return result;
}
Ejemplo n.º 2
0
//---------------------------------------------------------------------------
STATIC BitmapFont* BitmapFont::CreateAndGetFont( const std::string& metaDataFilePath )
{
	BitmapFont* result = new BitmapFont();
	bool didLoad = result->LoadMetaDataWithTinyXML( metaDataFilePath );
	if ( !didLoad )
	{
		delete result;
		result = nullptr;
	}

	return result;
}
Ejemplo n.º 3
0
//---------------------------------------------------------------------------
STATIC BitmapFont* BitmapFont::CreateOrGetFont( const char* metaDataFilePath )
{
	BitmapFont* result = nullptr;
	if ( s_bitmapFontRegistry.find( metaDataFilePath ) == s_bitmapFontRegistry.end() )
	{
		result = new BitmapFont();
		if ( !result->LoadMetaDataWithTinyXML( metaDataFilePath ) )
		{
			delete result;
			result = nullptr;
		}
		else
		{
			s_bitmapFontRegistry.insert( std::make_pair( metaDataFilePath, result ) );
		}
	}
	else
	{
		return s_bitmapFontRegistry[ metaDataFilePath ];
	}

	return result;
}