예제 #1
0
파일: font.cpp 프로젝트: Fomka/ufo2000
/** Destroys fonts.
 *  Uses allegro function to reach destructor in the vtable. 
 */
void destroy_fonts() 
{
    if (g_small_font != font)
        destroy_font(g_small_font);
    if (large != font)
        destroy_font(large);
    if (g_console_font != font)
        destroy_font(g_console_font);
#ifdef HAVE_FREETYPE
    if (g_console_font_rend) gk_done_renderer(g_console_font_rend);
    if (g_small_font_rend) gk_done_renderer(g_small_font_rend);
    if (g_large_font_rend) gk_done_renderer(g_large_font_rend);
    
    if (g_console_font_keep) gk_done_keeper(g_console_font_keep);
    if (g_small_font_keep) gk_done_keeper(g_small_font_keep);
    if (g_large_font_keep) gk_done_keeper(g_large_font_keep);
    
    if (g_console_font_face) gk_unload_face(g_console_font_face);
    if (g_small_font_face) gk_unload_face(g_small_font_face);
    if (g_large_font_face) gk_unload_face(g_large_font_face);
    
    gk_library_cleanup();
#endif  
}
        AllegroGlyphKeeperFont::~AllegroGlyphKeeperFont()
        {
            if (mRend != NULL)
            {
                gk_done_renderer(mRend);
            }

            mRend = NULL;

            if (mFace != NULL)
            {
                gk_unload_face(mFace);
            }

            mFace = NULL;

            if (mKeeper != NULL)
            {
                gk_done_keeper(mKeeper);
            }

            mKeeper = NULL;
        }