当前位置: 首页>>代码示例>>C++>>正文


C++ P_FindSectorFromLineTag函数代码示例

本文整理汇总了C++中P_FindSectorFromLineTag函数的典型用法代码示例。如果您正苦于以下问题:C++ P_FindSectorFromLineTag函数的具体用法?C++ P_FindSectorFromLineTag怎么用?C++ P_FindSectorFromLineTag使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了P_FindSectorFromLineTag函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: EV_ClearForceFields

//
// EV_ClearForceFields
//
// villsa [STRIFE] new function
//
boolean EV_ClearForceFields(line_t* line)
{
    int         secnum;
    sector_t*   sec;
    int         i;
    line_t*     secline;
    boolean     ret = false;

    secnum = -1;

    while((secnum = P_FindSectorFromLineTag(line,secnum)) >= 0)
    {
        sec = &sectors[secnum];

        line->special = 0;
        ret = true;

        // haleyjd 09/18/10: fixed to continue w/linecount == 0, not return
        for(i = 0; i < sec->linecount; i++)
        {
            secline = sec->lines[i];
            if(!(secline->flags & ML_TWOSIDED))
                continue;
            if(secline->special != 148)
                continue;

            secline->flags &= ~ML_BLOCKING;
            secline->special = 0;
            sides[secline->sidenum[0]].midtexture = 0;
            sides[secline->sidenum[1]].midtexture = 0;
        }
    }

    return ret;
}
开发者ID:M-Code,项目名称:chocolate-doom,代码行数:40,代码来源:p_doors.c

示例2: EV_LightTurnOn

//
// TURN LINE'S TAG LIGHTS ON
//
void EV_LightTurnOn(line_t *line, int bright)
{
    int		i;
    int		j;
    sector_t	*sector;
    sector_t	*temp;
    line_t	*templine;

    for (i = -1; (i = P_FindSectorFromLineTag(line, i)) >= 0;)
    {
        sector = sectors + i;
        // bright = 0 means to search
        // for highest light level
        // surrounding sector
        if (!bright)
        {
            for (j = 0; j < sector->linecount; j++)
            {
                templine = sector->lines[j];
                temp = getNextSector(templine, sector);

                if (!temp)
                    continue;

                if (temp->lightlevel > bright)
                    bright = temp->lightlevel;
            }
        }
        sector-> lightlevel = bright;
    }
}
开发者ID:smokhov,项目名称:atsm,代码行数:34,代码来源:p_lights.c

示例3: EV_LightTurnOn

//
// EV_LightTurnOn()
//
// Turn sectors tagged to line lights on to specified or max neighbor level
//
// Passed the activating line, and a level to set the light to
// If level passed is 0, the maximum neighbor lighting is used
// Returns true
//
// jff 2/12/98 added int return value, fixed return
//
int EV_LightTurnOn(line_t *line, int bright)
{
  int i;

  // search all sectors for ones with same tag as activating line

  // killough 10/98: replace inefficient search with fast search
  for (i = -1; (i = P_FindSectorFromLineTag(line,i)) >= 0;)
    {
      sector_t *temp, *sector = sectors+i;
      int j, tbright = bright; //jff 5/17/98 search for maximum PER sector

      // bright = 0 means to search for highest light level surrounding sector

      if (!bright)
	for (j = 0;j < sector->linecount; j++)
	  if ((temp = getNextSector(sector->lines[j],sector)) &&
	      temp->lightlevel > tbright)
	    tbright = temp->lightlevel;

      sector->lightlevel = tbright;
      
      //jff 5/17/98 unless compatibility optioned 
      //then maximum near ANY tagged sector
      if (compatibility)
	bright = tbright;
    }
  return 1;
}
开发者ID:hexameron,项目名称:DOOM,代码行数:40,代码来源:p_lights.c

示例4: EV_TurnTagLightsOff

