Esempio n. 1
0
// ----------------------------------------------------------------------- //
//
//	ROUTINE:	CLTWnd::FreeAllSurfaces
//
//	PURPOSE:	Frees all the surfaces
//
// ----------------------------------------------------------------------- //
void CLTWnd::FreeAllSurfaces(CLTSurfaceArray* pcollSurfs)
{
	if(m_hSurf)
	{
		TERMSHAREDSURF(m_hSurf);
	}
}
Esempio n. 2
0
// ----------------------------------------------------------------------- //
//
//	ROUTINE:	CLTWnd::SetSurface
//
//	PURPOSE:	Changes the main surface
//
// ----------------------------------------------------------------------- //
HSURFACE CLTWnd::SetSurface(HSURFACE hSurf, BOOL bDeleteSurf)
{
	if(hSurf == m_hSurf)
		return m_hSurf;

	// Get the dims of the current surface
	HSURFACE hSurfTemp = m_hSurf;
	m_hSurf = hSurf;
	DWORD x, y;
    g_pLTClient->GetSurfaceDims(hSurf, &x, &y);

/*#ifdef _DEBUG
	if(((int)x != m_nSurfWidth) || ((int)y != m_nSurfHeight))
	{
		TRACE("CLTWnd::SetSurf - WARNING - Surface dimensions changed from %d,%d to %d,%d!\n",m_nSurfWidth,m_nSurfHeight,x,y);
	}
#endif*/

	m_nSurfWidth = m_nWidth = (int)x;
	m_nSurfHeight = m_nHeight = (int)y;

	// Delete the old surface if so desired
	if (bDeleteSurf)
	{
		TERMSHAREDSURF(hSurfTemp);
		return NULL;
	}
	return hSurfTemp;
}
Esempio n. 3
0
// ----------------------------------------------------------------------- //
//
//	ROUTINE:	CLTWnd::InitFromBitmap
//
//	PURPOSE:	Initialization
//
// ----------------------------------------------------------------------- //
BOOL CLTWnd::InitFromBitmap(int nControlID, char* szWndName, CLTWnd* pParentWnd, char* szBitmap, int xPos, int yPos, DWORD dwFlags, DWORD dwState)
{
	// Sanity Check
	if(m_bInitialized)
		return FALSE;

	// We will be deleting the surface
	m_bDeleteSurfOnTerm = TRUE;

	// Create the surface
	HSURFACE hSurf = g_pInterfaceResMgr->GetSharedSurface(szBitmap);
//  HSURFACE hSurf = g_pLTClient->CreateSurfaceFromBitmap(szBitmap);
	if(!hSurf)
	{
		TRACE("CLTWnd::InitFromBitmap - ERROR - Could not create the surface: ""%s""\n",szBitmap);
		return FALSE;
	}

	if(!Init(nControlID,szWndName,pParentWnd,hSurf,xPos,yPos,dwFlags,dwState))
	{
		TERMSHAREDSURF(hSurf);
		return FALSE;
	}

	return TRUE;
}
// ----------------------------------------------------------------------- //
//
//	ROUTINE:	CLTDialogueWnd::Term
//
//	PURPOSE:	Termination
//
// ----------------------------------------------------------------------- //
void CLTDialogueWnd::Term()
{
	// Term the frames
	for(int i=0;i<m_collFrames.GetSize();i++)
	{
		TERMSHAREDSURF(m_collFrames[i]);
	}
	m_collFrames.RemoveAll();

	// Term the decision window
	m_DecisionWnd.Term();

	// Term the picture
	m_Pic.Term();

	// Free extra stuff
    m_lfsd.szPrevString = NULL;

	// Base class
	CLTMaskedWnd::Term();
}