Modificado debug.txt

This commit is contained in:
2022-08-30 20:41:58 +02:00
parent a5c983df9d
commit 4674c3dab2
2 changed files with 107 additions and 106 deletions

View File

@@ -184,47 +184,48 @@ void Game::renderDebugInfo()
}
// Pinta el texto
const int inc = debugText->getCharacterWidth() + 1;
int line = 0;
std::string text = "";
text = "R - Reload player and map";
debugText->write(1, 210, text, -1);
debugText->write(1, 210, text);
text = "D - Toggle debug mode";
debugText->write(1, 216, text, -1);
debugText->write(1, 216, text);
text = std::to_string((int)player->sprite->getPosX()) + "," + std::to_string((int)player->sprite->getPosY()) + "," + std::to_string((int)player->sprite->getWidth()) + "," + std::to_string((int)player->sprite->getHeight());
debugText->write(0, line, text, -1);
debugText->write(0, line, text);
text = "VY " + std::to_string(player->vy) + " " + std::to_string(player->jumpStrenght);
debugText->write(0, line += 6, text, -1);
debugText->write(0, line += inc, text);
text = "VX " + std::to_string(player->vx);
debugText->write(0, line += 6, text, -1);
debugText->write(0, line += inc, text);
text = "jump_pressed " + std::to_string(player->jumpPressed);
debugText->write(0, line += 6, text, -1);
debugText->write(0, line += inc, text);
text = "isOnFloor " + std::to_string(player->isOnFloor());
debugText->write(0, line += 6, text, -1);
debugText->write(0, line += inc, text);
const std::string foot_x = std::to_string(player->underFeet[0].x);
const std::string foot_y = std::to_string(player->underFeet[0].y);
const std::string gettile = std::to_string(player->map->getTile(player->underFeet[0]));
text = "getTile(" + foot_x + "," + foot_y + ") = " + gettile;
debugText->write(0, line += 6, text, -1);
debugText->write(0, line += inc, text);
text = "state " + std::to_string(player->state);
debugText->write(0, line += 6, text, -1);
debugText->write(0, line += inc, text);
text = map->getName() + " (" + map->getRoomFileName(b_top) + ", " + map->getRoomFileName(b_right) + ", " + map->getRoomFileName(b_bottom) + ", " + map->getRoomFileName(b_left) + ")";
debugText->write(0, line += 6, text, -1);
debugText->write(0, line += inc, text);
text = "hookedOn = " + std::to_string(player->hookedOnMovingPlatform);
debugText->write(0, line += 6, text, -1);
debugText->write(0, line += inc, text);
text = "DIAMONDS = " + std::to_string(player->diamonds);
debugText->write(0, line += 6, text, -1);
debugText->write(0, line += inc, text);
// Pinta mascaras
SDL_SetRenderDrawColor(renderer, 0, 255, 0, 128);