예제 #1
0
void CT_Demo_Playlist_Draw(int x, int y, int w, int h, CTab_t *tab, CTabPage_t *page)
{
	int i, y2;

	if(demo_playlist_num == 0)
	{
		UI_Print_Center(x, y + 16, w, "Playlist is empty", false);
		UI_Print_Center(x, y + 32, w, "Use [Insert] or [Ctrl]+[Enter]", true);
		UI_Print_Center(x, y + 40, w, "in the demo browser to add a demo", true);
		// UI_Print_Center(x, y + 40, w, "to add demo to the playlist", true);
	}
	else
	{
		y = y - 48;
		for (i = 0; i <= demo_playlist_num - demo_playlist_base && i < DEMO_MAXLINES; i++)
		{
			y2 = 32 + i * 8 ;

			if (demo_playlist_cursor == i)
				M_Print (24, y + y2, demo_playlist[demo_playlist_base + i].name);
			else
				M_PrintWhite (24, y + y2, demo_playlist[demo_playlist_base + i].name);
		}

		M_DrawCharacter (8, y + 32 + demo_playlist_cursor * 8, FLASHINGARROW());
	}
}
예제 #2
0
/*
================
VID_MenuDraw
================
*/
static void VID_MenuDraw (void)
{
	ScrollTitle("gfx/menu/title7.lmp");

	if (vid_menu_firsttime)
	{	// settings for entering the menu first time
		vid_menunum = vid_modenum;
		vid_menu_fs = (modestate != MS_WINDOWED);
		vid_cursor = (num_fmodes) ? 0 : VID_RESOLUTION;
		vid_menu_firsttime = false;
	}

	want_fstoggle = ( ((modestate == MS_WINDOWED) && vid_menu_fs) || ((modestate != MS_WINDOWED) && !vid_menu_fs) );

	need_apply = (vid_menunum != vid_modenum) || want_fstoggle;

	M_Print (76, 92 + 8*VID_FULLSCREEN, "Fullscreen: ");
	M_DrawYesNo (76+12*8, 92 + 8*VID_FULLSCREEN, vid_menu_fs, !want_fstoggle);

	M_Print (76, 92 + 8*VID_RESOLUTION, "Resolution: ");
	if (vid_menunum == vid_modenum)
		M_PrintWhite (76+12*8, 92 + 8*VID_RESOLUTION, modelist[vid_menunum].modedesc);
	else
		M_Print (76+12*8, 92 + 8*VID_RESOLUTION, modelist[vid_menunum].modedesc);

	if (need_apply)
	{
		M_Print (76, 92 + 8*VID_RESET, "RESET CHANGES");
		M_Print (76, 92 + 8*VID_APPLY, "APPLY CHANGES");
	}

	M_DrawCharacter (64, 92 + vid_cursor*8, 12+((int)(realtime*4)&1));
}
예제 #3
0
void CT_Demo_Entry_Draw(int x, int y, int w, int h, CTab_t *tab, CTabPage_t *page)
{
	int z;
	y = y - 32;

	if (demo_playlist_started && cls.demoplayback)
	{
		M_Print (24, y + 32, "Currently playing:");
		M_PrintWhite (24, y + 40, demo_playlist[demo_playlist_current_played].name);
	}
	else
	{
		M_Print (24, y + 32, "Not playing anything");
	}

	M_Print (24, y + 56, "Next     demo");
	M_Print (24, y + 64, "Previous demo");
	M_Print (24, y + 72, "Stop  playlist");
	M_Print (24, y + 80, "Clear playlist");

	if (demo_playlist_num > 0)
	{
		M_Print (24, y + 96, "Currently selected:");
		M_Print (24, y + 104, demo_playlist[demo_playlist_cursor].name);
	}
	else
	{
		M_Print (24, y + 96, "No demo in playlist");
	}

	if (strcasecmp(demo_playlist[demo_playlist_cursor].name + strlen(demo_playlist[demo_playlist_cursor].name) - 4, ".mvd"))
	{
		M_Print (24, y + 120, "Tracking only available with mvds");
	}
	else
	{
		M_Print (24, y + 120, "Track");
		M_DrawTextBox (160, y + 112, 16, 1);
		M_PrintWhite (168, y + 120, demo_track);
		if (demo_playlist_opt_cursor == 4 && demo_playlist_num > 0)
			M_DrawCharacter (168 + 8*strlen(demo_track), 120 + y, FLASHINGCURSOR());
	}

	z = demo_playlist_opt_cursor + (demo_playlist_opt_cursor >= 4 ? 4 : 0);
	z = y + 56 + z * 8;
	M_DrawCharacter (8, z, FLASHINGARROW());
}
예제 #4
0
/*
================
VID_MenuDraw
================
*/
static void VID_MenuDraw (void)
{
	int i, y;
	qpic_t *p;
	const char *title;

	y = 4;

	// plaque
	p = Draw_CachePic ("gfx/qplaque.lmp");
	M_DrawTransPic (16, y, p);

	//p = Draw_CachePic ("gfx/vidmodes.lmp");
	p = Draw_CachePic ("gfx/p_option.lmp");
	M_DrawPic ( (320-p->width)/2, y, p);

	y += 28;

	// title
	title = "Video Options";
	M_PrintWhite ((320-8*strlen(title))/2, y, title);

	y += 16;

	// options
	for (i = 0; i < VIDEO_OPTIONS_ITEMS; i++)
	{
		switch (i)
		{
		case VID_OPT_MODE:
			M_Print (16, y, "        Video mode");
			M_Print (184, y, va("%ix%i", (int)vid_width.value, (int)vid_height.value));
			break;
		case VID_OPT_BPP:
			M_Print (16, y, "       Color depth");
			M_Print (184, y, va("%i", (int)vid_bpp.value));
			break;
		case VID_OPT_FULLSCREEN:
			M_Print (16, y, "        Fullscreen");
			M_DrawCheckbox (184, y, (int)vid_fullscreen.value);
			break;
		case VID_OPT_VSYNC:
			M_Print (16, y, "     Vertical sync");
			if (gl_swap_control)
				M_DrawCheckbox (184, y, (int)vid_vsync.value);
			else
				M_Print (184, y, "N/A");
			break;
		case VID_OPT_TEST:
			y += 8; //separate the test and apply items
			M_Print (16, y, "      Test changes");
			break;
		case VID_OPT_APPLY:
			M_Print (16, y, "     Apply changes");
			break;
		}

		if (video_options_cursor == i)
			M_DrawCharacter (168, y, 12+((int)(realtime*4)&1));

		y += 8;
	}
}
예제 #5
0
파일: vid_dos.c 프로젝트: Blzut3/Engoo
/*
================
VID_MenuDraw
================
*/
void VID_MenuDraw (void)
{
	qpic_t		*p;
	char		*ptr;
	int			nummodes, i, j, column, row, dup;
	char		temp[100];

	vid_wmodes = 0;
	nummodes = VID_NumModes ();

	p = Draw_CachePic ("gfx/vidmodes.lmp");
	M_DrawPic ( (320-p->width)/2, 4, p);

	for (i=0 ; i<nummodes ; i++)
	{
		if (vid_wmodes < MAX_MODEDESCS)
		{
			if (i != 1)
			{
				ptr = VID_GetModeDescription (i);

				if (ptr)
				{
					dup = 0;

					for (j=0 ; j<vid_wmodes ; j++)
					{
						if (!strcmp (modedescs[j].desc, ptr))
						{
							if (modedescs[j].modenum != 0)
							{
								modedescs[j].modenum = i;
								dup = 1;

								if (i == vid_modenum)
									modedescs[j].iscur = 1;
							}
							else
							{
								dup = 1;
							}

							break;
						}
					}

					if (!dup)
					{
						modedescs[vid_wmodes].modenum = i;
						modedescs[vid_wmodes].desc = ptr;
						modedescs[vid_wmodes].iscur = 0;

						if (i == vid_modenum)
							modedescs[vid_wmodes].iscur = 1;

						vid_wmodes++;
					}
				}
			}
		}
	}

	vid_column_size = (vid_wmodes + 2) / 3;

	column = 16;
	row = 36;

	for (i=0 ; i<vid_wmodes ; i++)
	{
		if (modedescs[i].iscur)
			M_PrintWhite (column, row, modedescs[i].desc);
		else
			M_Print (column, row, modedescs[i].desc);

		row += 8;

		if ((i % vid_column_size) == (vid_column_size - 1))
		{
			column += 13*8;
			row = 36;
		}
	}

// line cursor
	if (vid_testingmode)
	{
		sprintf (temp, "TESTING %s",
				modedescs[vid_line].desc);
		M_Print (13*8, 36 + MAX_COLUMN_SIZE * 8 + 8*4, temp);
		M_Print (9*8, 36 + MAX_COLUMN_SIZE * 8 + 8*6,
				"Please wait 5 seconds...");
	}
	else
	{
		M_Print (9*8, 36 + MAX_COLUMN_SIZE * 8 + 8,
				"Press Enter to set mode");
		M_Print (6*8, 36 + MAX_COLUMN_SIZE * 8 + 8*3,
				"T to test mode for 5 seconds");
		ptr = VID_GetModeDescription (vid_modenum);
		sprintf (temp, "D to make %s the default", ptr);
		M_Print (6*8, 36 + MAX_COLUMN_SIZE * 8 + 8*5, temp);
		ptr = VID_GetModeDescription ((int)_vid_default_mode->value);

		if (ptr)
		{
			sprintf (temp, "Current default is %s", ptr);
			M_Print (7*8, 36 + MAX_COLUMN_SIZE * 8 + 8*6, temp);
		}

		M_Print (15*8, 36 + MAX_COLUMN_SIZE * 8 + 8*8,
				"Esc to exit");

		row = 36 + (vid_line % vid_column_size) * 8;
		column = 8 + (vid_line / vid_column_size) * 13*8;

		M_DrawCharacter (column, row, 12+((int)(realtime*4)&1));
	}
}
예제 #6
0
static void VR_MenuDraw (void)
{
	int i, y;
	qpic_t *p;
	const char *title;

	y = 4;

	// plaque
	p = Draw_CachePic ("gfx/qplaque.lmp");
	M_DrawTransPic (16, y, p);


	// customize header
	p = Draw_CachePic ("gfx/ttl_cstm.lmp");
	M_DrawPic ( (320-p->width)/2, y, p);

	y += 28;

	// title
	title = "VR/HMD OPTIONS";
	M_PrintWhite ((320-8*strlen(title))/2, y, title);

	y += 16;

	for ( i = 0; i < VR_OPTION_MAX; i++ ) {
		switch ( i ) {
			case VR_OPTION_ENABLED:
				M_Print( 16, y, "            VR Enabled" );
				VR_MenuPrintOptionValue( 220, y, i );
				break;
			case VR_OPTION_PERFHUD:
				M_Print( 16, y, "             Debug HMD" );
				VR_MenuPrintOptionValue( 220, y, i );
				break;
			case VR_OPTION_AIMMODE:
				y += 4; // separation
				M_Print( 16, y, "              Aim Mode" );
				VR_MenuPrintOptionValue( 220, y, i );
				break;
			case VR_OPTION_DEADZONE:
				M_Print( 16, y, "              Deadzone" );
				VR_MenuPrintOptionValue( 220, y, i );
				break;
			case VR_OPTION_CROSSHAIR:
				M_Print( 16, y, "             Crosshair" );
				VR_MenuPrintOptionValue( 220, y, i );
				break;
			case VR_OPTION_CROSSHAIR_DEPTH:
				M_Print( 16, y, "       Crosshair Depth" );
				VR_MenuPrintOptionValue( 220, y, i );
				break;
			case VR_OPTION_CROSSHAIR_SIZE:
				M_Print( 16, y, "        Crosshair Size" );
				VR_MenuPrintOptionValue( 220, y, i );
				break;
			case VR_OPTION_CROSSHAIR_ALPHA:
				M_Print( 16, y, "       Crosshair Alpha" );
				VR_MenuPrintOptionValue( 220, y, i );
				break;

			default: break;
		}

		// draw the blinking cursor
		if ( vr_options_cursor == i ) {
			M_DrawCharacter( 200, y, 12 + ((int)(realtime*4)&1) );
		}

		y += 8;
	}
}
예제 #7
0
파일: sbar.c 프로젝트: dommul/super8
/*
================
Sbar_DrawCharacter

Draws one solid graphics character
================
*/
void Sbar_DrawCharacter (int x, int y, int num)
{
    M_DrawCharacter (x + 4, y + 200 - SBAR_HEIGHT, num, true);
}
예제 #8
0
파일: sbar.c 프로젝트: dommul/super8
/*
==================
Sbar_DeathmatchOverlay

==================
*/
void Sbar_DeathmatchOverlay (void)
{
    int				i, k, l;
    int				top, bottom;
    int				x, y, f;
    char			num[12];
    float           oldsbarscale; //qb: do it big
    scoreboard_t	*s;

    //qb: big and sort of lazy..
    oldsbarscale = sbar_scale.value;
    sbar_scale.value = 1.0;
    scr_2d_scale_h = vid.width * sbar_scale.value / (200.0 * 1.8);
    scr_2d_scale_v = vid.height / (MIN_VID_HEIGHT/sbar_scale.value);

    scr_copyeverything = 1;
    scr_fullupdate = 0;


    M_DrawPlaque ("gfx/ranking.lmp", false); // mankrip

// scores
    Sbar_SortFrags ();

// draw the text
    l = scoreboardlines;

    x = 80; // mankrip - edited
    y = 36; //qb: also edited, was 36 - mankrip - edited
    for (i=0 ; i<l ; i++)
    {
        k = fragsort[i];
        s = &cl.scores[k];
        if (!s->name[0])
            continue;

        // draw background
        top = s->colors & 0xf0;
        bottom = (s->colors & 15)<<4;
        top = Sbar_ColorForMap (top);
        bottom = Sbar_ColorForMap (bottom);

        M_Draw_Fill (x+20, y + 1    , 40, 4, top);
        M_Draw_Fill (x+20, y + 1 + 4, 40, 4, bottom);

        // draw number
        f = s->frags;
        sprintf (num, "%3i",f);

        M_DrawCharacter ( x+8 , y, num[0], true);
        M_DrawCharacter ( x+16 , y, num[1], true);
        M_DrawCharacter ( x+24 , y, num[2], true);

        if (k == cl.viewentity - 1)
            M_DrawCharacter ( x - 8, y, 12, true);

#if 0
        {
            int				total;
            int				n, minutes, tens, units;

            // draw time
            total = cl.completed_time - s->entertime;
            minutes = (int)total/60;
            n = total - minutes*60;
            tens = n/10;
            units = n%10;

            sprintf (num, "%3i:%i%i", minutes, tens, units);

            Draw_String ( x+48 , y, num);
        }
#endif

        // draw name
        Draw_String (x+64, y, s->name, true);

        y += 10;
    }
    sbar_scale.value =oldsbarscale;
    scr_2d_scale_h = vid.width * sbar_scale.value / (200.0 * nativeaspect);
    if (scr_2d_scale_h < 1)
        scr_2d_scale_h = 1;
    scr_2d_scale_v =  vid.height / (200.0/sbar_scale.value);
    if (scr_2d_scale_v < 1)
        scr_2d_scale_v = 1;
}