コード例 #1
0
ファイル: ddplat.cpp プロジェクト: Scraft/avpmp
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
	);
}
コード例 #2
0
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;
}
コード例 #3
0
ファイル: OffScreenContext.cpp プロジェクト: hufuman/xindows
//+------------------------------------------------------------------------
//
//  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();
	}
}