• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ P_AddThinker函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Z_Malloc

void
EV_SlidingDoor
( line_t*		line,
  mobj_t*		thing )
{
	sector_t*			sec;
	slidedoor_t*		door;

	// DOOM II ONLY...
	if (gamemode != commercial)
		return;

	// Make sure door isn't already being animated
	sec = line->frontsector;
	door = NULL;
	if (sec->specialdata)
	{
		if (!thing->player)
			return;

		door = sec->specialdata;
		if (door->type == sdt_openAndClose)
		{
			if (door->status == sd_waiting)
				door->status = sd_closing;
		}
		else
			return;
	}

	// Init sliding door vars
	if (!door)
	{
		door = Z_Malloc (sizeof(*door), PU_LEVSPEC, 0);
		P_AddThinker (&door->thinker);
		sec->specialdata = door;

		door->type = sdt_openAndClose;
		door->status = sd_opening;
		door->whichDoorIndex = P_FindSlidingDoorType(line);

		if (door->whichDoorIndex < 0)
			I_Error("EV_SlidingDoor: Can't use texture for sliding door!");

		door->frontsector = sec;
		door->backsector = line->backsector;
		door->thinker.function = T_SlidingDoor;
		door->timer = SWAITTICS;
		door->frame = 0;
		door->line = line;
	}
}
开发者ID:FulcronZ,项目名称:NyuziProcessor,代码行数:52,代码来源:p_doors.c


示例2: P_SpawnGlowingLight

void P_SpawnGlowingLight(sector_t * sector)
{
    glow_t *g;

    g = Z_Malloc(sizeof(*g), PU_LEVSPEC, 0);
    P_AddThinker(&g->thinker);
    g->sector = sector;
    g->minlight = P_FindMinSurroundingLight(sector, sector->lightlevel);
    g->maxlight = sector->lightlevel;
    g->thinker.function = T_Glow;
    g->direction = -1;

    sector->special = 0;
}
开发者ID:Krazygamr,项目名称:D-Touch,代码行数:14,代码来源:p_lights.c


示例3: P_StartACS

boolean P_StartACS(int number, int map, byte * args, mobj_t * activator,
                   line_t * line, int side)
{
    int i;
    acs_t *script;
    int infoIndex;
    aste_t *statePtr;

    NewScript = NULL;
    if (map && map != gamemap)
    {                           // Add to the script store
        return AddToACSStore(map, number, args);
    }
    infoIndex = GetACSIndex(number);
    if (infoIndex == -1)
    {                           // Script not found
        //I_Error("P_StartACS: Unknown script number %d", number);
        snprintf(ErrorMsg, sizeof(ErrorMsg),
                 "P_STARTACS ERROR: UNKNOWN SCRIPT %d", number);
        P_SetMessage(&players[consoleplayer], ErrorMsg, true);
    }
    statePtr = &ACSInfo[infoIndex].state;
    if (*statePtr == ASTE_SUSPENDED)
    {                           // Resume a suspended script
        *statePtr = ASTE_RUNNING;
        return true;
    }
    if (*statePtr != ASTE_INACTIVE)
    {                           // Script is already executing
        return false;
    }
    script = Z_Malloc(sizeof(acs_t), PU_LEVSPEC, 0);
    memset(script, 0, sizeof(acs_t));
    script->number = number;
    script->infoIndex = infoIndex;
    script->activator = activator;
    script->line = line;
    script->side = side;
    script->ip = ACSInfo[infoIndex].address;
    script->thinker.function = T_InterpretACS;
    for (i = 0; i < ACSInfo[infoIndex].argCount; i++)
    {
        script->vars[i] = args[i];
    }
    *statePtr = ASTE_RUNNING;
    P_AddThinker(&script->thinker);
    NewScript = script;
    return true;
}
开发者ID:MP2E,项目名称:chocolate-doom,代码行数:49,代码来源:p_acs.c


示例4: P_UnArchiveThinkers

void P_UnArchiveThinkers(void)
{
    byte tclass;
    thinker_t *currentthinker, *next;
    mobj_t *mobj;

    //
    // remove all the current thinkers
    //
    currentthinker = thinkercap.next;
    while (currentthinker != &thinkercap)
    {
        next = currentthinker->next;
        if (currentthinker->function == P_MobjThinker)
            P_RemoveMobj((mobj_t *) currentthinker);
        else
            Z_Free(currentthinker);
        currentthinker = next;
    }
    P_InitThinkers();

    // read in saved thinkers
    while (1)
    {
        tclass = SV_ReadByte();
        switch (tclass)
        {
            case tc_end:
                return;         // end of list

            case tc_mobj:
                mobj = Z_Malloc(sizeof(*mobj), PU_LEVEL, NULL);
                saveg_read_mobj_t(mobj);
                mobj->target = NULL;
                P_SetThingPosition(mobj);
                mobj->info = &mobjinfo[mobj->type];
                mobj->floorz = mobj->subsector->sector->floorheight;
                mobj->ceilingz = mobj->subsector->sector->ceilingheight;
                mobj->thinker.function = P_MobjThinker;
                P_AddThinker(&mobj->thinker);
                break;

            default:
                I_Error("Unknown tclass %i in savegame", tclass);
        }

    }

}
开发者ID:twipley,项目名称:chocolate-doom,代码行数:49,代码来源:p_saveg.c


