clang-tidy modernize
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#include "scoreboard.h"
|
||||
|
||||
#include <SDL3/SDL.h> // Para SDL_DestroyTexture, SDL_SetRenderDrawColor
|
||||
#include <math.h> // Para roundf
|
||||
|
||||
#include <cmath> // Para roundf
|
||||
#include <iomanip> // Para operator<<, setfill, setw
|
||||
#include <sstream> // Para basic_ostringstream, basic_ostream, basic_os...
|
||||
|
||||
@@ -29,7 +29,7 @@ void Scoreboard::destroy() {
|
||||
}
|
||||
|
||||
// [SINGLETON] Con este método obtenemos el objeto score_board y podemos trabajar con él
|
||||
Scoreboard *Scoreboard::get() {
|
||||
auto Scoreboard::get() -> Scoreboard * {
|
||||
return Scoreboard::instance;
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ Scoreboard::~Scoreboard() {
|
||||
}
|
||||
|
||||
// Transforma un valor numérico en una cadena de 7 cifras
|
||||
std::string Scoreboard::updateScoreText(int num) {
|
||||
auto Scoreboard::updateScoreText(int num) -> std::string {
|
||||
std::ostringstream oss;
|
||||
oss << std::setw(7) << std::setfill('0') << num;
|
||||
return oss.str();
|
||||
@@ -385,8 +385,8 @@ void Scoreboard::createPanelTextures() {
|
||||
panel_texture_.clear();
|
||||
|
||||
// Crea las texturas para cada panel_
|
||||
for (int i = 0; i < SCOREBOARD_MAX_PANELS; ++i) {
|
||||
SDL_Texture *tex = SDL_CreateTexture(renderer_, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, panel_[i].pos.w, panel_[i].pos.h);
|
||||
for (auto &i : panel_) {
|
||||
SDL_Texture *tex = SDL_CreateTexture(renderer_, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, i.pos.w, i.pos.h);
|
||||
SDL_SetTextureBlendMode(tex, SDL_BLENDMODE_BLEND);
|
||||
panel_texture_.push_back(tex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user