本文整理汇总了C++中G_EventEnd函数的典型用法代码示例。如果您正苦于以下问题:C++ G_EventEnd函数的具体用法?C++ G_EventEnd怎么用?C++ G_EventEnd使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了G_EventEnd函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: G_EventModelExplode
void G_EventModelExplode (const Edict& ent, const char* sound)
{
assert(ent.inuse);
G_EventAdd(PM_ALL, EV_MODEL_EXPLODE, ent.number);
gi.WriteString(sound);
G_EventEnd();
}
示例2: G_ActorFall
/**
* @brief Let an actor fall down if e.g. the func_breakable the actor was standing on was destroyed.
* @param[in,out] ent The actor that should fall down
* @todo Handle cases where the grid position the actor would fall to is occupied by another actor already.
*/
void G_ActorFall (edict_t *ent)
{
edict_t* entAtPos;
const int oldZ = ent->pos[2];
ent->pos[2] = gi.GridFall(gi.routingMap, ent->fieldSize, ent->pos);
if (oldZ == ent->pos[2])
return;
entAtPos = G_GetEdictFromPos(ent->pos, ET_NULL);
if (entAtPos != NULL && (G_IsBreakable(entAtPos) || G_IsBlockingMovementActor(entAtPos))) {
const int diff = oldZ - ent->pos[2];
G_TakeDamage(entAtPos, (int)(FALLING_DAMAGE_FACTOR * (float)diff));
}
G_EdictCalcOrigin(ent);
gi.LinkEdict(ent);
G_CheckVis(ent);
G_EventActorFall(ent);
G_EventEnd();
}
示例3: G_EventEdictPerish
/**
* @brief Send disappear event
* @param[in] playerMask The bitmask to determine the clients this event is send to
* @param[in,out] ent The edict that perished
*/
void G_EventEdictPerish (playermask_t playerMask, const Edict& ent)
{
assert(ent.inuse);
G_EventAdd(playerMask, EV_ENT_PERISH, ent.number);
gi.WriteByte(ent.type);
G_EventEnd();
}
示例4: G_EventReset
void G_EventReset (const player_t *player, int activeTeam)
{
G_EventAdd(G_PlayerToPM(player), EV_RESET | EVENT_INSTANTLY, -1);
gi.WriteByte(player->pers.team);
gi.WriteByte(activeTeam);
G_EventEnd();
}
示例5: G_EventActorDie
/**
* @brief Announce the actor die event for the clients that are seeing the actor
* @param[in] ent The actor that is dying
*/
void G_EventActorDie (const edict_t* ent)
{
G_EventAdd(G_VisToPM(ent->visflags), EV_ACTOR_DIE, ent->number);
gi.WriteShort(ent->state);
gi.WriteByte(ent->pnum);
G_EventEnd();
}
示例6: G_EventEndRoundAnnounce
void G_EventEndRoundAnnounce (const player_t *player)
{
G_EventAdd(PM_ALL, EV_ENDROUNDANNOUNCE | EVENT_INSTANTLY, -1);
gi.WriteByte(player->num);
gi.WriteByte(player->pers.team);
G_EventEnd();
}
示例7: G_EventEdictPerish
/**
* @brief Send disappear event
* @param[in] playerMask The bitmask to determine the clients this event is send to
* @param[in,out] ent The edict that perished
*/
void G_EventEdictPerish (unsigned int playerMask, const edict_t *ent)
{
assert(ent->inuse);
G_EventAdd(playerMask, EV_ENT_PERISH, ent->number);
gi.WriteByte(ent->type);
G_EventEnd();
}
示例8: G_EventEdictAppear
/**
* @brief Send an appear event to the client.
* @param playerMask The players to send the event to
* @param ent The edict that should appear to the players included in the given mask.
* @note Each following event that is relying on the fact that this edict must already
* be known in the client, must also adopt the client side parsing of the event times.
*/
void G_EventEdictAppear (unsigned int playerMask, const edict_t *ent)
{
G_EventAdd(playerMask, EV_ENT_APPEAR, ent->number);
gi.WriteByte(ent->type);
gi.WriteGPos(ent->pos);
G_EventEnd();
}
示例9: G_EventReset
void G_EventReset (const Player& player, int activeTeam)
{
G_EventAdd(G_PlayerToPM(player), EV_RESET | EVENT_INSTANTLY, -1);
gi.WriteByte(player.getTeam());
gi.WriteByte(activeTeam);
G_EventEnd();
}
示例10: G_EventModelExplodeTriggered
void G_EventModelExplodeTriggered (const Edict& ent, const char* sound)
{
assert(ent.inuse);
G_EventAdd(PM_ALL, EV_MODEL_EXPLODE_TRIGGERED, ent.getIdNum());
gi.WriteString(sound);
G_EventEnd();
}
示例11: G_EventEdictAppear
/**
* @brief Send an appear event to the client.
* @param playerMask The players to send the event to
* @param ent The edict that should appear to the players included in the given mask.
* @note Each following event that is relying on the fact that this edict must already
* be known in the client, must also adopt the client side parsing of the event times.
*/
void G_EventEdictAppear (playermask_t playerMask, const Edict& ent)
{
G_EventAdd(playerMask, EV_ENT_APPEAR, ent.number);
gi.WriteByte(ent.type);
gi.WriteGPos(ent.pos);
G_EventEnd();
}
示例12: G_EventEndRoundAnnounce
void G_EventEndRoundAnnounce (const Player& player)
{
G_EventAdd(PM_ALL, EV_ENDROUNDANNOUNCE, -1);
gi.WriteByte(player.getNum());
gi.WriteByte(player.getTeam());
G_EventEnd();
}
示例13: G_EventSendParticle
/**
* Send a particle spawn event to the client
* @param[in] playerMask The clients that should see the particle
* @param[in] ent The particle to spawn
*/
void G_EventSendParticle (playermask_t playerMask, const Edict& ent)
{
G_EventAdd(playerMask, EV_PARTICLE_APPEAR, ent.number);
gi.WriteShort(ent.spawnflags);
gi.WritePos(ent.origin);
gi.WriteString(ent.particle);
G_EventEnd();
}
示例14: G_EventSendState
void G_EventSendState (playermask_t playerMask, const Edict& ent)
{
G_EventActorStateChange(playerMask & G_TeamToPM(ent.team), ent);
G_EventAdd(playerMask & ~G_TeamToPM(ent.team), EV_ACTOR_STATECHANGE, ent.number);
gi.WriteShort(ent.state & STATE_PUBLIC);
G_EventEnd();
}
示例15: G_EventSendEdict
/**
* @brief Send the bounding box info to the client.
* @param[in] ent The edict to send the bounding box for
*/
void G_EventSendEdict (const Edict& ent)
{
G_EventAdd(PM_ALL, EV_ADD_EDICT, ent.number);
gi.WriteByte(ent.type);
gi.WritePos(ent.absBox.mins);
gi.WritePos(ent.absBox.maxs);
G_EventEnd();
}