Exemple #1
0
/*
* UI_Refresh
*/
void UI_Refresh( unsigned int time, int clientState, int serverState, qboolean demoplaying, qboolean backGround )
{
	uis.frameTime = ( time - uis.time ) * 0.001f;
	uis.time = time;
	uis.clientState = clientState;
	uis.serverState = serverState;
	uis.backGround = backGround;
	uis.demoplaying = demoplaying;

	if( !m_drawfunc )  // ui is inactive
		return;

	// draw background
	if( uis.backGround )
	{
		trap_R_DrawStretchPic( 0, 0, uis.vidWidth, uis.vidHeight,
			0, 0, 1, 1, colorWhite, trap_R_RegisterPic( UI_SHADER_VIDEOBACK ) );

		trap_R_DrawStretchPic( 0, 0, uis.vidWidth, uis.vidHeight,
			0, 0, 1, 1, colorWhite, trap_R_RegisterPic( UI_SHADER_FXBACK ) );

		trap_R_DrawStretchPic( 0, 0, uis.vidWidth, uis.vidHeight,
			0, 0, 1, 1, colorWhite, trap_R_RegisterPic( UI_SHADER_BIGLOGO ) );

		if( !uis.backGroundTrackStarted )
		{
			trap_S_StartBackgroundTrack( S_PLAYLIST_MENU, "3" ); // shuffle and loop
			uis.backGroundTrackStarted = qtrue;
		}
	}
	else
	{
		uis.backGroundTrackStarted = qfalse;
		//trap_R_DrawStretchPic( 0, 0, uis.vidWidth, uis.vidHeight,
		//	0, 0, 1, 1, colorDkGrey, trap_R_RegisterPic( "gfx/ui/novideoback" ) );

		//trap_R_DrawStretchPic ( 0, 0, uis.vidWidth, uis.vidHeight,
		//	0, 0, 1, 1, colorWhite, trap_R_RegisterPic( UI_SHADER_BIGLOGO ) );
	}

	m_drawfunc();

	// draw cursor
	if( !uis.bind_grab )
		trap_R_DrawStretchPic( uis.cursorX - 16, uis.cursorY - 16, 32, 32,
		0, 0, 1, 1, colorWhite, trap_R_RegisterPic( UI_SHADER_CURSOR ) );

	// delay playing the enter sound until after the
	// menu has been drawn, to avoid delay while
	// caching images
	if( m_entersound )
	{
		trap_S_StartLocalSound( menu_in_sound );
		m_entersound = qfalse;
	}
}
Exemple #2
0
/*
 * =================
 * UI_Draw
 * =================
 */
void UI_Draw(void)
{
    if (cls.key_dest != key_menu)
    {
        return;
    }

    // dim everything behind it down
    if ((cl.cinematictime > 0) || (cls.state == ca_disconnected))
    {
        if (R_DrawFindPic("/gfx/ui/menu_background.pcx"))
        {
            R_DrawStretchPic(0, 0, viddef.width, viddef.height, "/gfx/ui/menu_background.pcx", 1.0);
        }
        else
        {
            R_DrawFill(0, 0, viddef.width, viddef.height, 0, 0, 0, 255);
        }
    }
    // ingame menu uses alpha
    else if (R_DrawFindPic("/gfx/ui/menu_background.pcx"))
    {
        R_DrawStretchPic(0, 0, viddef.width, viddef.height, "/gfx/ui/menu_background.pcx", menu_alpha->value);
    }
    else
    {
        R_DrawFill(0, 0, viddef.width, viddef.height, 0, 0, 0, (int)(menu_alpha->value * 255));
    }

    // Knigthmare- added Psychospaz's mouse support
    UI_RefreshCursorMenu();

    m_drawfunc();

    // delay playing the enter sound until after the
    // menu has been drawn, to avoid delay while
    // caching images
    if (m_entersound)
    {
        S_StartLocalSound(menu_in_sound);
        m_entersound = false;
    }

    // Knigthmare- added Psychospaz's mouse support
    //menu cursor for mouse usage :)
    UI_Draw_Cursor();
}
/*
=================
UI_Draw
=================
*/
void UI_Draw (void)
{
	if (cls.key_dest != key_menu)
		return;

	// scaled menu stuff
	//SCR_InitScreenScale();

	// repaint everything next frame
	SCR_DirtyScreen ();

	// dim everything behind it down
	if (cl.cinematictime > 0 || cls.state == ca_disconnected)
	{
		//bc removing this background!!!
		/*
		if (R_DrawFindPic("/gfx/menu_background.pcx")) {
			R_DrawStretchPic (0, 0, viddef.width, viddef.height, "/gfx/menu_background.pcx", 1.0);
			//R_DrawFadeScreen ();
		}
		else*/
			R_DrawFill2 (0,0,viddef.width, viddef.height, 0,0,0,255);
	}
	// ingame menu uses alpha
	//else if (R_DrawFindPic("/gfx/menu_background.pcx"))
	//	R_DrawStretchPic (0, 0, viddef.width, viddef.height, "/gfx/menu_background.pcx", menu_alpha->value);
	else
		R_DrawFadeScreen ();

	// Knigthmare- added Psychospaz's mouse support
	UI_RefreshCursorMenu();

	m_drawfunc ();

	// delay playing the enter sound until after the
	// menu has been drawn, to avoid delay while
	// caching images
	if (m_entersound)
	{
		S_StartLocalSound( menu_in_sound );
		m_entersound = false;
	}

	// Knigthmare- added Psychospaz's mouse support
	//menu cursor for mouse usage :)
	UI_Draw_Cursor();
}