Eliminado todo el código para añadir un borde a la zona de juego. Eran restos del código del JDD
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user