Un altre punteret a pendre per cul: options

This commit is contained in:
2024-09-27 19:00:09 +02:00
parent 0de9188547
commit 20de9e4b72
26 changed files with 677 additions and 679 deletions

View File

@@ -1,14 +1,14 @@
#include "title.h"
#include "param.h"
#include "options.h"
// Constructor
Title::Title(Screen *screen, Asset *asset, Input *input, options_t *options, section_t *section, JA_Music_t *music)
Title::Title(Screen *screen, Asset *asset, Input *input, section_t *section, JA_Music_t *music)
{
// Copia las direcciones de los punteros y objetos
this->screen = screen;
this->input = input;
this->asset = asset;
this->options = options;
this->section = section;
this->music = music;
SDL_Renderer *renderer = screen->getRenderer();
@@ -30,7 +30,7 @@ Title::Title(Screen *screen, Asset *asset, Input *input, options_t *options, sec
gameLogo = new GameLogo(renderer, screen, asset, param.game.gameArea.centerX, param.title.titleCCPosition);
gameLogo->enable();
defineButtons = new DefineButtons(input, text2, options, section);
defineButtons = new DefineButtons(input, text2, section);
// Inicializa los valores
init();
@@ -261,7 +261,7 @@ void Title::checkInput()
if (section->options == SECTION_OPTIONS_TITLE_2 || ALLOW_TITLE_ANIMATION_SKIP)
{
fade->activate();
postFade = options->controller[0].playerId;
postFade = options.controller[0].playerId;
}
}
@@ -290,10 +290,10 @@ void Title::checkInput()
// Comprueba si se va a activar o desactivar el audio
if (input->checkModInput(input_service, input_mute, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_GAMECONTROLLER, i))
{
options->audio.sound.enabled = options->audio.music.enabled = !options->audio.music.enabled;
JA_EnableMusic(options->audio.music.enabled);
JA_EnableSound(options->audio.sound.enabled);
screen->showNotification("Audio " + boolToOnOff(options->audio.music.enabled));
options.audio.sound.enabled = options.audio.music.enabled = !options.audio.music.enabled;
JA_EnableMusic(options.audio.music.enabled);
JA_EnableSound(options.audio.sound.enabled);
screen->showNotification("Audio " + boolToOnOff(options.audio.music.enabled));
return;
}
@@ -317,7 +317,7 @@ void Title::checkInput()
if (section->options == SECTION_OPTIONS_TITLE_2 || ALLOW_TITLE_ANIMATION_SKIP)
{
fade->activate();
postFade = options->controller[i].playerId;
postFade = options.controller[i].playerId;
return;
}
}
@@ -379,16 +379,16 @@ void Title::swapControllers()
// Obtiene para cada jugador el índice del mando correspondiente
for (int i = 0; i < MAX_CONTROLLERS; ++i)
{
playerControllerIndex[options->controller[i].playerId - 1] = i;
playerControllerIndex[options.controller[i].playerId - 1] = i;
}
// Genera el texto correspondiente
for (int i = 0; i < MAX_CONTROLLERS; ++i)
{
const int index = playerControllerIndex[i];
if (options->controller[index].name != "NO NAME")
if (options.controller[index].name != "NO NAME")
{
text[i] = "Jugador " + std::to_string(i + 1) + ": " + options->controller[index].name;
text[i] = "Jugador " + std::to_string(i + 1) + ": " + options.controller[index].name;
}
}