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


C++ wr_u16b函数代码示例

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


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

示例1: wr_misc

void wr_misc(void)
{
	int i;

	/* Write the "object seeds" */
	wr_u32b(seed_flavor);
	wr_byte(NUM_TOWNS);
	for (i = 0; i < NUM_TOWNS; i++)
		wr_u32b(seed_town[i]);


	/* Special stuff */
	wr_u16b(p_ptr->quests);
	wr_u32b(p_ptr->score);
	wr_u16b(p_ptr->total_winner);
	wr_u16b(p_ptr->noscore);


	/* Write death */
	wr_byte(p_ptr->is_dead);

	/* Write feeling */
	wr_byte((byte) feeling);

	/* Turn of last "feeling" */
	wr_byte(do_feeling);

	/* Current turn */
	wr_s32b(turn);

}
开发者ID:NickMcConnell,项目名称:FAangband,代码行数:31,代码来源:save.c

示例2: wr_monster

/**
 * Write a "monster" record
 */
static void wr_monster(monster_type * m_ptr)
{
	monster_race *r_ptr = &r_info[m_ptr->r_idx];

	/* Special treatment for player ghosts */
	if (rf_has(r_ptr->flags, RF_PLAYER_GHOST))
		wr_s16b(r_ghost);
	else
		wr_s16b(m_ptr->r_idx);

	wr_byte(m_ptr->fy);
	wr_byte(m_ptr->fx);
	wr_s16b(m_ptr->hp);
	wr_s16b(m_ptr->maxhp);
	wr_s16b(m_ptr->csleep);
	wr_byte(m_ptr->mspeed);
	wr_byte(m_ptr->energy);
	wr_byte(m_ptr->stunned);
	wr_byte(m_ptr->confused);
	wr_byte(m_ptr->monfear);
	wr_byte(m_ptr->stasis);

	wr_byte(m_ptr->black_breath);

	wr_u32b(m_ptr->smart);		/* Flags for 'smart-learn' */

	/* Dummy writes for features soon to be implemented */
	wr_byte(0);

	/* Shapechange counter */
	wr_byte(m_ptr->schange);

	/* Original form of shapechanger */
	wr_s16b(m_ptr->orig_idx);

	/* Extra desire to cast harassment spells */
	wr_byte(m_ptr->harass);

	/* Current Mana */
	wr_byte(m_ptr->mana);

	/* Racial type */
	wr_byte(m_ptr->p_race);
	wr_byte(m_ptr->old_p_race);

	/* AI info */
	wr_s16b(m_ptr->hostile);
	wr_u16b(m_ptr->group);
	wr_u16b(m_ptr->group_leader);

	/* Territorial info */
	wr_u16b(m_ptr->y_terr);
	wr_u16b(m_ptr->x_terr);

	/* Spare */
	wr_s16b(0);

	/* Expansion */
	wr_u32b(0);
}
开发者ID:NickMcConnell,项目名称:FAangband,代码行数:63,代码来源:save.c

示例3: wr_inventory

void wr_inventory(void)
{
	int i;

	wr_byte(ALL_INVEN_TOTAL);
	/* Write the inventory */
	for (i = 0; i < ALL_INVEN_TOTAL; i++) {
		object_type *o_ptr = &p_ptr->inventory[i];

		/* Skip non-objects */
		if (!o_ptr->k_idx)
			continue;

		/* Dump index */
		wr_u16b((u16b) i);

		/* Dump object */
		wr_item(o_ptr);
	}

	/* Add a sentinel */
	wr_u16b(0xFFFF);

	/* Expansion */
	wr_u32b(0);
}
开发者ID:NickMcConnell,项目名称:FAangband,代码行数:26,代码来源:save.c

示例4: wr_randarts

/*
 * Dump the random artifacts
 */