//
// TURN LINE'S TAG LIGHTS OFF
//
void EV_TurnTagLightsOff(line_t *line)
{
    int			i;
    int			j;
    int			min;
    sector_t		*sector;
    sector_t		*tsec;
    line_t		*templine;

    for (j = -1; (j = P_FindSectorFromLineTag(line, j)) >= 0;)
    {
        sector = sectors + j;
        min = sector->lightlevel;
        for (i = 0; i < sector->linecount; i++)
        {
            templine = sector->lines[i];
            tsec = getNextSector(templine, sector);
            if (!tsec)
                continue;
            if (tsec->lightlevel < min)
                min = tsec->lightlevel;
        }
        sector->lightlevel = min;
    }
}
开发者ID:smokhov,项目名称:atsm,代码行数:28,代码来源:p_lights.c

示例5: EV_DoDonut

//
// Special Stuff that can not be categorized
//
int EV_DoDonut(line_t*	line)
{
    sector_t*		s1;
    sector_t*		s2;
    sector_t*		s3;
    int			secnum;
    int			rtn;
    int			i;
    floormove_t*	floor;
	
    secnum = -1;
    rtn = 0;
    while ((secnum = P_FindSectorFromLineTag(line,secnum)) >= 0)
    {
	s1 = &sectors[secnum];
		
	// ALREADY MOVING?  IF SO, KEEP GOING...
	if (s1->specialdata)
	    continue;
			
	rtn = 1;
	s2 = getNextSector(s1->lines[0],s1);
	for (i = 0;i < s2->linecount;i++)
	{
		//isn't this always false?
	    /*if ((!s2->lines[i]->flags & ML_TWOSIDED) ||
		(s2->lines[i]->backsector == s1))
		continue;*/
	    s3 = s2->lines[i]->backsector;
	    
	    //	Spawn rising slime
	    floor = (floormove_t*)malloc (sizeof(*floor));
	    P_AddThinker (&floor->thinker);
	    s2->specialdata = floor;
	    floor->thinker.function.acp1 = (actionf_p1) T_MoveFloor;
	    floor->type = donutRaise;
	    floor->crush = false;
	    floor->direction = Direction::UP;
	    floor->sector = s2;
	    floor->speed = FLOORSPEED / 2;
	    floor->texture = s3->floorpic;
	    floor->newspecial = 0;
	    floor->floordestheight = s3->floorheight;
	    
	    //	Spawn lowering donut-hole
	    floor = (floormove_t*)malloc (sizeof(*floor));
	    P_AddThinker (&floor->thinker);
	    s1->specialdata = floor;
	    floor->thinker.function.acp1 = (actionf_p1) T_MoveFloor;
	    floor->type = lowerFloor;
	    floor->crush = false;
	    floor->direction = Direction::DOWN;
	    floor->sector = s1;
	    floor->speed = FLOORSPEED / 2;
	    floor->floordestheight = s3->floorheight;
	    break;
	}
    }
    return rtn;
}
开发者ID:JonnyPtn,项目名称:SFML-DOOM,代码行数:63,代码来源:p_spec.cpp

示例6: P_DoSectorLightChange

int P_DoSectorLightChange(line_t* line, short tag) {
    int j = 0;
    int ptr1 = 0;
    int ptr2 = 0;
    sector_t* sec1;
    sector_t* sec2;
    int secnum;
    int rtn;

    secnum = P_FindSectorFromTag(tag);

    if(secnum == -1) {
        return 0;
    }

    sec2 = &sectors[secnum];
    
    secnum = -1;
    rtn = 0;

    while((secnum = P_FindSectorFromLineTag(line, secnum)) >= 0) {
        sec1 = &sectors[secnum];
        rtn = 1;

        for(j = 0; j < 5; j++) {
            ptr1 = (sec1->colors[j]);
            ptr2 = (sec2->colors[j]);
            P_UpdateLightThinker(&lights[ptr1], &lights[ptr2]);
        }
    }

    return 1;
}
开发者ID:directhex,项目名称:doom64,代码行数:33,代码来源:p_lights.c

示例7: EV_LightTurnOnPartway

