void CEsmSpellDlg::SetEffectData (void) {

    CEsmSubENAM*	pEffectRecord;

    int		RecordIndex;

    int		EffectIndex;



    pEffectRecord = (CEsmSubENAM *) m_pSpell->FindFirst(MWESM_SUBREC_ENAM, RecordIndex);



    for (EffectIndex = 0; EffectIndex < MWESM_ENCHANT_NUMENCHANTS; EffectIndex++) {

        SetEffectData(EffectIndex, pEffectRecord);

        pEffectRecord =  (CEsmSubENAM *) m_pSpell->FindNext(MWESM_SUBREC_ENAM, RecordIndex);

    }



}
// -----------------------------------------------------------------------------
// CSourceLocationProxy::ConstructL
// -----------------------------------------------------------------------------
//
void CSourceLocationProxy::ConstructL()
    {
    iSourceLocationEventObserver = CSourceLocationEventObserver::NewL(iMessageHandler, *iCustomCommand, *this);
    StartObserver();

    TEfLocationDataPckg dataPckgFrom;
    // sends a message to fetch initial data.
	iCustomCommand->CustomCommandSync(iMessageHandler, (TInt)ESlfInitialize, KNullDesC8, KNullDesC8, dataPckgFrom);
	SetEffectData(dataPckgFrom);
	}
void CAMeshSHSkin::Render ()
{
	SetEffectData ();

	// only one pass
	m_pEffect->Begin (NULL,0);
	m_pEffect->BeginPass (0);

	APROJECT_WINDOW->GetD3DDevice ()->DrawIndexedPrimitive (D3DPT_TRIANGLELIST, 0, 0, m_nNumVertices, 0, m_nNumTriangles);

	m_pEffect->EndPass ();
	m_pEffect->End ();
}
Beispiel #4
0
void DxStdMtl2::Draw()
{
	bool	NegScale;

	if(!IsDxMaterialEnabled(map))
		return;

	TimeValue m_T = GetCOREInterface()->GetTime();
	NegScale = TMNegParity(mpMeshCache->GetActiveNode(m_CurCache)->GetObjTMAfterWSM(m_T));
	Mtl * m_Mtl	 = mpMeshCache->GetActiveNode(m_CurCache)->GetMtl();


	Color  col = GetCOREInterface()->GetViewportBGColor();
	D3DCOLOR bkgColor = col.toRGB();
	
	if(!pd3dDevice)
		pd3dDevice = GetDevice();


	int w =0, h =0;
	myGWindow->GetWindowDimension(w,h);
	SetRenderStates();

	if(pEffectParser)
	{
		SetEffectData();
		if(!pEffectParser->PreRender(pd3dDevice,mpMeshCache->GetActiveRenderMesh(m_CurCache),this,this,bkgColor, w,h))
		{
			DrawError();
			return;
		}

		if(!mpMeshCache->GetActiveRenderMesh(m_CurCache)->Evaluate(pd3dDevice, mpMeshCache->GetActiveMesh(m_CurCache),GetMatIndex(m_Mtl),NegScale))
			return;

		
		if(!pEffectParser->Render(pd3dDevice,mpMeshCache->GetActiveRenderMesh(m_CurCache),techniqueName.data()))
		{
			DrawError();
			return;

		}
	}
	//draw the object in Red WireFrame mode for testing purposes
	else 
	{
		DrawError();		
	}

}
void CEsmSpellDlg::SetControlData (void) {



    /* Ignore if the current item is not valid */

    if (m_pSpell == NULL) return;



    /* Armor ID, update title as well */

    m_IDText.SetWindowText(m_pSpell->GetID());

    UpdateTitle(m_pSpell->GetID());



    /* Spell type */

    FindComboListItem(m_TypeList, m_pSpell->GetSpellTypeID(), true);

    m_DisableCost = !(( m_pSpell->GetSpellTypeID() == MWESM_SPELLTYPE_SPELL) || ( m_pSpell->GetSpellTypeID() == MWESM_SPELLTYPE_POWER));



    /* Item strings and values */

    m_NameText.SetWindowText(m_pSpell->GetName());

    m_CostText.SetWindowText(m_pSpell->GetFieldString(ESM_FIELD_COST));

    m_CostText.EnableWindow(!m_pSpell->IsAutoCalc() && !m_DisableCost);

    m_CostText.SetModify(FALSE);

    m_NameText.SetModify(FALSE);



    /* Record flags */

    m_AutoCalcCheck.SetCheck(m_pSpell->IsAutoCalc());

    m_AutoCalcCheck.EnableWindow(!m_DisableCost);

    m_SucceedCheck.SetCheck(m_pSpell->IsSucceeds());

    m_BlockedCheck.SetCheck(m_pSpell->IsBlocked());

    m_PCStartCheck.SetCheck(m_pSpell->IsPCStart());

    m_PCStartCheck.EnableWindow(m_pSpell->GetSpellTypeID() == MWESM_SPELLTYPE_SPELL);



    /* Set the effect data */

    SetEffectData();

}