void wr_randarts(void)
{
	size_t i, j, k;

	if (!OPT(birth_randarts))
		return;

	wr_u16b(z_info->a_max);

	for (i = 0; i < z_info->a_max; i++)
	{
		artifact_type *a_ptr = &a_info[i];

		wr_byte(a_ptr->tval);
		wr_byte(a_ptr->sval);
		for (j = 0; j < MAX_PVALS; j++)
			wr_s16b(a_ptr->pval[j]);
		wr_byte(a_ptr->num_pvals);

		wr_s16b(a_ptr->to_h);
		wr_s16b(a_ptr->to_d);
		wr_s16b(a_ptr->to_a);
		wr_s16b(a_ptr->ac);

		wr_byte(a_ptr->dd);
		wr_byte(a_ptr->ds);

		wr_s16b(a_ptr->weight);

		wr_s32b(a_ptr->cost);

		for (j = 0; j < OF_BYTES && j < OF_SIZE; j++)
			wr_byte(a_ptr->flags[j]);
		if (j < OF_BYTES) pad_bytes(OF_BYTES - j);

		for (k = 0; k < MAX_PVALS; k++) {
			for (j = 0; j < OF_BYTES && j < OF_SIZE; j++)
				wr_byte(a_ptr->pval_flags[k][j]);
			if (j < OF_BYTES) pad_bytes(OF_BYTES - j);
		}

		wr_byte(a_ptr->level);
		wr_byte(a_ptr->rarity);
		wr_byte(a_ptr->alloc_prob);
		wr_byte(a_ptr->alloc_min);
		wr_byte(a_ptr->alloc_max);

		wr_u16b(a_ptr->effect);
		wr_u16b(a_ptr->time.base);
		wr_u16b(a_ptr->time.dice);
		wr_u16b(a_ptr->time.sides);
	}
}
开发者ID:Hrrunstar,项目名称:angband,代码行数:56,代码来源:save.c

示例5: wr_quests

void wr_quests(void)
{
	int i;
	u16b tmp16u;

	/* Hack -- Dump the quests */
	tmp16u = MAX_Q_IDX;
	wr_u16b(tmp16u);
	for (i = 0; i < tmp16u; i++) {
		wr_u16b((u16b) q_list[i].stage);
		wr_byte(0);
		wr_byte(0);
	}
}
开发者ID:NickMcConnell,项目名称:FAangband,代码行数:14,代码来源:save.c

示例6: wr_monsters

void wr_monsters(void)
{
	int i, j;

	if (p_ptr->is_dead)
		return;

	/* Total monsters */
	wr_u16b(cave_monster_max(cave));

	/* Dump the monsters */
	for (i = 1; i < cave_monster_max(cave); i++) {
		byte unaware = 0;
	
		const monster_type *m_ptr = cave_monster(cave, i);

		wr_s16b(m_ptr->r_idx);
		wr_byte(m_ptr->fy);
		wr_byte(m_ptr->fx);
		wr_s16b(m_ptr->hp);
		wr_s16b(m_ptr->maxhp);
		wr_byte(m_ptr->mspeed);
		wr_byte(m_ptr->energy);
		wr_byte(MON_TMD_MAX);

		for (j = 0; j < MON_TMD_MAX; j++)
			wr_s16b(m_ptr->m_timed[j]);

		if (m_ptr->unaware) unaware |= 0x01;
		wr_byte(unaware);

		wr_byte(0);
	}
}
开发者ID:Hrrunstar,项目名称:angband,代码行数:34,代码来源:save.c

示例7: wr_messages

void wr_messages(void)
{
	s16b i;
	u16b num;

	num = messages_num();
	if (num > 80) num = 80;
	wr_u16b(num);

	/* Dump the messages (oldest first!) */
	for (i = num - 1; i >= 0; i--)
	{
		wr_string(message_str(i));
		wr_u16b(message_type(i));
	}
}
开发者ID:DaPortlyJester,项目名称:angband,代码行数:16,代码来源:save.c

示例8: wr_stores

