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

C++ END_OF_LIST函数代码示例

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

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



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

示例1: multi_respawn_build_points

// build a list of respawn points for the mission
void multi_respawn_build_points()
{
	ship_obj *moveup;
	respawn_point *r;

	// respawn points
	Multi_respawn_point_count = 0;
	Multi_next_respawn_point = 0;
	moveup = GET_FIRST(&Ship_obj_list);
	while(moveup != END_OF_LIST(&Ship_obj_list)){
		// player ships
		if(Objects[moveup->objnum].flags & (OF_PLAYER_SHIP | OF_COULD_BE_PLAYER)){			
			r = &Multi_respawn_points[Multi_respawn_point_count++];
			
			r->pos = Objects[moveup->objnum].pos;
			r->team = Ships[Objects[moveup->objnum].instance].team;			
		}
		moveup = GET_NEXT(moveup);
	}	

	// priority respawn points
	Multi_respawn_priority_count = 0;
	moveup = GET_FIRST(&Ship_obj_list);
	while(moveup != END_OF_LIST(&Ship_obj_list)){
		// stuff info
		if((Ships[Objects[moveup->objnum].instance].respawn_priority > 0) && (Multi_respawn_priority_count < MAX_PRIORITY_POINTS)){
			r = &Multi_respawn_priority_ships[Multi_respawn_priority_count++];

			strcpy(r->ship_name, Ships[Objects[moveup->objnum].instance].ship_name);
			r->team = Ships[Objects[moveup->objnum].instance].team;
		}
		moveup = GET_NEXT(moveup);
	}	
}
开发者ID:lubomyr,项目名称:freespace2,代码行数:35,代码来源:multi_respawn.cpp


示例2: AddIdentToHash

//--------------------------------------------------------------------------
// Name         AddIdentToHash
//
// Adds an identifier to the list, keeping the list sorted by scope nesting
// level. Higher nesting levels are at start of list, smaller at the end.
//
// Note: for debugging purposes we make sure that there is no already inserted
// ident with the same scope nesting. 
//--------------------------------------------------------------------------
static void AddIdentToHash (
    TListRoot * pList,
    TLocalIdent * pIdent
  )
{
  int identLevel; // nesting level of the ident being added
  TLocalIdent * pCur;

  identLevel = pIdent->parentScope->level;

  // Skip all idents with greater scope nesting
  //

  for ( pCur = (TLocalIdent *)pList->Flink;
        !END_OF_LIST( pList, pCur ) && pCur->parentScope->level > identLevel;
        pCur = (TLocalIdent *)pCur->nameLink.Flink )
    {};


  ASSERT( END_OF_LIST( pList, pCur ) || pCur->parentScope->level < identLevel ); // they can't be equal

  // Insert before _pCur_
  //
  INSERT_TAIL_LIST( &pCur->nameLink, &pIdent->nameLink );
};
开发者ID:tmikov,项目名称:cfe99-old,代码行数:34,代码来源:SYMTAB.C


示例3: _FindScopeIdent

//--------------------------------------------------------------------------
// Name         FindScopeIdent
//
// Finds an ident with this name and specified scope.
//--------------------------------------------------------------------------
TLocalIdent * _FindScopeIdent (
    TListRoot * pTab,
    TScope * pScope
  )
{
  TLocalIdent * pCur;
  int scopeLevel;

  scopeLevel = pScope->level;

  // Iterate through all symbols. The scopes are ordered decreasingly.
  // So, as soon as we reach a smaller scope, we can abort the search.
  // 
  for ( pCur = (TLocalIdent *)pTab->Flink;
        !END_OF_LIST( pTab, pCur );
        pCur = (TLocalIdent *)pCur->nameLink.Flink
     )
  {
    int lev;
    ASSERT( pCur->parentScope );

    lev = pCur->parentScope->level;

    if (lev == scopeLevel)
    {
      ASSERT( pCur->parentScope == pScope );
      return pCur;
    }
    else
    if (lev < scopeLevel)
      break;
  }

  return NULL;
};
开发者ID:tmikov,项目名称:cfe99-old,代码行数:40,代码来源:SYMTAB.C


示例4: hud_wingman_status_update

