diff --git a/source/common/notify.cpp b/source/common/notify.cpp index 65b6d67..406ad48 100644 --- a/source/common/notify.cpp +++ b/source/common/notify.cpp @@ -1,6 +1,7 @@ #include "notify.h" #include #include +#include // Constructor Notify::Notify(SDL_Renderer *renderer, std::string bitmapFile, std::string textFile) @@ -36,6 +37,8 @@ void Notify::render() { notifications.at(i).sprite->render(); } + + text->write(8,8,"TEXTO DE PRUEBA"); } // Actualiza el estado de las notificaiones @@ -114,7 +117,6 @@ void Notify::showText(std::string text) const int despH = this->text->getCharacterSize() / 2; const int despV = despH; const int travelDist = height + despV; - // const int offset = (int)notifications.size() * (travelDist) + despV; const int offset = (int)notifications.size() > 0 ? notifications.back().y + travelDist : despV; // Crea la notificacion @@ -142,6 +144,12 @@ void Notify::showText(std::string text) // Añade la notificación a la lista notifications.push_back(n); + + //std::cout << "Notification " << notifications.size() << std::endl; + //std::cout << "width " << width << std::endl; + //std::cout << "height " << height << std::endl; + //std::cout << "offset " << offset << std::endl; + //std::cout << "desp " << despH << std::endl; } // Indica si hay notificaciones activas diff --git a/source/common/screen.cpp b/source/common/screen.cpp index a1c37f2..1ae37c5 100644 --- a/source/common/screen.cpp +++ b/source/common/screen.cpp @@ -72,7 +72,7 @@ void Screen::blit() SDL_RenderCopy(renderer, gameCanvas, nullptr, &dest); // Dibuja las notificaciones - //renderNotifications(); + renderNotifications(); // Muestra por pantalla el renderizador SDL_RenderPresent(renderer); @@ -356,12 +356,12 @@ void Screen::showText(std::string text) // Dibuja las notificaciones void Screen::renderNotifications() { - // if (!notifyActive) - // { - // return; - // } + //if (!notifyActive) + //{ + // return; + //} - SDL_RenderSetLogicalSize(renderer, windowWidth, windowHeight); + //SDL_RenderSetLogicalSize(renderer, windowWidth * options->windowSize, windowHeight * options->windowSize); notify->render(); - SDL_RenderSetLogicalSize(renderer, gameCanvasWidth, gameCanvasHeight); + //SDL_RenderSetLogicalSize(renderer, windowWidth, windowHeight); } \ No newline at end of file diff --git a/source/game.cpp b/source/game.cpp index 6e7f57a..709ac9f 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -21,9 +21,9 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *as this->options = options; #ifdef DEBUG - currentRoom = "48.room"; - const int x1 = 18; - const int y1 = 13; + currentRoom = "02.room"; + const int x1 = 20; + const int y1 = 6; spawnPoint = {x1 * 8, y1 * 8, 0, 0, 0, s_standing, SDL_FLIP_HORIZONTAL}; #endif diff --git a/source/player.cpp b/source/player.cpp index cebee85..d18f6cc 100644 --- a/source/player.cpp +++ b/source/player.cpp @@ -823,6 +823,8 @@ void Player::setState(state_e value) { prevState = state; state = value; + + checkState(); } // Comprueba si el jugador esta vivo diff --git a/source/stats.cpp b/source/stats.cpp index 6596f95..8fcceb6 100644 --- a/source/stats.cpp +++ b/source/stats.cpp @@ -14,7 +14,9 @@ Stats::Stats(std::string file) // Destructor Stats::~Stats() { +#ifndef DEBUG saveToFile(); +#endif list.clear(); } diff --git a/source/title.cpp b/source/title.cpp index 45ce59c..ec15f7d 100644 --- a/source/title.cpp +++ b/source/title.cpp @@ -115,6 +115,12 @@ void Title::checkEventHandler() switchPalette(); break; +#ifdef DEBUG + case SDL_SCANCODE_F6: + screen->showText("MAMA MIRA! SIN MANOS!"); + break; +#endif + default: break; }