Skip to content

Commit 16109bd

Browse files
committed
upd: some ref and warning cleanups
1 parent adf283e commit 16109bd

File tree

3 files changed

+30
-32
lines changed

3 files changed

+30
-32
lines changed

src/engine/shared/config_variables.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,4 +778,5 @@ MACRO_CONFIG_INT(GfxDriverIsBlocked, gfx_driver_is_blocked, 0, 0, 1, CFGFLAG_SAV
778778

779779
MACRO_CONFIG_INT(ClVideoRecorderFPS, cl_video_recorder_fps, 60, 1, 1000, CFGFLAG_SAVE | CFGFLAG_CLIENT, "At which FPS the videorecorder should record demos.")
780780

781-
#include "config_pulse.h"
781+
782+
#include "config_pulse.h"

src/game/client/components/comp_pulse/menus_pulse.cpp

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ void CMenus::RenderConsoleImages(CUIRect MainView)
9191
static std::vector<CConsoleImage> s_vConsoleImages;
9292
static bool s_ImagesLoaded = false;
9393
static int s_SelectedImage = -1;
94-
static int s_SelectedConsoleType = 0; // 0 = default, 1 = RCON
9594

9695
if(!s_ImagesLoaded)
9796
{
@@ -107,21 +106,21 @@ void CMenus::RenderConsoleImages(CUIRect MainView)
107106

108107
std::vector<CConsoleImage> vFiles;
109108
Storage()->ListDirectory(IStorage::TYPE_ALL, aPath, ListConsoleImagesCallback, &vFiles);
110-
dbg_msg("console_images", "Found %d PNG files in %s", vFiles.size(), aPath);
109+
dbg_msg("console_images", "Found %lu PNG files in %s", vFiles.size(), aPath);
111110

112111
for(CConsoleImage &Image : vFiles)
113112
{
114-
bool bExists = false;
113+
bool BExists = false;
115114
for(const CConsoleImage &ExistingImage : s_vConsoleImages)
116115
{
117116
if(str_comp(ExistingImage.m_aName, Image.m_aName) == 0)
118117
{
119-
bExists = true;
118+
BExists = true;
120119
break;
121120
}
122121
}
123122

124-
if(!bExists)
123+
if(!BExists)
125124
{
126125
CImageInfo ImgInfo;
127126
char aFullPath[IO_MAX_PATH_LENGTH];
@@ -149,9 +148,6 @@ void CMenus::RenderConsoleImages(CUIRect MainView)
149148
CUIRect ConsoleTypeSelector;
150149
MainView.HSplitTop(20.0f, &ConsoleTypeSelector, &MainView);
151150

152-
static CButtonContainer s_DefaultConsoleBtn;
153-
static CButtonContainer s_RconConsoleBtn;
154-
155151
CUIRect DefaultBtn, RconBtn;
156152
ConsoleTypeSelector.VSplitMid(&DefaultBtn, &RconBtn);
157153

@@ -260,14 +256,14 @@ void CMenus::RenderSettingsPulse(CUIRect MainView)
260256
CUIRect LeftSection, RightSection;
261257
MainView.VSplitMid(&LeftSection, &RightSection, 10.0f);
262258

263-
ColorRGBA defaultCol = ColorRGBA(0, 0, 0, 0.45f);
259+
ColorRGBA DefaultCol = ColorRGBA(0, 0, 0, 0.45f);
264260

265261
// Left Section - Gameplay Settings
266262
{
267263
CUIRect Section, Label;
268264

269265
CUIRect GameplayRect;
270-
DRAW_BOX(LeftSection, GameplayRect, 100.0f, defaultCol, 10.0f);
266+
DRAW_BOX(LeftSection, GameplayRect, 100.0f, DefaultCol, 10.0f);
271267
s_ScrollRegion.AddRect(GameplayRect);
272268
BOX_LABEL(GameplayRect, Section, "Input & Predict", 40.0f, 10.0f);
273269
BUTTON(GameplayRect, Button, 20.0f, &g_Config.m_ClFastInp, "Fast Input", g_Config.m_ClFastInp);
@@ -276,7 +272,7 @@ void CMenus::RenderSettingsPulse(CUIRect MainView)
276272

277273
// Laser Settings
278274
CUIRect LaserRect;
279-
DRAW_BOX(LeftSection, LaserRect, 260.0f, defaultCol, 10.0f);
275+
DRAW_BOX(LeftSection, LaserRect, 260.0f, DefaultCol, 10.0f);
280276
s_ScrollRegion.AddRect(LaserRect);
281277
BOX_LABEL(LaserRect, Section, "Laser Settings", 40.0f, 10.0f);
282278

@@ -303,7 +299,7 @@ void CMenus::RenderSettingsPulse(CUIRect MainView)
303299

304300
CUIRect EffectsRect;
305301
// Effects Settings Box
306-
DRAW_BOX(LeftSection, EffectsRect, 160.0f, defaultCol, 10.0f);
302+
DRAW_BOX(LeftSection, EffectsRect, 160.0f, DefaultCol, 10.0f);
307303
s_ScrollRegion.AddRect(EffectsRect);
308304
BOX_LABEL(EffectsRect, Section, "Effects Settings", 40.0f, 10.0f);
309305
BUTTON(EffectsRect, Button, 20.0f, &g_Config.m_ClFreezeSnowFlakes, "Show Freeze Snowflakes", g_Config.m_ClFreezeSnowFlakes);
@@ -315,7 +311,7 @@ void CMenus::RenderSettingsPulse(CUIRect MainView)
315311

316312
// Player Aura Settings
317313
CUIRect PlayerAuraRect;
318-
DRAW_BOX(LeftSection, PlayerAuraRect, 160.0f, defaultCol, 10.0f);
314+
DRAW_BOX(LeftSection, PlayerAuraRect, 160.0f, DefaultCol, 10.0f);
319315
s_ScrollRegion.AddRect(PlayerAuraRect);
320316
BOX_LABEL(PlayerAuraRect, Section, "Player Aura Settings", 40.0f, 10.0f);
321317
BUTTON(PlayerAuraRect, Button, 20.0f, &g_Config.m_ClPlayerIdleAura, "Idle Player Aura", g_Config.m_ClPlayerIdleAura);
@@ -334,7 +330,7 @@ void CMenus::RenderSettingsPulse(CUIRect MainView)
334330

335331
END_LABEL(LeftSection);
336332
CUIRect FunRect;
337-
DRAW_BOX(LeftSection, FunRect, 80.0f, defaultCol, 10.0f);
333+
DRAW_BOX(LeftSection, FunRect, 80.0f, DefaultCol, 10.0f);
338334
s_ScrollRegion.AddRect(FunRect);
339335
BOX_LABEL(FunRect, Section, "Fun Settings", 40.0f, 10.0f);
340336
BUTTON(FunRect, Button, 20.0f, &g_Config.m_ClDeathPhrases, "Funny death phrases on death", g_Config.m_ClDeathPhrases);
@@ -343,27 +339,27 @@ void CMenus::RenderSettingsPulse(CUIRect MainView)
343339

344340
// Right Section - Visual Effects
345341
{
346-
CUIRect Section, Label;
342+
CUIRect Section;
347343
CUIRect PreferencesRect;
348344

349345
// Preferences
350-
DRAW_BOX(RightSection, PreferencesRect, 80.0f, defaultCol, 10.0f);
346+
DRAW_BOX(RightSection, PreferencesRect, 80.0f, DefaultCol, 10.0f);
351347
s_ScrollRegion.AddRect(PreferencesRect);
352348
BOX_LABEL(PreferencesRect, Section, "Preferences", 40.0f, 10.0f);
353349
BUTTON(PreferencesRect, Button, 20.0f, &g_Config.m_ClAntiRQ, "Prevent alt+f4 quit", g_Config.m_ClAntiRQ);
354350
END_LABEL(RightSection);
355351

356352
// Player Effects Box
357353
CUIRect VisualRect;
358-
DRAW_BOX(RightSection, VisualRect, 80.0f, defaultCol, 10.0f);
354+
DRAW_BOX(RightSection, VisualRect, 80.0f, DefaultCol, 10.0f);
359355
s_ScrollRegion.AddRect(VisualRect);
360356
BOX_LABEL(VisualRect, Section, "Player Effects", 40.0f, 10.0f);
361357
BUTTON(VisualRect, Button, 20.0f, &g_Config.m_ClPlayerSquashStretch, "Squash & Stretch Animation (beta)", g_Config.m_ClPlayerSquashStretch);
362358
END_LABEL(RightSection);
363359

364360
// Hover Messages Box
365361
CUIRect HoverRect;
366-
DRAW_BOX(RightSection, HoverRect, 140.0f, defaultCol, 10.0f);
362+
DRAW_BOX(RightSection, HoverRect, 140.0f, DefaultCol, 10.0f);
367363
s_ScrollRegion.AddRect(HoverRect);
368364
BOX_LABEL(HoverRect, Section, "Hover Messages", 40.0f, 10.0f);
369365
BUTTON(HoverRect, Button, 20.0f, &g_Config.m_ClHoverMessages, "Hover Messages", g_Config.m_ClHoverMessages);
@@ -378,7 +374,7 @@ void CMenus::RenderSettingsPulse(CUIRect MainView)
378374

379375
CUIRect DuckRect;
380376
// Duck Settings Box
381-
DRAW_BOX(RightSection, DuckRect, 140.0f, defaultCol, 10.0f);
377+
DRAW_BOX(RightSection, DuckRect, 140.0f, DefaultCol, 10.0f);
382378
s_ScrollRegion.AddRect(DuckRect);
383379
BOX_LABEL(DuckRect, Section, "Duck Settings", 40.0f, 10.0f);
384380
BUTTON(DuckRect, Button, 20.0f, &g_Config.m_ClShowFlags, "Show Nameplates Flags (Deep/Jetpack/etc)", g_Config.m_ClShowFlags);
@@ -395,14 +391,15 @@ void CMenus::RenderSettingsPulse(CUIRect MainView)
395391

396392
CUIRect ScoreboardRect;
397393
// Scoreboard Settings Box
398-
DRAW_BOX(RightSection, ScoreboardRect, 140.0f, defaultCol, 10.0f);
394+
DRAW_BOX(RightSection, ScoreboardRect, 140.0f, DefaultCol, 10.0f);
399395
s_ScrollRegion.AddRect(ScoreboardRect);
400396
BOX_LABEL(ScoreboardRect, Section, "Scoreboard Settings", 40.0f, 10.0f);
401397
static CButtonContainer s_FoeColor, s_FriendColor;
402-
ColorRGBA DefaultCol = ColorRGBA(1.0f, 1.0f, 1.0f, 1.f);
403-
COLORPICKER(s_FoeColor, ScoreboardRect, "Foe Color In Scoreboard", &g_Config.m_ClFoeColor, DefaultCol);
404-
COLORPICKER(s_FriendColor, ScoreboardRect, "Friend Color In Scoreboard", &g_Config.m_ClFriendColor, DefaultCol);
405-
398+
{
399+
ColorRGBA DefaulCol = ColorRGBA(1.0f, 1.0f, 1.0f, 1.f);
400+
COLORPICKER(s_FoeColor, ScoreboardRect, "Foe Color In Scoreboard", &g_Config.m_ClFoeColor, DefaulCol);
401+
COLORPICKER(s_FriendColor, ScoreboardRect, "Friend Color In Scoreboard", &g_Config.m_ClFriendColor, DefaulCol);
402+
}
406403
CKeyInfo Key;
407404
FIND_KEY_BINDING(Key, "toggle_scoreboard_menu");
408405

@@ -431,11 +428,11 @@ void CMenus::RenderSettingsPulse(CUIRect MainView)
431428

432429
if(g_Config.m_ClFocusMode)
433430
{
434-
DRAW_BOX(RightSection, FocusModeRect, 180.0f, defaultCol, 10.0f);
431+
DRAW_BOX(RightSection, FocusModeRect, 180.0f, DefaultCol, 10.0f);
435432
}
436433
else
437434
{
438-
DRAW_BOX(RightSection, FocusModeRect, 80.0f, defaultCol, 10.0f);
435+
DRAW_BOX(RightSection, FocusModeRect, 80.0f, DefaultCol, 10.0f);
439436
}
440437

441438
s_ScrollRegion.AddRect(FocusModeRect);
@@ -453,15 +450,15 @@ void CMenus::RenderSettingsPulse(CUIRect MainView)
453450
END_LABEL(RightSection);
454451

455452
CUIRect CursorModeRect;
456-
DRAW_BOX(RightSection, CursorModeRect, 140.0f, defaultCol, 10.0f);
453+
DRAW_BOX(RightSection, CursorModeRect, 140.0f, DefaultCol, 10.0f);
457454
s_ScrollRegion.AddRect(CursorModeRect);
458455
BOX_LABEL(CursorModeRect, Section, "Cursor Settings", 40.0f, 10.0f);
459456
SCROLLBAR(CursorModeRect, Button, 20.0f, &g_Config.m_ClPlayerIdleAuraTimer, 2, 30, "Aura Timer (seconds)"); //#define SCROLLBAR(section, button, height, value, min, max, text) \
460457
461458

462-
float multiplier = g_Config.m_ClWeaponCursorSize / 64.0f;
459+
float Multiplier = g_Config.m_ClWeaponCursorSize / 64.0f;
463460
char aMultiplierText[16];
464-
str_format(aMultiplierText, sizeof(aMultiplierText), " (%.1fx)", multiplier);
461+
str_format(aMultiplierText, sizeof(aMultiplierText), " (%.1fx)", Multiplier);
465462
CursorModeRect.HSplitTop(20.0f, &Button, &CursorModeRect);
466463
Ui()->DoScrollbarOption(&g_Config.m_ClWeaponCursorSize, &g_Config.m_ClWeaponCursorSize, &Button, Localize("Cursor scaling"), 16, 128, &CUi::ms_LinearScrollbarScale, 0, aMultiplierText);
467464

src/game/client/components/scoreboard.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <game/client/ui.h>
1919
#include <game/localization.h>
2020

21+
#include <cmath>
2122
#include <sstream>
2223

2324
struct SPopupProperties
@@ -743,9 +744,8 @@ bool CScoreboard::RenderScoreboard(CUIRect Scoreboard, int Team, int CountStart,
743744
{
744745
float Time = LocalTime();
745746
float PulseSpeed = 0.2f;
746-
float PulseIntensity = 0.5f;
747747

748-
float Hue = fmod(Time * PulseSpeed, 1.0f);
748+
float Hue = std::fmod(Time * PulseSpeed, 1.0f);
749749
float Saturation = 0.8f + 0.2f * sinf(Time * PulseSpeed * 2.0f);
750750
float Value = 0.8f + 0.2f * sinf(Time * PulseSpeed * 1.5f);
751751

0 commit comments

Comments
 (0)