void wr_stores(void)
{
	int i;

	wr_u16b(MAX_STORES);
	for (i = 0; i < MAX_STORES; i++)
	{
		const struct store *st_ptr = &stores[i];
		int j;

		/* XXX Old values */
		wr_u32b(0L);
		wr_s16b(0);

		/* Save the current owner */
		wr_byte(st_ptr->owner->oidx);

		/* Save the stock size */
		wr_byte(st_ptr->stock_num);

		/* XXX Old values */
		wr_s16b(0);
		wr_s16b(0);

		/* Save the stock */
		for (j = 0; j < st_ptr->stock_num; j++)
			wr_item(&st_ptr->stock[j]);
	}
}
开发者ID:DaPortlyJester,项目名称:angband,代码行数:29,代码来源:save.c

示例9: wr_object_memory

/**
 * Write object memory, including flag sizes and other constants.
 */
void wr_object_memory(void)
{
    int k_idx;

    wr_u16b(z_info->k_max);
    wr_byte(OF_SIZE);
    wr_byte(CF_SIZE);
    wr_byte(IF_SIZE);
    wr_byte(MAX_P_RES);
    wr_byte(A_MAX);
    wr_byte(MAX_P_BONUS);
    wr_byte(MAX_P_SLAY);
    wr_byte(MAX_P_BRAND);
    for (k_idx = 0; k_idx < z_info->k_max; k_idx++)
    {
	byte tmp8u = 0;
  
	object_kind *k_ptr = &k_info[k_idx];
  
	if (k_ptr->aware) tmp8u |= 0x01;
	if (k_ptr->tried) tmp8u |= 0x02;
	if (k_ptr->known_effect) tmp8u |= 0x04;
	if (k_ptr->squelch) tmp8u |= 0x08;
  
	wr_byte(tmp8u);

	tmp8u = 0;
	if (k_ptr->everseen) tmp8u |= 0x01;
	wr_byte(tmp8u);

	/* Expansion */
	wr_u32b(0);
    }
}
开发者ID:artes-liberales,项目名称:FAangband,代码行数:37,代码来源:save.c

示例10: wr_player_hp

void wr_player_hp(void)
{
	int i;

	wr_u16b(PY_MAX_LEVEL);
	for (i = 0; i < PY_MAX_LEVEL; i++)
		wr_s16b(p_ptr->player_hp[i]);
}
开发者ID:DaPortlyJester,项目名称:angband,代码行数:8,代码来源:save.c

示例11: wr_randarts

/*
 * Dump the random artefacts
 */
static void wr_randarts(void)
{
	int i, begin;

	if (adult_rand_artefacts) begin = 0;
	else begin = z_info->art_norm_max;

	wr_u16b(begin);
	wr_u16b(z_info->art_max);
	wr_u16b(z_info->art_norm_max);


	for (i = begin; i < z_info->art_max; i++)
	{
		artefact_type *a_ptr = &a_info[i];

		wr_string(a_ptr->name);

		wr_byte(a_ptr->tval);
		wr_byte(a_ptr->sval);
		wr_s16b(a_ptr->pval);

		wr_s16b(a_ptr->att);
		wr_byte(a_ptr->dd);
		wr_byte(a_ptr->ds);
		wr_s16b(a_ptr->evn);
		wr_byte(a_ptr->pd);
		wr_byte(a_ptr->ps);

		wr_s16b(a_ptr->weight);
		wr_s32b(a_ptr->cost);

		wr_u32b(a_ptr->flags1);
		wr_u32b(a_ptr->flags2);
		wr_u32b(a_ptr->flags3);

		wr_byte(a_ptr->level);
		wr_byte(a_ptr->rarity);

		wr_byte(a_ptr->activation);
		wr_u16b(a_ptr->time);
		wr_u16b(a_ptr->randtime);
	}

}
开发者ID:fph,项目名称:mortsil,代码行数:48,代码来源:save.c

示例12: wr_randomizer

/*!
 * @brief 乱数情報を書き込む / Write RNG state
 * @return なし
 */
static errr wr_randomizer(void)
{
	int i;

	/* Zero */
	wr_u16b(0);

	/* Place */
	wr_u16b(Rand_place);

	/* State */
	for (i = 0; i < RAND_DEG; i++)
	{
		wr_u32b(Rand_state[i]);
	}

	/* Success */
	return (0);
}
开发者ID:dis-,项目名称:hengband,代码行数:23,代码来源:save.c

