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


C++ ship::clear方法代码示例

本文整理汇总了C++中ship::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ ship::clear方法的具体用法?C++ ship::clear怎么用?C++ ship::clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ship的用法示例。


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

示例1: hud_observer_init

/**
 * Initialize observer hud stuff
 */
void hud_observer_init(ship *shipp, ai_info *aip)
{
	// setup the pseduo ship and ai
	memcpy(&Hud_obs_ai, aip, sizeof(ai_info));
	// (we used to do a memcpy here, but that doesn't work any longer, so let's just assign the values we need)
	Hud_obs_ship.clear();
	strcpy_s(Hud_obs_ship.ship_name, shipp->ship_name);
	Hud_obs_ship.team = shipp->team;
	Hud_obs_ship.ai_index = shipp->ai_index;
	Hud_obs_ship.flags = shipp->flags;
	Hud_obs_ship.flags2 = shipp->flags2;
	Hud_obs_ship.ship_info_index = shipp->ship_info_index;
	Hud_obs_ship.objnum = shipp->objnum;
	Hud_obs_ship.wingnum = shipp->wingnum;
	Hud_obs_ship.alt_type_index = shipp->alt_type_index;
	Hud_obs_ship.callsign_index = shipp->callsign_index;
	memcpy(&Hud_obs_ship.np_updates, shipp->np_updates, MAX_PLAYERS * sizeof(np_update));
	Hud_obs_ship.ship_max_hull_strength = shipp->ship_max_hull_strength;
	Hud_obs_ship.ship_max_shield_strength = shipp->ship_max_shield_strength;
	memcpy(&Hud_obs_ship.weapons, &shipp->weapons, sizeof(ship_weapon));

	HUD_config.is_observer = 1;
	HUD_config.show_flags = HUD_observer_default_flags;
	HUD_config.show_flags2 = HUD_observer_default_flags2;

	HUD_config.popup_flags = 0x0;
	HUD_config.popup_flags2 = 0x0;

	// shutdown any playing static animations
	hud_init_target_static();
}
开发者ID:DahBlount,项目名称:Freespace-Open-Swifty,代码行数:34,代码来源:hudobserver.cpp


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