Ejemplo n.º 1
0
//	-----------------------------------------------------------------------------------------------------
//called when the player is starting a level (new game or new ship)
StartLevel(int random)
{
	Assert(!Player_is_dead);

	InitPlayerPosition(random);

	verify_console_object();

	ConsoleObject->control_type	= CT_FLYING;
	ConsoleObject->movement_type	= MT_PHYSICS;

	disable_matcens();

	clear_transient_objects(0);		//0 means leave proximity bombs

	// create_player_appearance_effect(ConsoleObject);
	Do_appearance_effect = 1;

#ifdef NETWORK
	if (Game_mode & GM_MULTI)
	{
#ifndef SHAREWARE
		if (Game_mode & GM_MULTI_COOP)
			multi_send_score();
#endif
		multi_send_position(Players[Player_num].objnum);
	 	multi_send_reappear();
	}		

	if (Game_mode & GM_NETWORK)
		network_do_frame(1, 1);
#endif

	ai_reset_all_paths();
	ai_init_boss_for_ship();
	reset_time();

	reset_rear_view();
	Auto_fire_fusion_cannon_time = 0;
	Fusion_charge = 0;

	Robot_firing_enabled = 1;

	if (VR_screen_mode == SCREEN_MENU)
		vr_reset_display();
}
Ejemplo n.º 2
0
void change_res()
{
 //edited 05/27/99 Matt Mueller - ingame fullscreen changing
 newmenu_item m[11];
 u_int32_t modes[11];
 int i=0, mc=0, num_presets=0;
 char customres[16];
#ifdef GR_SUPPORTS_FULLSCREEN_TOGGLE
 int fullscreenc;
#endif
 //end edit -MM
 u_int32_t screen_mode = 0;
 int screen_width = 0;
 int screen_height = 0;
 int vr_mode = VR_NONE;
 int screen_compatible = 0;
 int use_double_buffer = 0;
 
//changed 6/15/1999 by Owen Evans to fix some platform-related problems
#ifdef __MSDOS__
 m[mc].type = NM_TYPE_RADIO; m[mc].text = "320x100"; m[mc].value=(Game_screen_mode==SM(320,100)); m[mc].group=0; modes[mc] = SM(320,100); mc++;
#endif
 m[mc].type = NM_TYPE_RADIO; m[mc].text = "320x200"; m[mc].value=(Game_screen_mode==SM(320,200)); m[mc].group=0; modes[mc] = SM(320,200); mc++;
 m[mc].type = NM_TYPE_RADIO; m[mc].text = "320x240"; m[mc].value=(Game_screen_mode==SM(320,240)); m[mc].group=0; modes[mc] = SM(320,240); mc++;
 m[mc].type = NM_TYPE_RADIO; m[mc].text = "320x400"; m[mc].value=(Game_screen_mode==SM(320,400)); m[mc].group=0; modes[mc] = SM(320,400); mc++;
//#ifndef __LINUX__ - heh?  640x400 is perfectly fine on linux
 m[mc].type = NM_TYPE_RADIO; m[mc].text = "640x400"; m[mc].value=(Game_screen_mode==SM(640,400)); m[mc].group=0; modes[mc] = SM(640,400); mc++;
//#endif
 m[mc].type = NM_TYPE_RADIO; m[mc].text = "640x480"; m[mc].value=(Game_screen_mode==SM(640,480)); m[mc].group=0; modes[mc] = SM(640,480); mc++;
 m[mc].type = NM_TYPE_RADIO; m[mc].text = "800x600"; m[mc].value=(Game_screen_mode==SM(800,600)); m[mc].group=0; modes[mc] = SM(800,600); mc++;
 m[mc].type = NM_TYPE_RADIO; m[mc].text = "1024x768"; m[mc].value=(Game_screen_mode==SM(1024,768)); m[mc].group=0; modes[mc] = SM(1024,768); mc++;
//end section - OE
 num_presets = mc;
 for (i=0; i<mc; i++)
	 if (m[mc].value)
		 break;
 m[mc].type = NM_TYPE_RADIO; m[mc].text = "custom:"; m[mc].value=(i==mc); m[mc].group=0; modes[mc] = 0; mc++;
 sprintf(customres, "%ix%i", SM_W(Game_screen_mode), SM_H(Game_screen_mode));
 m[mc].type = NM_TYPE_INPUT; m[mc].text = customres; m[mc].text_len=11; modes[mc] = 0; mc++;

// m[mc].type = NM_TYPE_CHECK; m[mc].text = "No Doublebuffer"; m[mc].value = use_double_buffer;

 //added 05/27/99 Matt Mueller - ingame fullscreen changing
#ifdef GR_SUPPORTS_FULLSCREEN_TOGGLE
 fullscreenc=mc;m[mc].type = NM_TYPE_CHECK; m[mc].text = "Fullscreen"; m[mc].value = gr_check_fullscreen();mc++;
#endif
 //end addition -MM


   i=newmenu_do1( NULL, "Screen Resolution", mc, m, &change_res_poll, 0);

  //added 05/27/99 Matt Mueller - ingame fullscreen changing
#ifdef GR_SUPPORTS_FULLSCREEN_TOGGLE
   if (m[fullscreenc].value != gr_check_fullscreen()){
	   gr_toggle_fullscreen();
        Game_screen_mode = -1;
   }
#endif
  //end addition -MM
   
  for(i=0;(m[i].value==0)&&(i<num_presets);i++);
  if (modes[i]==0){
	  char *h=strchr(customres, 'x');
	  if (!h) 
		  return;
	  screen_mode = SM(atoi(customres), atoi(h+1));
  }else{
	  screen_mode = modes[i];
  }

  screen_width = SM_W(screen_mode);
  screen_height = SM_H(screen_mode);
  if (screen_height<=0 || screen_width<=0)
	  return;

  switch(screen_mode)
   {
    case SM(320,100)://19:
           screen_compatible = 0;
           use_double_buffer = 0;
           break;
	case SM(320,200)://SM_320x200C:
           screen_compatible = 1;
           use_double_buffer = 0;
           break;
	default:
           screen_compatible = 0;
           use_double_buffer = 1;
           break;
   }
#ifdef __MSDOS__
  if ( FindArg( "-nodoublebuffer" ) )
#endif
   use_double_buffer = 0;

//added 6/15/1999 by Owen Evans to eliminate unneccesary mode modification
	if (Game_screen_mode == screen_mode)
		return;
//      gr_set_mode(Game_screen_mode);
//end section - OE

        VR_offscreen_buffer = 0;        //Disable VR (so that VR_Screen_mode doesnt mess us up
        Game_screen_mode = screen_mode;
        Game_window_w=screen_width;
        Game_window_h=screen_height;
        game_init_render_buffers(screen_mode, screen_width, screen_height, use_double_buffer, vr_mode, screen_compatible);
        

        mprintf( (0, "\nInitializing palette system..." ));
        gr_use_palette_table( "PALETTE.256" );
        mprintf( (0, "\nInitializing font system..." ));
        gamefont_init();        // must load after palette data loaded.


  reset_palette_add();
  init_cockpit();
  last_drawn_cockpit[0]=-1;
  last_drawn_cockpit[1]=-1;
//  init_gauges();

   vr_reset_display();
}