fix: errors de renombrat de variables

This commit is contained in:
2025-10-29 11:56:34 +01:00
parent ead3265bfc
commit 95b82e5f62
6 changed files with 32 additions and 32 deletions

View File

@@ -18,7 +18,7 @@ Scoreboard::Scoreboard(std::shared_ptr<ScoreboardData> data)
: item_surface_(Resource::get()->getSurface("items.gif")),
data_(std::move(std::move(data))) {
const float SURFACE_WIDTH = Options::game.width;
constexpr float SURFACE_HEIGHT = 6.0F * BLOCK;
constexpr float SURFACE_HEIGHT = 6.0F * TILE_SIZE;
// Reserva memoria para los objetos
auto player_texture = Resource::get()->getSurface(Options::cheats.alternate_skin == Options::Cheat::State::ENABLED ? "player2.gif" : "player.gif");
@@ -125,8 +125,8 @@ void Scoreboard::fillTexture() {
surface_->clear(stringToColor("black"));
// Anclas
constexpr int LINE1 = BLOCK;
constexpr int LINE2 = 3 * BLOCK;
constexpr int LINE1 = TILE_SIZE;
constexpr int LINE2 = 3 * TILE_SIZE;
// Dibuja las vidas
const int DESP = (counter_ / 40) % 8;
@@ -143,21 +143,21 @@ void Scoreboard::fillTexture() {
if (data_->music) {
const Uint8 C = data_->color;
SDL_FRect clip = {0, 8, 8, 8};
item_surface_->renderWithColorReplace(20 * BLOCK, LINE2, 1, C, &clip);
item_surface_->renderWithColorReplace(20 * TILE_SIZE, LINE2, 1, C, &clip);
}
// Escribe los textos
auto text = Resource::get()->getText("smb2");
const std::string TIME_TEXT = std::to_string((clock_.minutes % 100) / 10) + std::to_string(clock_.minutes % 10) + clock_.separator + std::to_string((clock_.seconds % 60) / 10) + std::to_string(clock_.seconds % 10);
const std::string ITEMS_TEXT = std::to_string(data_->items / 100) + std::to_string((data_->items % 100) / 10) + std::to_string(data_->items % 10);
text->writeColored(BLOCK, LINE1, "Items collected ", data_->color);
text->writeColored(17 * BLOCK, LINE1, ITEMS_TEXT, items_color_);
text->writeColored(20 * BLOCK, LINE1, " Time ", data_->color);
text->writeColored(26 * BLOCK, LINE1, TIME_TEXT, stringToColor("white"));
text->writeColored(TILE_SIZE, LINE1, "Items collected ", data_->color);
text->writeColored(17 * TILE_SIZE, LINE1, ITEMS_TEXT, items_color_);
text->writeColored(20 * TILE_SIZE, LINE1, " Time ", data_->color);
text->writeColored(26 * TILE_SIZE, LINE1, TIME_TEXT, stringToColor("white"));
const std::string ROOMS_TEXT = std::to_string(data_->rooms / 100) + std::to_string((data_->rooms % 100) / 10) + std::to_string(data_->rooms % 10);
text->writeColored(22 * BLOCK, LINE2, "Rooms", stringToColor("white"));
text->writeColored(28 * BLOCK, LINE2, ROOMS_TEXT, stringToColor("white"));
text->writeColored(22 * TILE_SIZE, LINE2, "Rooms", stringToColor("white"));
text->writeColored(28 * TILE_SIZE, LINE2, ROOMS_TEXT, stringToColor("white"));
// Deja el renderizador como estaba
Screen::get()->setRendererSurface(previuos_renderer);