示例#1
0
static void near FiltOrigin(void *v, char *words[], char *line)
{
  char *txt=fchar(line, ctl_delim, 3);

  if (*words[1] != '.')
  {
    if (! isdigit(*words[1]))
    {
      printf("\a\nWarning!  First word after 'Origin' on line %d must be a network address.\n",
             linenum);
      Compiling(-1, NULL, NULL);
    }

    ParseNNN(words[1], &PMI(v)->ma.primary, FALSE);
  }

  if (*words[2] != '.')
  {
    if (! isdigit(*words[2]))
    {
      printf("\a\nWarning!  Second word after 'Origin' on line %d must be a network address.\n",
             linenum);
      Compiling(-1, NULL, NULL);
    }

    ParseNNN(words[2], &PMI(v)->ma.seenby, FALSE);
  }

  strocpy(line, txt);
}
示例#2
0
文件: s_misc.c 项目: klamonte/maximus
void near FiltOverride(void *v, char *words[], char *line)
{
  OVRLIST ol=malloc(sizeof(*ol));
  int idx;

  NW(line);

  if (!ol)
    NoMem();

/* 0        1       2         3          4 */
/* override message msg_reply sysop/1234 R */

  if (!*words[1])
  {
    printf("Error!  No menu name specified for override on line %d!\n", linenum);
    return;
  }

  if (!*words[3])
  {
    printf("Error!  No access control string specified for override on line %d!\n", linenum);
    return;
  }

  if ((idx=tsearch(words[2], silt_table, silt_table_size)) != -1)
    ol->or.opt=silt_table[idx].opt;
  else Unknown_Ctl(linenum, words[2]);

  if (*words[4])
    ol->or.name=*words[4];
  else ol->or.name=0;

  if (PFI(v)->marea)
  {
    HeapAdd(&PMI(v)->h, &ol->or.menuname, words[1]);
    HeapAdd(&PMI(v)->h, &ol->or.acs, words[3]);

    /* Add this to the linked list of override options */

    ol->next=PMI(v)->ol;
    PMI(v)->ol=ol;

    PMI(v)->ma.num_override++;
  }
  else
  {
    HeapAdd(&PFI(v)->h, &ol->or.menuname, words[1]);
    HeapAdd(&PFI(v)->h, &ol->or.acs, words[3]);

    /* Add this to the linked list of override options */

    ol->next=PFI(v)->ol;
    PFI(v)->ol=ol;

    PFI(v)->fa.num_override++;
  }
}
示例#3
0
static void near FiltBarricade(void *v, char *words[], char *line)
{
  NW(line);

  if (! *words[1] || !*words[2])
  {
    printf("\n\aError!  Two arguments required for Barricade keyword on line %d!\n", linenum);
    Compiling(-1,NULL,NULL);
  }

  HeapAdd(&PMI(v)->h, &PMI(v)->ma.barricademenu, words[1]);
  HeapAdd(&PMI(v)->h, &PMI(v)->ma.barricade, words[2]);
}
示例#4
0
void CN3PMesh::ReGenerateSharpNormal()
{
	if(m_iMaxNumVertices <= 0) return;

	CN3PMeshInstance PMI(this);
	PMI.SetLODByNumVertices(m_iMaxNumVertices); // 최대 점으로 세팅하고..
	int nIC = PMI.GetNumIndices(); // Index Count...
	WORD* pwIndices = PMI.GetIndices(); // Index ...

	int nFC = nIC / 3;
	__Vector3 v0, v1, v2, vN(0,0,0);
	for(int j = 0; j < nFC; j++)
	{
		v0 = m_pVertices[pwIndices[j*3+0]];
		v1 = m_pVertices[pwIndices[j*3+1]];
		v2 = m_pVertices[pwIndices[j*3+2]];

		vN.Cross(v1 - v0, v2 - v1); // Normal 값을 계산하고...
		vN.Normalize();

		m_pVertices[pwIndices[j*3+0]].n = vN;
		m_pVertices[pwIndices[j*3+1]].n = vN;
		m_pVertices[pwIndices[j*3+2]].n = vN;
	}

}
示例#5
0
static void near FiltRenum(void *v, char *words[], char *line)
{
  int atoi2;

  NW(line);

  atoi2=atoi(words[2]);

  if (eqstri(words[1], "max"))
    PMI(v)->ma.killbynum=atoi2;
  else if (eqstri(words[1], "days"))
    PMI(v)->ma.killbyage=atoi2;
  else if (eqstri(words[1], ""))
    PMI(v)->ma.killskip=atoi2;
  else
    Unknown_Ctl(linenum, words[2]);
}
示例#6
0
文件: s_misc.c 项目: klamonte/maximus
void near FiltMenuname(void *v, char *words[], char *line)
{
  NW(line);

  if (! *words[1] || !*words[2])
    printf("\n\aError!  Two arguments must be specified for the MenuName keyword!\n");

  if (PFI(v)->marea)
  {
    HeapAdd(&PMI(v)->h, &PMI(v)->ma.menureplace, words[1]);
    HeapAdd(&PMI(v)->h, &PMI(v)->ma.menuname, words[2]);
  }
  else
  {
    HeapAdd(&PFI(v)->h, &PFI(v)->fa.menureplace, words[1]);
    HeapAdd(&PFI(v)->h, &PFI(v)->fa.menuname, words[2]);
  }
}
示例#7
0
void CN3PMesh::ReGenerateSmoothNormal()
{
	if(m_iMaxNumVertices <= 0) return;

	CN3PMeshInstance PMI(this);
	PMI.SetLODByNumVertices(m_iMaxNumVertices); // 최대 점으로 세팅하고..
	int nIC = PMI.GetNumIndices(); // Index Count...
	WORD* pwIndices = PMI.GetIndices(); // Index ...

	int* pnNs = new int[m_iMaxNumVertices];
	memset(pnNs, 0, 4 * m_iMaxNumVertices);
	__Vector3* pvNs = new __Vector3[m_iMaxNumVertices];
	memset(pvNs, 0, sizeof(__Vector3)*m_iMaxNumVertices);

	int nFC = nIC / 3;

	__Vector3 v0, v1, v2, vN(0,0,0);
	for(int i = 0; i < m_iMaxNumVertices; i++)
	{
		for(int j = 0; j < nFC; j++)
		{
			v0 = m_pVertices[pwIndices[j*3+0]];
			v1 = m_pVertices[pwIndices[j*3+1]];
			v2 = m_pVertices[pwIndices[j*3+2]];

			if(	m_pVertices[i] == v0 ||
				m_pVertices[i] == v1 ||
				m_pVertices[i] == v2 )
			{
				vN.Cross(v1 - v0, v2 - v1); // Normal 값을 계산하고...
				vN.Normalize();

				pnNs[i]++;
				pvNs[i] += vN;
			}
		}

		if(pnNs[i] > 0) m_pVertices[i].n = pvNs[i] / (float)pnNs[i];
	}

	delete [] pnNs;
	delete [] pvNs;
}
示例#8
0
static void near FiltStyle(void *v, char *words[], char *line)
{
  int w;  /* Word number */

  static struct
  {
    char *name;
    word mask1;
    word mask2;
  } *pst, style_tab[]=
    {
      {"Pvt",           MA_PVT,     0},
      {"Private",       MA_PVT,     0},
      {"Pub",           MA_PUB,     0},
      {"Public",        MA_PUB,     0},
      {"ReadOnly",      MA_READONLY,0},
      {"HiBit",         MA_HIBIT,   0},
      {"HighBit",       MA_HIBIT,   0},
      {"Net",           MA_NET,     0},
      {"Matrix",        MA_NET,     0},
      {"Echo",          MA_ECHO,    0},
      {"EchoMail",      MA_ECHO,    0},
      {"Conf",          MA_CONF,    0},
      {"Conference",    MA_CONF,    0},
      {"Loc",           0,          0},
      {"Local",         0,          0},
      {"Anon",          MA_ANON,    0},
      {"Anonymous",     MA_ANON,    0},
      {"NoNameKludge",  MA_NORNK,   0},
      {"RealName",      MA_REAL,    0},
      {"Alias",         MA_ALIAS,   0},
      {"Audit",         MA_AUDIT,   0},
      {"Hidden",        MA_HIDDN,   0},
      {"Attach",        MA_ATTACH,  0},
      {"NoMailCheck",   0,          MA2_NOMCHK},
      {NULL, 0}
    };

  NW(line);

  /* Parse all of the known keywords */

  for (w=1; w < MAX_PARSE_WORDS && *words[w]; w++)
  {
    for (pst=style_tab; pst->name; pst++)
      if (eqstri(words[w], pst->name))
      {
        PMI(v)->ma.attribs |= pst->mask1;
        PMI(v)->ma.attribs_2 |= pst->mask2;
        break;
      }

    if (!pst->name)
    {
      /* Handle exceptions */

      if (eqstri(words[w], "squish"))
        PMI(v)->ma.type=MSGTYPE_SQUISH;
      else if (eqstri(words[w], "*.msg") || eqstri(words[w], "sdm"))
        PMI(v)->ma.type=MSGTYPE_SDM;
      else
        Unknown_Ctl(linenum, words[w]);
    }
  }
}