示例5: P_SpawnDoorCloseIn30

//==================================================================
//
//      Spawn a door that closes after 30 seconds
//
//==================================================================
void P_SpawnDoorCloseIn30(sector_t * sec)
{
    vldoor_t *door;

    door = Z_Malloc(sizeof(*door), PU_LEVSPEC, 0);
    P_AddThinker(&door->thinker);
    sec->specialdata = door;
    sec->special = 0;
    door->thinker.function = T_VerticalDoor;
    door->sector = sec;
    door->direction = 0;
    door->type = normal;
    door->speed = VDOORSPEED;
    door->topcountdown = 30 * 35;
}
开发者ID:Krazygamr,项目名称:D-Touch,代码行数:20,代码来源:p_doors.c


示例6: P_SpawnStrobeAltFlash

void P_SpawnStrobeAltFlash(sector_t* sector, int speed) {      // 0x80015C44
    strobe_t* flash;

    flash = Z_Malloc(sizeof(*flash), PU_LEVSPEC, 0);

    P_AddThinker(&flash->thinker);

    flash->sector = sector;
    flash->darktime = speed;
    flash->thinker.function.acp1 = (actionf_p1)T_StrobeFlash;
    flash->special = sector->special;
    flash->maxlight = 127;
    flash->brighttime = 1;
    flash->count = 1;
}
开发者ID:directhex,项目名称:doom64,代码行数:15,代码来源:p_lights.c


示例7: P_SpawnStrobeFlash

void P_SpawnStrobeFlash(sector_t* sector, int speed) {
    strobe_t* flash;

    flash = Z_Malloc(sizeof(*flash), PU_LEVSPEC, 0);

    P_AddThinker(&flash->thinker);

    flash->sector = sector;
    flash->darktime = speed;
    flash->thinker.function.acp1 = (actionf_p1)T_StrobeFlash;
    flash->special = sector->special;
    flash->maxlight = 16;
    flash->brighttime = 3;
    flash->count = (P_Random(pr_lights) & 7) + 1;
}
开发者ID:directhex,项目名称:doom64,代码行数:15,代码来源:p_lights.c


示例8: P_CombineLightSpecials

void P_CombineLightSpecials(sector_t *sector) {
    actionf_p1 func;
    thinker_t *thinker;
    combine_t *combine;

    switch(sector->special) {
    case 1:
        func = T_LightFlash;
        break;
    case 2:
    case 3:
    case 202:
    case 203:
    case 204:
    case 205:
    case 206:
    case 208:
        func = T_StrobeFlash;
        break;
    case 8:
    case 9:
    case 11:
        func = T_Glow;
        break;
    case 17:
        func = T_FireFlicker;
        break;
    default:
        return;
    }

    for(thinker = thinkercap.next; thinker != &thinkercap; thinker = thinker->next) {
        if((actionf_p1)func != (actionf_p1)thinker->function.acp1) {
            continue;
        }

        combine = Z_Malloc(sizeof(*combine), PU_LEVSPEC, 0);

        P_AddThinker(&combine->thinker);

        combine->sector = sector;
        combine->special = sector->special;
        combine->combiner = thinker;
        combine->func = func;
        combine->thinker.function.acp1 = (actionf_p1)T_Combine;
        return;
    }
}
开发者ID:directhex,项目名称:doom64,代码行数:48,代码来源:p_lights.c


示例9: P_SpawnGlowingLight

//
// P_SpawnGlowingLight()
//
// Spawns a glowing light (smooth oscillation from min to max) thinker
//
// Passed the sector that spawned the thinker
// Returns nothing
//
void P_SpawnGlowingLight(sector_t*  sector)
{
  glow_t* g;

  g = Z_Malloc( sizeof(*g), PU_LEVSPEC, 0);

  P_AddThinker(&g->thinker);

  g->sector = sector;
  g->minlight = P_FindMinSurroundingLight(sector,sector->lightlevel);
  g->maxlight = sector->lightlevel;
  g->thinker.function.acp1 = (actionf_p1) T_Glow;
  g->direction = -1;

  sector->special &= ~31; //jff 3/14/98 clear non-generalized sector type
}
开发者ID:hexameron,项目名称:DOOM,代码行数:24,代码来源:p_lights.c


