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,16 +1,16 @@
#include "hiscore_table.h"
#include "param.h"
#include "options.h"
#include <iostream>
// Constructor
HiScoreTable::HiScoreTable(Screen *screen, Asset *asset, Input *input, options_t *options, section_t *section, JA_Music_t *music)
HiScoreTable::HiScoreTable(Screen *screen, Asset *asset, Input *input, section_t *section, JA_Music_t *music)
{
// Copia punteros
this->screen = screen;
this->asset = asset;
this->input = input;
this->section = section;
this->options = options;
this->music = music;
renderer = screen->getRenderer();
@@ -118,8 +118,8 @@ void HiScoreTable::fillTexture()
// Escribe los nombres de la tabla de puntuaciones
for (int i = 0; i < maxNames; ++i)
{
const int nameLenght = options->game.hiScoreTable[i].name.length();
const std::string score = format(options->game.hiScoreTable[i].score);
const int nameLenght = options.game.hiScoreTable[i].name.length();
const std::string score = format(options.game.hiScoreTable[i].score);
const int scoreLenght = score.size();
const int numDots = 25 - nameLenght - scoreLenght;
std::string dots = "";
@@ -127,7 +127,7 @@ void HiScoreTable::fillTexture()
{
dots = dots + ".";
}
const std::string line = options->game.hiScoreTable[i].name + dots + score;
const std::string line = options.game.hiScoreTable[i].name + dots + score;
text->writeDX(TXT_CENTER | TXT_SHADOW, param.game.gameArea.centerX, (i * spaceBetweenLines) + firstLine + spaceBetweenHeader, line, 1, orangeColor, 1, shdwTxtColor);
}
@@ -229,10 +229,10 @@ void HiScoreTable::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;
}
}