您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ timer_get_fixed_seconds函数代码示例

51自学网 2021-06-03 08:51:19
  C++
这篇教程C++ timer_get_fixed_seconds函数代码示例写得很实用,希望能帮到您。

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

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

示例1: main

void main (void){	fix t1, t2, t3, delta, mdelta, mt3;	printf( "Press any key to start.../n" );	timer_init();	timer_set_rate( 9943 );	t1 = t2 = timer_get_fixed_seconds();	mdelta = 0;	mt3 = 0;	while(!kbhit())	{		t3 = t2;		t1 = timer_get_approx_seconds();		t2 = timer_get_fixed_seconds();		delta = t2 - t1;		if ( abs(delta) > mdelta )			mdelta = abs(delta);		if ( abs(t2-t3) > mt3 )			mt3 = abs(t2-t3);		printf( "%.8f/t%.8f/t%.8f/t%d/t%.8f/t%.8f/n", f2fl(t2), f2fl(t2-t1), f2fl(mdelta), TICKER/19, f2fl(t2-t3), f2fl(mt3) );//		if ( t2 < t1 )	{//			printf( "Bad time of %.8f/n", f2fl(t1-t2) );//		}	}}
开发者ID:NonCreature0714,项目名称:descent,代码行数:29,


示例2: generic_render_eff_stream

//for timer debug, #define TIMERvoid generic_render_eff_stream(generic_anim *ga){	if(ga->current_frame == ga->previous_frame)		return;	ubyte bpp = 32;	if(ga->use_hud_color)		bpp = 8;	#ifdef TIMER		int start_time = timer_get_fixed_seconds();	#endif	#ifdef TIMER		mprintf(("=========================/n"));		mprintf(("frame: %d/n", ga->current_frame));	#endif		char frame_name[MAX_FILENAME_LEN];		snprintf(frame_name, MAX_FILENAME_LEN, "%s_%.4d", ga->filename, ga->current_frame);		if(bm_reload(ga->eff.next_frame, frame_name) == ga->eff.next_frame)		{			bitmap* next_frame_bmp = bm_lock(ga->eff.next_frame, bpp, (bpp==8)?BMP_AABITMAP:BMP_TEX_NONCOMP, true);			if(next_frame_bmp->data)				gr_update_texture(ga->bitmap_id, bpp, (ubyte*)next_frame_bmp->data, ga->width, ga->height);			bm_unlock(ga->eff.next_frame);			bm_unload(ga->eff.next_frame, 0, true);			if (ga->current_frame == ga->num_frames-1)			{				snprintf(frame_name, MAX_FILENAME_LEN, "%s_0001", ga->filename);				bm_reload(ga->eff.next_frame, frame_name);			}		}	#ifdef TIMER		mprintf(("end: %d/n", timer_get_fixed_seconds() - start_time));		mprintf(("=========================/n"));	#endif}
开发者ID:joshuasb,项目名称:fs2open,代码行数:36,


示例3: show_char_delay

//	-----------------------------------------------------------------------------//	Returns char width.//	If show_robot_flag set, then show a frame of the spinning robot.int show_char_delay(char the_char, int delay, int robot_num, int cursor_flag){	int	w, h, aw;	char	message[2];	fix	start_time;	int	i;	start_time = timer_get_fixed_seconds();	message[0] = the_char;	message[1] = 0;	gr_get_string_size(message, &w, &h, &aw );	Assert((Current_color >= 0) && (Current_color < MAX_BRIEFING_COLORS));	//	Draw cursor if there is some delay and caller says to draw cursor//added/changed on 9/13/98 by adb to fix messy code and add gr_update     if (delay)      {	if (cursor_flag && delay) {		gr_set_fontcolor(Briefing_foreground_colors[Current_color], -1);		gr_printf(Briefing_text_x+1, Briefing_text_y, "_" );	}	for (i=0; i<2; i++) {                if (robot_num != -1)			show_spinning_robot_frame(robot_num);                show_bitmap_frame();                gr_update();		while (timer_get_fixed_seconds() < start_time + delay/2)			;		start_time = timer_get_fixed_seconds();	}	//	Erase cursor        if (cursor_flag) {		gr_set_fontcolor(Erase_color, -1);		gr_printf(Briefing_text_x+1, Briefing_text_y, "_" );	}      }//end additions/changed - adb	//	Draw the character	gr_set_fontcolor(Briefing_background_colors[Current_color], -1);	gr_printf(Briefing_text_x, Briefing_text_y, message );	gr_set_fontcolor(Briefing_foreground_colors[Current_color], -1);	gr_printf(Briefing_text_x+1, Briefing_text_y, message );//	if (the_char != ' ')//		if (!digi_is_sound_playing(231))//			digi_play_sample( 231, F1_0 );	return w;}
开发者ID:btb,项目名称:d1x,代码行数:62,


示例4: delay

void delay(int d_time){	fix t, total;		total = (F1_0 * d_time) / 1000;	t = timer_get_fixed_seconds();	while (timer_get_fixed_seconds() - t < total) ;}
开发者ID:btb,项目名称:d2x,代码行数:8,


示例5: joy_hat_handler

void joy_hat_handler(SDL_JoyHatEvent *jhe){	int hat = SDL_Joysticks[jhe->which].hat_map[jhe->hat];	int hbi;	//Save last state of the hat-button	Joystick.buttons[hat  ].last_state = Joystick.buttons[hat  ].state;	Joystick.buttons[hat+1].last_state = Joystick.buttons[hat+1].state;	Joystick.buttons[hat+2].last_state = Joystick.buttons[hat+2].state;	Joystick.buttons[hat+3].last_state = Joystick.buttons[hat+3].state;	//get current state of the hat-button	Joystick.buttons[hat  ].state = ((jhe->value & SDL_HAT_UP)>0);	Joystick.buttons[hat+1].state = ((jhe->value & SDL_HAT_RIGHT)>0);	Joystick.buttons[hat+2].state = ((jhe->value & SDL_HAT_DOWN)>0);	Joystick.buttons[hat+3].state = ((jhe->value & SDL_HAT_LEFT)>0);	//determine if a hat-button up or down event based on state and last_state	for(hbi=0;hbi<4;hbi++)	{		if(	!Joystick.buttons[hat+hbi].last_state && Joystick.buttons[hat+hbi].state) //last_state up, current state down		{			Joystick.buttons[hat+hbi].time_went_down				= timer_get_fixed_seconds();			Joystick.buttons[hat+hbi].num_downs++;		}		else if(Joystick.buttons[hat+hbi].last_state && !Joystick.buttons[hat+hbi].state)  //last_state down, current state up		{			Joystick.buttons[hat+hbi].num_ups++;		}	}}
开发者ID:gameplayer22,项目名称:d2x-1,代码行数:32,


示例6: debug_draw

void debug_draw(){	int i;	gr_clear();	gr_set_font(FONT1);	gr_set_color_fast( &Color_bright );	gr_string( 0x8000, 3, "Debug Console" );	gr_set_color_fast( &Color_normal );	for (i=0; i<DROWS; i++ ) {		gr_string( 0, i*16+16, debug_text[i] );	}	int t = timer_get_fixed_seconds() / (F1_0/3);	if ( t & 1 ) {		int w,h;		char c;		c = debug_text[debug_y][command_line_pos+1];		debug_text[debug_y][command_line_pos+1] = 0;		gr_get_string_size( &w, &h, debug_text[debug_y] );		//gr_string( w, debug_y*16, "_" );		gr_rect(w+1,debug_y*16+1+16,2,14);		debug_text[debug_y][command_line_pos+1] = c;	}	gr_flip();}
开发者ID:derek-yeung,项目名称:fs2open.github.com,代码行数:33,


示例7: choose_drop_segment

//	------------------------------------------------------------------------------------------------------//	Choose segment to drop a powerup in.//	For all active net players, try to create a N segment path from the player.  If possible, return that//	segment.  If not possible, try another player.  After a few tries, use a random segment.//	Don't drop if control center in segment.int choose_drop_segment(void){	int	pnum = 0;	int	segnum = -1;	int	initial_drop_depth = BASE_NET_DROP_DEPTH + ((rand() * 10) >> 15);	int	cur_drop_depth = initial_drop_depth;	int	count;	srand(timer_get_fixed_seconds());	while ((segnum == -1) && (cur_drop_depth > BASE_NET_DROP_DEPTH/2)) {		pnum = (rand() * N_players) >> 15;		count = 0;		while ((Players[pnum].connected == 0) && (count < N_players)) {			pnum = (pnum+1)%N_players;			count++;		}		if (count == N_players) {			mprintf((1, "Warning: choose_drop_segment: Couldn't find legal drop segment because no connected players./n"));			return (rand() * Highest_segment_index) >> 15;		}		segnum = pick_connected_segment(&Objects[Players[pnum].objnum], cur_drop_depth);		if (Segments[segnum].special == SEGMENT_IS_CONTROLCEN)			segnum = -1;		cur_drop_depth--;	}
开发者ID:devint1,项目名称:descent-win,代码行数:33,


示例8: key_flush

void key_flush(){	int i;	fix curtime;	if (!Installed)		key_init();	arch_key_flush();	key_data.keyhead = key_data.keytail = 0;	//Clear the keyboard buffer	for (i=0; i<KEY_BUFFER_SIZE; i++ )	{		key_data.keybuffer[i] = 0;		key_data.time_pressed[i] = 0;	}	//use gettimeofday here:	curtime = timer_get_fixed_seconds();	for (i=0; i<256; i++ )	{		keyd_pressed[i] = 0;		key_data.keys[i].state = 1;		key_data.keys[i].last_state = 0;		key_data.keys[i].timewentdown = curtime;		key_data.keys[i].downcount=0;		key_data.keys[i].upcount=0;		key_data.keys[i].timehelddown = 0;		key_data.keys[i].counter = 0;	}}
开发者ID:Ringdingcoder,项目名称:d1x,代码行数:32,


示例9: do_robot_dialog

//-------------------------------------------------------------------------// Called from the editor... does one instance of the robot dialog box//-------------------------------------------------------------------------int do_robot_dialog(){	int i;	// Only open 1 instance of this window...	if ( MainWindow != NULL ) return 0;		// Close other windows	close_all_windows();	Cur_goody_count = 0;	// Open a window with a quit button	MainWindow = ui_open_window( TMAPBOX_X+20, TMAPBOX_Y+20, 765-TMAPBOX_X, 545-TMAPBOX_Y, WIN_DIALOG );	QuitButton = ui_add_gadget_button( MainWindow, 20, 286, 40, 32, "Done", NULL );	ui_add_gadget_button( MainWindow, GOODY_X+50, GOODY_Y-3, 25, 22, "<<", GoodyPrevType );	ui_add_gadget_button( MainWindow, GOODY_X+80, GOODY_Y-3, 25, 22, ">>", GoodyNextType );	ui_add_gadget_button( MainWindow, GOODY_X+50, GOODY_Y+21, 25, 22, "<<", GoodyPrevID );	ui_add_gadget_button( MainWindow, GOODY_X+80, GOODY_Y+21, 25, 22, ">>", GoodyNextID );	ui_add_gadget_button( MainWindow, GOODY_X+50, GOODY_Y+45, 25, 22, "<<", GoodyPrevCount );	ui_add_gadget_button( MainWindow, GOODY_X+80, GOODY_Y+45, 25, 22, ">>", GoodyNextCount );	InitialMode[0] = ui_add_gadget_radio( MainWindow,  6, 58, 16, 16, 0, "Hover" );	InitialMode[1] = ui_add_gadget_radio( MainWindow, 76, 58, 16, 16, 0, "Normal" );	InitialMode[2] = ui_add_gadget_radio( MainWindow,  6, 78, 16, 16, 0, "(hide)" );	InitialMode[3] = ui_add_gadget_radio( MainWindow, 76, 78, 16, 16, 0, "Avoid" );	InitialMode[4] = ui_add_gadget_radio( MainWindow,  6, 98, 16, 16, 0, "Follow" );	InitialMode[5] = ui_add_gadget_radio( MainWindow, 76, 98, 16, 16, 0, "Station" );	// The little box the robots will spin in.	RobotViewBox = ui_add_gadget_userbox( MainWindow,155, 5, 150, 125 );	// The little box the robots will spin in.	ContainsViewBox = ui_add_gadget_userbox( MainWindow,10, 202, 100, 80 );	// A bunch of buttons...	i = 135;	ui_add_gadget_button( MainWindow,190,i,53, 26, "<<Typ", 			RobotPrevType );	ui_add_gadget_button( MainWindow,247,i,53, 26, "Typ>>", 			RobotNextType );							i += 29;			ui_add_gadget_button( MainWindow,190,i,110, 26, "Next in Seg", LocalObjectSelectNextinSegment );	i += 29;			ui_add_gadget_button( MainWindow,190,i,53, 26, "<<Obj",		 	LocalObjectSelectPrevinMine );	ui_add_gadget_button( MainWindow,247,i,53, 26, ">>Obj",			LocalObjectSelectNextinMine ); 		i += 29;			ui_add_gadget_button( MainWindow,190,i,110, 26, "Delete", 		LocalObjectDelete );						i += 29;			ui_add_gadget_button( MainWindow,190,i,110, 26, "Create New", 	LocalObjectPlaceObject );				i += 29;			ui_add_gadget_button( MainWindow,190,i,110, 26, "Set Path", 	med_set_ai_path );		Time = timer_get_fixed_seconds();	old_object = -2;		// Set to some dummy value so everything works ok on the first frame.	if ( Cur_object_index == -1 )		LocalObjectSelectNextinMine();	return 1;}
开发者ID:arbruijn,项目名称:d1xnacl,代码行数:63,


示例10: autodemo_menu_check

void autodemo_menu_check(int nitems, newmenu_item * items, int *last_key, int citem ){	int curtime;	nitems = nitems;	items=items;	citem = citem;	//draw copyright message	if ( Menu_draw_copyright )		{		Menu_draw_copyright = 0;		gr_set_current_canvas(NULL);		gr_set_curfont(GAME_FONT);		gr_set_fontcolor(BM_XRGB(6,6,6),-1);		gr_printf(0x8000,grd_curcanv->cv_bitmap.bm_h-GAME_FONT->ft_h-2,TXT_COPYRIGHT);	}		// Don't allow them to hit ESC in the main menu.	if (*last_key==KEY_ESC) *last_key = 0;	if ( do_auto_demo )	{		curtime = timer_get_fixed_seconds();		//if ( ((keyd_time_when_last_pressed+i2f(20)) < curtime) && ((last_joy_time+i2f(20)) < curtime) && (!speedtest_on)  ) {		if ( ((keyd_time_when_last_pressed+i2f(45)) < curtime) && (!speedtest_on)  ) {			hide_cursor();			keyd_time_when_last_pressed = curtime;			// Reset timer so that disk won't thrash if no demos.			newdemo_start_playback(NULL);		// Randomly pick a file			if (Newdemo_state == ND_STATE_PLAYBACK)	{				Function_mode = FMODE_GAME;				*last_key = -2;							  				}		}	}}
开发者ID:osgcc,项目名称:descent-mac,代码行数:34,


示例11: DoMenu

//returns number of item chosenint DoMenu() {	int menu_choice[25];	newmenu_item m[25];	int num_options = 0;	if ( Players[Player_num].callsign[0]==0 )	{		RegisterPlayer();		return 0;	}		if ((Game_mode & GM_SERIAL) || (Game_mode & GM_MODEM)) {		do_option(MENU_START_SERIAL);		return 0;	}	create_main_menu(m, menu_choice, &num_options);	do {		keyd_time_when_last_pressed = timer_get_fixed_seconds();		// .. 20 seconds from now!		if (main_menu_choice < 0 )	main_menu_choice = 0;				Menu_draw_copyright = 1;		main_menu_choice = newmenu_do2( "", NULL, num_options, m, autodemo_menu_check, main_menu_choice, Menu_pcx_name);		if ( main_menu_choice > -1 ) do_option(menu_choice[main_menu_choice]);		create_main_menu(m, menu_choice, &num_options);	//	may have to change, eg, maybe selected pilot and no save games.	} while( Function_mode==FMODE_MENU );//	if (main_menu_choice != -2)//		do_auto_demo = 0;		// No more auto demos	if ( Function_mode==FMODE_GAME )			gr_palette_fade_out( gr_palette, 32, 0 );	return main_menu_choice;}
开发者ID:osgcc,项目名称:descent-mac,代码行数:35,


示例12: test_john

int test_john(void){	int	start, finish;	float	elapsed_time;	mprintf(0, "John test:...");	start = timer_get_fixed_seconds();	john_test();	finish = timer_get_fixed_seconds();	elapsed_time = (float) (finish - start);	mprintf(0, "Done, time = %7.3f/n", elapsed_time/65536.0);	return finish - start;}
开发者ID:NonCreature0714,项目名称:descent,代码行数:17,


示例13: show_title_screen

int show_title_screen( char * filename, int allow_keys )	{	fix timer;	int pcx_error;	grs_bitmap title_bm;	gr_init_bitmap_data (&title_bm);	if ((pcx_error=pcx_read_bitmap( filename, &title_bm, BM_LINEAR, New_pal ))!=PCX_ERROR_NONE)	{		printf( "File '%s', PCX load error: %s (%i)/n  (No big deal, just no title screen.)/n",filename, pcx_errormsg(pcx_error), pcx_error);		mprintf((0, "File '%s', PCX load error: %s (%i)/n  (No big deal, just no title screen.)/n",filename, pcx_errormsg(pcx_error), pcx_error));		Int3();		gr_free_bitmap_data (&title_bm);		return 0;	}//        vfx_set_palette_sub( New_pal );#ifdef OGL	gr_palette_load(New_pal);#else	gr_palette_clear();	#endif	gr_set_current_canvas( NULL );	show_fullscr(&title_bm);        //added on 9/13/98 by adb to make update-needing arch's work        gr_update();        //end addition - adb	gr_free_bitmap_data (&title_bm);	if (allow_keys > 2 || gr_palette_fade_in( New_pal, 32, allow_keys ) || allow_keys > 1) {		return 1;	}	gr_palette_load( New_pal );	timer = timer_get_fixed_seconds() + i2f(3);	while (1)	{		if ( local_key_inkey() && allow_keys ) break;		if ( timer_get_fixed_seconds() > timer ) break;        }                	if (gr_palette_fade_out( New_pal, 32, allow_keys ))		return 1;	return 0;}
开发者ID:btb,项目名称:d1x,代码行数:45,


示例14: mouse_button_handler

void mouse_button_handler(SDL_MouseButtonEvent *mbe){	// to bad, SDL buttons use a different mapping as descent expects,	// this is at least true and tested for the first three buttons 	int button_remap[17] = {		MBTN_LEFT,		MBTN_MIDDLE,		MBTN_RIGHT,		MBTN_Z_UP,		MBTN_Z_DOWN,		MBTN_PITCH_BACKWARD,		MBTN_PITCH_FORWARD,		MBTN_BANK_LEFT,		MBTN_BANK_RIGHT,		MBTN_HEAD_LEFT,		MBTN_HEAD_RIGHT,		MBTN_11,		MBTN_12,		MBTN_13,		MBTN_14,		MBTN_15,		MBTN_16	};	int button = button_remap[mbe->button - 1]; // -1 since SDL seems to start counting at 1	if (mbe->state == SDL_PRESSED) {		Mouse.buttons[button].pressed = 1;		Mouse.buttons[button].time_went_down = timer_get_fixed_seconds();		Mouse.buttons[button].num_downs++;		if (button == MBTN_Z_UP) {			Mouse.delta_z += Z_SENSITIVITY;			Mouse.z += Z_SENSITIVITY;		} else if (button == MBTN_Z_DOWN) {			Mouse.delta_z -= Z_SENSITIVITY;			Mouse.z -= Z_SENSITIVITY;		}	} else {		Mouse.buttons[button].pressed = 0;		Mouse.buttons[button].time_held_down += timer_get_fixed_seconds() - Mouse.buttons[button].time_went_down;		Mouse.buttons[button].num_ups++;	}}
开发者ID:arbruijn,项目名称:d1xnacl,代码行数:44,


示例15: main

int main(){	fix fsecs;	int oldmin=-1, oldsec=-1;	error_init(NULL, NULL);	dpmi_init(0);	timer_init();	key_init();	RBAInit();	RBARegisterCD();	RBAPlayTrack(2);	fsecs = timer_get_fixed_seconds();	do	{		int min, sec, frame;		long headloc;		if ((timer_get_fixed_seconds() - fsecs) >= F2_0) {			headloc = RBAGetHeadLoc(&min, &sec, &frame);			printf("Head loc: %d (%d:%d:%d)/n", headloc, min, sec, frame);			if (min==oldmin && sec==oldsec) {				printf("/nRepeating track../n");				RBAPlayTrack(2);			}			oldmin = min; oldsec = sec;			fsecs = timer_get_fixed_seconds();		}		if (key_inkey()) {			RBAStop();			printf("/nCD stopped./n");			break;		}	}	while (1); 	key_close();	timer_close();	return 0;}
开发者ID:btb,项目名称:d2x,代码行数:42,


示例16: key_init

void key_init(){	// Initialize queue	Status1= *(ubyte*)0x417;	Status2= *(ubyte*)0x418; 	keyd_time_when_last_pressed = timer_get_fixed_seconds();	keyd_buffer_type = 1;	keyd_repeat = 1;	key_data.in_key_handler = 0;	key_data.E0Flag = 0;	key_data.E1Flag = 0;	// Clear the keyboard array	key_flush();	if (Installed) return;	Installed = 1;	//--------------- lock everything for the virtal memory ----------------------------------	if (!dpmi_lock_region ((void near *)key_handler, (char *)key_handler_end - (char near *)key_handler))	{		Error( "Can't lock keyboard handler!/n" );	}	if (!dpmi_lock_region (&key_data, sizeof(keyboard)))	{		Error( "Can't lock keyboard handler's data!/n" );	}	if (!dpmi_lock_region (&keyd_buffer_type, sizeof(char)))	{		Error( "Can't lock keyboard handler's data!/n" );	}	if (!dpmi_lock_region (&keyd_repeat, sizeof(char)))	{		Error( "Can't lock keyboard handler's data!/n" );	}	if (!dpmi_lock_region (&keyd_editor_mode, sizeof(char)))	{		Error( "Can't lock keyboard handler's data!/n" );	}	if (!dpmi_lock_region (&keyd_last_pressed, sizeof(char)))	{		Error( "Can't lock keyboard handler's data!/n" );	}	if (!dpmi_lock_region (&keyd_last_released, sizeof(char)))	{		Error( "Can't lock keyboard handler's data!/n" );	}	if (!dpmi_lock_region (&keyd_pressed, sizeof(char)*256))	{		Error( "Can't lock keyboard handler's data!/n" );	}	if (!dpmi_lock_region (&keyd_time_when_last_pressed, sizeof(int)))	{		Error( "Can't lock keyboard handler's data!/n" );	}	key_data.prev_int_9 = _dos_getvect( 9 );	_dos_setvect( 9, key_handler );	atexit( key_close );}
开发者ID:NonCreature0714,项目名称:descent2,代码行数:54,


示例17: DoMenu

//returns number of item chosenint DoMenu() {	int menu_choice[25];	newmenu_item m[25];	int num_options = 0;	if ( Players[Player_num].callsign[0]==0 )	{		RegisterPlayer();		return 0;	}		if ((Game_mode & GM_SERIAL) || (Game_mode & GM_MODEM)) {		do_option(MENU_START_SERIAL);		return 0;	}	create_main_menu(m, menu_choice, &num_options);	do {		keyd_time_when_last_pressed = timer_get_fixed_seconds();		// .. 20 seconds from now!		if (main_menu_choice < 0 )	main_menu_choice = 0;				Menu_draw_copyright = 1;                //added on 11/19/98 by Victor Rachels to add immediate join/start                 if(start_net_immediately == 1){					if ( gr_palette_faded_out )	{//fix black screen with -startnetgame						gr_palette_fade_in( gr_palette, 32, 0 );					}                    do_option(MENU_START_NETGAME);                    start_net_immediately = 0;				 }                 else if(start_net_immediately == 2)                  {                    do_option(MENU_JOIN_NETGAME);                    start_net_immediately = 0;                  }                 else                  {                //end this section addition - VR                   extern int Menu_Special;                    Menu_Special = 1;                    main_menu_choice = newmenu_do2(NULL, NULL, num_options, m, autodemo_menu_check, main_menu_choice, Menu_pcx_name);                    if ( main_menu_choice > -1 ) do_option(menu_choice[main_menu_choice]);                  }		create_main_menu(m, menu_choice, &num_options);	//	may have to change, eg, maybe selected pilot and no save games.	} while( Function_mode==FMODE_MENU );//	if (main_menu_choice != -2)//		do_auto_demo = 0;		// No more auto demos	if ( Function_mode==FMODE_GAME )			gr_palette_fade_out( gr_palette, 32, 0 );	return main_menu_choice;}
开发者ID:Ringdingcoder,项目名称:d1x,代码行数:54,


示例18: key_init

void key_init(){	Installed=1;	keyd_time_when_last_pressed = timer_get_fixed_seconds();	keyd_buffer_type = 1;	keyd_repeat = 1;// Clear the keyboard array	key_flush();	atexit(key_close);}
开发者ID:gameplayer22,项目名称:d2x-1,代码行数:12,


示例19: joy_get_button_down_time

fix joy_get_button_down_time(int btn){	fix time = F0_0;	if (!num_joysticks)		return 0;	event_poll();	switch (Joystick.buttons[btn].state) {	case SDL_PRESSED:		time = timer_get_fixed_seconds() - Joystick.buttons[btn].time_went_down;		Joystick.buttons[btn].time_went_down = timer_get_fixed_seconds();		break;	case SDL_RELEASED:		time = 0;		break;	}	return time;}
开发者ID:gameplayer22,项目名称:d2x-1,代码行数:21,


示例20: fs2netd_update_valid_tables_do

int fs2netd_update_valid_tables_do(){	if (timeout == -1) {		timeout = timer_get_fixed_seconds() + (30 * F1_0);	}	int rc = FS2NetD_ValidateTableList(do_full_packet);	// if timeout passes then bail on crc failure	if ( timer_get_fixed_seconds() > timeout ) {		timeout = -1;		return 1;	}	do_full_packet = 0;	if ( rc == 0 ) {		return 0;	}	switch (rc) {		// some error occured, assume that there are no valid table crcs		case -1:			timeout = -1;			return 2;		// timeout		case 1:			timeout = -1;			return 1;		// done!		case 2:			timeout = -1;			return 3;	}	return 0;}
开发者ID:svn2github,项目名称:FS2Open_Trunk,代码行数:39,


示例21: flash_cursor

//	-----------------------------------------------------------------------------void flash_cursor(int cursor_flag){	if (cursor_flag == 0)		return;	if ((timer_get_fixed_seconds() % (F1_0/2) ) > (F1_0/4))		gr_set_fontcolor(Briefing_foreground_colors[Current_color], -1);	else		gr_set_fontcolor(Erase_color, -1);	gr_printf(Briefing_text_x+1, Briefing_text_y, "_" );}
开发者ID:btb,项目名称:d1x,代码行数:14,


示例22: dc_draw_cursor

void dc_draw_cursor( SCP_string &cmd_string, int x, int y ){	int t;	int w, h;	// gr_string width and height	t = timer_get_fixed_seconds() / (F1_0/3);	if ( t & 1 ) {		gr_get_string_size( &w, &h, cmd_string.c_str() );		w %= (DCOLS * Current_font->w);		//gr_string( w, debug_y*16, "_" );		gr_rect((x + (w + 1)), (y + (h + 1)), 2, Current_font->h, GR_RESIZE_NONE);	}}
开发者ID:nisselarsson,项目名称:fs2_open_patchbucket,代码行数:14,


示例23: fs2netd_load_servers_do

int fs2netd_load_servers_do(){	if (timeout == -1) {		timeout = timer_get_fixed_seconds() + (30 * F1_0);	}	// if timeout passes then bail on stats failure	if ( timer_get_fixed_seconds() > timeout ) {		timeout = -1;		return 3;	}	int rescode = FS2NetD_GetServerList(do_full_packet);	do_full_packet = 0;	if (rescode) {		timeout = -1;		return rescode;	}	return 0;}
开发者ID:svn2github,项目名称:FS2Open_Trunk,代码行数:23,


示例24: fs2netd_update_ban_list_do

int fs2netd_update_ban_list_do(){	if (timeout == -1) {		timeout = timer_get_fixed_seconds() + (30 * F1_0);	}	// if timeout passes then bail on stats failure	if ( timer_get_fixed_seconds() > timeout ) {		timeout = -1;		return 2;	}	FS2NetD_ban_list = FS2NetD_GetBanList(&FS2NetD_ban_list_count, do_full_packet);	do_full_packet = 0;	if ( (FS2NetD_ban_list != NULL) || (FS2NetD_ban_list_count >= 0) ) {		timeout = -1;		return 1;	}	return 0;}
开发者ID:svn2github,项目名称:FS2Open_Trunk,代码行数:23,


示例25: do_hostage_dialog

//-------------------------------------------------------------------------// Called from the editor... does one instance of the hostage dialog box//-------------------------------------------------------------------------int do_hostage_dialog(){	int i;	// Only open 1 instance of this window...	if ( MainWindow != NULL ) return 0;		// Close other windows	close_all_windows();	CurrentHostageIndex = 0;	SelectClosestHostage();	// Open a window with a quit button	MainWindow = ui_open_window( TMAPBOX_X+10, TMAPBOX_Y+20, 765-TMAPBOX_X, 545-TMAPBOX_Y, WIN_DIALOG );	QuitButton = ui_add_gadget_button( MainWindow, 20, 222, 48, 40, "Done", NULL );	ui_wprintf_at( MainWindow, 10, 32,"&Message:" );	HostageText = ui_add_gadget_inputbox( MainWindow, 10, 50, HOSTAGE_MESSAGE_LEN, HOSTAGE_MESSAGE_LEN, HostageMessage );	// The little box the hostage vclip will play in.	HostageViewBox = ui_add_gadget_userbox( MainWindow,10, 90+10, 64, 64 );	// A bunch of buttons...	i = 90;//@@	ui_add_gadget_button( MainWindow,155,i,70, 26, "<< Type", SelectPrevVclip );//@@	ui_add_gadget_button( MainWindow,155+70,i,70, 26, "Type >>", SelectNextVclip );i += 29;		//@@	ui_add_gadget_button( MainWindow,155,i,70, 26, "<< Sound",  find_prev_hostage_sound );//@@	ui_add_gadget_button( MainWindow,155+70,i,70, 26, "Sound >>", find_next_hostage_sound );i += 29;			ui_add_gadget_button( MainWindow,155,i,70, 26, "<< Face", SelectPrevFace );	ui_add_gadget_button( MainWindow,155+70,i,70, 26, "Face >>", SelectNextFace );i += 29;			ui_add_gadget_button( MainWindow,155,i,140, 26, "Play sound", PlayHostageSound );i += 29;			ui_add_gadget_button( MainWindow,155,i,140, 26, "Next Hostage", SelectNextHostage );	i += 29;			ui_add_gadget_button( MainWindow,155,i,140, 26, "Prev Hostage", SelectPrevHostage ); i += 29;			ui_add_gadget_button( MainWindow,155,i,140, 26, "Compress All", CompressHostages ); i += 29;			ui_add_gadget_button( MainWindow,155,i,140, 26, "Delete", ObjectDelete );	i += 29;			ui_add_gadget_button( MainWindow,155,i,140, 26, "Create New", PlaceHostage );	i += 29;				Time = timer_get_fixed_seconds();	LastHostageIndex = -2;		// Set to some dummy value so everything works ok on the first frame.	//	if ( CurrentHostageIndex == -1 )//		SelectNextHostage();	return 1;}
开发者ID:NonCreature0714,项目名称:descent,代码行数:52,


示例26: dc_draw_cursor

void dc_draw_cursor( SCP_string &cmd_string, int x, int y ){	int t;	int w, h;	// gr_string width and height	t = timer_get_fixed_seconds() / (F1_0/3);	if ( t & 1 ) {		gr_get_string_size( &w, &h, cmd_string.c_str() );		w %= (DCOLS * col_width);		//gr_string( w, debug_y*16, "_" );		gr_rect(gr_screen.center_offset_x + (x + (w + 1)), gr_screen.center_offset_y + (y + (h + 1)), 2,			fl2i(font::get_current_font()->getHeight()), GR_RESIZE_NONE);	}}
开发者ID:Kobrar,项目名称:fs2open.github.com,代码行数:15,


示例27: joy_get_button_down_time

fix joy_get_button_down_time( int btn ) {        fix count;        if ((!joy_installed)||(!joy_present)) return 0;	if ( btn >= MAX_BUTTONS ) return 0;        joy_get_btns();        if (joystick.buttons[btn].state) {                count = timer_get_fixed_seconds() - joystick.buttons[btn].timedown;                joystick.buttons[btn].timedown = 0;        } else count = 0;                return count;}
开发者ID:Ringdingcoder,项目名称:d1x,代码行数:16,


示例28: mouse_button_down_time

// Returns how long this button has been down since last call.fix mouse_button_down_time(int button){	fix time_down, time;	event_poll();	if (!Mouse.buttons[button].pressed) {		time_down = Mouse.buttons[button].time_held_down;		Mouse.buttons[button].time_held_down = 0;	} else {		time = timer_get_fixed_seconds();		time_down = time - Mouse.buttons[button].time_held_down;		Mouse.buttons[button].time_held_down = time;	}	return time_down;}
开发者ID:gameplayer22,项目名称:d2x-1,代码行数:17,



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


C++ timer_init函数代码示例
C++ timer_get函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。