示例10: StartOpenACS

static void StartOpenACS(int number, int infoIndex, int *address)
{
    acs_t *script;

    script = Z_Malloc(sizeof(acs_t), PU_LEVSPEC, 0);
    memset(script, 0, sizeof(acs_t));
    script->number = number;

    // World objects are allotted 1 second for initialization
    script->delayCount = 35;

    script->infoIndex = infoIndex;
    script->ip = address;
    script->thinker.function = T_InterpretACS;
    P_AddThinker(&script->thinker);
}
开发者ID:MP2E,项目名称:chocolate-doom,代码行数:16,代码来源:p_acs.c


示例11: P_SpawnLightFlash

//==================================================================
//
//      P_SpawnLightFlash
//
//      After the map has been loaded, scan each sector for specials that spawn thinkers
//
//==================================================================
void P_SpawnLightFlash(sector_t * sector)
{
    lightflash_t *flash;

    sector->special = 0;        // nothing special about it during gameplay

    flash = Z_Malloc(sizeof(*flash), PU_LEVSPEC, 0);
    P_AddThinker(&flash->thinker);
    flash->thinker.function = T_LightFlash;
    flash->sector = sector;
    flash->maxlight = sector->lightlevel;

    flash->minlight = P_FindMinSurroundingLight(sector, sector->lightlevel);
    flash->maxtime = 64;
    flash->mintime = 7;
    flash->count = (P_Random() & flash->maxtime) + 1;
}
开发者ID:Krazygamr,项目名称:D-Touch,代码行数:24,代码来源:p_lights.c


示例12: P_SpawnFireFlicker

//
// P_SpawnFireFlicker
//
void P_SpawnFireFlicker(sector_t *sector)
{
    fireflicker_t       *flick = Z_Malloc(sizeof(*flick), PU_LEVSPEC, 0);

    // Note that we are resetting sector attributes.
    // Nothing special about it during gameplay.
    sector->special = 0;

    memset(flick, 0, sizeof(*flick));
    P_AddThinker(&flick->thinker);

    flick->thinker.function = T_FireFlicker;
    flick->sector = sector;
    flick->maxlight = sector->lightlevel;
    flick->minlight = P_FindMinSurroundingLight(sector, sector->lightlevel) + 16;
    flick->count = 4;
}
开发者ID:Clever-Boy,项目名称:doomretro,代码行数:20,代码来源:p_lights.c


示例13: P_SpawnFireFlicker

//
// P_SpawnFireFlicker
//
// [STRIFE] 
// haleyjd 2011023: Changes to minimum light level and initial duration
//
void P_SpawnFireFlicker (sector_t*      sector)
{
    fireflicker_t*      flick;

    // Note that we are resetting sector attributes.
    // Nothing special about it during gameplay.
    sector->special = 0; 

    flick = Z_Malloc ( sizeof(*flick), PU_LEVSPEC, 0);

    P_AddThinker (&flick->thinker);

    flick->thinker.function.acp1 = (actionf_p1) T_FireFlicker;
    flick->sector = sector;
    flick->maxlight = sector->lightlevel;
    flick->minlight = sector->lightlevel - 32; // [STRIFE] changed from min surrounding+16
    flick->count = 2;                          // [STRIFE]: Initial count 4 -> 2
}
开发者ID:Azarien,项目名称:chocolate-doom,代码行数:24,代码来源:p_lights.c


示例14: P_SpawnDoorRaiseIn5Mins

//==================================================================
//
//      Spawn a door that opens after 5 minutes
//
//==================================================================
void P_SpawnDoorRaiseIn5Mins(sector_t * sec, int secnum)
{
    vldoor_t *door;

    door = Z_Malloc(sizeof(*door), PU_LEVSPEC, 0);
    P_AddThinker(&door->thinker);
    sec->specialdata = door;
    sec->special = 0;
    door->thinker.function = T_VerticalDoor;
    door->sector = sec;
    door->direction = 2;
    door->type = raiseIn5Mins;
    door->speed = VDOORSPEED;
    door->topheight = P_FindLowestCeilingSurrounding(sec);
    door->topheight -= 4 * FRACUNIT;
    door->topwait = VDOORWAIT;
    door->topcountdown = 5 * 60 * 35;
}
开发者ID:Krazygamr,项目名称:D-Touch,代码行数:23,代码来源:p_doors.c


示例15: P_SpawnFireFlicker

