bool wxsCorrector::GlobalCheck()
{
    // It will be done in two passes,
    // first will correct all invalid names, second will fill empty names

    wxsItem* RootItem = m_Data->GetRootItem();
    m_Vars.clear();
    m_Ids.clear();
    bool AreInvalid = FixAfterLoadCheckNames(RootItem);
    for ( int i=0; i<m_Data->GetToolsCount(); i++ )
    {
        if ( !FixAfterLoadCheckNames(m_Data->GetTool(i)) )
        {
            AreInvalid = false;
        }
    }
    bool AreEmpty = FillEmpty(RootItem);
    for ( int i=0; i<m_Data->GetToolsCount(); i++ )
    {
        if ( !FillEmpty(m_Data->GetTool(i)) )
        {
            AreEmpty = false;
        }
    }

    m_NeedRebuild = false;

    if ( AreInvalid || AreEmpty ) return true;
    return false;
}
Beispiel #2
0
IDirect3DSurface9 * HoeRenderTexture::GetSurface()
{
	IDirect3DSurface9 * sur = NULL;
#else
IDirect3DSurface8 * HoeRenderTexture::GetSurface()
{
	IDirect3DSurface8 * sur = NULL;
#endif
	assert(m_texture);
	HRESULT hRef = m_texture->GetSurfaceLevel(0,&sur);
	assert(hRef==S_OK);
	return sur;
}
#endif

///////////////////////////////////////////////////
bool HoeVideoTexture::Create(uint w,uint h,HOEFORMAT f)
{
	width = w;
	height = h;
	format = f;
#ifdef _HOE_D3D_
	HRESULT hRes;
	hRes = D3DDevice()->CreateTexture(w,h,1,D3DUSAGE_DYNAMIC,HoeFormatX(f),D3DPOOL_DEFAULT,&m_texture RESERVE_PAR);
	assert(hRes==S_OK);
#endif
#ifdef _HOE_OPENGL_
	glGenTextures(1,&m_texture);
	FillEmpty();
#endif
	return true;
}
Beispiel #3
0
bool HoeRenderTexture::Create(uint w,uint h,HOEFORMAT f)
{
	width = w;
	height = h;
	format = f;
#ifdef _HOE_D3D_
	HRESULT hRes;
	hRes = D3DDevice()->CreateTexture(w,h,1,D3DUSAGE_RENDERTARGET,HoeFormatX(f),D3DPOOL_DEFAULT,&m_texture RESERVE_PAR);
	assert(hRes==S_OK);
#endif
#ifdef _HOE_OPENGL_
	glGenTextures(1,&m_texture);
	FillEmpty();
#endif
	return true;
}
bool wxsCorrector::FillEmpty(wxsItem* Item)
{
    bool Ret = false;
    if ( Item->GetPropertiesFlags() & flVariable )
    {
        if ( Item->GetVarName().empty() )
        {
            Ret = true;
            SetNewVarName(Item);
            m_Vars.insert(Item->GetVarName());
        }
    }
    if ( Item->GetPropertiesFlags() & flId )
    {
        if ( Item->GetIdName().empty() )
        {
            Ret = true;
            SetNewIdName(Item);
            if (!IsWxWidgetsIdPrefix(Item->GetIdName()))
            {
                m_Ids.insert(Item->GetIdName());
            }
        }
    }

    wxsParent* Parent = Item->ConvertToParent();
    if ( Parent )
    {
        int Count = Parent->GetChildCount();
        for ( int i=0; i<Count; i++ )
        {
            if ( FillEmpty(Parent->GetChild(i)) ) Ret = true;
        }
    }
    return Ret;
}