int EV_LightTurnOnPartway(line_t *line, fixed_t level)
{
   int i;

   if (level < 0)          // clip at extremes
      level = 0;
   if (level > FRACUNIT)
      level = FRACUNIT;

   // search all sectors for ones with same tag as activating line
   for (i = -1; (i = P_FindSectorFromLineTag(line,i)) >= 0;)
   {
      sector_t *temp, *sector = sectors+i;
      int j, bright = 0, min = sector->lightlevel;

      for (j = 0; j < sector->linecount; j++)
         if ((temp = getNextSector(sector->lines[j],sector)))
         {
            if (temp->lightlevel > bright)
               bright = temp->lightlevel;
            if (temp->lightlevel < min)
               min = temp->lightlevel;
         }

      sector->lightlevel =   // Set level in-between extremes
         (level * bright + (FRACUNIT-level) * min) >> FRACBITS;
   }
   return 1;
}
开发者ID:4nykey,项目名称:rockbox,代码行数:29,代码来源:p_lights.c

示例8: EV_LightTurnOn

int EV_LightTurnOn(line_t *line, int bright)
{

    int i;

    for (i = -1; (i = P_FindSectorFromLineTag(line, i)) >= 0;)
    {

        sector_t *temp, *sector = sectors + i;
        int j, tbright = bright;

        if (!bright)
        {

            for (j = 0;j < sector->linecount; j++)
            {

                if ((temp = getNextSector(sector->lines[j],sector)) && temp->lightlevel > tbright)
                    tbright = temp->lightlevel;

            }

            sector->lightlevel = tbright;

        }

    }

    return 1;

}
开发者ID:jezze,项目名称:doom,代码行数:31,代码来源:p_lights.c

示例9: EV_TurnTagLightsOff

int EV_TurnTagLightsOff(line_t *line)
{

    int j;

    for (j = -1; (j = P_FindSectorFromLineTag(line,j)) >= 0;)
    {

        sector_t *sector = sectors + j, *tsec;
        int i, min = sector->lightlevel;

        for (i = 0;i < sector->linecount; i++)
        {

            if ((tsec = getNextSector(sector->lines[i], sector)) && tsec->lightlevel < min)
                min = tsec->lightlevel;

        }

        sector->lightlevel = min;

    }

    return 1;

}
开发者ID:jezze,项目名称:doom,代码行数:26,代码来源:p_lights.c

示例10: EV_RemoteSlidingDoor

//
// EV_RemoteSlidingDoor
//
// villsa [STRIFE] new function
//
int EV_RemoteSlidingDoor(line_t* line, mobj_t* thing)
{
    int		    secnum;
    sector_t*       sec;
    int             i;
    int             rtn;
    line_t*         secline;
	
    secnum = -1;
    rtn = 0;
    
    while((secnum = P_FindSectorFromLineTag(line,secnum)) >= 0)
    {
        sec = &sectors[secnum];
        if(sec->specialdata)
            continue;

        for(i = 0; i < 4; i++)
        {
            secline = sec->lines[i];

            if(P_FindSlidingDoorType(secline) < 0)
                continue;

            EV_SlidingDoor(secline, thing);
            rtn = 1;
        }
    }

    return rtn;
}
开发者ID:M-Code,项目名称:chocolate-doom,代码行数:36,代码来源:p_doors.c

示例11: EV_DoDoor

