Initialize with = instead of braces, and drop const from local autos

Scalars get = 0, = false or = nullptr. Standard containers and strings rely on their constructors.
Other types get = {} or = value, and lists keep = {...}.
glm types are left alone until they're replaced.
This commit is contained in:
shweet committed 2026-11-22 17:27:24 -05:00
1 parent 666f65bf3a
commit 40f6b554b5
138 files changed
+1500 -1500

No files matched your search

+24 -24
View File
@@ -18,50 +18,50 @@
public:
struct Credit
{
const char* string{};
FontStyle font{FONT_REGULAR};
const char* string = nullptr;
FontStyle font = FONT_REGULAR;
};
// One 30 Hz tick of the credits roll, after the original editor's About box. Lengths are in its pixels (for
// 14 px text); `trailAlpha` is how much of what was drawn before this tick it faded out (255 clears it).
struct RollFrame
{
float scroll{};
float offsetX{};
float stretch{1.0f};
int effect{};
int trailAlpha{255};
float scroll = 0;
float offsetX = 0;
float stretch = 1.0f;
int effect = 0;
int trailAlpha = 255;
glm::vec2 levels{};
float gradientHeight{};
ImU32 gradientColor{};
float gradientHeight = 0;
ImU32 gradientColor = 0;
};
// The credits scroll up through a box, one of four effects per pass (none, sway, stretch to the music, wave),
// between volume bars; recent ticks are kept to draw the trails they leave.
struct RollState
{
std::deque<RollFrame> history{};
float scroll{};
float tickTime{};
int tick{};
int pass{};
float levelPeak{};
ImU32 titleColor{};
std::deque<RollFrame> history;
float scroll = 0;
float tickTime = 0;
int tick = 0;
int pass = 0;
float levelPeak = 0;
ImU32 titleColor = 0;
};
struct FriendState
{
Model model{};
std::unique_ptr<Canvas> canvas{};
std::unordered_map<int, Image> textures{};
Model model = {};
std::unique_ptr<Canvas> canvas;
std::unordered_map<int, Image> textures;
glm::vec4 rect{-1.0f};
float time{};
float fps{30.0f};
bool isLoaded{};
float time = 0;
float fps = 30.0f;
bool isLoaded = false;
};
RollState roll{};
std::array<FriendState, FRIEND_COUNT> friendStates{};
RollState roll = {};
std::array<FriendState, FRIEND_COUNT> friendStates = {};
void reset(Resources& resources);
void update(Resources& resources);