//-----------------------------------------------------------------------------
// Purpose: Replaces any missing textures with the default texture.
// Input  : pError - 
//-----------------------------------------------------------------------------
static void FixInvalidTexture(MapError *pError)
{
	CMapSolid *pSolid = (CMapSolid *)pError->pObjects[0];

	int nFaces = pSolid->GetFaceCount();
	for (int i = 0; i < nFaces; i++)
	{
		CMapFace *pFace = pSolid->GetFace(i);
		if (pFace != NULL)
		{
			IEditorTexture *pTex = pFace->GetTexture();
			if (pTex != NULL)
			{
				if (pTex->IsDummy())
				{
					pFace->SetTexture(GetDefaultTextureName());
				}
			}
		}
	}
}
//-----------------------------------------------------------------------------
// Purpose: Determines if there are any invalid textures or texture axes on any
//			face of this solid. Adds an error message to the list box for each
//			error found.
// Input  : pSolid - Solid to check.
//			pList - Pointer to the error list box.
// Output : Returns TRUE.
//-----------------------------------------------------------------------------
static BOOL _CheckInvalidTextures(CMapSolid *pSolid, CListBox *pList)
{
	int nFaces = pSolid->GetFaceCount();
	for(int i = 0; i < nFaces; i++)
	{
		const CMapFace *pFace = pSolid->GetFace(i);

		IEditorTexture *pTex = pFace->GetTexture();
		if (pTex->IsDummy())
		{
			AddError(pList, ErrorInvalidTexture, (DWORD)pFace->texture.texture, pSolid);
			return TRUE;
		}

		if (!pFace->IsTextureAxisValid())
		{
			AddError(pList, ErrorInvalidTextureAxes, i, pSolid);
			return(TRUE);
		}
	}
	
	return(TRUE);
}