int EV_DoDoor(line_t * line, vldoor_e type, fixed_t speed)
{
    int secnum;
    int retcode;
    sector_t *sec;
    vldoor_t *door;

    secnum = -1;
    retcode = 0;
    while ((secnum = P_FindSectorFromLineTag(line, secnum)) >= 0)
    {
        sec = &sectors[secnum];
        if (sec->specialdata)
        {
            continue;
        }
        // Add new door thinker
        retcode = 1;
        door = Z_Malloc(sizeof(*door), PU_LEVSPEC, 0);
        P_AddThinker(&door->thinker);
        sec->specialdata = door;
        door->thinker.function = T_VerticalDoor;
        door->sector = sec;
        switch (type)
        {
            case close:
                door->topheight = P_FindLowestCeilingSurrounding(sec);
                door->topheight -= 4 * FRACUNIT;
                door->direction = -1;
                S_StartSound(&door->sector->soundorg, sfx_doropn);
                break;
            case close30ThenOpen:
                door->topheight = sec->ceilingheight;
                door->direction = -1;
                S_StartSound(&door->sector->soundorg, sfx_doropn);
                break;
            case normal:
            case open:
                door->direction = 1;
                door->topheight = P_FindLowestCeilingSurrounding(sec);
                door->topheight -= 4 * FRACUNIT;
                if (door->topheight != sec->ceilingheight)
                {
                    S_StartSound(&door->sector->soundorg,
                                 sfx_doropn);
                }
                break;
            default:
                break;
        }
        door->type = type;
        door->speed = speed;
        door->topwait = VDOORWAIT;
    }
    return (retcode);
}
开发者ID:Krazygamr,项目名称:D-Touch,代码行数:56,代码来源:p_doors.c

示例12: EV_StartLightStrobing

void EV_StartLightStrobing(line_t* line) {
    int            secnum;
    sector_t*    sec;

    secnum = -1;
    while((secnum = P_FindSectorFromLineTag(line, secnum)) >= 0) {
        sec = &sectors[secnum];
        if(sec->specialdata) {
            continue;
        }

        P_SpawnStrobeFlash(sec, SLOWDARK);
    }
}
开发者ID:directhex,项目名称:doom64,代码行数:14,代码来源:p_lights.c

示例13: EV_StartLightStrobing

//
// EV_StartLightStrobing()
//
// Start strobing lights (usually from a trigger)
//
// Passed the line that activated the strobing
// Returns true
//
// jff 2/12/98 added int return value, fixed return
//
int EV_StartLightStrobing(line_t* line)
{
  int   secnum;
  sector_t* sec;

  secnum = -1;
  // start lights strobing in all sectors tagged same as line
  while ((secnum = P_FindSectorFromLineTag(line,secnum)) >= 0)
  {
    sec = &sectors[secnum];
    // if already doing a lighting function, don't start a second
    if (P_SectorActive(lighting_special,sec)) //jff 2/22/98
      continue;

    P_SpawnStrobeFlash (sec,SLOWDARK, 0);
  }
  return 1;
}
开发者ID:hexameron,项目名称:DOOM,代码行数:28,代码来源:p_lights.c

示例14: EV_TurnTagLightsOff

//
// EV_TurnTagLightsOff()
//
// Turn line's tagged sector's lights to min adjacent neighbor level
//
// Passed the line that activated the lights being turned off
// Returns true
//
// jff 2/12/98 added int return value, fixed return
//
int EV_TurnTagLightsOff(line_t* line)
{
  int j;
  
  // search sectors for those with same tag as activating line

  // killough 10/98: replaced inefficient search with fast search
  for (j = -1; (j = P_FindSectorFromLineTag(line,j)) >= 0;)
    {
      sector_t *sector = sectors + j, *tsec;
      int i, min = sector->lightlevel;
      // find min neighbor light level
      for (i = 0;i < sector->linecount; i++)
	if ((tsec = getNextSector(sector->lines[i], sector)) &&
	    tsec->lightlevel < min)
	  min = tsec->lightlevel;
      sector->lightlevel = min;
    }
  return 1;
}
开发者ID:hexameron,项目名称:DOOM,代码行数:30,代码来源:p_lights.c

示例15: EV_StartLightStrobing

int EV_StartLightStrobing(line_t *line)
{

    int secnum = -1;
    sector_t* sec;

    while ((secnum = P_FindSectorFromLineTag(line,secnum)) >= 0)
    {

        sec = &sectors[secnum];

        if (P_SectorActive(lighting_special,sec))
            continue;

        P_SpawnStrobeFlash (sec,SLOWDARK, 0);

    }

    return 1;

}
开发者ID:jezze,项目名称:doom,代码行数:21,代码来源:p_lights.c


注:本文中的P_FindSectorFromLineTag函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。