millorada una mica la classe Debug en quant a mostrar info
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user