millorada una mica la classe Debug en quant a mostrar info

This commit is contained in:
2026-03-28 21:58:54 +01:00
parent a21f530dd4
commit 9282d661aa
6 changed files with 79 additions and 50 deletions

View File

@@ -79,25 +79,25 @@ auto CollisionMap::getSlopeHeight(SDL_FPoint p, Tile slope) -> int {
// Calcula la base del tile
int base = ((p.y / TILE_SIZE) * TILE_SIZE) + TILE_SIZE;
#ifdef _DEBUG
Debug::get()->add("BASE = " + std::to_string(base));
Debug::get()->set("slope.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
Debug::get()->add("POS = " + std::to_string(POS));
Debug::get()->set("slope.POS", std::to_string(POS));
#endif
// Se resta a la base la cantidad de pixeles pos en funcion de la rampa
if (slope == Tile::SLOPE_R) {
base -= POS + 1;
#ifdef _DEBUG
Debug::get()->add("BASE_R = " + std::to_string(base));
Debug::get()->set("slope.result", "BASE_R=" + std::to_string(base));
#endif
} else {
base -= (TILE_SIZE - POS);
#ifdef _DEBUG
Debug::get()->add("BASE_L = " + std::to_string(base));
Debug::get()->set("slope.result", "BASE_L=" + std::to_string(base));
#endif
}