// Update the status of the wingman status
void hud_wingman_status_update()
{
	if ( timestamp_elapsed(HUD_wingman_update_timer) ) {
		int		wing_index,wing_pos;
		ship_obj	*so;
		object	*ship_objp;
		ship		*shipp;

		HUD_wingman_update_timer=timestamp(HUD_WINGMAN_UPDATE_STATUS_INTERVAL);

		for ( so = GET_FIRST(&Ship_obj_list); so != END_OF_LIST(&Ship_obj_list); so = GET_NEXT(so) ) {
			ship_objp = &Objects[so->objnum];
			shipp = &Ships[ship_objp->instance];

			wing_index = shipp->wing_status_wing_index;
			wing_pos = shipp->wing_status_wing_pos;

			if ( (wing_index >= 0) && (wing_pos >= 0) && !(ship_objp->flags & OF_SHOULD_BE_DEAD) ) {

				HUD_wingman_status[wing_index].used = 1;
				if (!(shipp->flags & SF_DEPARTING) ) {
					HUD_wingman_status[wing_index].status[wing_pos] = HUD_WINGMAN_STATUS_ALIVE;	
				}
				HUD_wingman_status[wing_index].hull[wing_pos] = get_hull_pct(ship_objp);
				if ( HUD_wingman_status[wing_index].hull[wing_pos] <= 0 ) {
					HUD_wingman_status[wing_index].status[wing_pos] = HUD_WINGMAN_STATUS_DEAD;
				}
			}
		}
	}
}
开发者ID:DahBlount,项目名称:Freespace-Open-Swifty,代码行数:32,代码来源:hudwingmanstatus.cpp


示例5: object_h

void camera::set_object_host(object *objp, int n_object_host_submodel)
{
	if(objp == NULL)
		object_host = object_h();

	object_host = object_h(objp);
	object_host_submodel = n_object_host_submodel;
	set_custom_position_function(NULL);
	set_custom_orientation_function(NULL);
	if(n_object_host_submodel > 0)
	{
		if(objp->type == OBJ_SHIP)
		{
			ship_subsys* ssp = GET_FIRST(&Ships[objp->instance].subsys_list);
			while ( ssp != END_OF_LIST( &Ships[objp->instance].subsys_list ) )
			{
				if(ssp->system_info->subobj_num == n_object_host_submodel)
				{
					if(ssp->system_info->type == SUBSYSTEM_TURRET)
					{
						set_custom_position_function(get_turret_cam_pos);
						set_custom_orientation_function(get_turret_cam_orient);
					}
				}
				ssp = GET_NEXT( ssp );
			}
		}
	}
}
开发者ID:Esarai,项目名称:fs2open.github.com,代码行数:29,代码来源:camera.cpp


示例6: red_alert_bash_subsys_status

void red_alert_bash_subsys_status(red_alert_ship_status *ras, ship *shipp)
{
	ship_subsys *ss;
	int i, count = 0;
	int list_size;

	// restore from ship_exited
	if ( (ras->ship_class == RED_ALERT_DESTROYED_SHIP_CLASS) || (ras->ship_class == RED_ALERT_PLAYER_DEL_SHIP_CLASS) ) {
		return;
	}

	ss = GET_FIRST(&shipp->subsys_list);
	while ( ss != END_OF_LIST( &shipp->subsys_list ) ) {
		// using at() here for the bounds check, although out-of-bounds should
		// probably never happen here
		try {
			ss->current_hits = ras->subsys_current_hits.at(count);
		} catch (std::out_of_range range) {
			break;
		}

		if (ss->current_hits <= 0) {
			ss->submodel_info_1.blown_off = 1;
		}

		ss = GET_NEXT( ss );
		count++;
	}

	list_size = (int)ras->subsys_aggregate_current_hits.size();
	CLAMP(list_size, 0, SUBSYSTEM_MAX);
	for (i = 0; i < list_size; i++) {
		shipp->subsys_info[i].aggregate_current_hits = ras->subsys_aggregate_current_hits[i];
	}
}
开发者ID:Echelon9,项目名称:fs2open.github.com,代码行数:35,代码来源:redalert.cpp


示例7: GET_FIRST

