Retocando las constantes

This commit is contained in:
2022-08-30 14:01:44 +02:00
parent add7e5201a
commit c5728d0849
11 changed files with 124 additions and 533 deletions

View File

@@ -3,15 +3,15 @@
#include <stdio.h>
// Constructor
Screen::Screen(SDL_Window *window, SDL_Renderer *renderer, options_t *options)
Screen::Screen(SDL_Window *window, SDL_Renderer *renderer, options_t *options, int gameInternalResX, int gameInternalResY)
{
// Inicializa variables
this->window = window;
this->renderer = renderer;
this->options = options;
gameCanvasWidth = 256;
gameCanvasHeight = 192;
gameCanvasWidth = gameInternalResX;
gameCanvasHeight = gameInternalResY;
// Establece el modo de video
setVideoMode(options->fullScreenMode);
@@ -24,6 +24,14 @@ Screen::Screen(SDL_Window *window, SDL_Renderer *renderer, options_t *options)
gameCanvas = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, gameCanvasWidth, gameCanvasHeight);
if (gameCanvas == NULL)
printf("TitleSurface could not be created!\nSDL Error: %s\n", SDL_GetError());
// Calcula los anclajes
anchor.left = 0;
anchor.right = gameCanvasWidth;
anchor.center = gameCanvasWidth / 2;
anchor.top = 0;
anchor.bottom = gameCanvasHeight;
anchor.middle = gameCanvasHeight / 2;
}
// Destructor