summaryrefslogtreecommitdiff
path: root/utils/xbox/vxconsole/common.cpp
blob: 1b8418c6efa0cefab3444a4a836920160401d13a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//========= Copyright Valve Corporation, All rights reserved. ============//
//
//	COMMON.CPP
//
//	Common/Misc specialized support routines not uniquely owned.
//=====================================================================================//
#include "vxconsole.h"

vprofState_e	g_vprof_state = VPROF_OFF;

//-----------------------------------------------------------------------------
//	NotImplementedYet
//
//-----------------------------------------------------------------------------
void NotImplementedYet()
{
	Sys_MessageBox( "Attention!", "Sorry, Not Implemented Yet." );
}

//-----------------------------------------------------------------------------
//	VProf_GetState
//
//-----------------------------------------------------------------------------
vprofState_e VProf_GetState()
{
	return g_vprof_state;
}

//-----------------------------------------------------------------------------
//	VProf_Enable
//
//	Coordinates multiple vprof commands for proper exclusion
//-----------------------------------------------------------------------------
void VProf_Enable( vprofState_e state )
{
	char	commandString[256];

	switch ( state )
	{
		case VPROF_CPU:
			strcpy( commandString, "vprof_off ; vprof_on ; vprof_update cpu" );
			break;

		case VPROF_TEXTURE:
			strcpy( commandString, "vprof_off ; vprof_on ; vprof_update texture" );
			break;

		case VPROF_TEXTUREFRAME:
			strcpy( commandString, "vprof_off ; vprof_on ; vprof_update texture_frame" );
			break;

		default:
			state = VPROF_OFF;
			strcpy( commandString, "vprof_off" );
			break;

	}

	// track state
	if ( g_vprof_state != state )
	{
		g_vprof_state = state;

		// do command
		ProcessCommand( commandString );

		// update all the dependant titles
		CpuProfile_SetTitle();
		TexProfile_SetTitle();
	}
}