void WeaponEditorDlg::update_pilot()
{
	int i;
	object *ptr;
	ship_weapon *weapon;

	if (m_multi_edit) {
		ptr = GET_FIRST(&obj_used_list);
		while (ptr != END_OF_LIST(&obj_used_list)) {
			if (((ptr->type == OBJ_SHIP) || (ptr->type == OBJ_START)) && (ptr->flags[Object::Object_Flags::Marked])) {
				weapon = &Ships[ptr->instance].weapons;

				if (pilot.ai_class >= 0)
					weapon->ai_class = pilot.ai_class;
				
				for (i=0; i<MAX_SHIP_PRIMARY_BANKS; i++)
					if (pilot.primary_bank_weapons[i] != -2)
						weapon->primary_bank_weapons[i] = pilot.primary_bank_weapons[i];

				for (i=0; i<MAX_SHIP_SECONDARY_BANKS; i++) {
					if (pilot.secondary_bank_weapons[i] != -2)
						weapon->secondary_bank_weapons[i] = pilot.secondary_bank_weapons[i];
					if (pilot.secondary_bank_ammo[i] >= 0)
						weapon->secondary_bank_ammo[i] = pilot.secondary_bank_ammo[i];
				}
			}

			ptr = GET_NEXT(ptr);
		}
	}
}
开发者ID:Kobrar,项目名称:fs2open.github.com,代码行数:31,代码来源:weaponeditordlg.cpp


示例8: multi_lag_recvfrom

// recvfrom for multilag
int multi_lag_recvfrom(uint s, char *buf, int len, int flags, struct sockaddr *from, int *fromlen)
{
	lag_buf *moveup = NULL;
	lag_buf *item = NULL;

	// now determine if we have any pending packets - find the first one
	moveup=GET_FIRST(&Lag_used_list);
	while ( moveup!=END_OF_LIST(&Lag_used_list) )	{		
		// if the timestamp has elapsed
		if((s == (SOCKET)moveup->socket) && ((moveup->stamp <= 0) || timestamp_elapsed(moveup->stamp))){
			item = moveup;
			break;
		}

		moveup = GET_NEXT(moveup);
	}

	// if this happens, it means that the multi_lag_select() returned an improper value
	Assert(item);
	// stuff the data
	Assert(item->data_len <= len);
	memcpy(buf, item->data, item->data_len);
	Assertion(Tcp_active, "multi_lag_recvfrom(): TCP/IP is not active!");
	memcpy(from, &item->ip_addr, sizeof(SOCKADDR_IN));

	// stick the item back on the free list
	multi_lag_put_free(item);

	// return the size in bytes
	return item->data_len;
}
开发者ID:Kobrar,项目名称:fs2open.github.com,代码行数:32,代码来源:multilag.cpp


示例9: unmark_all

void ship_select::OnOK()
{
	int i;
	object *ptr;

	unmark_all();
	update_status();
	ptr = GET_FIRST(&obj_used_list);
	while (ptr != END_OF_LIST(&obj_used_list))
	{
		if (ptr->flags & OF_TEMP_MARKED)
			mark_object(OBJ_INDEX(ptr));

		ptr = GET_NEXT(ptr);
	}

	if (query_valid_object() && (Marked == 1) && (Objects[cur_object_index].type == OBJ_POINT)) {
		Assert(Briefing_dialog);
		Briefing_dialog->icon_select(Objects[cur_object_index].instance);

	} else {
		if (Briefing_dialog)
			Briefing_dialog->icon_select(-1);
	}

	filter_ships = m_filter_ships;
	filter_starts = m_filter_starts;
	filter_waypoints = m_filter_waypoints;

	for (i = 0; i < MAX_IFFS; i++)
		filter_iff[i] = m_filter_iff[i];

	CDialog::OnOK();
}
开发者ID:n-kawamt,项目名称:fs2open_snapshot,代码行数:34,代码来源:ship_select.cpp


示例10: unmark_all

void ship_select::OnOK()
{
	object *ptr;

	unmark_all();
	update_status();
	ptr = GET_FIRST(&obj_used_list);
	while (ptr != END_OF_LIST(&obj_used_list))
	{
		if (ptr->flags & OF_TEMP_MARKED)
			mark_object(OBJ_INDEX(ptr));

		ptr = GET_NEXT(ptr);
	}

	if (query_valid_object() && (Marked == 1) && (Objects[cur_object_index].type == OBJ_POINT)) {
		Assert(Briefing_dialog);
		Briefing_dialog->icon_select(Objects[cur_object_index].instance);

	} else {
		if (Briefing_dialog)
			Briefing_dialog->icon_select(-1);
	}

	filter_ships = m_filter_ships;
	filter_starts = m_filter_starts;
	filter_waypoints = m_filter_waypoints;
	filter_friendly = m_filter_friendly;
	filter_hostile = m_filter_hostile;
	filter_neutral = m_filter_neutral;
	filter_unknown = m_filter_unknown;
	CDialog::OnOK();
}
开发者ID:NonCreature0714,项目名称:freespace2,代码行数:33,代码来源:ship_select.cpp


