當前位置: 首頁>>代碼示例>>C++>>正文


C++ G_EventEnd函數代碼示例

本文整理匯總了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();
}
開發者ID:Maximaximum,項目名稱:ufoai,代碼行數:7,代碼來源:g_events.cpp

示例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();
}
開發者ID:jklemmack,項目名稱:ufoai,代碼行數:30,代碼來源:g_move.cpp

示例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();
}
開發者ID:Maximaximum,項目名稱:ufoai,代碼行數:12,代碼來源:g_events.cpp

示例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();
}
開發者ID:jklemmack,項目名稱:ufoai,代碼行數:7,代碼來源:g_events.cpp

示例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();
}
開發者ID:jklemmack,項目名稱:ufoai,代碼行數:11,代碼來源:g_events.cpp

示例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();
}
開發者ID:jklemmack,項目名稱:ufoai,代碼行數:7,代碼來源:g_events.cpp

示例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();
}
開發者ID:jklemmack,項目名稱:ufoai,代碼行數:12,代碼來源:g_events.cpp

示例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();
}
開發者ID:jklemmack,項目名稱:ufoai,代碼行數:14,代碼來源:g_events.cpp

示例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();
}
開發者ID:Maximaximum,項目名稱:ufoai,代碼行數:7,代碼來源:g_events.cpp

示例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();
}
開發者ID:ArkyRomania,項目名稱:ufoai,代碼行數:7,代碼來源:g_events.cpp

示例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();
}
開發者ID:Maximaximum,項目名稱:ufoai,代碼行數:14,代碼來源:g_events.cpp

示例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();
}
開發者ID:Maximaximum,項目名稱:ufoai,代碼行數:7,代碼來源:g_events.cpp

示例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();
}
開發者ID:Maximaximum,項目名稱:ufoai,代碼行數:13,代碼來源:g_events.cpp

示例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();
}
開發者ID:Maximaximum,項目名稱:ufoai,代碼行數:8,代碼來源:g_events.cpp

示例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();
}
開發者ID:Maximaximum,項目名稱:ufoai,代碼行數:12,代碼來源:g_events.cpp


注:本文中的G_EventEnd函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。