migracio de Title a time based

This commit is contained in:
2025-10-26 23:07:08 +01:00
parent fc17131455
commit 87370dd11d
12 changed files with 150 additions and 134 deletions

View File

@@ -378,7 +378,7 @@ void Room::fillMapTexture() {
}
}
#ifdef DEBUG
#ifdef _DEBUG
if (Debug::get()->getEnabled()) {
auto surface = Screen::get()->getRendererSurface();
@@ -432,7 +432,7 @@ void Room::fillMapTexture() {
}
}
#endif // DEBUG
#endif // _DEBUG
Screen::get()->setRendererSurface(previuos_renderer);
}
@@ -443,7 +443,7 @@ void Room::renderMap() {
map_surface_->render(nullptr, &dest);
// Dibuja los tiles animados
#ifdef DEBUG
#ifdef _DEBUG
if (!Debug::get()->getEnabled()) {
renderAnimatedTiles();
}
@@ -591,25 +591,25 @@ bool Room::itemCollision(SDL_FRect& rect) {
int Room::getSlopeHeight(SDL_FPoint p, TileType slope) {
// Calcula la base del tile
int base = ((p.y / TILE_SIZE_) * TILE_SIZE_) + TILE_SIZE_;
#ifdef DEBUG
#ifdef _DEBUG
Debug::get()->add("BASE = " + std::to_string(base));
#endif
// Calcula cuanto se ha entrado en el tile horizontalmente
const int pos = (static_cast<int>(p.x) % TILE_SIZE_); // Esto da un valor entre 0 y 7
#ifdef DEBUG
#ifdef _DEBUG
Debug::get()->add("POS = " + std::to_string(pos));
#endif
// Se resta a la base la cantidad de pixeles pos en funcion de la rampa
if (slope == TileType::SLOPE_R) {
base -= pos + 1;
#ifdef DEBUG
#ifdef _DEBUG
Debug::get()->add("BASE_R = " + std::to_string(base));
#endif
} else {
base -= (TILE_SIZE_ - pos);
#ifdef DEBUG
#ifdef _DEBUG
Debug::get()->add("BASE_L = " + std::to_string(base));
#endif
}