示例11: GET_FIRST

BOOL ShipSpecialDamage::OnInitDialog() 
{
	
	// TODO: Add extra initialization here

	// get ship num
	object *objp;

	m_ship_num = -1;

	objp = GET_FIRST(&obj_used_list);
	while (objp != END_OF_LIST(&obj_used_list)) {
		if ((objp->type == OBJ_START) || (objp->type == OBJ_SHIP)) {
			if (objp->flags & OF_MARKED) {

				m_ship_num = objp->instance;
				break;
			}
		}
		objp = GET_NEXT(objp);
	}

	if (Ships[m_ship_num].special_exp_index == -1) {
		// get default_table_values
		ship_info *sip;
		sip = &Ship_info[Ships[m_ship_num].ship_info_index];

		m_inner_rad = (int)sip->inner_rad;
		m_outer_rad = (int)sip->outer_rad;
		m_damage = (int) sip->damage;
		m_blast = (int) sip->blast;
		m_shock_enabled = (int) sip->explosion_propagates;
		m_shock_speed = (int) sip->shockwave_speed;
		m_special_exp_enabled = FALSE;

		if (m_inner_rad < 10) m_inner_rad = 10;
		if (m_outer_rad < 11) m_outer_rad = 11;
		if (m_shock_speed < 10) m_shock_speed = 10;
	} else {
		int index = Ships[m_ship_num].special_exp_index;
		Assert( (index > 0) && (index < MAX_SEXP_VARIABLES-5) );

		m_inner_rad = atoi(Sexp_variables[index++].text);
		m_outer_rad = atoi(Sexp_variables[index++].text);
		m_damage = atoi(Sexp_variables[index++].text);
		m_blast = atoi(Sexp_variables[index++].text);
		m_shock_enabled = atoi(Sexp_variables[index++].text);
		m_shock_speed = atoi(Sexp_variables[index++].text);
		m_special_exp_enabled = TRUE;
	}

	CDialog::OnInitDialog();

	// maybe gray out lots of stuff
	DoGray();

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
开发者ID:lubomyr,项目名称:freespace2,代码行数:59,代码来源:shipspecialdamage.cpp


示例12: GET_FIRST

BOOL ship_select::OnInitDialog() 
{
    int i;
	object *ptr;

	CDialog::OnInitDialog();

	ptr = GET_FIRST(&obj_used_list);
	while (ptr != END_OF_LIST(&obj_used_list))
	{
		ptr->flags.set(Object::Object_Flags::Temp_marked, ptr->flags[Object::Object_Flags::Marked]);
		ptr = GET_NEXT(ptr);
	}

	list_size = 0;
	create_list();

	// init dialog stuff
	for (i = 0; i < MAX_IFFS; i++)
	{
		if (i < Num_iffs)
		{
			GetDlgItem(IDC_FILTER_SHIPS_IFF[i])->SetWindowText(Iff_info[i].iff_name);
		}

		GetDlgItem(IDC_FILTER_SHIPS_IFF[i])->ShowWindow(i < Num_iffs);
	}

	for (i = 0; i < Num_iffs; i++)
		GetDlgItem(IDC_FILTER_SHIPS_IFF[i])->EnableWindow(m_filter_ships);

	wlist_size = wplist_size = 0;
	wing_index.clear();
	wing_sel_last.clear();

	// Elements 0 - wlist_size are wings, and elements wlist_size - wplist_size are waypoint paths
	m_wing_list.ResetContent();
	wlist_size = 0;
	for (i=0; i<MAX_WINGS; i++) {
		if (Wings[i].wave_count) {
			m_wing_list.AddString(Wings[i].name);
			wing_sel_last.push_back(0);
			wing_index.push_back(i);
			wlist_size++;
		}
	}

	wplist_size = wlist_size;

	SCP_list<waypoint_list>::iterator ii;
	for (i = 0, ii = Waypoint_lists.begin(); ii != Waypoint_lists.end(); ++i, ++ii) {
		m_wing_list.AddString(ii->get_name());
		wing_sel_last.push_back(0);
		wing_index.push_back(i);
		wplist_size++;
	}

	return TRUE;
}
开发者ID:DahBlount,项目名称:fs2open.github.com,代码行数:59,代码来源:ship_select.cpp


示例13: hud_lock_get_new_lock_pos

// Try and find a new locking point
void hud_lock_get_new_lock_pos(object *target_objp, vector *lock_world_pos)
{
	ship			*target_shipp=NULL;
	int			lock_in_range=0;
	float			best_lock_dot=-1.0f, lock_dot=-1.0f;
	ship_subsys	*ss;
	vector		subsys_world_pos, vec_to_lock;

	if ( target_objp->type == OBJ_SHIP ) {
		target_shipp = &Ships[target_objp->instance];
	}

	// if a large ship, lock to pos closest to center and within range
	if ( (target_shipp) && (Ship_info[target_shipp->ship_info_index].flags & (SIF_BIG_SHIP|SIF_HUGE_SHIP)) ) {
		// check all the subsystems and the center of the ship
		
		// assume best lock pos is the center of the ship
		*lock_world_pos=target_objp->pos;
		Player->locking_on_center=1;
		Player->locking_subsys=NULL;
		Player->locking_subsys_parent=-1;
		lock_in_range = hud_lock_world_pos_in_range(lock_world_pos, &vec_to_lock);
		vm_vec_normalize(&vec_to_lock);
		if ( lock_in_range ) {
			best_lock_dot=vm_vec_dot(&Player_obj->orient.vec.fvec, &vec_to_lock);
		} 
		// take center if reasonable dot
		if ( best_lock_dot > 0.95 ) {
			return;
		}

		// iterate through subsystems to see if we can get a better choice
		ss = GET_FIRST(&target_shipp->subsys_list);
		while ( ss != END_OF_LIST( &target_shipp->subsys_list ) ) {

			// get world pos of subsystem
			get_subsystem_world_pos(target_objp, ss, &subsys_world_pos);

			if ( hud_lock_world_pos_in_range(&subsys_world_pos, &vec_to_lock) ) {
				vm_vec_normalize(&vec_to_lock);
				lock_dot=vm_vec_dot(&Player_obj->orient.vec.fvec, &vec_to_lock);
				if ( lock_dot > best_lock_dot ) {
					best_lock_dot=lock_dot;
					Player->locking_on_center=0;
					Player->locking_subsys=ss;
					Player->locking_subsys_parent=Player_ai->target_objnum;
					*lock_world_pos=subsys_world_pos;
				}
			}
			ss = GET_NEXT( ss );
		}
	} else {
		// if small ship (or weapon), just go for the center
		*lock_world_pos = target_objp->pos;
		Player->locking_on_center=1;
		Player->locking_subsys=NULL;
		Player->locking_subsys_parent=-1;
	}
}
开发者ID:chief1983,项目名称:Imperial-Alliance,代码行数:60,代码来源:HUDLOCK.CPP


示例14: hud_goto_pos

void hud_goto_pos(int delta)
{
    int pos=0, font_height = gr_get_font_height();

    if (Scrollback_mode == SCROLLBACK_MODE_MSGS_LOG) {
        int count = 0, y = 0;
        line_node *ptr;

        if (EMPTY(&Msg_scrollback_used_list) || !HUD_msg_inited)
            return;

        ptr = GET_FIRST(&Msg_scrollback_used_list);
        while (ptr != END_OF_LIST(&Msg_scrollback_used_list)) {
            if (ptr->source != HUD_SOURCE_HIDDEN) {
                if (count == Scroll_offset) {
                    pos = y;
                    break;
                }

                y += font_height + ptr->y;
                count++;
            }

            ptr = GET_NEXT(ptr);
        }

        Scroll_offset = count = y = 0;
        ptr = GET_FIRST(&Msg_scrollback_used_list);
        while (ptr != END_OF_LIST(&Msg_scrollback_used_list)) {
            if (ptr->source != HUD_SOURCE_HIDDEN) {
                if (y <= pos + delta)
                    Scroll_offset = count;

                y += font_height + ptr->y;
                count++;
            }

            ptr = GET_NEXT(ptr);
        }

    } else {
        pos = Scroll_offset * font_height;
        pos += delta;
        Scroll_offset = pos / font_height;
    }
}
开发者ID:rtoijala,项目名称:fs2open.github.com,代码行数:46,代码来源:hudmessage.cpp


示例15: GET_FIRST

BOOL ship_select::OnInitDialog() 
{
	int i, flags;
	object *ptr;

	wlist_size = wplist_size = 0;
	CDialog::OnInitDialog();

	ptr = GET_FIRST(&obj_used_list);
	while (ptr != END_OF_LIST(&obj_used_list))
	{
		flags = ptr->flags & ~OF_TEMP_MARKED;
		if (flags & OF_MARKED)
			flags |= OF_TEMP_MARKED;
		else
			flags &= ~OF_TEMP_MARKED;

		ptr->flags = flags;
		ptr = GET_NEXT(ptr);
	}

	list_size = 0;
	create_list();
	GetDlgItem(IDC_FILTER_SHIPS_FRIENDLY)->EnableWindow(m_filter_ships);
	GetDlgItem(IDC_FILTER_SHIPS_HOSTILE)->EnableWindow(m_filter_ships);
	GetDlgItem(IDC_FILTER_SHIPS_NEUTRAL)->EnableWindow(m_filter_ships);
	GetDlgItem(IDC_FILTER_SHIPS_UNKNOWN)->EnableWindow(m_filter_ships);

	// Elements 0 - wlist_size are wings, and elements wlist_size - wplist_size are waypoint paths
	m_wing_list.ResetContent();
	wlist_size = 0;
	
	for (i=0; i<MAX_WINGS; i++)
	{
		if (Wings[i].wave_count) {
			m_wing_list.AddItem(Wings[i].name, RGB(255,255,0));
						
			//m_wing_list.AddString(Wings[i].name);
			wing_sel_last[wlist_size] = 0;
			wing_index[wlist_size++] = i;
		}
	}

	/*wplist_size = wlist_size;
	for (i=0; i<Num_waypoint_lists; i++) {
		//m_wing_list.AddString(Waypoint_lists[i].name);
		wing_sel_last[wplist_size] = 0;
		wing_index[wplist_size++] = i;
	}*/

	BOOL bRet = m_cBrush.CreateSolidBrush(RGB(0, 0, 0)); 
    m_hBrush  = (HBRUSH)m_cBrush;
   	

	SetTimer(1, 100, 0);

	return TRUE;
}
开发者ID:chief1983,项目名称:Imperial-Alliance,代码行数:58,代码来源:ship_select.cpp


示例16: UpdateData

void create_wing_dlg::OnOK()
{
	char msg[512];
	int i;
	object *ptr;

	UpdateData(TRUE);
	UpdateData(TRUE);
	m_name = drop_white_space((char *)(LPCSTR) m_name);
	if (m_name.IsEmpty()) {
		MessageBox("You must give a name before you can continue.");
		return;
	}

	for (i=0; i<MAX_WINGS; i++)
		if (!stricmp(Wings[i].name, m_name) && Wings[i].wave_count) {
			sprintf(msg, "The name \"%s\" is already being used by another wing", m_name);
			MessageBox(msg);
			return;
		}

	ptr = GET_FIRST(&obj_used_list);
	while (ptr != END_OF_LIST(&obj_used_list)) {
		if (ptr->type == OBJ_SHIP) {
			i = ptr->instance;
			if (!strnicmp(m_name, Ships[i].ship_name, strlen(m_name))) {
				char *namep;

				namep = Ships[i].ship_name + strlen(m_name);
				if (*namep == ' ') {
					namep++;
					while (*namep) {
						if (!isdigit(*namep))
							break;

						namep++;
					}
				}

				if (!*namep) {
					MessageBox("This wing name is already being used by a ship");
					return;
				}
			}
		}

		ptr = GET_NEXT(ptr);
	}

	for (i=0; i<MAX_WAYPOINT_LISTS; i++)
		if (Waypoint_lists[i].count && !stricmp(Waypoint_lists[i].name, m_name)) {
			MessageBox("This wing name is already being used by a waypoint path");
			return;
		}

	CDialog::OnOK();
}
开发者ID:svn2github,项目名称:FS2Open_Trunk,代码行数:57,代码来源:createwingdlg.cpp


示例17: Assert

void HudGaugeRadarStd::drawBlips(int blip_type, int bright, int distort)
{
	blip *b = NULL;
	blip *blip_head = NULL;
	int x, y;

	Assert((blip_type >= 0) && (blip_type < MAX_BLIP_TYPES));


	// Need to set font.
	gr_set_font(FONT1);


	// get the appropriate blip list
	if (bright)
		blip_head = &Blip_bright_list[blip_type];
	else
		blip_head = &Blip_dim_list[blip_type];


	// draw all blips of this type
	for (b = GET_FIRST(blip_head); b != END_OF_LIST(blip_head); b = GET_NEXT(b))
	{
		gr_set_color_fast(b->blip_color);
		plotBlip(b, &x, &y);

		// maybe draw cool blip to indicate current target
		if (b->flags & BLIP_CURRENT_TARGET)
		{
			b->rad = Radar_blip_radius_target;
			current_target_x = x;
			current_target_y = y;
		}
		else
		{
			b->rad = Radar_blip_radius_normal;
		}

		// maybe distort blip
		if (distort)
		{
			blipDrawDistorted(b, x, y);
		}
		else if (b->flags & BLIP_DRAW_DISTORTED)
		{
			blipDrawFlicker(b, x, y);
		}
		else
		{
			if (b->radar_image_2d == -1 && b->radar_color_image_2d == -1)
				drawContactCircle(x, y, b->rad);
			else
				drawContactImage(x, y, b->rad, b->radar_image_2d, b->radar_color_image_2d, b->radar_image_size);
		}
	}
}
开发者ID:Admiral-MS,项目名称:fs2open.github.com,代码行数:56,代码来源:radar.cpp


示例18: UpdateData

void orient_editor::OnOK()
{
	vec3d delta, pos;
	object *ptr;

	UpdateData(TRUE);
	pos.xyz.x = convert(m_position_x);
	pos.xyz.y = convert(m_position_y);
	pos.xyz.z = convert(m_position_z);

	if ((((CButton *) GetDlgItem(IDC_POINT_TO_OBJECT))->GetCheck() == 1) ||
		(((CButton *) GetDlgItem(IDC_POINT_TO_LOCATION))->GetCheck() == 1))
			set_modified();

	vm_vec_sub(&delta, &pos, &Objects[cur_object_index].pos);
	if (delta.xyz.x || delta.xyz.y || delta.xyz.z)
		set_modified();

	ptr = GET_FIRST(&obj_used_list);
	while (ptr != END_OF_LIST(&obj_used_list)) {
		if (ptr->flags & OF_MARKED) {
			vm_vec_add2(&ptr->pos, &delta);
			update_object(ptr);
		}

		ptr = GET_NEXT(ptr);
	}

	ptr = GET_FIRST(&obj_used_list);
	while (ptr != END_OF_LIST(&obj_used_list)) {
		if (ptr->flags & OF_MARKED)
			object_moved(ptr);

		ptr = GET_NEXT(ptr);
	}

	theApp.record_window_data(&Object_wnd_data, this);
	CDialog::OnOK();
}
开发者ID:n-kawamt,项目名称:fs2open_snapshot,代码行数:39,代码来源:orienteditor.cpp


示例19: GET_FIRST

void briefing_editor_dlg::OnPropagateIcons() 
{
	object *ptr;

	ptr = GET_FIRST(&obj_used_list);
	while (ptr != END_OF_LIST(&obj_used_list)) {
		if ((ptr->type == OBJ_POINT) && (ptr->flags & OF_MARKED)) {
			propagate_icon(ptr->instance);
		}

		ptr = GET_NEXT(ptr);
	}
}
开发者ID:svn2github,项目名称:FS2Open_Trunk,代码行数:13,代码来源:briefingeditordlg.cpp


示例20: save_hotkeys

void save_hotkeys()
{
	ship_obj *so;
	int i;

	for (i=0; i<MAX_KEYED_TARGETS; i++) {
		hud_target_hotkey_clear(i);
		for ( so = GET_FIRST(&Ship_obj_list); so != END_OF_LIST(&Ship_obj_list); so = GET_NEXT(so) ) {
			if ( Hotkey_bits[Objects[so->objnum].instance] & (1 << i) ) {
				hud_target_hotkey_add_remove(i, &Objects[so->objnum], HOTKEY_USER_ADDED );
			}
		}
	}
}
开发者ID:PhantomHoover,项目名称:fs2open.github.com,代码行数:14,代码来源:missionhotkey.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ END_PROFILE函数代码示例发布时间:2022-05-30
下一篇:
C++ END_MENU函数代码示例发布时间: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