Пример #1
0
void SaveGameCallback( void *self )
{
	menuaction_s *a = ( menuaction_s * ) self;

	Cbuf_AddText (va("save save%i\n", a->generic.localdata[0] ));
	M_ForceMenuOff ();
}
Пример #2
0
void M_PopMenu( void )
{
	if( m_popped )
		m_popped();

	if( m_menudepth == 1 )
	{
		if( uis.clientState < CA_CONNECTING || uis.forceUI )
			return;
		M_ForceMenuOff();
		return;
	}

	trap_S_StartLocalSound( menu_out_sound );

	if( m_menudepth < 1 )
	{
		UI_Error( "M_PopMenu: depth < 1" );
		return;
	}

	m_menudepth--;

	m_drawfunc = m_layers[m_menudepth].draw;
	m_keyfunc = m_layers[m_menudepth].key;
	m_active = m_layers[m_menudepth].m;
	//wsw:will
	m_popped = m_layers[m_menudepth].popped;
	m_chareventfunc = m_layers[m_menudepth].charevent;

	UI_UpdateMousePosition( 0, 0 );
}
Пример #3
0
void StartServerActionFunc (void *self)
{
	char	startmap[1024];
    float timelimit;
    float fraglimit;
    float maxclients;
	char	*spot;

	strcpy (startmap, strchr (mapnames[s_startmap_list.curvalue], '\n') + 1);

    maxclients = (float)strtod(s_maxclients_field.buffer, (char **)NULL);
    timelimit = (float)strtod(s_timelimit_field.buffer, (char **)NULL);
    fraglimit = (float)strtod(s_fraglimit_field.buffer, (char **)NULL);

	Cvar_SetValue ("maxclients", Q_Clamp (0, maxclients, maxclients));
	Cvar_SetValue ("timelimit", Q_Clamp (0, timelimit, timelimit));
	Cvar_SetValue ("fraglimit", Q_Clamp (0, fraglimit, fraglimit));
	Cvar_Set ("hostname", s_hostname_field.buffer);

	Cvar_SetValue ("deathmatch", (float)!s_rules_box.curvalue);
	Cvar_SetValue ("coop", (float)s_rules_box.curvalue);

	spot = NULL;

	// coop spawns
	if (s_rules_box.curvalue == 1)
	{
		if (Q_stricmp (startmap, "bunk1") == 0)
			spot = "start";
		else if (Q_stricmp (startmap, "mintro") == 0)
			spot = "start";
		else if (Q_stricmp (startmap, "fact1") == 0)
			spot = "start";
		else if (Q_stricmp (startmap, "power1") == 0)
			spot = "pstart";
		else if (Q_stricmp (startmap, "biggun") == 0)
			spot = "bstart";
		else if (Q_stricmp (startmap, "hangar1") == 0)
			spot = "unitstart";
		else if (Q_stricmp (startmap, "city1") == 0)
			spot = "unitstart";
		else if (Q_stricmp (startmap, "boss1") == 0)
			spot = "bosstart";
	}

	if (spot)
	{
		if (Com_ServerState())
			Cbuf_AddText ("disconnect\n");

		Cbuf_AddText (va ("gamemap \"*%s$%s\"\n", startmap, spot));
	}
	else
	{
		Cbuf_AddText (va ("map %s\n", startmap));
	}

	M_ForceMenuOff ();
}
Пример #4
0
void LoadGameCallback( void *self )
{
	menuaction_s *a = ( menuaction_s * ) self;

	if ( m_savevalid[ a->generic.localdata[0] ] )
		Cbuf_AddText (va("load save%i\n",  a->generic.localdata[0] ) );
	M_ForceMenuOff ();
}
Пример #5
0
static void ApplyChanges( void *unused )
{
    float gamma;

    /*
    ** invert sense so greater = brighter, and scale to a range of 0.5 to 1.3
    */
    gamma = ( 0.8f - ( s_brightness_slider.curvalue/10.0f - 0.5f ) ) + 0.5f;

    Cvar_SetValue( "vid_gamma", gamma );
    Cvar_SetValue( "sw_stipplealpha", s_stipple_box.curvalue );
    Cvar_SetValue( "gl_picmip", 3 - s_tq_slider.curvalue );
    Cvar_SetValue( "vid_fullscreen", s_fs_box.curvalue );
    Cvar_SetValue( "gl_finish", s_finish_box.curvalue );

#ifndef GL_QUAKE
    if(s_mode_list.curvalue == RMODES)
        Cvar_SetValue( "sw_mode", -1 );
    else
        Cvar_SetValue( "sw_mode", s_mode_list.curvalue );
#else
    if(s_mode_list.curvalue == RMODES)
        Cvar_SetValue( "gl_mode", -1 );
    else
        Cvar_SetValue( "gl_mode", s_mode_list.curvalue );

    switch ( s_ref_list.curvalue )
    {
#ifdef _WIN32
    case REF_OPENGL:
        Cvar_Set( "gl_driver", "opengl32" );
        break;
    case REF_3DFX:
        Cvar_Set( "gl_driver", "3dfxgl" );
        break;
    case REF_POWERVR:
        Cvar_Set( "gl_driver", "pvrgl" );
        break;
#else
    case REF_OPENGLX :
        Cvar_Set( "gl_driver", "libGL.so" );
        break;

    case REF_MESA3DGLX :
        Cvar_Set( "gl_driver", "libMesaGL.so.2" );
        break;
#endif
    }
    if ( gl_driver->modified )
        VID_Restart_f ();
#endif


    M_ForceMenuOff();
}
Пример #6
0
static void JoinServerFunc( void *self )
{
    char	buffer[128];
    int		index;

    index = s_joinserver_server_list.curvalue;

    if (index >= m_num_servers)
        return;

    Com_sprintf (buffer, sizeof(buffer), "connect %s\n", localServers[sortedSList[index]].address);
    Cbuf_AddText (buffer);
    M_ForceMenuOff ();
}
Пример #7
0
void M_PopMenu (void)
{
	if (m_menudepth < 1)
		Com_Error (ERR_FATAL, "M_PopMenu: depth < 1");

	if( !m_entersound )
		S_StartLocalSound( menu_out_sound );

	m_menudepth--;

	if (!m_menudepth) {
		M_ForceMenuOff ();
		return;
	}

	m_active = m_layers[m_menudepth - 1];
}
Пример #8
0
/**
 * \brief Remove menu from the stack
 */
