void UI_DrawTitleAnim()
{
	UI_SetupTitleQuad();

	if( !TransPic ) return;

	wrect_t r = { 0, uiStatic.buttons_width, 26, 51 };

	float frac = UI_GetTitleTransFraction();/*(sin(gpGlobals->time*4)+1)/2*/;

#ifdef TA_ALT_MODE
	if( frac == 1 && transition_state == AS_TO_BUTTON )
		return;
#else
	if( frac == 1 ) return;
#endif

	ui_quad_t c;
	
	int f_idx = (transition_state == AS_TO_TITLE) ? 0 : 1;
	int s_idx = (transition_state == AS_TO_TITLE) ? 1 : 0;

	LerpQuad( TitleLerpQuads[f_idx], TitleLerpQuads[s_idx], frac, &c );

	PIC_Set( TransPic, 255, 255, 255, 255 );
	PIC_DrawAdditive( c.x, c.y, c.lx, c.ly, &r );
}
Beispiel #2
0
/*
=================
UI_DrawPicAdditive
=================
*/
void UI_DrawPicAdditive( int x, int y, int width, int height, const int color, const char *pic )
{
	HIMAGE hPic = PIC_Load( pic );

	int r, g, b, a;
	UnpackRGBA( r, g, b, a, color );

	PIC_Set( hPic, r, g, b, a );
	PIC_DrawAdditive( x, y, width, height );
}
static void UI_Preview_Ownerdraw( void *self )
{
    menuCommon_s	*item = (menuCommon_s *)self;
    UI_FillRect( item->x - 2, item->y - 2, item->width + 4, item->height + 4, 0xFFC0C0C0 );
    UI_FillRect( item->x, item->y, item->width, item->height, 0xFF808080 );
    PIC_Set( uiTouchButtons.textureid, CURCOLOR1(red), CURCOLOR1(green), CURCOLOR1(blue), CURCOLOR1(alpha));
    if( uiTouchButtons.additive.enabled )
        PIC_DrawAdditive( item->x, item->y, item->width, item->height );
    else
        PIC_DrawTrans( item->x, item->y, item->width, item->height );
}
Beispiel #4
0
/*
=================
UI_Crosshair_Ownerdraw
=================
*/
static void UI_Crosshair_Ownerdraw( void *self )
{
	menuBitmap_s *item = (menuBitmap_s*)self;

	UI_DrawPic(item->generic.x, item->generic.y, item->generic.width, item->generic.height, 0x00FFFFFF, "gfx/vgui/crosshair" );


	int l;
	switch( (int)uiPlayerSetup.crosshairSize.curValue )
	{
	case 1:
		l = 10;
		break;
	case 2:
		l = 20;
		break;
	case 3:
		l = 30;
		break;
	case 0:
		if( ScreenWidth < 640 )
			l = 30;
		else if( ScreenWidth < 1024 )
			l = 20;
		else l = 10;
	}

	l *= ScreenHeight / 768.0f;

	int x = item->generic.x, // xpos
		y = item->generic.y, // ypos
		w = item->generic.width, // width
		h = item->generic.height, // height
		// delta distance
		d = (item->generic.width / 2 - l) * 0.5,
		// alpha
		a = 180,
		// red
		r = g_iCrosshairAvailColors[(int)uiPlayerSetup.crosshairColor.curValue][0],
		// green
		g = g_iCrosshairAvailColors[(int)uiPlayerSetup.crosshairColor.curValue][1],
		// blue
		b = g_iCrosshairAvailColors[(int)uiPlayerSetup.crosshairColor.curValue][2];

	if( uiPlayerSetup.crosshairTranslucent.enabled )
	{
		// verical
		PIC_Set(uiPlayerSetup.uiWhite, r, g, b, a);
		PIC_DrawTrans(x + w / 2, y + d,         1, l );

		PIC_Set(uiPlayerSetup.uiWhite, r, g, b, a);
		PIC_DrawTrans(x + w / 2, y + h / 2 + d, 1, l );

		// horizontal
		PIC_Set(uiPlayerSetup.uiWhite, r, g, b, a);
		PIC_DrawTrans(x + d,         y + h / 2, l, 1 );

		PIC_Set(uiPlayerSetup.uiWhite, r, g, b, a);
		PIC_DrawTrans(x + w / 2 + d, y + h / 2, l, 1 );
	}
	else
	{
		// verical
		PIC_Set(uiPlayerSetup.uiWhite, r, g, b, a);
		PIC_DrawAdditive(x + w / 2, y + d,         1, l );

		PIC_Set(uiPlayerSetup.uiWhite, r, g, b, a);
		PIC_DrawAdditive(x + w / 2, y + h / 2 + d, 1, l );

		// horizontal
		PIC_Set(uiPlayerSetup.uiWhite, r, g, b, a);
		PIC_DrawAdditive(x + d,         y + h / 2, l, 1 );

		PIC_Set(uiPlayerSetup.uiWhite, r, g, b, a);
		PIC_DrawAdditive(x + w / 2 + d, y + h / 2, l, 1 );
	}

#if 0
	// verical
	FillRGBA(x + w / 2, y + d,         1, l, r, g, b, a);
	FillRGBA(x + w / 2, y + h / 2 + d, 1, l, r, g, b, a);

	// horizontal
	FillRGBA(x + d,         y + h / 2, l, 1, r, g, b, a);
	FillRGBA(x + w / 2 + d, y + h / 2, l, 1, r, g, b, a);
#endif
}