Counter Strike : Global Offensive Source Code
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.

89 lines
2.9 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "cbase.h"
  8. #include "vgui_int.h"
  9. #include "ienginevgui.h"
  10. #include "c_csrootpanel.h"
  11. #include "view_shared.h"
  12. // memdbgon must be the last include file in a .cpp file!!!
  13. #include "tier0/memdbgon.h"
  14. using namespace vgui;
  15. static C_CSRootPanel *g_pCSRootPanel[ MAX_SPLITSCREEN_PLAYERS ];
  16. static C_CSRootPanel *g_pFullscreenRootPanel;
  17. void VGui_GetPanelList( CUtlVector< Panel * > &list )
  18. {
  19. for ( int i = 0 ; i < MAX_SPLITSCREEN_PLAYERS; ++i )
  20. {
  21. list.AddToTail( g_pCSRootPanel[ i ] );
  22. }
  23. }
  24. //-----------------------------------------------------------------------------
  25. // Purpose:
  26. //-----------------------------------------------------------------------------
  27. void VGUI_CreateClientDLLRootPanel( void )
  28. {
  29. for ( int i = 0 ; i < MAX_SPLITSCREEN_PLAYERS; ++i )
  30. {
  31. g_pCSRootPanel[ i ] = new C_CSRootPanel( enginevgui->GetPanel( PANEL_CLIENTDLL ), i );
  32. }
  33. g_pFullscreenRootPanel = new C_CSRootPanel( enginevgui->GetPanel( PANEL_CLIENTDLL ), 0, "Fullscreen Root Panel" );
  34. g_pFullscreenRootPanel->SetZPos( 1 );
  35. }
  36. //-----------------------------------------------------------------------------
  37. // Purpose:
  38. //-----------------------------------------------------------------------------
  39. void VGUI_DestroyClientDLLRootPanel( void )
  40. {
  41. for ( int i = 0 ; i < MAX_SPLITSCREEN_PLAYERS; ++i )
  42. {
  43. delete g_pCSRootPanel[ i ];
  44. g_pCSRootPanel[ i ] = NULL;
  45. }
  46. delete g_pFullscreenRootPanel;
  47. g_pFullscreenRootPanel = NULL;
  48. }
  49. //-----------------------------------------------------------------------------
  50. // Purpose: Game specific root panel
  51. // Output : vgui::Panel
  52. //-----------------------------------------------------------------------------
  53. vgui::VPANEL VGui_GetClientDLLRootPanel( void )
  54. {
  55. ASSERT_LOCAL_PLAYER_RESOLVABLE();
  56. return g_pCSRootPanel[ GET_ACTIVE_SPLITSCREEN_SLOT() ]->GetVPanel();
  57. }
  58. //-----------------------------------------------------------------------------
  59. // Purpose: Fullscreen root panel for shared hud elements during splitscreen
  60. // Output : vgui::Panel
  61. //-----------------------------------------------------------------------------
  62. vgui::Panel *VGui_GetFullscreenRootPanel( void )
  63. {
  64. return g_pFullscreenRootPanel;
  65. }
  66. vgui::VPANEL VGui_GetFullscreenRootVPANEL( void )
  67. {
  68. return g_pFullscreenRootPanel->GetVPanel();
  69. }
  70. //-----------------------------------------------------------------------------
  71. // Purpose: Link into multiple sub views if client is rendering from multiple locations
  72. // Output : CViewSetup linked list
  73. //-----------------------------------------------------------------------------
  74. void VGui_GetAllSubViews( int nSlot, const CViewSetup &orig_view, CUtlLinkedList< CViewSetup > &subviews, CUtlVector< vrect_t > &letterbox )
  75. {
  76. subviews.AddToTail( orig_view );
  77. return;
  78. }