void M_PopMenu( void )
{
//	Sound_StartLocalSound( menu_out_sound );
	if( m_menudepth < 1 )
	{
		Com_Error( ERR_FATAL, "M_PopMenu: depth < 1" );
	}
	
	m_menudepth--;

	m_drawfunc = m_layers[ m_menudepth ].draw;
	m_keyfunc = m_layers[ m_menudepth ].key;

	if( ! m_menudepth )
	{
		M_ForceMenuOff();
	}
}
Пример #9
0
void M_Custom_ExecuteButton( struct menucommon_s *menuitem )
{
	if( menuitem && menuitem->itemlocal )
	{
		int i;

		trap_Cmd_ExecuteText( EXEC_APPEND, va( "%s\n", (char *)menuitem->itemlocal ) );

		for( i = 0; i < s_custom_menu.nitems; i++ )
		{
			if( s_custom_menu.items[i] && s_custom_menu.items[i]->itemlocal )
			{
				UI_Free( s_custom_menu.items[i]->itemlocal );
				s_custom_menu.items[i]->itemlocal = NULL;
			}
		}

		M_ForceMenuOff();
	}
}
Пример #10
0
PRIVATE const char *M_Victory_Key( int key )
{
	if( nvictory )
	{
		M_PopMenu();
		M_PushMenu( M_Victory_Text_Draw, M_Victory_Key );
		nvictory = 0;
		page = 0;
		ClientStatic.state = ca_disconnected;

		return NULL;
	}

	switch( key )
	{
		case K_ESCAPE:
			nvictory = 1;
			M_ForceMenuOff();
			M_Menu_Main_f();
			break;

		case K_KP_LEFTARROW:
		case K_LEFTARROW:
			if( page == 1 )
			{
				page = 0;
			}
			break;

		case K_KP_RIGHTARROW:
		case K_RIGHTARROW:
			if( page == 0 )
			{
				page = 1;
			}
			break;

	}

	return NULL;
}
Пример #11
0
static void ApplyChanges( void *unused )
{
	float gamma;

	/*
	** make values consistent
	*/
	s_fs_box[!s_current_menu_index].curvalue = s_fs_box[s_current_menu_index].curvalue;
	s_brightness_slider[!s_current_menu_index].curvalue = s_brightness_slider[s_current_menu_index].curvalue;
	s_ref_list[!s_current_menu_index].curvalue = s_ref_list[s_current_menu_index].curvalue;

	/*
	** invert sense so greater = brighter, and scale to a range of 0.5 to 1.3
	*/
	gamma = ( 0.8 - ( s_brightness_slider[s_current_menu_index].curvalue/10.0 - 0.5 ) ) + 0.5;

	Cvar_SetValue( "vid_gamma", gamma );
	Cvar_SetValue( "sw_stipplealpha", s_stipple_box.curvalue );
	Cvar_SetValue( "gl_picmip", 3 - s_tq_slider.curvalue );
	Cvar_SetValue( "vid_fullscreen", s_fs_box[s_current_menu_index].curvalue );
	Cvar_SetValue( "gl_ext_palettedtexture", s_paletted_texture_box.curvalue );
	Cvar_SetValue( "sw_mode", s_mode_list[SOFTWARE_MENU].curvalue );
	Cvar_SetValue( "gl_mode", s_mode_list[OPENGL_MENU].curvalue );
	Cvar_SetValue( "_windowed_mouse", s_windowed_mouse.curvalue);

	switch ( s_ref_list[s_current_menu_index].curvalue )
	{
	case REF_SOFT:
		Cvar_Set( "vid_ref", "soft" );
		break;
	case REF_OPENGL:
		Cvar_Set( "vid_ref", "gl" );
		Cvar_Set( "gl_driver", "opengl32" );
		break;
	}

#if 0
	/*
	** update appropriate stuff if we're running OpenGL and gamma
	** has been modified
	*/
	if ( Q_stricmp( vid_ref->string, "gl" ) == 0 )
	{
		if ( vid_gamma->modified )
		{
			vid_ref->modified = true;
			if ( Q_stricmp( gl_driver->string, "3dfxgl" ) == 0 )
			{
				char envbuffer[1024];
				float g;

				vid_ref->modified = true;

				g = 2.00 * ( 0.8 - ( vid_gamma->value - 0.5 ) ) + 1.0F;
				Com_sprintf( envbuffer, sizeof(envbuffer), "SST_GAMMA=%f", g );
				putenv( envbuffer );

				vid_gamma->modified = false;
			}
		}
	}
#endif

	M_ForceMenuOff();
}
Пример #12
0
static void
ApplyChanges(void *unused)
{
	qboolean restart = false;

	/* custom mode */
	if (s_mode_list.curvalue != GetCustomValue(&s_mode_list))
	{
		/* Restarts automatically */
		Cvar_SetValue("gl_mode", s_mode_list.curvalue);
	}
	else
	{
		/* Restarts automatically */
		Cvar_SetValue("gl_mode", -1);
	}

	/* horplus */
	if (s_aspect_list.curvalue == 0)
	{
		if (horplus->value != 1)
		{
			Cvar_SetValue("horplus", 1);
		}
	}
	else
	{
		if (horplus->value != 0)
		{
			Cvar_SetValue("horplus", 0);
		}
	}

	/* fov */
	if (s_aspect_list.curvalue == 0 || s_aspect_list.curvalue == 1)
	{
		if (fov->value != 90)
		{
			/* Restarts automatically */
			Cvar_SetValue("fov", 90);
		}
	}
	else if (s_aspect_list.curvalue == 2)
	{
		if (fov->value != 86)
		{
			/* Restarts automatically */
			Cvar_SetValue("fov", 86);
		}
	}
	else if (s_aspect_list.curvalue == 3)
	{
		if (fov->value != 100)
		{
			/* Restarts automatically */
			Cvar_SetValue("fov", 100);
		}
	}
	else if (s_aspect_list.curvalue == 4)
	{
		if (fov->value != 106)
		{
			/* Restarts automatically */
			Cvar_SetValue("fov", 106);
		}
	}

	/* UI scaling */
	if (s_uiscale_list.curvalue == 0)
	{
		Cvar_SetValue("gl_hudscale", -1);
	}
	else if (s_uiscale_list.curvalue < GetCustomValue(&s_uiscale_list))
	{
		Cvar_SetValue("gl_hudscale", s_uiscale_list.curvalue);
	}

	if (s_uiscale_list.curvalue != GetCustomValue(&s_uiscale_list))
	{
		Cvar_SetValue("gl_consolescale", gl_hudscale->value);
		Cvar_SetValue("gl_menuscale", gl_hudscale->value);
		Cvar_SetValue("crosshair_scale", gl_hudscale->value);
	}

	/* Restarts automatically */
	Cvar_SetValue("vid_fullscreen", s_fs_box.curvalue);

	/* vertical sync */
	if (gl_swapinterval->value != s_vsync_list.curvalue)
	{
		Cvar_SetValue("gl_swapinterval", s_vsync_list.curvalue);
		restart = true;
	}

	/* multisample anti-aliasing */
	if (s_msaa_list.curvalue == 0)
	{
		if (gl_msaa_samples->value != 0)
		{
			Cvar_SetValue("gl_msaa_samples", 0);
			restart = true;
		}
	}
	else
	{
		if (gl_msaa_samples->value != pow(2, s_msaa_list.curvalue))
		{
			Cvar_SetValue("gl_msaa_samples", pow(2, s_msaa_list.curvalue));
			restart = true;
		}
	}

	if (restart)
	{
		Cbuf_AddText("vid_restart\n");
	}

	M_ForceMenuOff();
}
Пример #13
0
static void
ApplyChanges(void *unused)
{
    qboolean restart = false;

    if (gl_picmip->value != (3 - s_tq_slider.curvalue))
    {

        Cvar_SetValue("gl_picmip", 3 - s_tq_slider.curvalue);
        restart = true;
    }

    if (gl_ext_palettedtexture->value != s_paletted_texture_box.curvalue)
    {
        Cvar_SetValue("gl_ext_palettedtexture", s_paletted_texture_box.curvalue);
        restart = true;
    }

    /* Restarts automatically */
    Cvar_SetValue("vid_fullscreen", s_fs_box.curvalue);

    /* custom mode */
    if (s_mode_list.curvalue != CUSTOM_MODE)
    {
        /* Restarts automatically */
        Cvar_SetValue("gl_mode", s_mode_list.curvalue);
    }
    else
    {
        /* Restarts automatically */
        Cvar_SetValue("gl_mode", -1);
    }

    /* horplus */
    if (s_aspect_list.curvalue == 0)
    {
        if (horplus->value != 1)
        {
            Cvar_SetValue("horplus", 1);
        }
    }
    else
    {
        if (horplus->value != 0)
        {
            Cvar_SetValue("horplus", 0);
        }
    }

    /* fov */
    if (s_aspect_list.curvalue == 0 || s_aspect_list.curvalue == 1)
    {
        if (fov->value != 90)
        {
            /* Restarts automatically */
            Cvar_SetValue("fov", 90);
        }
    }
    else if (s_aspect_list.curvalue == 2)
    {
        if (fov->value != 86)
        {
            /* Restarts automatically */
            Cvar_SetValue("fov", 86);
        }
    }
    else if (s_aspect_list.curvalue == 3)
    {
        if (fov->value != 100)
        {
            /* Restarts automatically */
            Cvar_SetValue("fov", 100);
        }
    }
    else if (s_aspect_list.curvalue == 4)
    {
        if (fov->value != 106)
        {
            /* Restarts automatically */
            Cvar_SetValue("fov", 106);
        }
    }

    if (restart)
    {
        Cbuf_AddText("vid_restart\n");
    }

    M_ForceMenuOff();
}
Пример #14
0
PRIVATE const char *M_Intermission_Key( int key )
{
	char szTextMsg[ 128 ];

	PL_NextLevel( &Player );


	M_ForceMenuOff();

	if( g_version->value == SPEAROFDESTINY )
	{
		if( Player.playstate == ex_secretlevel )
		{
			int mapon = 0;

			switch( currentMap.map )
			{
				case FROMSECRET1:
					mapon = SECRET1;
					break;

				case FROMSECRET2:
					mapon = SECRET2;
					break;

				default:
					Com_Printf("No secret level from floor %d!\n", currentMap.map+1);
					ClientStatic.key_dest = key_console;
					return NULL;
			}

			com_snprintf( szTextMsg, sizeof( szTextMsg ),
				"loading ; map s%.2d.map\n", mapon );
		}
		else
		{
			int mapon = 0;

			switch( currentMap.map )
			{
				case SECRET1:
					mapon = FROMSECRET1+1;
					break;

				case SECRET2:
					mapon = FROMSECRET2+1;
					break;

				default:
					mapon = currentMap.map + 1;
			}

			com_snprintf( szTextMsg, sizeof( szTextMsg ),
				"loading ; map s%.2d.map\n", mapon );
		}
	}
	else
	{
		int currentLevel = currentMap.episode * 10 + currentMap.map;
		int nextLevel;

		if( Player.playstate == ex_secretlevel ) {
			switch( currentLevel ) {
				case 0: nextLevel = 9; break;
				case 10: nextLevel = 19; break;
				case 26: nextLevel = 29; break;
				case 32: nextLevel = 39; break;
				case 44: nextLevel = 49; break;
				case 52: nextLevel = 59; break;
				default:
					Com_Printf("No secret level from e%dm%d!\n", currentMap.episode+1, currentMap.map+1);
					ClientStatic.key_dest = key_console;
					return NULL;
			}
		} else {
			switch ( currentLevel ) {
#if 0
				case 8:
				case 18:
				case 28:
				case 38:
				case 48:
				case 58:
					// go back to the episode select screen
					return NULL;
#endif
				case 9: nextLevel = 1; break;
				case 19: nextLevel = 11; break;
				case 29: nextLevel = 27; break;
				case 39: nextLevel = 33; break;
				case 49: nextLevel = 44; break;
				case 59: nextLevel = 53; break;
				default: nextLevel = currentLevel + 1; break;
			}
		}

		com_snprintf( szTextMsg, sizeof( szTextMsg ),
				"loading ; map w%.2d.map\n", nextLevel );
	}

	Player.playstate = ex_playing;

	Cbuf_AddText( szTextMsg );

	return NULL;
}
Пример #15
0
static void ApplyChanges( void *unused )
{
	float gamma;

	/*
	** invert sense so greater = brighter, and scale to a range of 0.5 to 1.3
	*/
	// jkrige - gamma
	//gamma = ( 0.8 - ( s_brightness_slider.curvalue / 10.0 - 0.5 ) ) + 0.5;
	gamma = (1.7 - (s_brightness_slider.curvalue / 10.0 - 1.0)) + 1.0;
	// jkrige - gamma

	Cvar_SetValue( "vid_gamma", gamma );
	Cvar_SetValue( "vid_fullscreen", s_fs_box.curvalue );

	// jkrige - texture quality
	//Cvar_SetValue( "gl_picmip", 3 - s_tq_slider.curvalue );
	// jkrige - texture quality

	// jkrige - palette removal
	//Cvar_SetValue( "gl_ext_palettedtexture", s_paletted_texture_box.curvalue );
	// jkrige - palette removal

	Cvar_SetValue( "gl_finish", s_finish_box.curvalue );
	Cvar_SetValue( "gl_mode", s_mode_list.curvalue );

	Cvar_Set( "vid_ref", "gl" );
	Cvar_Set( "gl_driver", "opengl32" );

	/*
	** update appropriate stuff if we're running OpenGL and gamma
	** has been modified
	*/
	if ( stricmp( vid_ref->string, "gl" ) == 0 )
	{
		if ( vid_gamma->modified )
		{
			vid_ref->modified = true;
			/*if ( stricmp( gl_driver->string, "3dfxgl" ) == 0 )
			{
				char envbuffer[1024];
				float g;

				vid_ref->modified = true;

				g = 2.00 * ( 0.8 - ( vid_gamma->value - 0.5 ) ) + 1.0F;
				Com_sprintf( envbuffer, sizeof(envbuffer), "SSTV2_GAMMA=%f", g );
				putenv( envbuffer );
				Com_sprintf( envbuffer, sizeof(envbuffer), "SST_GAMMA=%f", g );
				putenv( envbuffer );

				vid_gamma->modified = false;
			}*/
		}

		if ( gl_driver->modified )
			vid_ref->modified = true;
	}

	M_ForceMenuOff();
}
Пример #16
0
static void ConsoleFunc( menucommon_t *unused )
{
	if( uis.clientState > CA_DISCONNECTED )
		M_ForceMenuOff();
	trap_Cmd_ExecuteText( EXEC_APPEND, "toggleconsole\n" );
}
Пример #17
0
static void ApplyChanges( void *unused )
{
	float	gamma;
	int		temp;

	/*
	** make values consistent
	*/
	s_fs_box[!s_current_menu_index].curvalue = s_fs_box[s_current_menu_index].curvalue;
	s_brightness_slider[!s_current_menu_index].curvalue = s_brightness_slider[s_current_menu_index].curvalue;
	s_ref_list[!s_current_menu_index].curvalue = s_ref_list[s_current_menu_index].curvalue;

	/*
	** invert sense so greater = brighter, and scale to a range of 0.5 to 1.3
	*/
//	gamma = (0.8 - (s_brightness_slider[s_current_menu_index].curvalue/10.0 - 0.5)) + 0.5;
	gamma = (1.3 - (s_brightness_slider[s_current_menu_index].curvalue/20.0));

	Cvar_SetValue ("vid_gamma", gamma);
	Cvar_SetValue ("sw_stipplealpha", s_stipple_box.curvalue);
	Cvar_SetValue ("vid_fullscreen", s_fs_box[s_current_menu_index].curvalue);
	Cvar_SetValue ("gl_picmip", 3 - s_tq_slider.curvalue);
	Cvar_SetValue ("gl_ext_palettedtexture", s_paletted_texture_box.curvalue);
	Cvar_SetValue ("gl_nonpoweroftwo_mipmaps", s_npot_mipmap_box.curvalue);	// Knightmare- non-power-of-2 texture option

	Cvar_SetValue ("gl_swapinterval", s_vsync_box.curvalue);

	temp = s_mode_list[SOFTWARE_MENU].curvalue;
	Cvar_SetValue ("sw_mode", (temp == 0) ? -1 : temp + 2);	// Knightmare- use offset of 2 because of hidden modes
	temp = s_mode_list[OPENGL_MENU].curvalue;
	Cvar_SetValue ("gl_mode", (temp == 0) ? -1 : temp + 2);	// Knightmare- use offset of 2 because of hidden modes

	// Knightmare- refesh rate option
	switch (s_refresh_box.curvalue)
	{
	case 9:
		Cvar_SetValue ("r_displayrefresh", 150);
		break;
	case 8:
		Cvar_SetValue ("r_displayrefresh", 120);
		break;
	case 7:
		Cvar_SetValue ("r_displayrefresh", 110);
		break;
	case 6:
		Cvar_SetValue ("r_displayrefresh", 100);
		break;
	case 5:
		Cvar_SetValue ("r_displayrefresh", 85);
		break;
	case 4:
		Cvar_SetValue ("r_displayrefresh", 75);
		break;
	case 3:
		Cvar_SetValue ("r_displayrefresh", 72);
		break;
	case 2:
		Cvar_SetValue ("r_displayrefresh", 70);
		break;
	case 1:
		Cvar_SetValue ("r_displayrefresh", 60);
		break;
	case 0:
	default:
		Cvar_SetValue ("r_displayrefresh", 0);
		break;
	}

	// Knightmare- texture filter mode
	if (s_texfilter_box.curvalue == 1)
		Cvar_Set ("r_texturemode", "GL_LINEAR_MIPMAP_LINEAR");
	else // (s_texfilter_box.curvalue == 0)
		Cvar_Set ("r_texturemode", "GL_LINEAR_MIPMAP_NEAREST");

	// Knightmare- anisotropic filtering
	switch ((int)s_aniso_box.curvalue)
	{
		case 1: Cvar_SetValue ("gl_anisotropic", 2.0); break;
		case 2: Cvar_SetValue ("gl_anisotropic", 4.0); break;
		case 3: Cvar_SetValue ("gl_anisotropic", 8.0); break;
		case 4: Cvar_SetValue ("gl_anisotropic", 16.0); break;
		default:
		case 0: Cvar_SetValue ("gl_anisotropic", 0.0); break;
	}

	switch ( s_ref_list[s_current_menu_index].curvalue )
	{
	case REF_SOFT:
		Cvar_Set( "vid_ref", "soft" );
		break;
	case REF_OPENGL:
		Cvar_Set( "vid_ref", "gl" );
		Cvar_Set( "gl_driver", "opengl32" );
		break;
	case REF_3DFX:
		Cvar_Set( "vid_ref", "gl" );
		Cvar_Set( "gl_driver", "3dfxgl" );
		break;
	case REF_POWERVR:
		Cvar_Set( "vid_ref", "gl" );
		Cvar_Set( "gl_driver", "pvrgl" );
		break;
	case REF_VERITE:
		Cvar_Set( "vid_ref", "gl" );
		Cvar_Set( "gl_driver", "veritegl" );
		break;
	}

	/*
	** update appropriate stuff if we're running OpenGL and gamma
	** has been modified
	*/
	if ( Q_strcasecmp( Cvar_VariableString("vid_ref"), "gl" ) == 0 )
	{
		if ( vid_gamma->modified )
		{
			vid_ref->modified = true;
			if ( Q_strcasecmp( Cvar_VariableString("gl_driver"), "3dfxgl" ) == 0 )
			{
				char envbuffer[1024];
				float g;

				vid_ref->modified = true;

				g = 2.00 * ( 0.8 - ( Cvar_VariableValue("vid_gamma") - 0.5 ) ) + 1.0F;
				Com_sprintf( envbuffer, sizeof(envbuffer), "SSTV2_GAMMA=%f", g );
				putenv( envbuffer );
				Com_sprintf( envbuffer, sizeof(envbuffer), "SST_GAMMA=%f", g );
				putenv( envbuffer );

				vid_gamma->modified = false;
			}
		}

		if ( gl_driver->modified )
			vid_ref->modified = true;
	}

	M_ForceMenuOff();
}
Пример #18
0
void StartServerActionFunc( void *self )
{
	char	startmap[1024];
	int		timelimit;
	int		fraglimit;
	int		maxclients;
	char	*spot;

//	strcpy( startmap, strchr( mapnames[maplist.curvalue], '\n' ) + 1 );
	strcpy( startmap, mapnames[maplist.curvalue]);

	maxclients  = atoi( s_maxclients_field.buffer );
	timelimit	= atoi( s_timelimit_field.buffer );
	fraglimit	= atoi( s_fraglimit_field.buffer );

	Cvar_SetLatched( "maxclients", va("%i", (int)ClampCvar( 0, maxclients, maxclients )) );
	Cvar_SetValue ("timelimit", ClampCvar( 0, timelimit, timelimit ) );
	Cvar_SetValue ("fraglimit", ClampCvar( 0, fraglimit, fraglimit ) );
	Cvar_Set("hostname", s_hostname_field.buffer );
//	Cvar_SetValue ("deathmatch", !s_rules_box.curvalue );
//	Cvar_SetValue ("coop", s_rules_box.curvalue );

//PGM
	if((s_rules_box.curvalue < 2) || (Developer_searchpath() != 2))
	{
		Cvar_SetLatched ("deathmatch", s_rules_box.curvalue ? "0" : "1");
		Cvar_SetLatched ("coop", s_rules_box.curvalue ? "1" : "0" );
		Cvar_SetValue ("gamerules", 0 );
	}
	else
	{
		Cvar_SetLatched ("deathmatch", "1");	// deathmatch is always true for rogue games, right?
		Cvar_SetLatched ("coop", "0");			// FIXME - this might need to depend on which game we're running
		Cvar_SetValue ("gamerules", s_rules_box.curvalue);
	}
//PGM

	spot = NULL;
	if (s_rules_box.curvalue == 1)		// PGM
	{
 		if(Q_stricmp(startmap, "bunk1") == 0)
  			spot = "start";
 		else if(Q_stricmp(startmap, "mintro") == 0)
  			spot = "start";
 		else if(Q_stricmp(startmap, "fact1") == 0)
  			spot = "start";
 		else if(Q_stricmp(startmap, "power1") == 0)
  			spot = "pstart";
 		else if(Q_stricmp(startmap, "biggun") == 0)
  			spot = "bstart";
 		else if(Q_stricmp(startmap, "hangar1") == 0)
  			spot = "unitstart";
 		else if(Q_stricmp(startmap, "city1") == 0)
  			spot = "unitstart";
 		else if(Q_stricmp(startmap, "boss1") == 0)
			spot = "bosstart";
	}

	if (spot)
	{
		if (Com_ServerState())
			Cbuf_AddText ("disconnect\n");
		Cbuf_AddText (va("gamemap \"*%s$%s\"\n", startmap, spot));
	}
	else
	{
		Cbuf_AddText (va("map %s\n", startmap));
	}

	M_ForceMenuOff ();
}