Commit ae9bc7d6 authored by D-AIRY's avatar D-AIRY

Support for !this, !parent ent names

parent 822e2412
......@@ -73,6 +73,8 @@ struct VSI_Animation
half3 vPosition : POSITION0;
half2 vTexUV : TEXCOORD0;
half3 vNormal : NORMAL0;
half3 vTangent : TANGENT0;
half3 vBinormal : BINORMAL0;
uint4 vBones : BLENDINDICES0;
half4 vWeights : BLENDWEIGHT0;
};
......
......@@ -14,7 +14,7 @@ See the license in LICENSE
BEGIN_PROPTABLE(CBaseAnimating)
//! Файл модели. Поддерживаются статические и анимированные модели
DEFINE_FIELD_STRING(m_szModelFile, 0, "model", "Model file", EDITOR_FILEFIELD)
FILE_OPTION("Model file (*.dse)", "*.dse")
FILE_OPTION("Select model", "dse")
EDITOR_FILE_END()
//! Масштаб модели
......
......@@ -616,6 +616,34 @@ CEntityManager * CBaseEntity::getManager()
return(m_vDiscreteLinearVelocity);
}*/
CBaseEntity *CBaseEntity::getEntByName(const char *szName, CBaseEntity *pStartFrom)
{
if(!strcmp(szName, "!this"))
{
return(pStartFrom ? NULL : this);
}
if(!strcmp(szName, "!parent"))
{
return(pStartFrom ? NULL : getParent());
}
return(m_pMgr->findEntityByName(szName, pStartFrom));
}
int CBaseEntity::countEntByName(const char *szName)
{
if(!strcmp(szName, "!this"))
{
return(1);
}
if(!strcmp(szName, "!parent"))
{
return(getParent() ? 1 : 0);
}
return(m_pMgr->countEntityByName(szName));
}
void CBaseEntity::updateOutputs()
{
proptable_t * pt = getPropTable();
......@@ -632,7 +660,7 @@ void CBaseEntity::updateOutputs()
named_output_t * pOut = &pOutput->pOutputs[j];
mem_delete_a(pOut->pOutputs);
pOut->iOutCount = m_pMgr->countEntityByName(pOut->szTargetName);
pOut->iOutCount = countEntByName(pOut->szTargetName);
if(!pOut->iOutCount)
{
printf(COLOR_CYAN "Broken output target '%s' source '%s'.'%s'\n" COLOR_RESET, pOut->szTargetName, getClassName(), m_szName);
......@@ -644,7 +672,7 @@ void CBaseEntity::updateOutputs()
CBaseEntity * pEnt = NULL;
int c = 0;
while((pEnt = m_pMgr->findEntityByName(pOut->szTargetName, pEnt)))
while((pEnt = getEntByName(pOut->szTargetName, pEnt)))
{
propdata_t * pField = pEnt->getField(pOut->szTargetInput);
if(!pField || !(pField->flags & PDFF_INPUT))
......
......@@ -132,6 +132,9 @@ private:
const char * m_szClassName;
CBaseEntity *getEntByName(const char *szName, CBaseEntity *pStartFrom);
int countEntByName(const char *szName);
protected:
virtual void _cleanup();
......
......@@ -23,7 +23,7 @@ BEGIN_PROPTABLE(CPropBreakable)
DEFINE_FIELD_FLOAT(m_fHealth, PDFF_NONE, "health", "Health", EDITOR_TEXTFIELD)
DEFINE_FIELD_STRING(m_szSndBreak, PDFF_NONE, "snd_break", "Break sound", EDITOR_FILEFIELD)
FILE_OPTION("Sound (*.ogg)", "*.ogg")
FILE_OPTION("Select sound", "ogg")
EDITOR_FILE_END()
END_PROPTABLE()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment