本文整理匯總了C++中GET_FIRST函數的典型用法代碼示例。如果您正苦於以下問題:C++ GET_FIRST函數的具體用法?C++ GET_FIRST怎麽用?C++ GET_FIRST使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GET_FIRST函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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();
}
示例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);
}
}
示例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 );
}
}
}
}
示例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);
}
}
}
示例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
}
示例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);
}
}
}
示例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
}
示例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();
}
示例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;
}
示例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;
}
}
示例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;
}