diff --git a/source/common/screen.cpp b/source/common/screen.cpp index cf747c7..24811bc 100644 --- a/source/common/screen.cpp +++ b/source/common/screen.cpp @@ -22,8 +22,6 @@ Screen::Screen(SDL_Window *window, SDL_Renderer *renderer, Asset *asset, Input * SDL_GetRendererOutputSize(renderer, &windowWidth, &windowHeight); gameCanvasWidth = options->video.gameWidth; gameCanvasHeight = options->video.gameHeight; - borderWidth = options->video.border.width * 2; - borderHeight = options->video.border.height * 2; dest = {0, 0, 0, 0}; borderColor = {0, 0, 0}; flashEffect.enabled = false; @@ -40,7 +38,11 @@ Screen::Screen(SDL_Window *window, SDL_Renderer *renderer, Asset *asset, Input * fpsTicks = 0; fpsCounter = 0; fps = 0; +#ifdef DEBUG + showFps = true; +#else showFps = false; +#endif // Crea los objetos notify = new Notify(renderer, asset->get("notify.png"), asset->get("8bithud.png"), asset->get("8bithud.txt"), asset->get("notify.wav"), options); @@ -92,7 +94,7 @@ void Screen::blit() // Actualiza el contador de FPS fpsCounter++; - + // Pinta en pantalla el contador de FPS if (showFps) { @@ -147,19 +149,9 @@ void Screen::setVideoMode(int videoMode) // Muestra el puntero SDL_ShowCursor(SDL_ENABLE); - if (options->video.border.enabled) - { - windowWidth = gameCanvasWidth + borderWidth; - windowHeight = gameCanvasHeight + borderHeight; - dest = {0 + (borderWidth / 2), 0 + (borderHeight / 2), gameCanvasWidth, gameCanvasHeight}; - } - - else - { - windowWidth = gameCanvasWidth; - windowHeight = gameCanvasHeight; - dest = {0, 0, gameCanvasWidth, gameCanvasHeight}; - } + windowWidth = gameCanvasWidth; + windowHeight = gameCanvasHeight; + dest = {0, 0, gameCanvasWidth, gameCanvasHeight}; // Modifica el tamaño de la ventana SDL_SetWindowSize(window, windowWidth * options->video.window.size, windowHeight * options->video.window.size); @@ -291,31 +283,6 @@ void Screen::setBlendMode(SDL_BlendMode blendMode) SDL_SetRenderDrawBlendMode(renderer, blendMode); } -// Establece el tamaño del borde -void Screen::setBorderWidth(int s) -{ - options->video.border.width = s; -} - -// Establece el tamaño del borde -void Screen::setBorderHeight(int s) -{ - options->video.border.height = s; -} - -// Establece si se ha de ver el borde en el modo ventana -void Screen::setBorderEnabled(bool value) -{ - options->video.border.enabled = value; -} - -// Cambia entre borde visible y no visible -void Screen::switchBorder() -{ - options->video.border.enabled = !options->video.border.enabled; - setVideoMode(SCREEN_VIDEO_MODE_WINDOW); -} - // Actualiza la lógica de la clase void Screen::update() { diff --git a/source/common/screen.h b/source/common/screen.h index 4cf282c..09e7b26 100644 --- a/source/common/screen.h +++ b/source/common/screen.h @@ -31,8 +31,6 @@ private: int windowHeight; // Alto de la pantalla o ventana int gameCanvasWidth; // Resolución interna del juego. Es el ancho de la textura donde se dibuja el juego int gameCanvasHeight; // Resolución interna del juego. Es el alto de la textura donde se dibuja el juego - int borderWidth; // Anchura del borde - int borderHeight; // Anltura del borde SDL_Rect dest; // Coordenadas donde se va a dibujar la textura del juego sobre la pantalla o ventana color_t borderColor; // Color del borde añadido a la textura de juego para rellenar la pantalla bool attenuateEffect; // Indica si la pantalla ha de estar atenuada @@ -117,16 +115,6 @@ public: // Cambia el tipo de mezcla void setBlendMode(SDL_BlendMode blendMode); - // Establece el tamaño del borde - void setBorderWidth(int s); - void setBorderHeight(int s); - - // Establece si se ha de ver el borde en el modo ventana - void setBorderEnabled(bool value); - - // Cambia entre borde visible y no visible - void switchBorder(); - // Agita la pantalla void shake(); diff --git a/source/common/utils.h b/source/common/utils.h index 355906a..711679e 100644 --- a/source/common/utils.h +++ b/source/common/utils.h @@ -87,14 +87,6 @@ struct demoKeys_t Uint8 fireRight; }; -// Estructura con las opciones para el borde -struct op_border_t -{ - bool enabled; // Indica si ha de mostrar el borde en el modo de ventana - int width; // Cantidad de pixels que se añade en el borde de la ventana - int height; // Cantidad de pixels que se añade en el borde de la ventana -}; - // Estructura para las opciones de la ventana struct op_window_t { @@ -114,7 +106,6 @@ struct op_video_t bool vSync; // Indica si se quiere usar vsync o no bool integerScale; // Indica si el escalado de la imagen ha de ser entero en el modo a pantalla completa bool keepAspect; // Indica si se ha de mantener la relación de aspecto al poner el modo a pantalla completa - op_border_t border; // Opciones para el borde la pantalla de juego bool shaders; // Indica si se van a usar shaders para los filtros de video }; diff --git a/source/director.cpp b/source/director.cpp index fe008c8..9dd0c31 100644 --- a/source/director.cpp +++ b/source/director.cpp @@ -224,14 +224,7 @@ bool Director::initSDL() } #endif // Crea la ventana - int incW = 0; - int incH = 0; - if (options->video.border.enabled) - { - incW = options->video.border.width * 2; - incH = options->video.border.height * 2; - } - window = SDL_CreateWindow(WINDOW_CAPTION, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, (param->gameWidth + incW) * options->video.window.size, (param->gameHeight + incH) * options->video.window.size, SDL_WINDOW_HIDDEN); + window = SDL_CreateWindow(WINDOW_CAPTION, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, param->gameWidth * options->video.window.size, param->gameHeight * options->video.window.size, SDL_WINDOW_HIDDEN); if (window == nullptr) { if (options->console) @@ -463,9 +456,6 @@ void Director::initOptions() options->video.vSync = true; options->video.integerScale = true; options->video.keepAspect = true; - options->video.border.width = 0; - options->video.border.height = 0; - options->video.border.enabled = false; options->video.shaders = true; // Opciones de las notificaciones @@ -694,9 +684,6 @@ bool Director::saveConfigFile() file << "video.vSync=" + boolToString(options->video.vSync) + "\n"; file << "video.integerScale=" + boolToString(options->video.integerScale) + "\n"; file << "video.keepAspect=" + boolToString(options->video.keepAspect) + "\n"; - file << "video.border.enabled=" + boolToString(options->video.border.enabled) + "\n"; - file << "video.border.width=" + std::to_string(options->video.border.width) + "\n"; - file << "video.border.height=" + std::to_string(options->video.border.height) + "\n"; // Opciones de notificaciones file << "\n\n## NOTIFICATION\n"; @@ -975,21 +962,6 @@ bool Director::setOptions(options_t *options, std::string var, std::string value options->video.keepAspect = stringToBool(value); } - else if (var == "video.border.enabled") - { - options->video.border.enabled = stringToBool(value); - } - - else if (var == "video.border.width") - { - options->video.border.width = std::stoi(value); - } - - else if (var == "video.border.height") - { - options->video.border.height = std::stoi(value); - } - // Opciones de notificaciones else if (var == "notification.posH") {