Añadido el cambio de borde, tamaño de ventana y paleta a todas las secciones del juego
This commit is contained in:
@@ -29,35 +29,6 @@ Credits::Credits(SDL_Renderer *renderer, Screen *screen, Resource *resource, Ass
|
|||||||
// Cambia el color del borde
|
// Cambia el color del borde
|
||||||
screen->setBorderColor(stringToColor(options->palette, "black"));
|
screen->setBorderColor(stringToColor(options->palette, "black"));
|
||||||
|
|
||||||
// Inicializa los textos
|
|
||||||
texts.push_back({"", stringToColor(options->palette, "white")});
|
|
||||||
texts.push_back({"INSTRUCTIONS:", stringToColor(options->palette, "yellow")});
|
|
||||||
texts.push_back({"", stringToColor(options->palette, "white")});
|
|
||||||
texts.push_back({"HELP JAILDOC TO GET BACK ALL HIS", stringToColor(options->palette, "white")});
|
|
||||||
texts.push_back({"PROJECTS AND GO TO THE JAIL TO", stringToColor(options->palette, "white")});
|
|
||||||
texts.push_back({"FINISH THEM", stringToColor(options->palette, "white")});
|
|
||||||
texts.push_back({"", stringToColor(options->palette, "white")});
|
|
||||||
texts.push_back({"", stringToColor(options->palette, "white")});
|
|
||||||
|
|
||||||
texts.push_back({"KEYS:", stringToColor(options->palette, "yellow")});
|
|
||||||
texts.push_back({"", stringToColor(options->palette, "white")});
|
|
||||||
texts.push_back({"USE 'CURSORS' TO MOVE AND JUMP", stringToColor(options->palette, "white")});
|
|
||||||
texts.push_back({"'F1-F4' TO CHANGE WINDOWS SIZE", stringToColor(options->palette, "white")});
|
|
||||||
texts.push_back({"'F' TO SWITCH TO FULLSCREEN", stringToColor(options->palette, "white")});
|
|
||||||
texts.push_back({"'B' TO SWITCH THE BORDER SCREEN", stringToColor(options->palette, "white")});
|
|
||||||
texts.push_back({"'M' TO TURN ON/OFF THE MUSIC", stringToColor(options->palette, "white")});
|
|
||||||
texts.push_back({"'ESC' TO LEAVE THE GAME", stringToColor(options->palette, "white")});
|
|
||||||
texts.push_back({"", stringToColor(options->palette, "white")});
|
|
||||||
texts.push_back({"", stringToColor(options->palette, "white")});
|
|
||||||
|
|
||||||
texts.push_back({"A GAME BY JAILDESIGNER", stringToColor(options->palette, "yellow")});
|
|
||||||
texts.push_back({"MADE ON SUMMER/FALL 2022", stringToColor(options->palette, "yellow")});
|
|
||||||
texts.push_back({"", stringToColor(options->palette, "white")});
|
|
||||||
texts.push_back({"", stringToColor(options->palette, "white")});
|
|
||||||
|
|
||||||
texts.push_back({"I LOVE JAILGAMES! ", stringToColor(options->palette, "white")});
|
|
||||||
texts.push_back({"", stringToColor(options->palette, "white")});
|
|
||||||
|
|
||||||
// Crea la textura para el texto que se escribe en pantalla
|
// Crea la textura para el texto que se escribe en pantalla
|
||||||
textTexture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, GAMECANVAS_WIDTH, GAMECANVAS_HEIGHT);
|
textTexture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, GAMECANVAS_WIDTH, GAMECANVAS_HEIGHT);
|
||||||
if (textTexture == nullptr)
|
if (textTexture == nullptr)
|
||||||
@@ -101,8 +72,8 @@ void Credits::checkEventHandler()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Comprueba si se ha pulsado alguna tecla
|
// Comprueba las teclas que se han pulsado
|
||||||
else if ((eventHandler->type == SDL_KEYDOWN) and (eventHandler->key.repeat == 0))
|
if ((eventHandler->type == SDL_KEYDOWN && eventHandler->key.repeat == 0) || (eventHandler->type == SDL_JOYBUTTONDOWN))
|
||||||
{
|
{
|
||||||
switch (eventHandler->key.keysym.scancode)
|
switch (eventHandler->key.keysym.scancode)
|
||||||
{
|
{
|
||||||
@@ -110,6 +81,40 @@ void Credits::checkEventHandler()
|
|||||||
section.name = SECTION_PROG_QUIT;
|
section.name = SECTION_PROG_QUIT;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SDL_SCANCODE_B:
|
||||||
|
screen->switchBorder();
|
||||||
|
resource->reLoadTextures();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SDL_SCANCODE_F:
|
||||||
|
screen->switchVideoMode();
|
||||||
|
resource->reLoadTextures();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SDL_SCANCODE_F1:
|
||||||
|
screen->setWindowSize(1);
|
||||||
|
resource->reLoadTextures();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SDL_SCANCODE_F2:
|
||||||
|
screen->setWindowSize(2);
|
||||||
|
resource->reLoadTextures();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SDL_SCANCODE_F3:
|
||||||
|
screen->setWindowSize(3);
|
||||||
|
resource->reLoadTextures();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SDL_SCANCODE_F4:
|
||||||
|
screen->setWindowSize(4);
|
||||||
|
resource->reLoadTextures();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SDL_SCANCODE_F5:
|
||||||
|
switchPalette();
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
section.name = SECTION_PROG_TITLE;
|
section.name = SECTION_PROG_TITLE;
|
||||||
section.subsection = 0;
|
section.subsection = 0;
|
||||||
@@ -122,6 +127,36 @@ void Credits::checkEventHandler()
|
|||||||
// Escribe el texto en la textura
|
// Escribe el texto en la textura
|
||||||
void Credits::fillTexture()
|
void Credits::fillTexture()
|
||||||
{
|
{
|
||||||
|
// Inicializa los textos
|
||||||
|
texts.clear();
|
||||||
|
texts.push_back({"", stringToColor(options->palette, "white")});
|
||||||
|
texts.push_back({"INSTRUCTIONS:", stringToColor(options->palette, "yellow")});
|
||||||
|
texts.push_back({"", stringToColor(options->palette, "white")});
|
||||||
|
texts.push_back({"HELP JAILDOC TO GET BACK ALL HIS", stringToColor(options->palette, "white")});
|
||||||
|
texts.push_back({"PROJECTS AND GO TO THE JAIL TO", stringToColor(options->palette, "white")});
|
||||||
|
texts.push_back({"FINISH THEM", stringToColor(options->palette, "white")});
|
||||||
|
texts.push_back({"", stringToColor(options->palette, "white")});
|
||||||
|
texts.push_back({"", stringToColor(options->palette, "white")});
|
||||||
|
|
||||||
|
texts.push_back({"KEYS:", stringToColor(options->palette, "yellow")});
|
||||||
|
texts.push_back({"", stringToColor(options->palette, "white")});
|
||||||
|
texts.push_back({"USE 'CURSORS' TO MOVE AND JUMP", stringToColor(options->palette, "white")});
|
||||||
|
texts.push_back({"'F1-F4' TO CHANGE WINDOWS SIZE", stringToColor(options->palette, "white")});
|
||||||
|
texts.push_back({"'F' TO SWITCH TO FULLSCREEN", stringToColor(options->palette, "white")});
|
||||||
|
texts.push_back({"'B' TO SWITCH THE BORDER SCREEN", stringToColor(options->palette, "white")});
|
||||||
|
texts.push_back({"'M' TO TURN ON/OFF THE MUSIC", stringToColor(options->palette, "white")});
|
||||||
|
texts.push_back({"'ESC' TO LEAVE THE GAME", stringToColor(options->palette, "white")});
|
||||||
|
texts.push_back({"", stringToColor(options->palette, "white")});
|
||||||
|
texts.push_back({"", stringToColor(options->palette, "white")});
|
||||||
|
|
||||||
|
texts.push_back({"A GAME BY JAILDESIGNER", stringToColor(options->palette, "yellow")});
|
||||||
|
texts.push_back({"MADE ON SUMMER/FALL 2022", stringToColor(options->palette, "yellow")});
|
||||||
|
texts.push_back({"", stringToColor(options->palette, "white")});
|
||||||
|
texts.push_back({"", stringToColor(options->palette, "white")});
|
||||||
|
|
||||||
|
texts.push_back({"I LOVE JAILGAMES! ", stringToColor(options->palette, "white")});
|
||||||
|
texts.push_back({"", stringToColor(options->palette, "white")});
|
||||||
|
|
||||||
// Rellena la textura de texto
|
// Rellena la textura de texto
|
||||||
SDL_SetRenderTarget(renderer, textTexture);
|
SDL_SetRenderTarget(renderer, textTexture);
|
||||||
const color_t c = stringToColor(options->palette, "black");
|
const color_t c = stringToColor(options->palette, "black");
|
||||||
@@ -266,4 +301,19 @@ section_t Credits::run()
|
|||||||
}
|
}
|
||||||
|
|
||||||
return section;
|
return section;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cambia la paleta
|
||||||
|
void Credits::switchPalette()
|
||||||
|
{
|
||||||
|
if (options->palette == p_zxspectrum)
|
||||||
|
{
|
||||||
|
options->palette = p_zxarne;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
options->palette = p_zxspectrum;
|
||||||
|
}
|
||||||
|
|
||||||
|
fillTexture();
|
||||||
}
|
}
|
||||||
@@ -62,6 +62,9 @@ private:
|
|||||||
// Escribe el texto en la textura
|
// Escribe el texto en la textura
|
||||||
void fillTexture();
|
void fillTexture();
|
||||||
|
|
||||||
|
// Cambia la paleta
|
||||||
|
void switchPalette();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
Credits(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *asset, options_t *options);
|
Credits(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *asset, options_t *options);
|
||||||
|
|||||||
@@ -68,42 +68,53 @@ void Demo::checkEventHandler()
|
|||||||
screen->setBorderColor(stringToColor(options->palette, "black"));
|
screen->setBorderColor(stringToColor(options->palette, "black"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if ((eventHandler->type == SDL_KEYDOWN) and (eventHandler->key.repeat == 0))
|
|
||||||
|
// Comprueba las teclas que se han pulsado
|
||||||
|
if ((eventHandler->type == SDL_KEYDOWN && eventHandler->key.repeat == 0) || (eventHandler->type == SDL_JOYBUTTONDOWN))
|
||||||
{
|
{
|
||||||
switch (eventHandler->key.keysym.scancode)
|
switch (eventHandler->key.keysym.scancode)
|
||||||
{
|
{
|
||||||
|
case SDL_SCANCODE_ESCAPE:
|
||||||
|
section.name = SECTION_PROG_QUIT;
|
||||||
|
break;
|
||||||
|
|
||||||
case SDL_SCANCODE_B:
|
case SDL_SCANCODE_B:
|
||||||
screen->switchBorder();
|
screen->switchBorder();
|
||||||
reLoadTextures();
|
resource->reLoadTextures();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_SCANCODE_F:
|
case SDL_SCANCODE_F:
|
||||||
screen->switchVideoMode();
|
screen->switchVideoMode();
|
||||||
reLoadTextures();
|
resource->reLoadTextures();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_SCANCODE_F1:
|
case SDL_SCANCODE_F1:
|
||||||
screen->setWindowSize(1);
|
screen->setWindowSize(1);
|
||||||
reLoadTextures();
|
resource->reLoadTextures();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_SCANCODE_F2:
|
case SDL_SCANCODE_F2:
|
||||||
screen->setWindowSize(2);
|
screen->setWindowSize(2);
|
||||||
reLoadTextures();
|
resource->reLoadTextures();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_SCANCODE_F3:
|
case SDL_SCANCODE_F3:
|
||||||
screen->setWindowSize(3);
|
screen->setWindowSize(3);
|
||||||
reLoadTextures();
|
resource->reLoadTextures();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_SCANCODE_F4:
|
case SDL_SCANCODE_F4:
|
||||||
screen->setWindowSize(4);
|
screen->setWindowSize(4);
|
||||||
reLoadTextures();
|
resource->reLoadTextures();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SDL_SCANCODE_F5:
|
||||||
|
switchPalette();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
section.name = SECTION_PROG_TITLE;
|
section.name = SECTION_PROG_TITLE;
|
||||||
|
section.subsection = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -180,6 +191,26 @@ void Demo::reLoadTextures()
|
|||||||
text->reLoadTexture();
|
text->reLoadTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Cambia la paleta
|
||||||
|
void Demo::switchPalette()
|
||||||
|
{
|
||||||
|
// Modifica la variable
|
||||||
|
if (options->palette == p_zxspectrum)
|
||||||
|
{
|
||||||
|
options->palette = p_zxarne;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
options->palette = p_zxspectrum;
|
||||||
|
}
|
||||||
|
|
||||||
|
room->reLoadPalette();
|
||||||
|
scoreboard->reLoadPalette();
|
||||||
|
|
||||||
|
const color_t c = room->getBorderColor();
|
||||||
|
board.color = (c.r + c.g + c.b == 0) ? stringToColor(options->palette, "white") : c; // Si el color es negro lo cambia a blanco
|
||||||
|
}
|
||||||
|
|
||||||
// Cambia de habitación
|
// Cambia de habitación
|
||||||
bool Demo::changeRoom(std::string file)
|
bool Demo::changeRoom(std::string file)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -60,6 +60,9 @@ private:
|
|||||||
// Recarga todas las texturas
|
// Recarga todas las texturas
|
||||||
void reLoadTextures();
|
void reLoadTextures();
|
||||||
|
|
||||||
|
// Cambia la paleta
|
||||||
|
void switchPalette();
|
||||||
|
|
||||||
// Cambia de habitación
|
// Cambia de habitación
|
||||||
bool changeRoom(std::string file);
|
bool changeRoom(std::string file);
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Director::Director(std::string path)
|
|||||||
section.name = SECTION_PROG_LOGO;
|
section.name = SECTION_PROG_LOGO;
|
||||||
section.subsection = SUBSECTION_LOGO_TO_INTRO;
|
section.subsection = SUBSECTION_LOGO_TO_INTRO;
|
||||||
|
|
||||||
section.name = SECTION_PROG_TITLE;
|
section.name = SECTION_PROG_LOGO;
|
||||||
|
|
||||||
// Crea el objeto que controla los ficheros de recursos
|
// Crea el objeto que controla los ficheros de recursos
|
||||||
asset = new Asset(path.substr(0, path.find_last_of("\\/")));
|
asset = new Asset(path.substr(0, path.find_last_of("\\/")));
|
||||||
|
|||||||
@@ -87,7 +87,8 @@ void Game::checkEventHandler()
|
|||||||
screen->setBorderColor(stringToColor(options->palette, "black"));
|
screen->setBorderColor(stringToColor(options->palette, "black"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if ((eventHandler->type == SDL_KEYDOWN) and (eventHandler->key.repeat == 0))
|
|
||||||
|
if ((eventHandler->type == SDL_KEYDOWN) and (eventHandler->key.repeat == 0))
|
||||||
{
|
{
|
||||||
switch (eventHandler->key.keysym.scancode)
|
switch (eventHandler->key.keysym.scancode)
|
||||||
{
|
{
|
||||||
@@ -420,6 +421,10 @@ void Game::switchPalette()
|
|||||||
|
|
||||||
room->reLoadPalette();
|
room->reLoadPalette();
|
||||||
player->reLoadPalette();
|
player->reLoadPalette();
|
||||||
|
scoreboard->reLoadPalette();
|
||||||
|
|
||||||
|
const color_t c = room->getBorderColor();
|
||||||
|
board.color = (c.r + c.g + c.b == 0) ? stringToColor(options->palette, "white") : c; // Si el color es negro lo cambia a blanco
|
||||||
}
|
}
|
||||||
|
|
||||||
// Establece la pantalla en negro
|
// Establece la pantalla en negro
|
||||||
|
|||||||
@@ -94,11 +94,15 @@ void Intro::checkEventHandler()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cualquier tecla pulsada
|
// Comprueba las teclas que se han pulsado
|
||||||
if ((eventHandler->type == SDL_KEYDOWN) || (eventHandler->type == SDL_JOYBUTTONDOWN))
|
if ((eventHandler->type == SDL_KEYDOWN && eventHandler->key.repeat == 0) || (eventHandler->type == SDL_JOYBUTTONDOWN))
|
||||||
{
|
{
|
||||||
switch (eventHandler->key.keysym.scancode)
|
switch (eventHandler->key.keysym.scancode)
|
||||||
{
|
{
|
||||||
|
case SDL_SCANCODE_ESCAPE:
|
||||||
|
section.name = SECTION_PROG_QUIT;
|
||||||
|
break;
|
||||||
|
|
||||||
case SDL_SCANCODE_B:
|
case SDL_SCANCODE_B:
|
||||||
screen->switchBorder();
|
screen->switchBorder();
|
||||||
resource->reLoadTextures();
|
resource->reLoadTextures();
|
||||||
@@ -135,6 +139,7 @@ void Intro::checkEventHandler()
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
section.name = SECTION_PROG_TITLE;
|
section.name = SECTION_PROG_TITLE;
|
||||||
|
section.subsection = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -293,13 +298,13 @@ void Intro::switchPalette()
|
|||||||
if (options->palette == p_zxspectrum)
|
if (options->palette == p_zxspectrum)
|
||||||
{
|
{
|
||||||
options->palette = p_zxarne;
|
options->palette = p_zxarne;
|
||||||
loadingScreenTexture1 = resource->getTexture("loading_screen_bn_zxarne.png");
|
sprite1->setTexture(resource->getTexture("loading_screen_bn_zxarne.png"));
|
||||||
loadingScreenTexture2 = resource->getTexture("loading_screen_color_zxarne.png");
|
sprite2->setTexture(resource->getTexture("loading_screen_color_zxarne.png"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
options->palette = p_zxspectrum;
|
options->palette = p_zxspectrum;
|
||||||
loadingScreenTexture1 = resource->getTexture("loading_screen_bn.png");
|
sprite1->setTexture(resource->getTexture("loading_screen_bn.png"));
|
||||||
loadingScreenTexture2 = resource->getTexture("loading_screen_color.png");
|
sprite2->setTexture(resource->getTexture("loading_screen_color.png"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "logo.h"
|
#include "logo.h"
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
Logo::Logo(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *asset, options_t *options, int subsection)
|
Logo::Logo(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *asset, options_t *options, int subsection)
|
||||||
@@ -78,12 +79,13 @@ void Logo::checkEventHandler()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cualquier tecla pulsada
|
// Comprueba las teclas que se han pulsado
|
||||||
if ((eventHandler->type == SDL_KEYDOWN) || (eventHandler->type == SDL_JOYBUTTONDOWN))
|
if ((eventHandler->type == SDL_KEYDOWN && eventHandler->key.repeat == 0) || (eventHandler->type == SDL_JOYBUTTONDOWN))
|
||||||
{
|
{
|
||||||
switch (eventHandler->key.keysym.scancode)
|
switch (eventHandler->key.keysym.scancode)
|
||||||
{
|
{
|
||||||
case SDL_SCANCODE_ESCAPE:
|
case SDL_SCANCODE_ESCAPE:
|
||||||
|
std::cout << "PULSADO ESCAPE" << std::endl;
|
||||||
section.name = SECTION_PROG_QUIT;
|
section.name = SECTION_PROG_QUIT;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,11 @@ void ScoreBoard::reLoadTexture()
|
|||||||
playerTexture->reLoad();
|
playerTexture->reLoad();
|
||||||
itemTexture->reLoad();
|
itemTexture->reLoad();
|
||||||
text->reLoadTexture();
|
text->reLoadTexture();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Recarga la paleta
|
||||||
|
void ScoreBoard::reLoadPalette()
|
||||||
|
{
|
||||||
// Reinicia el vector de colores
|
// Reinicia el vector de colores
|
||||||
const std::vector<std::string> vColors = {"blue", "magenta", "green", "cyan", "yellow", "white", "bright_blue", "bright_magenta", "bright_green", "bright_cyan", "bright_yellow", "bright_white"};
|
const std::vector<std::string> vColors = {"blue", "magenta", "green", "cyan", "yellow", "white", "bright_blue", "bright_magenta", "bright_green", "bright_cyan", "bright_yellow", "bright_white"};
|
||||||
color.clear();
|
color.clear();
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ private:
|
|||||||
Texture *playerTexture; // Textura con los graficos para las vidas
|
Texture *playerTexture; // Textura con los graficos para las vidas
|
||||||
AnimatedSprite *sprite; // Sprite para mostrar las vidas en el marcador
|
AnimatedSprite *sprite; // Sprite para mostrar las vidas en el marcador
|
||||||
SDL_Renderer *renderer; // El renderizador de la ventana
|
SDL_Renderer *renderer; // El renderizador de la ventana
|
||||||
Resource *resource; // Objeto con los recursos
|
Resource *resource; // Objeto con los recursos
|
||||||
Asset *asset; // Objeto con la ruta a todos los ficheros de recursos
|
Asset *asset; // Objeto con la ruta a todos los ficheros de recursos
|
||||||
Text *text; // Objeto para escribir texto
|
Text *text; // Objeto para escribir texto
|
||||||
Texture *itemTexture; // Textura con los graficos para las vidas
|
Texture *itemTexture; // Textura con los graficos para las vidas
|
||||||
@@ -72,6 +72,9 @@ public:
|
|||||||
// Recarga la textura
|
// Recarga la textura
|
||||||
void reLoadTexture();
|
void reLoadTexture();
|
||||||
|
|
||||||
|
// Recarga la paleta
|
||||||
|
void reLoadPalette();
|
||||||
|
|
||||||
// Pone el marcador en modo pausa
|
// Pone el marcador en modo pausa
|
||||||
void pause();
|
void pause();
|
||||||
|
|
||||||
|
|||||||
@@ -66,8 +66,8 @@ void Title::checkEventHandler()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Comprueba si se ha pulsado alguna tecla
|
// Comprueba las teclas que se han pulsado
|
||||||
else if ((eventHandler->type == SDL_KEYDOWN) and (eventHandler->key.repeat == 0))
|
if ((eventHandler->type == SDL_KEYDOWN && eventHandler->key.repeat == 0) || (eventHandler->type == SDL_JOYBUTTONDOWN))
|
||||||
{
|
{
|
||||||
switch (eventHandler->key.keysym.scancode)
|
switch (eventHandler->key.keysym.scancode)
|
||||||
{
|
{
|
||||||
@@ -82,32 +82,31 @@ void Title::checkEventHandler()
|
|||||||
|
|
||||||
case SDL_SCANCODE_F:
|
case SDL_SCANCODE_F:
|
||||||
screen->switchVideoMode();
|
screen->switchVideoMode();
|
||||||
//reLoadTextures();
|
resource->reLoadTextures();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_SCANCODE_F1:
|
case SDL_SCANCODE_F1:
|
||||||
screen->setWindowSize(1);
|
screen->setWindowSize(1);
|
||||||
//reLoadTextures();
|
resource->reLoadTextures();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_SCANCODE_F2:
|
case SDL_SCANCODE_F2:
|
||||||
screen->setWindowSize(2);
|
screen->setWindowSize(2);
|
||||||
//reLoadTextures();
|
resource->reLoadTextures();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_SCANCODE_F3:
|
case SDL_SCANCODE_F3:
|
||||||
screen->setWindowSize(3);
|
screen->setWindowSize(3);
|
||||||
//reLoadTextures();
|
resource->reLoadTextures();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_SCANCODE_F4:
|
case SDL_SCANCODE_F4:
|
||||||
screen->setWindowSize(4);
|
screen->setWindowSize(4);
|
||||||
//reLoadTextures();
|
resource->reLoadTextures();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_SCANCODE_F5:
|
case SDL_SCANCODE_F5:
|
||||||
switchPalette();
|
switchPalette();
|
||||||
// reLoadTextures();
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user