neteja tidy a source/game (fixes d'arrel: BulletKind enum class, signatures, branches)
This commit is contained in:
@@ -43,7 +43,7 @@ Instructions::Instructions(SDL_Renderer *renderer, section_t *section) {
|
||||
if (backbuffer != nullptr) {
|
||||
SDL_SetTextureScaleMode(backbuffer, Texture::currentScaleMode);
|
||||
} else {
|
||||
std::cout << "Error: textTexture could not be created!\nSDL Error: " << SDL_GetError() << std::endl;
|
||||
std::cout << "Error: textTexture could not be created!\nSDL Error: " << SDL_GetError() << '\n';
|
||||
}
|
||||
|
||||
// Inicializa variables
|
||||
@@ -197,7 +197,7 @@ void Instructions::render() {
|
||||
void Instructions::checkEvents() {
|
||||
#ifndef __EMSCRIPTEN__
|
||||
// Comprueba los eventos que hay en la cola
|
||||
while (SDL_PollEvent(eventHandler) != 0) {
|
||||
while (static_cast<int>(SDL_PollEvent(eventHandler)) != 0) {
|
||||
// Evento de salida de la aplicación
|
||||
if (eventHandler->type == SDL_EVENT_QUIT) {
|
||||
quitRequested = true;
|
||||
@@ -260,11 +260,11 @@ void Instructions::start(mode_e mode) {
|
||||
}
|
||||
|
||||
// Indica si las instrucciones han terminado
|
||||
bool Instructions::hasFinished() const {
|
||||
auto Instructions::hasFinished() const -> bool {
|
||||
return finished;
|
||||
}
|
||||
|
||||
// Indica si se ha solicitado salir de la aplicación
|
||||
bool Instructions::isQuitRequested() const {
|
||||
auto Instructions::isQuitRequested() const -> bool {
|
||||
return quitRequested;
|
||||
}
|
||||
|
||||
@@ -2,13 +2,14 @@
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
#include <vector> // for vector
|
||||
#include <cstdint> // for uint8_t
|
||||
#include <vector> // for vector
|
||||
class Sprite;
|
||||
class Text;
|
||||
class Texture;
|
||||
struct section_t;
|
||||
|
||||
enum mode_e {
|
||||
enum mode_e : std::uint8_t {
|
||||
m_manual,
|
||||
m_auto
|
||||
};
|
||||
|
||||
@@ -39,7 +39,7 @@ Intro::Intro(SDL_Renderer *renderer, section_t *section) {
|
||||
// Inicializa los bitmaps de la intro
|
||||
const int totalBitmaps = 6;
|
||||
for (int i = 0; i < totalBitmaps; ++i) {
|
||||
SmartSprite *ss = new SmartSprite(texture, renderer);
|
||||
auto *ss = new SmartSprite(texture, renderer);
|
||||
ss->setWidth(128);
|
||||
ss->setHeight(96);
|
||||
ss->setEnabledCounter(20);
|
||||
@@ -50,57 +50,57 @@ Intro::Intro(SDL_Renderer *renderer, section_t *section) {
|
||||
|
||||
bitmaps[0]->setPosX(-128);
|
||||
bitmaps[0]->setPosY(GAMECANVAS_FIRST_QUARTER_Y - 24);
|
||||
bitmaps[0]->setVelX(0.0f);
|
||||
bitmaps[0]->setVelY(0.0f);
|
||||
bitmaps[0]->setAccelX(0.6f);
|
||||
bitmaps[0]->setAccelY(0.0f);
|
||||
bitmaps[0]->setVelX(0.0F);
|
||||
bitmaps[0]->setVelY(0.0F);
|
||||
bitmaps[0]->setAccelX(0.6F);
|
||||
bitmaps[0]->setAccelY(0.0F);
|
||||
bitmaps[0]->setSpriteClip(0, 0, 128, 96);
|
||||
|
||||
bitmaps[1]->setPosX(GAMECANVAS_WIDTH);
|
||||
bitmaps[1]->setPosY(GAMECANVAS_FIRST_QUARTER_Y - 24);
|
||||
bitmaps[1]->setVelX(-1.0f);
|
||||
bitmaps[1]->setVelY(0.0f);
|
||||
bitmaps[1]->setAccelX(-0.3f);
|
||||
bitmaps[1]->setAccelY(0.0f);
|
||||
bitmaps[1]->setVelX(-1.0F);
|
||||
bitmaps[1]->setVelY(0.0F);
|
||||
bitmaps[1]->setAccelX(-0.3F);
|
||||
bitmaps[1]->setAccelY(0.0F);
|
||||
bitmaps[1]->setSpriteClip(128, 0, 128, 96);
|
||||
|
||||
bitmaps[2]->setPosX(GAMECANVAS_CENTER_X - 64);
|
||||
bitmaps[2]->setPosY(-96);
|
||||
bitmaps[2]->setVelX(0.0f);
|
||||
bitmaps[2]->setVelY(3.0f);
|
||||
bitmaps[2]->setAccelX(0.1f);
|
||||
bitmaps[2]->setAccelY(0.3f);
|
||||
bitmaps[2]->setVelX(0.0F);
|
||||
bitmaps[2]->setVelY(3.0F);
|
||||
bitmaps[2]->setAccelX(0.1F);
|
||||
bitmaps[2]->setAccelY(0.3F);
|
||||
bitmaps[2]->setSpriteClip(0, 96, 128, 96);
|
||||
bitmaps[2]->setEnabledCounter(250);
|
||||
|
||||
bitmaps[3]->setPosX(GAMECANVAS_CENTER_X - 64);
|
||||
bitmaps[3]->setPosY(GAMECANVAS_HEIGHT);
|
||||
bitmaps[3]->setVelX(0.0f);
|
||||
bitmaps[3]->setVelY(-0.7f);
|
||||
bitmaps[3]->setAccelX(0.0f);
|
||||
bitmaps[3]->setAccelY(0.0f);
|
||||
bitmaps[3]->setVelX(0.0F);
|
||||
bitmaps[3]->setVelY(-0.7F);
|
||||
bitmaps[3]->setAccelX(0.0F);
|
||||
bitmaps[3]->setAccelY(0.0F);
|
||||
bitmaps[3]->setSpriteClip(128, 96, 128, 96);
|
||||
|
||||
bitmaps[4]->setPosX(GAMECANVAS_CENTER_X - 64);
|
||||
bitmaps[4]->setPosY(-96);
|
||||
bitmaps[4]->setVelX(0.0f);
|
||||
bitmaps[4]->setVelY(3.0f);
|
||||
bitmaps[4]->setAccelX(0.1f);
|
||||
bitmaps[4]->setAccelY(0.3f);
|
||||
bitmaps[4]->setVelX(0.0F);
|
||||
bitmaps[4]->setVelY(3.0F);
|
||||
bitmaps[4]->setAccelX(0.1F);
|
||||
bitmaps[4]->setAccelY(0.3F);
|
||||
bitmaps[4]->setSpriteClip(0, 192, 128, 96);
|
||||
|
||||
bitmaps[5]->setPosX(GAMECANVAS_WIDTH);
|
||||
bitmaps[5]->setPosY(GAMECANVAS_FIRST_QUARTER_Y - 24);
|
||||
bitmaps[5]->setVelX(-0.7f);
|
||||
bitmaps[5]->setVelY(0.0f);
|
||||
bitmaps[5]->setAccelX(0.0f);
|
||||
bitmaps[5]->setAccelY(0.0f);
|
||||
bitmaps[5]->setVelX(-0.7F);
|
||||
bitmaps[5]->setVelY(0.0F);
|
||||
bitmaps[5]->setAccelX(0.0F);
|
||||
bitmaps[5]->setAccelY(0.0F);
|
||||
bitmaps[5]->setSpriteClip(128, 192, 128, 96);
|
||||
|
||||
// Inicializa los textos de la intro
|
||||
const int totalTexts = 9;
|
||||
for (int i = 0; i < totalTexts; ++i) {
|
||||
Writer *w = new Writer(text);
|
||||
auto *w = new Writer(text);
|
||||
w->setPosX(BLOCK * 0);
|
||||
w->setPosY(GAMECANVAS_HEIGHT - (BLOCK * 6));
|
||||
w->setKerning(-1);
|
||||
@@ -157,11 +157,11 @@ Intro::~Intro() {
|
||||
delete eventHandler;
|
||||
|
||||
// texture, text, music son propiedad de Resource — no liberar aquí.
|
||||
for (auto bitmap : bitmaps) {
|
||||
for (auto *bitmap : bitmaps) {
|
||||
delete bitmap;
|
||||
}
|
||||
|
||||
for (auto t : texts) {
|
||||
for (auto *t : texts) {
|
||||
delete t;
|
||||
}
|
||||
}
|
||||
@@ -329,7 +329,7 @@ void Intro::update() {
|
||||
ticks = SDL_GetTicks();
|
||||
|
||||
// Actualiza los objetos
|
||||
for (auto bitmap : bitmaps) {
|
||||
for (auto *bitmap : bitmaps) {
|
||||
bitmap->update();
|
||||
}
|
||||
|
||||
@@ -351,7 +351,7 @@ void Intro::render() {
|
||||
Screen::get()->clean(bgColor);
|
||||
|
||||
// Dibuja los objetos
|
||||
for (auto bitmap : bitmaps) {
|
||||
for (auto *bitmap : bitmaps) {
|
||||
bitmap->render();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "game/scenes/title.h"
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
#include <stdlib.h> // for rand
|
||||
|
||||
#include <cstdlib> // for rand
|
||||
#include <iostream> // for basic_ostream, operator<<, basic_ostrea...
|
||||
#include <string> // for basic_string, operator+, char_traits
|
||||
|
||||
@@ -147,10 +147,10 @@ void Title::init() {
|
||||
coffeeBitmap->setPosY(11 - 200);
|
||||
coffeeBitmap->setWidth(167);
|
||||
coffeeBitmap->setHeight(46);
|
||||
coffeeBitmap->setVelX(0.0f);
|
||||
coffeeBitmap->setVelY(2.5f);
|
||||
coffeeBitmap->setAccelX(0.0f);
|
||||
coffeeBitmap->setAccelY(0.1f);
|
||||
coffeeBitmap->setVelX(0.0F);
|
||||
coffeeBitmap->setVelY(2.5F);
|
||||
coffeeBitmap->setAccelX(0.0F);
|
||||
coffeeBitmap->setAccelY(0.1F);
|
||||
coffeeBitmap->setSpriteClip(0, 0, 167, 46);
|
||||
coffeeBitmap->setEnabled(true);
|
||||
coffeeBitmap->setEnabledCounter(0);
|
||||
@@ -163,10 +163,10 @@ void Title::init() {
|
||||
crisisBitmap->setPosY(57 + 200);
|
||||
crisisBitmap->setWidth(137);
|
||||
crisisBitmap->setHeight(46);
|
||||
crisisBitmap->setVelX(0.0f);
|
||||
crisisBitmap->setVelY(-2.5f);
|
||||
crisisBitmap->setAccelX(0.0f);
|
||||
crisisBitmap->setAccelY(-0.1f);
|
||||
crisisBitmap->setVelX(0.0F);
|
||||
crisisBitmap->setVelY(-2.5F);
|
||||
crisisBitmap->setAccelX(0.0F);
|
||||
crisisBitmap->setAccelY(-0.1F);
|
||||
crisisBitmap->setSpriteClip(0, 0, 137, 46);
|
||||
crisisBitmap->setEnabled(true);
|
||||
crisisBitmap->setEnabledCounter(0);
|
||||
@@ -202,7 +202,7 @@ void Title::init() {
|
||||
|
||||
// Inicializa los valores del vector con los valores del seno
|
||||
for (int i = 0; i < 360; ++i) {
|
||||
sin[i] = SDL_sinf((float)i * 3.14f / 180.0f);
|
||||
sin[i] = SDL_sinf((float)i * 3.14F / 180.0F);
|
||||
}
|
||||
|
||||
// Actualiza los textos de los menus
|
||||
@@ -313,8 +313,9 @@ void Title::update() {
|
||||
if (demo) {
|
||||
demoThenInstructions = true;
|
||||
runDemoGame();
|
||||
} else
|
||||
} else {
|
||||
section->name = SECTION_PROG_LOGO;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -326,7 +327,7 @@ void Title::update() {
|
||||
updateBG();
|
||||
|
||||
// Comprueba las entradas para el menu
|
||||
if (menuVisible == true && !fade->isEnabled()) {
|
||||
if (menuVisible && !fade->isEnabled()) {
|
||||
menu.active->update();
|
||||
}
|
||||
|
||||
@@ -393,12 +394,13 @@ void Title::update() {
|
||||
if (menu.active->getName() == "OPTIONS") {
|
||||
switch (menu.active->getItemSelected()) {
|
||||
case 0: // Difficulty
|
||||
if (Options::settings.difficulty == DIFFICULTY_EASY)
|
||||
if (Options::settings.difficulty == DIFFICULTY_EASY) {
|
||||
Options::settings.difficulty = DIFFICULTY_NORMAL;
|
||||
else if (Options::settings.difficulty == DIFFICULTY_NORMAL)
|
||||
} else if (Options::settings.difficulty == DIFFICULTY_NORMAL) {
|
||||
Options::settings.difficulty = DIFFICULTY_HARD;
|
||||
else
|
||||
} else {
|
||||
Options::settings.difficulty = DIFFICULTY_EASY;
|
||||
}
|
||||
updateMenuLabels();
|
||||
break;
|
||||
|
||||
@@ -414,8 +416,9 @@ void Title::update() {
|
||||
|
||||
case 5: // Language
|
||||
Options::settings.language++;
|
||||
if (Options::settings.language == 3)
|
||||
if (Options::settings.language == 3) {
|
||||
Options::settings.language = 0;
|
||||
}
|
||||
updateMenuLabels();
|
||||
break;
|
||||
|
||||
@@ -433,8 +436,9 @@ void Title::update() {
|
||||
|
||||
case 8: // Windows size
|
||||
Options::window.zoom++;
|
||||
if (Options::window.zoom > Options::window.max_zoom)
|
||||
if (Options::window.zoom > Options::window.max_zoom) {
|
||||
Options::window.zoom = 1;
|
||||
}
|
||||
updateMenuLabels();
|
||||
break;
|
||||
|
||||
@@ -585,7 +589,7 @@ void Title::render() {
|
||||
text2->writeDX(TXT_CENTER | TXT_SHADOW, GAMECANVAS_CENTER_X, GAMECANVAS_HEIGHT - (BLOCK * 2), TEXT_COPYRIGHT, 1, noColor, 1, shdwTxtColor);
|
||||
}
|
||||
|
||||
if (menuVisible == true) {
|
||||
if (menuVisible) {
|
||||
menu.active->render();
|
||||
}
|
||||
|
||||
@@ -593,7 +597,7 @@ void Title::render() {
|
||||
dustBitmapL->render();
|
||||
|
||||
// PRESS ANY KEY!
|
||||
if ((counter % 50 > 14) && (menuVisible == false)) {
|
||||
if ((counter % 50 > 14) && (!menuVisible)) {
|
||||
text1->writeDX(TXT_CENTER | TXT_SHADOW, GAMECANVAS_CENTER_X, PLAY_AREA_THIRD_QUARTER_Y + BLOCK, Lang::get()->getText(23), 1, noColor, 1, shdwTxtColor);
|
||||
}
|
||||
|
||||
@@ -638,7 +642,7 @@ void Title::switchFullScreenModeVar() {
|
||||
}
|
||||
|
||||
// Actualiza los elementos de los menus
|
||||
void Title::updateMenuLabels() {
|
||||
void Title::updateMenuLabels() const {
|
||||
int i = 0;
|
||||
// DIFFICULTY
|
||||
switch (Options::settings.difficulty) {
|
||||
@@ -673,9 +677,9 @@ void Title::updateMenuLabels() {
|
||||
|
||||
case INPUT_USE_GAMECONTROLLER:
|
||||
menu.options->setItemCaption(i, Lang::get()->getText(70)); // GAME CONTROLLER
|
||||
if (!Input::get()->gameControllerFound())
|
||||
if (!Input::get()->gameControllerFound()) {
|
||||
menu.options->setGreyed(i, true);
|
||||
else {
|
||||
} else {
|
||||
menu.options->setGreyed(i, false);
|
||||
menu.options->setItemCaption(i, Options::inputs[0].name);
|
||||
}
|
||||
@@ -700,9 +704,9 @@ void Title::updateMenuLabels() {
|
||||
|
||||
case INPUT_USE_GAMECONTROLLER:
|
||||
menu.options->setItemCaption(i, Lang::get()->getText(70)); // GAME CONTROLLER
|
||||
if (!Input::get()->gameControllerFound())
|
||||
if (!Input::get()->gameControllerFound()) {
|
||||
menu.options->setGreyed(i, true);
|
||||
else {
|
||||
} else {
|
||||
menu.options->setGreyed(i, false);
|
||||
menu.options->setItemCaption(i, Options::inputs[1].name);
|
||||
}
|
||||
@@ -725,11 +729,9 @@ void Title::updateMenuLabels() {
|
||||
break;
|
||||
|
||||
case en_UK:
|
||||
menu.options->setItemCaption(i, Lang::get()->getText(8) + ": " + Lang::get()->getText(26)); // ENGLISH
|
||||
break;
|
||||
|
||||
default:
|
||||
menu.options->setItemCaption(i, Lang::get()->getText(8) + ": " + Lang::get()->getText(26)); // ENGLISH
|
||||
// ENGLISH (i fallback per a llengües no reconegudes)
|
||||
menu.options->setItemCaption(i, Lang::get()->getText(8) + ": " + Lang::get()->getText(26));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -747,17 +749,19 @@ void Title::updateMenuLabels() {
|
||||
|
||||
i++;
|
||||
// SCALE MODE
|
||||
if (Options::video.scale_mode == SDL_SCALEMODE_LINEAR)
|
||||
if (Options::video.scale_mode == SDL_SCALEMODE_LINEAR) {
|
||||
menu.options->setItemCaption(i, Lang::get()->getText(60) + ": " + Lang::get()->getText(71)); // BILINEAL
|
||||
else
|
||||
} else {
|
||||
menu.options->setItemCaption(i, Lang::get()->getText(60) + ": " + Lang::get()->getText(72)); // LINEAL
|
||||
}
|
||||
|
||||
i++;
|
||||
// VSYNC
|
||||
if (Options::video.vsync)
|
||||
if (Options::video.vsync) {
|
||||
menu.options->setItemCaption(i, Lang::get()->getText(61) + ": " + Lang::get()->getText(73)); // ON
|
||||
else
|
||||
} else {
|
||||
menu.options->setItemCaption(i, Lang::get()->getText(61) + ": " + Lang::get()->getText(74)); // OFF
|
||||
}
|
||||
|
||||
i++;
|
||||
// HOW TO PLAY
|
||||
@@ -893,12 +897,12 @@ void Title::iterate() {
|
||||
// Procesa un evento individual
|
||||
void Title::handleEvent(const SDL_Event *event) {
|
||||
// Si hay un sub-estado activo, delega el evento
|
||||
if (instructionsActive && instructions) {
|
||||
if (instructionsActive && (instructions != nullptr)) {
|
||||
// SDL_EVENT_QUIT ya lo maneja Director
|
||||
return;
|
||||
}
|
||||
|
||||
if (demoGameActive && demoGame) {
|
||||
if (demoGameActive && (demoGame != nullptr)) {
|
||||
demoGame->handleEvent(event);
|
||||
return;
|
||||
}
|
||||
@@ -944,7 +948,7 @@ void Title::runDemoGame() {
|
||||
}
|
||||
|
||||
// Modifica las opciones para los controles de los jugadores
|
||||
bool Title::updatePlayerInputs(int numPlayer) {
|
||||
auto Title::updatePlayerInputs(int numPlayer) -> bool {
|
||||
const int numDevices = availableInputDevices.size();
|
||||
|
||||
if (!Input::get()->gameControllerFound()) { // Si no hay mandos se deja todo de manera prefijada
|
||||
@@ -960,37 +964,36 @@ bool Title::updatePlayerInputs(int numPlayer) {
|
||||
Options::inputs[1].deviceType = INPUT_USE_GAMECONTROLLER;
|
||||
|
||||
return true;
|
||||
} else { // Si hay mas de un dispositivo, se recorre el vector
|
||||
if (Options::settings.console) {
|
||||
std::cout << "numplayer:" << numPlayer << std::endl;
|
||||
std::cout << "deviceindex:" << deviceIndex[numPlayer] << std::endl;
|
||||
}
|
||||
|
||||
// Incrementa el indice
|
||||
if (deviceIndex[numPlayer] < numDevices - 1) {
|
||||
deviceIndex[numPlayer]++;
|
||||
} else {
|
||||
deviceIndex[numPlayer] = 0;
|
||||
}
|
||||
if (Options::settings.console) {
|
||||
std::cout << "deviceindex:" << deviceIndex[numPlayer] << std::endl;
|
||||
}
|
||||
|
||||
// Si coincide con el del otro jugador, se lo intercambian
|
||||
if (deviceIndex[0] == deviceIndex[1]) {
|
||||
const int theOtherPlayer = (numPlayer + 1) % 2;
|
||||
deviceIndex[theOtherPlayer]--;
|
||||
if (deviceIndex[theOtherPlayer] < 0) {
|
||||
deviceIndex[theOtherPlayer] = numDevices - 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Copia el dispositivo marcado por el indice a la variable de opciones de cada jugador
|
||||
Options::inputs[0] = availableInputDevices[deviceIndex[0]];
|
||||
Options::inputs[1] = availableInputDevices[deviceIndex[1]];
|
||||
|
||||
return true;
|
||||
} // Si hay mas de un dispositivo, se recorre el vector
|
||||
if (Options::settings.console) {
|
||||
std::cout << "numplayer:" << numPlayer << '\n';
|
||||
std::cout << "deviceindex:" << deviceIndex[numPlayer] << '\n';
|
||||
}
|
||||
|
||||
// Incrementa el indice
|
||||
if (deviceIndex[numPlayer] < numDevices - 1) {
|
||||
deviceIndex[numPlayer]++;
|
||||
} else {
|
||||
deviceIndex[numPlayer] = 0;
|
||||
}
|
||||
if (Options::settings.console) {
|
||||
std::cout << "deviceindex:" << deviceIndex[numPlayer] << '\n';
|
||||
}
|
||||
|
||||
// Si coincide con el del otro jugador, se lo intercambian
|
||||
if (deviceIndex[0] == deviceIndex[1]) {
|
||||
const int theOtherPlayer = (numPlayer + 1) % 2;
|
||||
deviceIndex[theOtherPlayer]--;
|
||||
if (deviceIndex[theOtherPlayer] < 0) {
|
||||
deviceIndex[theOtherPlayer] = numDevices - 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Copia el dispositivo marcado por el indice a la variable de opciones de cada jugador
|
||||
Options::inputs[0] = availableInputDevices[deviceIndex[0]];
|
||||
Options::inputs[1] = availableInputDevices[deviceIndex[1]];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Crea el mosaico de fondo del titulo
|
||||
@@ -1002,13 +1005,13 @@ void Title::createTiledBackground() {
|
||||
}
|
||||
if (background == nullptr) {
|
||||
if (Options::settings.console) {
|
||||
std::cout << "TitleSurface could not be created!\nSDL Error: " << SDL_GetError() << std::endl;
|
||||
std::cout << "TitleSurface could not be created!\nSDL Error: " << SDL_GetError() << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
// Crea los objetos para pintar en la textura de fondo
|
||||
Texture *bgTileTexture = new Texture(renderer, Asset::get()->get("title_bg_tile.png"));
|
||||
Sprite *tile = new Sprite({0, 0, 64, 64}, bgTileTexture, renderer);
|
||||
auto *bgTileTexture = new Texture(renderer, Asset::get()->get("title_bg_tile.png"));
|
||||
auto *tile = new Sprite({0, 0, 64, 64}, bgTileTexture, renderer);
|
||||
|
||||
// Prepara para dibujar sobre la textura
|
||||
SDL_SetRenderTarget(renderer, background);
|
||||
@@ -1039,23 +1042,24 @@ void Title::createTiledBackground() {
|
||||
// así que aquí solo leemos la lista actual sin reescanear.
|
||||
void Title::checkInputDevices() {
|
||||
if (Options::settings.console) {
|
||||
std::cout << "Filling devices for options menu..." << std::endl;
|
||||
std::cout << "Filling devices for options menu..." << '\n';
|
||||
}
|
||||
const int numControllers = Input::get()->getNumControllers();
|
||||
availableInputDevices.clear();
|
||||
input_t temp;
|
||||
|
||||
// Añade todos los mandos
|
||||
if (numControllers > 0)
|
||||
if (numControllers > 0) {
|
||||
for (int i = 0; i < numControllers; ++i) {
|
||||
temp.id = i;
|
||||
temp.name = Input::get()->getControllerName(i);
|
||||
temp.deviceType = INPUT_USE_GAMECONTROLLER;
|
||||
availableInputDevices.push_back(temp);
|
||||
if (Options::settings.console) {
|
||||
std::cout << "Device " << (int)availableInputDevices.size() << " - " << temp.name.c_str() << std::endl;
|
||||
std::cout << "Device " << (int)availableInputDevices.size() << " - " << temp.name.c_str() << '\n';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Añade el teclado al final
|
||||
temp.id = -1;
|
||||
@@ -1063,8 +1067,8 @@ void Title::checkInputDevices() {
|
||||
temp.deviceType = INPUT_USE_KEYBOARD;
|
||||
availableInputDevices.push_back(temp);
|
||||
if (Options::settings.console) {
|
||||
std::cout << "Device " << (int)availableInputDevices.size() << " - " << temp.name.c_str() << std::endl;
|
||||
std::cout << std::endl;
|
||||
std::cout << "Device " << (int)availableInputDevices.size() << " - " << temp.name.c_str() << '\n';
|
||||
std::cout << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -114,10 +114,10 @@ class Title {
|
||||
void updateBG();
|
||||
|
||||
// Cambia el valor de la variable de modo de pantalla completa
|
||||
void switchFullScreenModeVar();
|
||||
static void switchFullScreenModeVar();
|
||||
|
||||
// Actualiza los elementos de los menus
|
||||
void updateMenuLabels();
|
||||
void updateMenuLabels() const;
|
||||
|
||||
// Aplica las opciones de menu seleccionadas
|
||||
void applyOptions();
|
||||
|
||||
Reference in New Issue
Block a user