posat orden en defaults i defines

This commit is contained in:
2025-11-21 09:30:33 +01:00
parent 0fb986d7c4
commit 6bf26f7470
18 changed files with 307 additions and 297 deletions

View File

@@ -23,7 +23,7 @@
#include "game/options.hpp" // Para Options, options, Cheat, SectionState
#include "game/scene_manager.hpp" // Para SceneManager
#include "game/ui/notifier.hpp" // Para Notifier, NotificationText, CHEEVO_NO...
#include "utils/defines.hpp" // Para TILE_SIZE, PLAY_AREA_HEIGHT, RoomBorder::BOTTOM
#include "utils/defines.hpp" // Para Tile::SIZE, PlayArea::HEIGHT, RoomBorder::BOTTOM
#include "utils/utils.hpp" // Para PaletteColor, stringToColor
#ifdef _DEBUG
@@ -39,10 +39,10 @@ Game::Game(Mode mode)
mode_(mode),
#ifdef _DEBUG
current_room_("03.yaml"),
spawn_data_(Player::SpawnData(25 * TILE_SIZE, 13 * TILE_SIZE, 0, 0, 0, Player::State::ON_GROUND, SDL_FLIP_HORIZONTAL))
spawn_data_(Player::SpawnData(25 * Tile::SIZE, 13 * Tile::SIZE, 0, 0, 0, Player::State::ON_GROUND, SDL_FLIP_HORIZONTAL))
#else
current_room_("03.yaml"),
spawn_data_(Player::SpawnData(25 * TILE_SIZE, 13 * TILE_SIZE, 0, 0, 0, Player::State::ON_GROUND, SDL_FLIP_HORIZONTAL))
spawn_data_(Player::SpawnData(25 * Tile::SIZE, 13 * Tile::SIZE, 0, 0, 0, Player::State::ON_GROUND, SDL_FLIP_HORIZONTAL))
#endif
{
// Crea objetos e inicializa variables
@@ -197,19 +197,19 @@ void Game::renderDebugInfo() {
auto surface = Screen::get()->getRendererSurface();
// Borra el marcador
SDL_FRect rect = {0, 18 * TILE_SIZE, PLAY_AREA_WIDTH, GAMECANVAS_HEIGHT - PLAY_AREA_HEIGHT};
SDL_FRect rect = {0, 18 * Tile::SIZE, PlayArea::WIDTH, GameCanvas::HEIGHT - PlayArea::HEIGHT};
surface->fillRect(&rect, static_cast<Uint8>(PaletteColor::BLACK));
// Pinta la rejilla
/*for (int i = 0; i < PLAY_AREA_BOTTOM; i += 8)
/*for (int i = 0; i < PlayArea::BOTTOM; i += 8)
{
// Lineas horizontales
surface->drawLine(0, i, PLAY_AREA_RIGHT, i, static_cast<Uint8>(PaletteColor::BRIGHT_BLACK));
surface->drawLine(0, i, PlayArea::RIGHT, i, static_cast<Uint8>(PaletteColor::BRIGHT_BLACK));
}
for (int i = 0; i < PLAY_AREA_RIGHT; i += 8)
for (int i = 0; i < PlayArea::RIGHT; i += 8)
{
// Lineas verticales
surface->drawLine(i, 0, i, PLAY_AREA_BOTTOM - 1, static_cast<Uint8>(PaletteColor::BRIGHT_BLACK));
surface->drawLine(i, 0, i, PlayArea::BOTTOM - 1, static_cast<Uint8>(PaletteColor::BRIGHT_BLACK));
}*/
// Pinta el texto
@@ -509,7 +509,7 @@ void Game::fillRoomNameTexture() {
// Escribe el texto en la textura
auto text = Resource::Cache::get()->getText("smb2");
text->writeDX(Text::CENTER_FLAG | Text::COLOR_FLAG, GAMECANVAS_CENTER_X, text->getCharacterSize() / 2, room_->getName(), 1, room_->getBGColor());
text->writeDX(Text::CENTER_FLAG | Text::COLOR_FLAG, GameCanvas::CENTER_X, text->getCharacterSize() / 2, room_->getName(), 1, room_->getBGColor());
// Deja el renderizador por defecto
Screen::get()->setRendererSurface(previuos_renderer);
@@ -586,7 +586,7 @@ void Game::createRoomNameTexture() {
room_name_surface_ = std::make_shared<Surface>(Options::game.width, text->getCharacterSize() * 2);
// Establece el destino de la textura
room_name_rect_ = {.x = 0.0F, .y = PLAY_AREA_HEIGHT, .w = Options::game.width, .h = text->getCharacterSize() * 2.0F};
room_name_rect_ = {.x = 0.0F, .y = PlayArea::HEIGHT, .w = Options::game.width, .h = text->getCharacterSize() * 2.0F};
}
// Hace sonar la música