示例13: wr_monster_memory

/**
 * Write the monster memory, including flag sizes
 */
void wr_monster_memory(void)
{
    size_t i;
    int r_idx;

    wr_u16b(z_info->r_max);
    wr_byte(RF_SIZE);
    wr_byte(RSF_SIZE);
    wr_byte(MONSTER_BLOW_MAX);
    for (r_idx = 0; r_idx < z_info->r_max; r_idx++)
    {
	monster_race *r_ptr = &r_info[r_idx];
	monster_lore *l_ptr = &l_list[r_idx];
  
	/* Count sights/deaths/kills */
	wr_s16b(l_ptr->sights);
	wr_s16b(l_ptr->deaths);
	wr_s16b(l_ptr->pkills);
	wr_s16b(l_ptr->tkills);
  
	/* Count wakes and ignores */
	wr_byte(l_ptr->wake);
	wr_byte(l_ptr->ignore);
  
	/* Extra stuff */
	wr_byte(l_ptr->xtra1);
	wr_byte(l_ptr->xtra2);
  
	/* Count drops */
	wr_byte(l_ptr->drop_gold);
	wr_byte(l_ptr->drop_item);
  
	/* Count spells */
	wr_byte(l_ptr->cast_spell);
  
	/* Count blows of each type */
	for (i = 0; i < MONSTER_BLOW_MAX; i++)
	    wr_byte(l_ptr->blows[i]);
  
	/* Memorize flags */
	for (i = 0; i < RF_SIZE; i++)
	    wr_byte(l_ptr->flags[i]);
	for (i = 0; i < RSF_SIZE; i++)
	    wr_byte(l_ptr->spell_flags[i]);

  
  
	/* Monster limit per level */
	wr_byte(r_ptr->max_num);
	wr_byte(0);
	wr_byte(0);
	wr_byte(0);
    }
}
开发者ID:artes-liberales,项目名称:FAangband,代码行数:57,代码来源:save.c

示例14: wr_options

/*
 * Write the "options"
 */
void wr_options(void)
{
	int i, k;

	u32b window_flag[ANGBAND_TERM_MAX];
	u32b window_mask[ANGBAND_TERM_MAX];


	/* Special Options */
	wr_byte(op_ptr->delay_factor);
	wr_byte(op_ptr->hitpoint_warn);
	wr_u16b(lazymove_delay);

	/* Normal options */
	for (i = 0; i < OPT_MAX; i++) {
		const char *name = option_name(i);
		if (!name)
			continue;

		wr_string(name);
		wr_byte(op_ptr->opt[i]);
   }

	/* Sentinel */
	wr_byte(0);

	/*** Window options ***/

	/* Reset */
	for (i = 0; i < ANGBAND_TERM_MAX; i++)
	{
		/* Flags */
		window_flag[i] = op_ptr->window_flag[i];

		/* Mask */
		window_mask[i] = 0L;

		/* Build the mask */
		for (k = 0; k < 32; k++)
		{
			/* Set mask */
			if (window_flag_desc[k])
			{
				window_mask[i] |= (1L << k);
			}
		}
	}

	/* Dump the flags */
	for (i = 0; i < ANGBAND_TERM_MAX; i++) wr_u32b(window_flag[i]);

	/* Dump the masks */
	for (i = 0; i < ANGBAND_TERM_MAX; i++) wr_u32b(window_mask[i]);
}
开发者ID:DaPortlyJester,项目名称:angband,代码行数:57,代码来源:save.c

示例15: wr_player_spells

void wr_player_spells(void)
{
	int i;

	wr_u16b(PY_MAX_SPELLS);

	for (i = 0; i < PY_MAX_SPELLS; i++)
		wr_byte(p_ptr->spell_flags[i]);

	for (i = 0; i < PY_MAX_SPELLS; i++)
		wr_byte(p_ptr->spell_order[i]);
}
开发者ID:DaPortlyJester,项目名称:angband,代码行数:12,代码来源:save.c


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