@@ -37,11 +37,11 @@ extern "C" void DLLEXPORT HUD_ChatInputPosition( int *x, int *y )
3737 {
3838 if ( gHUD .m_Spectator .m_pip ->value == INSET_OFF )
3939 {
40- *y = YRES ( PANEL_HEIGHT );
40+ *y = YRES_HD ( PANEL_HEIGHT );
4141 }
4242 else
4343 {
44- *y = YRES ( gHUD .m_Spectator .m_OverviewData .insetWindowHeight + 5 );
44+ *y = YRES_HD ( gHUD .m_Spectator .m_OverviewData .insetWindowHeight + 5 );
4545 }
4646 }
4747}
@@ -101,15 +101,15 @@ void SpectatorPanel::Initialize()
101101
102102 SchemeHandle_t hSmallScheme = pSchemes->getSchemeHandle ( " Team Info Text" );
103103
104- m_TopBorder = new CTransparentPanel ( 64 , 0 , 0 , ScreenWidth, YRES ( PANEL_HEIGHT ) );
104+ m_TopBorder = new CTransparentPanel ( 64 , 0 , 0 , ScreenWidth, YRES_HD ( PANEL_HEIGHT ) );
105105 m_TopBorder->setParent ( this );
106106
107- m_BottomBorder = new CTransparentPanel ( 64 , 0 , ScreenHeight - YRES ( 32 ), ScreenWidth, YRES ( PANEL_HEIGHT ) );
107+ m_BottomBorder = new CTransparentPanel ( 64 , 0 , ScreenHeight - YRES_HD ( PANEL_HEIGHT ), ScreenWidth, YRES_HD ( PANEL_HEIGHT ) );
108108 m_BottomBorder->setParent ( this );
109109
110110 setPaintBackgroundEnabled ( false );
111111
112- m_ExtraInfo = new Label ( " Extra Info" , 0 , 0 , wide, YRES ( PANEL_HEIGHT ) );
112+ m_ExtraInfo = new Label ( " Extra Info" , 0 , 0 , wide, YRES_HD ( PANEL_HEIGHT ) );
113113 m_ExtraInfo->setParent ( m_TopBorder );
114114 m_ExtraInfo->setFont ( pSchemes->getFont ( hSmallScheme ) );
115115
@@ -120,24 +120,24 @@ void SpectatorPanel::Initialize()
120120 m_TimerImage = new CImageLabel ( " timer" , 0 , 0 , 14 , 14 );
121121 m_TimerImage->setParent ( m_TopBorder );
122122
123- m_TopBanner = new CImageLabel ( " banner" , 0 , 0 , XRES ( BANNER_WIDTH ), YRES ( BANNER_HEIGHT ) );
123+ m_TopBanner = new CImageLabel ( " banner" , 0 , 0 , XRES_HD ( BANNER_WIDTH ), YRES_HD ( BANNER_HEIGHT ) );
124124 m_TopBanner->setParent ( this );
125125
126- m_CurrentTime = new Label ( " 00:00" , 0 , 0 , wide, YRES ( PANEL_HEIGHT ) );
126+ m_CurrentTime = new Label ( " 00:00" , 0 , 0 , wide, YRES_HD ( PANEL_HEIGHT ) );
127127 m_CurrentTime->setParent ( m_TopBorder );
128128 m_CurrentTime->setFont ( pSchemes->getFont ( hSmallScheme ) );
129129 m_CurrentTime->setPaintBackgroundEnabled ( false );
130130 m_CurrentTime->setFgColor ( 143 , 143 , 54 , 0 );
131131 m_CurrentTime->setContentAlignment ( vgui::Label::a_west );
132132
133- m_Separator = new Panel ( 0 , 0 , XRES ( 64 ), YRES ( 96 ) );
133+ m_Separator = new Panel ( 0 , 0 , XRES_HD ( 64 ), YRES_HD ( 96 ) );
134134 m_Separator->setParent ( m_TopBorder );
135135 m_Separator->setFgColor ( 59 , 58 , 34 , 48 );
136136 m_Separator->setBgColor ( 59 , 58 , 34 , 48 );
137137
138138 for ( int j = 0 ; j < TEAM_NUMBER; j++ )
139139 {
140- m_TeamScores[j] = new Label ( " " , 0 , 0 , wide, YRES ( PANEL_HEIGHT ) );
140+ m_TeamScores[j] = new Label ( " " , 0 , 0 , wide, YRES_HD ( PANEL_HEIGHT ) );
141141 m_TeamScores[j]->setParent ( m_TopBorder );
142142 m_TeamScores[j]->setFont ( pSchemes->getFont ( hSmallScheme ) );
143143 m_TeamScores[j]->setPaintBackgroundEnabled ( false );
@@ -147,8 +147,8 @@ void SpectatorPanel::Initialize()
147147 }
148148
149149 // Initialize command buttons.
150- // m_OptionButton = new ColorButton( CHudTextMessage::BufferedLocaliseTextString( "#SPECT_OPTIONS" ), XRES (15), YRES (6), XRES (OPTIONS_BUTTON_X), YRES (20), false, false );
151- m_OptionButton = new DropDownButton ( CHudTextMessage::BufferedLocaliseTextString ( " #SPECT_OPTIONS" ), XRES (15 ), YRES (6 ), XRES (OPTIONS_BUTTON_X), YRES (20 ), false , false );
150+ // m_OptionButton = new ColorButton( CHudTextMessage::BufferedLocaliseTextString( "#SPECT_OPTIONS" ), XRES_HD (15), YRES_HD (6), XRES_HD (OPTIONS_BUTTON_X), YRES_HD (20), false, false );
151+ m_OptionButton = new DropDownButton ( CHudTextMessage::BufferedLocaliseTextString ( " #SPECT_OPTIONS" ), XRES_HD (15 ), YRES_HD (6 ), XRES_HD (OPTIONS_BUTTON_X), YRES_HD (20 ), false , false );
152152 m_OptionButton->setParent ( m_BottomBorder );
153153 m_OptionButton->setContentAlignment ( vgui::Label::a_center );
154154 m_OptionButton->setBoundKey ( (char )255 ); // special no bound to avoid leading spaces in name
@@ -158,7 +158,7 @@ void SpectatorPanel::Initialize()
158158 m_OptionButton->setUnArmedColor ( 143 , 143 , 54 , 0 );
159159 m_OptionButton->setArmedColor ( 194 , 202 , 54 , 0 );
160160
161- m_CamButton = new DropDownButton ( CHudTextMessage::BufferedLocaliseTextString ( " #CAM_OPTIONS" ), ScreenWidth - ( XRES ( CAMOPTIONS_BUTTON_X ) + 15 ), YRES (6 ), XRES ( CAMOPTIONS_BUTTON_X ), YRES (20 ), false , false );
161+ m_CamButton = new DropDownButton ( CHudTextMessage::BufferedLocaliseTextString ( " #CAM_OPTIONS" ), ScreenWidth - ( XRES_HD ( CAMOPTIONS_BUTTON_X ) + 15 ), YRES_HD (6 ), XRES_HD ( CAMOPTIONS_BUTTON_X ), YRES_HD (20 ), false , false );
162162 m_CamButton->setParent ( m_BottomBorder );
163163 m_CamButton->setContentAlignment ( vgui::Label::a_center );
164164 m_CamButton->setBoundKey ( (char )255 ); // special no bound to avoid leading spaces in name
@@ -168,8 +168,8 @@ void SpectatorPanel::Initialize()
168168 m_CamButton->setUnArmedColor ( 143 , 143 , 54 , 0 );
169169 m_CamButton->setArmedColor ( 194 , 202 , 54 , 0 );
170170
171- // m_PrevPlayerButton= new ColorButton("<", XRES ( 15 + OPTIONS_BUTTON_X + 15 ), YRES (6), XRES (24), YRES (20), false, false );
172- m_PrevPlayerButton= new CImageButton (" arrowleft" , XRES ( 15 + OPTIONS_BUTTON_X + 15 ), YRES (6 ), XRES (24 ), YRES (20 ), false , false );
171+ // m_PrevPlayerButton= new ColorButton("<", XRES_HD ( 15 + OPTIONS_BUTTON_X + 15 ), YRES_HD (6), XRES_HD (24), YRES_HD (20), false, false );
172+ m_PrevPlayerButton= new CImageButton (" arrowleft" , XRES_HD ( 15 + OPTIONS_BUTTON_X + 15 ), YRES_HD (6 ), XRES_HD (24 ), YRES_HD (20 ), false , false );
173173 m_PrevPlayerButton->setParent ( m_BottomBorder );
174174 m_PrevPlayerButton->setContentAlignment ( vgui::Label::a_center );
175175 m_PrevPlayerButton->setBoundKey ( (char )255 ); // special no bound to avoid leading spaces in name
@@ -179,8 +179,8 @@ void SpectatorPanel::Initialize()
179179 m_PrevPlayerButton->setUnArmedColor ( 143 , 143 , 54 , 0 );
180180 m_PrevPlayerButton->setArmedColor ( 194 , 202 , 54 , 0 );
181181
182- // m_NextPlayerButton= new ColorButton(">", (ScreenWidth - (XRES ( CAMOPTIONS_BUTTON_X ) + 15)) - XRES ( 24 + 15 ), YRES (6), XRES (24), YRES (20),false, false );
183- m_NextPlayerButton= new CImageButton (" arrowright" , (ScreenWidth - (XRES ( CAMOPTIONS_BUTTON_X ) + 15 )) - XRES ( 24 + 15 ), YRES (6 ), XRES (24 ), YRES (20 ),false , false );
182+ // m_NextPlayerButton= new ColorButton(">", (ScreenWidth - (XRES_HD ( CAMOPTIONS_BUTTON_X ) + 15)) - XRES_HD ( 24 + 15 ), YRES_HD (6), XRES_HD (24), YRES_HD (20),false, false );
183+ m_NextPlayerButton= new CImageButton (" arrowright" , (ScreenWidth - (XRES_HD ( CAMOPTIONS_BUTTON_X ) + 15 )) - XRES_HD ( 24 + 15 ), YRES_HD (6 ), XRES_HD (24 ), YRES_HD (20 ),false , false );
184184 m_NextPlayerButton->setParent ( m_BottomBorder );
185185 m_NextPlayerButton->setContentAlignment ( vgui::Label::a_center );
186186 m_NextPlayerButton->setBoundKey ( (char )255 ); // special no bound to avoid leading spaces in name
@@ -191,10 +191,10 @@ void SpectatorPanel::Initialize()
191191 m_NextPlayerButton->setArmedColor ( 194 , 202 , 54 , 0 );
192192
193193 // Initialize the bottom title.
194- float flLabelSize = ( ( ScreenWidth - ( XRES ( CAMOPTIONS_BUTTON_X ) + 15 ) ) - XRES ( 24 + 15 ) ) - XRES ( ( 15 + OPTIONS_BUTTON_X + 15 ) + 38 );
194+ float flLabelSize = ( ( ScreenWidth - ( XRES_HD ( CAMOPTIONS_BUTTON_X ) + 15 ) ) - XRES_HD ( 24 + 15 ) ) - XRES_HD ( ( 15 + OPTIONS_BUTTON_X + 15 ) + 38 );
195195
196196 m_BottomMainButton = new DropDownButton (" Spectator Bottom" ,
197- XRES ( ( 15 + OPTIONS_BUTTON_X + 15 ) + 31 ), YRES (6 ), flLabelSize, YRES (20 ),
197+ XRES_HD ( ( 15 + OPTIONS_BUTTON_X + 15 ) + 31 ), YRES_HD (6 ), flLabelSize, YRES_HD (20 ),
198198 false , false );
199199
200200 m_BottomMainButton->setParent (m_BottomBorder);
@@ -211,7 +211,7 @@ void SpectatorPanel::Initialize()
211211
212212
213213 m_BottomMainLabel = new Label (" Spectator Bottom" ,
214- XRES ( ( 15 + OPTIONS_BUTTON_X + 15 ) + 31 ), YRES (6 ), flLabelSize, YRES (20 ));
214+ XRES_HD ( ( 15 + OPTIONS_BUTTON_X + 15 ) + 31 ), YRES_HD (6 ), flLabelSize, YRES_HD (20 ));
215215
216216 m_BottomMainLabel->setParent ( m_BottomBorder );
217217 m_BottomMainLabel->setPaintBackgroundEnabled ( false );
@@ -220,7 +220,7 @@ void SpectatorPanel::Initialize()
220220 m_BottomMainLabel->setBorder ( NULL );
221221 m_BottomMainLabel->setVisible (false );
222222
223- m_InsetViewButton = new ColorButton ( " " , XRES ( 2 ), YRES ( 2 ), XRES ( 240 ), YRES ( 180 ), false , false );
223+ m_InsetViewButton = new ColorButton ( " " , XRES_HD ( 2 ), YRES_HD ( 2 ), XRES_HD ( 240 ), YRES_HD ( 180 ), false , false );
224224 m_InsetViewButton->setParent ( this );
225225 m_InsetViewButton->setBoundKey ( (char )255 );
226226 m_InsetViewButton->addActionSignal ( new CSpectatorHandler_Command ( this , SPECTATOR_PANEL_CMD_TOGGLE_INSET ) );
@@ -257,11 +257,11 @@ void SpectatorPanel::ShowMenu( bool isVisible )
257257 m_BottomMainButton->setVisible (false );
258258
259259 m_BottomMainLabel->getSize ( iLabelSizeX, iLabelSizeY );
260- m_BottomMainLabel->setPos ( ( ScreenWidth / 2 ) - ( iLabelSizeX / 2 ), YRES ( 6 ) );
260+ m_BottomMainLabel->setPos ( ( ScreenWidth / 2 ) - ( iLabelSizeX / 2 ), YRES_HD ( 6 ) );
261261 }
262262 else
263263 {
264- m_BottomMainButton->setPos ( XRES ( ( 15 + OPTIONS_BUTTON_X + 15 ) + 31 ), YRES (6 ) );
264+ m_BottomMainButton->setPos ( XRES_HD ( ( 15 + OPTIONS_BUTTON_X + 15 ) + 31 ), YRES_HD (6 ) );
265265 m_BottomMainLabel->setVisible (false );
266266 m_BottomMainButton->setVisible (true );
267267 }
@@ -328,18 +328,18 @@ void SpectatorPanel::EnableInsetView(bool isEnabled)
328328 if ( isEnabled )
329329 {
330330 // short black bar to see full inset
331- m_TopBorder->setBounds ( XRES ( offset ), 0 , XRES (640 - offset ), YRES ( PANEL_HEIGHT ) );
331+ m_TopBorder->setBounds ( XRES_HD ( offset ), 0 , XRES_HD (640 - offset ), YRES_HD ( PANEL_HEIGHT ) );
332332
333333 if ( gEngfuncs .IsSpectateOnly () )
334334 {
335335 m_TopBanner->setVisible ( true );
336- m_TopBanner->setPos ( XRES ( offset ), 0 );
336+ m_TopBanner->setPos ( XRES_HD ( offset ), 0 );
337337 }
338338 else
339339 m_TopBanner->setVisible ( false );
340340
341- m_InsetViewButton->setBounds ( XRES ( x -1 ), YRES ( y ),
342- XRES ( wide +2 ), YRES ( tall ) );
341+ m_InsetViewButton->setBounds ( XRES_HD ( x -1 ), YRES_HD ( y ),
342+ XRES_HD ( wide +2 ), YRES_HD ( tall ) );
343343 m_InsetViewButton->setVisible ( true );
344344 }
345345 else
@@ -354,7 +354,7 @@ void SpectatorPanel::EnableInsetView(bool isEnabled)
354354 else
355355 m_TopBanner->setVisible ( false );
356356
357- m_TopBorder->setBounds ( 0 , 0 , ScreenWidth, YRES ( PANEL_HEIGHT ) );
357+ m_TopBorder->setBounds ( 0 , 0 , ScreenWidth, YRES_HD ( PANEL_HEIGHT ) );
358358
359359 m_InsetViewButton->setVisible ( false );
360360 }
@@ -393,28 +393,28 @@ void SpectatorPanel::Update()
393393 m_ExtraInfo->getTextSize ( iTextWidth, iTextHeight );
394394 m_CurrentTime->getTextSize ( iTimeWidth, iTimeHeight );
395395
396- iTimeWidth += XRES ( SEPERATOR_WIDTH*2 + 1 ); // +timer icon
396+ iTimeWidth += XRES_HD ( SEPERATOR_WIDTH*2 + 1 ); // +timer icon
397397 iTimeWidth += ( SEPERATOR_WIDTH-(iTimeWidth%SEPERATOR_WIDTH) );
398398
399399 if ( iTimeWidth > iTextWidth )
400400 iTextWidth = iTimeWidth;
401401
402- int xPos = ScreenWidth - ( iTextWidth + XRES ( SEPERATOR_WIDTH + offset ) );
402+ int xPos = ScreenWidth - ( iTextWidth + XRES_HD ( SEPERATOR_WIDTH + offset ) );
403403
404- m_ExtraInfo->setBounds ( xPos, YRES ( SEPERATOR_HEIGHT ), iTextWidth, iTextHeight );
404+ m_ExtraInfo->setBounds ( xPos, YRES_HD ( SEPERATOR_HEIGHT ), iTextWidth, iTextHeight );
405405
406- m_TimerImage->setBounds ( xPos, YRES ( SEPERATOR_HEIGHT ) + iTextHeight , XRES (SEPERATOR_WIDTH*2 + 1 ), YRES (SEPERATOR_HEIGHT + 1 ) );
406+ m_TimerImage->setBounds ( xPos, YRES_HD ( SEPERATOR_HEIGHT ) + iTextHeight , XRES_HD (SEPERATOR_WIDTH*2 + 1 ), YRES_HD (SEPERATOR_HEIGHT + 1 ) );
407407
408- m_CurrentTime->setBounds ( xPos + XRES ( SEPERATOR_WIDTH*2 + 1 ), YRES ( SEPERATOR_HEIGHT ) + iTextHeight , iTimeWidth, iTimeHeight );
408+ m_CurrentTime->setBounds ( xPos + XRES_HD ( SEPERATOR_WIDTH*2 + 1 ), YRES_HD ( SEPERATOR_HEIGHT ) + iTextHeight , iTimeWidth, iTimeHeight );
409409
410- m_Separator->setPos ( ScreenWidth - ( iTextWidth + XRES ( 2 *SEPERATOR_WIDTH+SEPERATOR_WIDTH/2 +offset ) ) , YRES ( 5 ) );
411- m_Separator->setSize ( XRES ( 1 ), PANEL_HEIGHT - 10 );
410+ m_Separator->setPos ( ScreenWidth - ( iTextWidth + XRES_HD ( 2 *SEPERATOR_WIDTH+SEPERATOR_WIDTH/2 +offset ) ) , YRES_HD ( 5 ) );
411+ m_Separator->setSize ( XRES_HD ( 1 ), PANEL_HEIGHT - 10 );
412412
413413 for ( j = 0 ; j < TEAM_NUMBER; j++ )
414414 {
415415 int iwidth, iheight;
416416
417417 m_TeamScores[j]->getTextSize ( iwidth, iheight );
418- m_TeamScores[j]->setBounds ( ScreenWidth - ( iTextWidth + XRES ( 2 *SEPERATOR_WIDTH+2 *SEPERATOR_WIDTH/2 +offset ) + iwidth ), YRES ( SEPERATOR_HEIGHT ) + ( iheight * j ), iwidth, iheight );
418+ m_TeamScores[j]->setBounds ( ScreenWidth - ( iTextWidth + XRES_HD ( 2 *SEPERATOR_WIDTH+2 *SEPERATOR_WIDTH/2 +offset ) + iwidth ), YRES_HD ( SEPERATOR_HEIGHT ) + ( iheight * j ), iwidth, iheight );
419419 }
420420}
0 commit comments