//
// P_SpawnFireFlicker()
//
// Spawns a fire flicker lighting thinker
//
// Passed the sector that spawned the thinker
// Returns nothing
//
void P_SpawnFireFlicker (sector_t*  sector)
{
  fireflicker_t*  flick;

  // Note that we are resetting sector attributes.
  // Nothing special about it during gameplay.
  sector->special &= ~31; //jff 3/14/98 clear non-generalized sector type

  flick = Z_Malloc ( sizeof(*flick), PU_LEVSPEC, 0);

  P_AddThinker (&flick->thinker);

  flick->thinker.function.acp1 = (actionf_p1) T_FireFlicker;
  flick->sector = sector;
  flick->maxlight = sector->lightlevel;
  flick->minlight = P_FindMinSurroundingLight(sector,sector->lightlevel)+16;
  flick->count = 4;
}
开发者ID:hexameron,项目名称:DOOM,代码行数:26,代码来源:p_lights.c


示例16: P_SpawnFireFlicker

void P_SpawnFireFlicker(sector_t *sector)
{

    fireflicker_t *flick;
    sector->special &= ~31;

    flick = Z_Malloc(sizeof(*flick), PU_LEVSPEC, 0);

    memset(flick, 0, sizeof(*flick));
    P_AddThinker (&flick->thinker);

    flick->thinker.function = T_FireFlicker;
    flick->sector = sector;
    flick->maxlight = sector->lightlevel;
    flick->minlight = P_FindMinSurroundingLight(sector,sector->lightlevel) + 16;
    flick->count = 4;

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


示例17: P_SpawnDoorCloseIn30

//
// Spawn a door that closes after 30 seconds
//
void P_SpawnDoorCloseIn30(sector_t *sec)
{
    vldoor_t	*door;

    door = Z_Malloc(sizeof(*door), PU_LEVSPEC, (void *)0);

    P_AddThinker(&door->thinker);

    sec->ceilingdata = door;
    sec->special = 0;

    door->thinker.function.acp1 = (actionf_p1)T_VerticalDoor;
    door->sector = sec;
    door->direction = 0;
    door->type = normal;
    door->speed = VDOORSPEED;
    door->topcountdown = 30 * 35;
    door->line = (line_t *)0;	// no line triggered us
}
开发者ID:aagallag,项目名称:psDooM,代码行数:22,代码来源:p_doors.c


示例18: P_SpawnLightFlash

void P_SpawnLightFlash(sector_t *sector)
{

    lightflash_t *flash;
    sector->special &= ~31;

    flash = Z_Malloc(sizeof(*flash), PU_LEVSPEC, 0);

    memset(flash, 0, sizeof(*flash));
    P_AddThinker(&flash->thinker);

    flash->thinker.function = T_LightFlash;
    flash->sector = sector;
    flash->maxlight = sector->lightlevel;
    flash->minlight = P_FindMinSurroundingLight(sector,sector->lightlevel);
    flash->maxtime = 64;
    flash->mintime = 7;
    flash->count = (P_Random(pr_lights)&flash->maxtime) + 1;

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


示例19: P_SpawnLightFlash

//
// P_SpawnLightFlash()
//
// Spawns a broken light flash lighting thinker
//
// Passed the sector that spawned the thinker
// Returns nothing
//
void P_SpawnLightFlash (sector_t* sector)
{
  lightflash_t* flash;

  // nothing special about it during gameplay
  sector->special &= ~31; //jff 3/14/98 clear non-generalized sector type

  flash = Z_Malloc ( sizeof(*flash), PU_LEVSPEC, 0);

  P_AddThinker (&flash->thinker);

  flash->thinker.function.acp1 = (actionf_p1) T_LightFlash;
  flash->sector = sector;
  flash->maxlight = sector->lightlevel;

  flash->minlight = P_FindMinSurroundingLight(sector,sector->lightlevel);
  flash->maxtime = 64;
  flash->mintime = 7;
  flash->count = (P_Random(pr_lights)&flash->maxtime)+1;
}
开发者ID:hexameron,项目名称:DOOM,代码行数:28,代码来源:p_lights.c


示例20: P_UpdateLightThinker

void P_UpdateLightThinker(light_t* destlight, light_t* srclight) {
    lightmorph_t* lt;

    lt = Z_Malloc(sizeof(*lt), PU_LEVSPEC, 0);
    P_AddThinker(&lt->thinker);
    lt->thinker.function.acp1 = (actionf_p1)T_LightMorph;

    if(destlight) {
        destlight->r = srclight->r;
        destlight->g = srclight->g;
        destlight->b = srclight->b;
    }

    lt->inc = 0;
    lt->src = srclight; // the light to morph to
    lt->dest = destlight == NULL ? srclight : destlight; // the light to morph from
    lt->r = destlight == NULL ? 0 : destlight->base_r;
    lt->g = destlight == NULL ? 0 : destlight->base_g;
    lt->b = destlight == NULL ? 0 : destlight->base_b;
}
开发者ID:directhex,项目名称:doom64,代码行数:20,代码来源:p_lights.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ P_AimLineAttack函数代码示例发布时间:2022-05-30
下一篇:
C++ PZ_Unlock函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap