Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
1.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // COMMON.CPP
  4. //
  5. // Common/Misc specialized support routines not uniquely owned.
  6. //=====================================================================================//
  7. #include "vxconsole.h"
  8. vprofState_e g_vprof_state = VPROF_OFF;
  9. //-----------------------------------------------------------------------------
  10. // NotImplementedYet
  11. //
  12. //-----------------------------------------------------------------------------
  13. void NotImplementedYet()
  14. {
  15. Sys_MessageBox( "Attention!", "Sorry, Not Implemented Yet." );
  16. }
  17. //-----------------------------------------------------------------------------
  18. // VProf_GetState
  19. //
  20. //-----------------------------------------------------------------------------
  21. vprofState_e VProf_GetState()
  22. {
  23. return g_vprof_state;
  24. }
  25. //-----------------------------------------------------------------------------
  26. // VProf_Enable
  27. //
  28. // Coordinates multiple vprof commands for proper exclusion
  29. //-----------------------------------------------------------------------------
  30. void VProf_Enable( vprofState_e state )
  31. {
  32. char commandString[256];
  33. switch ( state )
  34. {
  35. case VPROF_CPU:
  36. strcpy( commandString, "vprof_off ; vprof_on ; vprof_update cpu" );
  37. break;
  38. case VPROF_TEXTURE:
  39. strcpy( commandString, "vprof_off ; vprof_on ; vprof_update texture" );
  40. break;
  41. case VPROF_TEXTUREFRAME:
  42. strcpy( commandString, "vprof_off ; vprof_on ; vprof_update texture_frame" );
  43. break;
  44. default:
  45. state = VPROF_OFF;
  46. strcpy( commandString, "vprof_off" );
  47. break;
  48. }
  49. // track state
  50. if ( g_vprof_state != state )
  51. {
  52. g_vprof_state = state;
  53. // do command
  54. ProcessCommand( commandString );
  55. // update all the dependant titles
  56. CpuProfile_SetTitle();
  57. TexProfile_SetTitle();
  58. }
  59. }