void UnloadFont(PFFONT *pffont) { GLOBALASSERT(pffont); if (pffont->hBackup) { ATRemoveSurface(pffont->data); AwDestroyBackupTexture(pffont->hBackup); pffont->hBackup = NULL; } if(pffont->data) { ReleaseDDSurface(pffont->data); pffont->data = NULL; } IndexedFont_Proportional_PF :: PFUnLoadHook ( (FontIndex) ( (pffont - &AvpFonts[0]) / sizeof(PFFONT) ) // FontIndex I_Font_Old, // very ugly way to get at the index ); }
void ReleaseMenuGraphic(MENUGRAPHIC* mptr) { GLOBALASSERT(mptr); GLOBALASSERT(mptr->image_ptr); ATRemoveSurface(mptr->image_ptr); ReleaseDDSurface(mptr->image_ptr); mptr->image_ptr = NULL; if (mptr->hBackup) AwDestroyBackupTexture(mptr->hBackup); mptr->hBackup = NULL; }
//+------------------------------------------------------------------------ // // Member: COffScreenContext::~COffScreenContext() // // Synopsis: Release resources used by this class. // //------------------------------------------------------------------------- COffScreenContext::~COffScreenContext() { _fOffScreen = FALSE; if(_nSavedDC) { // restore the DC for the cached case Verify(RestoreDC(_hdcMem, _nSavedDC)); _nSavedDC = 0; } // Put back a reasonable palette so ours can be deleted safely SelectPalette(_hdcMem, (HPALETTE)GetStockObject(DEFAULT_PALETTE), TRUE); if(_fUseDD) { ReleaseDDSurface(); } else { ReleaseDDB(); } }