本文整理汇总了C++中GET_FIRST函数的典型用法代码示例。如果您正苦于以下问题:C++ GET_FIRST函数的具体用法?C++ GET_FIRST怎么用?C++ GET_FIRST使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GET_FIRST函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: shockwave_move_all
/**
* Simulate all shockwaves in Shockwave_list
*
* @param frametime time for last frame in ms
*/
void shockwave_move_all(float frametime)
{
shockwave *sw, *next;
sw = GET_FIRST(&Shockwave_list);
while ( sw != &Shockwave_list ) {
next = sw->next;
Assert(sw->objnum != -1);
shockwave_move(&Objects[sw->objnum], frametime);
sw = next;
}
}
开发者ID:Kobrar,项目名称:fs2open.github.com,代码行数:17,代码来源:shockwave.cpp
示例2: shockwave_delete_all
/**
* Delete whole linked list
*/
void shockwave_delete_all()
{
shockwave *sw, *next;
sw = GET_FIRST(&Shockwave_list);
while ( sw != &Shockwave_list ) {
next = sw->next;
Assert(sw->objnum != -1);
Objects[sw->objnum].flags |= OF_SHOULD_BE_DEAD;
sw = next;
}
}
开发者ID:achilleas-k,项目名称:fs2open.github.com,代码行数:15,代码来源:shockwave.cpp
示例3: shockwave_render_all
/**
* Render all shockwaves
*/
void shockwave_render_all()
{
shockwave *sw, *next;
sw = GET_FIRST(&Shockwave_list);
while ( sw != &Shockwave_list ) {
next = sw->next;
Assert(sw->objnum != -1);
shockwave_render(&Objects[sw->objnum]);
sw = next;
}
}
开发者ID:achilleas-k,项目名称:fs2open.github.com,代码行数:15,代码来源:shockwave.cpp
示例4: shockwave_delete_all
/**
* Delete whole linked list
*/
void shockwave_delete_all()
{
shockwave *sw, *next;
sw = GET_FIRST(&Shockwave_list);
while ( sw != &Shockwave_list ) {
next = sw->next;
Assert(sw->objnum != -1);
Objects[sw->objnum].flags.set(Object::Object_Flags::Should_be_dead);
sw = next;
}
}
开发者ID:Kobrar,项目名称:fs2open.github.com,代码行数:15,代码来源:shockwave.cpp
示例5: 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
示例6: 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
示例7: 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
示例8: draw_radar_blips_std
// Draw all the active radar blips
void draw_radar_blips_std(int blip_type, int bright, int distort)
{
blip *b = NULL;
blip *blip_head = NULL;
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);
// maybe draw cool blip to indicate current target
if (b->flags & BLIP_CURRENT_TARGET)
{
b->rad = Current_radar_global->Radar_blip_radius_target[gr_screen.res];
}
else
{
b->rad = Current_radar_global->Radar_blip_radius_normal[gr_screen.res];
}
// maybe distort blip
if (distort)
{
radar_blip_draw_distorted_std(b);
}
else if (b->flags & BLIP_DRAW_DISTORTED)
{
radar_blip_draw_flicker_std(b);
}
else
{
radar_draw_circle_std(b->x, b->y, b->rad);
}
}
}
开发者ID:svn2github,项目名称:FS2Open_Trunk,代码行数:50,代码来源:radar.cpp
示例9: GET_FIRST
BOOL ShipSpecialHitpoints::OnInitDialog()
{
// 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_hitpoint_index == -1)
{
// get default_table_values
ship_info *sip;
sip = &Ship_info[Ships[m_ship_num].ship_info_index];
m_shields = (int)sip->initial_shield_strength;
m_hull = (int)sip->initial_hull_strength;
m_special_hitpoints_enabled = FALSE;
if (m_shields < 0) m_shields = 0;
if (m_hull < 10) m_hull = 10;
} else {
int index = Ships[m_ship_num].special_hitpoint_index;
// Assert( (index > 0) && (index < MAX_SEXP_VARIABLES-(BLOCK_HITPOINT_SIZE-1)) );
m_shields = atoi(Sexp_variables[index++].text);
m_hull = atoi(Sexp_variables[index++].text);
m_special_hitpoints_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:chief1983,项目名称:Imperial-Alliance,代码行数:49,代码来源:ShipSpecialHitpoints.cpp
示例10: update_item
void ShipGoalsDlg::update()
{
int i;
if (goalp) {
for (i=0; i<ED_MAX_GOALS; i++)
update_item(i);
verify_orders();
} else {
object *ptr;
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])) {
goalp = Ai_info[Ships[ptr->instance].ai_index].goals;
for (i=0; i<ED_MAX_GOALS; i++)
update_item(i, 1);
}
ptr = GET_NEXT(ptr);
}
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])) {
self_ship = ptr->instance;
goalp = Ai_info[Ships[self_ship].ai_index].goals;
verify_orders(self_ship);
}
ptr = GET_NEXT(ptr);
}
}
}
开发者ID:DahBlount,项目名称:fs2open.github.com,代码行数:36,代码来源:shipgoalsdlg.cpp
示例11: mission_hotkey_validate
void mission_hotkey_validate()
{
htarget_list *hitem, *plist;
object *A;
int obj_valid, i;
for ( i = 0; i < MAX_KEYED_TARGETS; i++ ) {
plist = &(Players[Player_num].keyed_targets[i]);
if ( EMPTY( plist ) ) // no items in list, then do nothing
continue;
hitem = GET_FIRST(plist);
while ( hitem != END_OF_LIST(plist) ) {
// ensure this object is still valid and in the obj_used_list
obj_valid = FALSE;
for ( A = GET_FIRST(&obj_used_list); A !=END_OF_LIST(&obj_used_list); A = GET_NEXT(A) ) {
if ( A->signature == hitem->objp->signature ) {
obj_valid = TRUE;
break;
}
}
if ( obj_valid == FALSE ) {
htarget_list *temp;
temp = GET_NEXT(hitem);
list_remove( plist, hitem );
list_append( &htarget_free_list, hitem );
hitem->objp = NULL;
hitem = temp;
continue;
}
hitem = GET_NEXT( hitem );
} // end while
} // end for
}
开发者ID:PhantomHoover,项目名称:fs2open.github.com,代码行数:36,代码来源:missionhotkey.cpp
示例12: GET_FIRST
void ship_flags_dlg::OnOK()
{
object *objp;
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)
update_ship(objp->instance);
}
objp = GET_NEXT(objp);
}
CDialog::OnOK();
}
开发者ID:chief1983,项目名称:Imperial-Alliance,代码行数:16,代码来源:ShipFlagsDlg.cpp
示例13: 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.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;
}
return TRUE;
}
开发者ID:NonCreature0714,项目名称:freespace2,代码行数:47,代码来源:ship_select.cpp
示例14: anim_release_all_instances
/**
* @brief Free all anim instances that are on the anim_render_list.
*
* @param screen_id Optional parameter that lets you only free a subset of the anim instances.
* A screen_id of 0 is the default value, and this is used for animations that always play when
* they are placed on the aim_render_list.
*/
void anim_release_all_instances(int screen_id)
{
anim_instance* A;
anim_instance* temp;
if ( Anim_inited == FALSE )
return;
A = GET_FIRST(&anim_render_list);
while( A !=END_OF_LIST(&anim_render_list) ) {
temp = GET_NEXT(A);
if ( A->screen_id == screen_id || screen_id == 0 ) {
anim_release_render_instance(A);
}
A = temp;
}
}
开发者ID:X3N0-Life-Form,项目名称:fs2open.github.com,代码行数:24,代码来源:animplay.cpp
示例15: hud_get_scroll_max_pos
// how many lines to skip
int hud_get_scroll_max_pos()
{
int max = 0, font_height = gr_get_font_height();
if (Scrollback_mode == SCROLLBACK_MODE_MSGS_LOG) {
int count = 0;
line_node *ptr;
// number of pixels in excess of what can be displayed
int excess = Scroll_max - Hud_mission_log_list_coords[gr_screen.res][3];
if (EMPTY(&Msg_scrollback_used_list) || !HUD_msg_inited) {
max = 0;
} else {
ptr = GET_FIRST(&Msg_scrollback_used_list);
while (ptr != END_OF_LIST(&Msg_scrollback_used_list)) {
if (ptr->source != HUD_SOURCE_HIDDEN) {
if (excess > 0) {
excess -= font_height;
count++;
}
if (excess <= 0) {
max = count;
break;
}
// spacing between lines
excess -= ptr->y;
}
ptr = GET_NEXT(ptr);
}
}
} else {
max = (Scroll_max - Hud_mission_log_list_coords[gr_screen.res][3]) / font_height;
}
if (max < 0)
max = 0;
return max;
}
开发者ID:rtoijala,项目名称:fs2open.github.com,代码行数:47,代码来源:hudmessage.cpp
示例16: hud_free_scrollback_list
// hud_free_scrollback_list() will free the memory that was allocated to store the messages
// for the scroll-back list
//
void hud_free_scrollback_list()
{
line_node *A;
// check if the list has been inited yet. If not, return with doing nothing.
if ( Msg_scrollback_used_list.next == NULL || Msg_scrollback_used_list.prev == NULL )
return;
A = GET_FIRST(&Msg_scrollback_used_list);
while( A !=END_OF_LIST(&Msg_scrollback_used_list) ) {
if ( A->text != NULL ) {
vm_free(A->text);
A->text = NULL;
}
A = GET_NEXT(A);
}
}
开发者ID:rtoijala,项目名称:fs2open.github.com,代码行数:21,代码来源:hudmessage.cpp
示例17: collide_predict_large_ship
// Return true if objp will collide with some large object.
// Don't check for an object this ship is docked to.
int collide_predict_large_ship(object *objp, float distance)
{
object *objp2;
vec3d cur_pos, goal_pos;
ship_info *sip;
sip = &Ship_info[Ships[objp->instance].ship_info_index];
cur_pos = objp->pos;
vm_vec_scale_add(&goal_pos, &cur_pos, &objp->orient.vec.fvec, distance);
for ( objp2 = GET_FIRST(&obj_used_list); objp2 != END_OF_LIST(&obj_used_list); objp2 = GET_NEXT(objp2) ) {
if ((objp != objp2) && (objp2->type == OBJ_SHIP)) {
if (Ship_info[Ships[objp2->instance].ship_info_index].flags & (SIF_BIG_SHIP | SIF_HUGE_SHIP)) {
if (dock_check_find_docked_object(objp, objp2))
continue;
if (cpls_aux(&goal_pos, objp2, objp))
return 1;
}
} else if (!(sip->flags & (SIF_BIG_SHIP | SIF_HUGE_SHIP)) && (objp2->type == OBJ_ASTEROID)) {
if (vm_vec_dist_quick(&objp2->pos, &objp->pos) < (distance + objp2->radius)*2.5f) {
vec3d pos, delvec;
int count;
float d1;
d1 = 2.5f * distance + objp2->radius;
count = (int) (d1/(objp2->radius + objp->radius)); // Scale up distance, else looks like there would be a collision.
pos = cur_pos;
vm_vec_normalized_dir(&delvec, &goal_pos, &cur_pos);
vm_vec_scale(&delvec, d1/count);
for (; count>0; count--) {
if (vm_vec_dist_quick(&pos, &objp2->pos) < objp->radius + objp2->radius)
return 1;
vm_vec_add2(&pos, &delvec);
}
}
}
}
return 0;
}
开发者ID:achilleas-k,项目名称:fs2open.github.com,代码行数:46,代码来源:objcollide.cpp
示例18: GetItemData
void ShipGoalsDlg::set_object(int item)
{
char *str;
int i = 0, z, num, not_used;
ship_subsys *subsys;
if (m_behavior[item] > 0) {
auto mode = m_behavior_box[item] -> GetItemData(m_behavior[item]);
if (!m_object_box[item] -> GetCount())
m_behavior[item] = m_data[item] = 0;
else
m_data[item] = (int)m_object_box[item] -> GetItemData(m_object[item]);
if ((mode == AI_GOAL_DOCK) && (m_data[item] >= 0)) {
num = get_docking_list(Ship_info[Ships[m_data[item] & DATA_MASK].ship_info_index].model_num);
m_dock2_box[item] -> EnableWindow(TRUE);
m_dock2_box[item] -> ResetContent();
for (i=0; i<num; i++) {
Assert(Docking_bay_list[i]);
z = m_dock2_box[item] -> AddString(Docking_bay_list[i]);
str = ai_get_goal_target_name(Docking_bay_list[i], ¬_used);
m_dock2_box[item] -> SetItemDataPtr(z, str);
}
} else if ((mode == AI_GOAL_DESTROY_SUBSYSTEM) && (m_data[item] >= 0)) {
if (((m_data[item] & TYPE_MASK) == TYPE_SHIP) || ((m_data[item] & TYPE_MASK) == TYPE_PLAYER)) {
i = m_data[item] & DATA_MASK;
} else
Int3();
m_subsys_box[item] -> ResetContent();
subsys = GET_FIRST(&Ships[i].subsys_list);
z = 0;
while (subsys != END_OF_LIST(&Ships[i].subsys_list)) {
m_subsys_box[item]->AddString(subsys->system_info->subobj_name);
m_subsys_box[item]->SetItemDataPtr(z, &subsys->system_info->subobj_name);
z++;
subsys = GET_NEXT(subsys);
}
}
}
}
开发者ID:DahBlount,项目名称:fs2open.github.com,代码行数:43,代码来源:shipgoalsdlg.cpp
示例19: GET_FIRST
void ship_select::update_status(bool first_time)
{
int i, z;
object *ptr;
ptr = GET_FIRST(&obj_used_list);
while (ptr != END_OF_LIST(&obj_used_list)) {
ptr->flags.remove(Object::Object_Flags::Temp_marked);
ptr = GET_NEXT(ptr);
}
for (i=0; i<list_size; i++)
{
z = m_ship_list.GetSel(i);
obj_index[i]->flags.set(Object::Object_Flags::Temp_marked, z >= 1);
}
if(!first_time)
OnSelchangeShipList();
}
开发者ID:DahBlount,项目名称:fs2open.github.com,代码行数:19,代码来源:ship_select.cpp
示例20: reset_hotkeys
void reset_hotkeys()
{
int i;
htarget_list *hitem, *plist;
for (i=0; i<MAX_SHIPS; i++)
Hotkey_bits[i] = 0;
for ( i=0; i<MAX_KEYED_TARGETS; i++ ) {
plist = &(Players[Player_num].keyed_targets[i]);
if ( EMPTY(plist) ) // no items in list, then do nothing
continue;
for ( hitem = GET_FIRST(plist); hitem != END_OF_LIST(plist); hitem = GET_NEXT(hitem) ) {
Assert(hitem->objp->type == OBJ_SHIP);
Hotkey_bits[hitem->objp->instance] |= (1 << i);
}
}
}
开发者ID:PhantomHoover,项目名称:fs2open.github.com,代码行数:19,代码来源:missionhotkey.cpp
注:本文中的GET_FIRST函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论