Los datos se guardan en la carpeta de sistema

This commit is contained in:
2022-12-07 11:23:19 +01:00
parent c87e1e68a9
commit bbe82d329b
7 changed files with 262 additions and 64 deletions

View File

@@ -1025,8 +1025,11 @@ bool Title::updatePlayerInputs(int numPlayer)
}
else
{ // Si hay mas de un dispositivo, se recorre el vector
std::cout << "numplayer:" << numPlayer << std::endl;
std::cout << "deviceindex:" << deviceIndex[numPlayer] << std::endl;
if (options->console)
{
std::cout << "numplayer:" << numPlayer << std::endl;
std::cout << "deviceindex:" << deviceIndex[numPlayer] << std::endl;
}
// Incrementa el indice
if (deviceIndex[numPlayer] < numDevices - 1)
@@ -1037,7 +1040,10 @@ bool Title::updatePlayerInputs(int numPlayer)
{
deviceIndex[numPlayer] = 0;
}
std::cout << "deviceindex:" << deviceIndex[numPlayer] << std::endl;
if (options->console)
{
std::cout << "deviceindex:" << deviceIndex[numPlayer] << std::endl;
}
// Si coincide con el del otro jugador, se lo intercambian
if (deviceIndex[0] == deviceIndex[1])
@@ -1065,7 +1071,10 @@ void Title::createTiledBackground()
background = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, GAMECANVAS_WIDTH * 2, GAMECANVAS_HEIGHT * 2);
if (background == nullptr)
{
std::cout << "TitleSurface could not be created!\nSDL Error: " << SDL_GetError() << std::endl;
if (options->console)
{
std::cout << "TitleSurface could not be created!\nSDL Error: " << SDL_GetError() << std::endl;
}
}
// Crea los objetos para pintar en la textura de fondo
@@ -1101,7 +1110,10 @@ void Title::createTiledBackground()
// Comprueba cuantos mandos hay conectados para gestionar el menu de opciones
void Title::checkInputDevices()
{
std::cout << "Filling devices for options menu..." << std::endl;
if (options->console)
{
std::cout << "Filling devices for options menu..." << std::endl;
}
input->discoverGameController();
const int numControllers = input->getNumControllers();
availableInputDevices.clear();
@@ -1115,7 +1127,10 @@ void Title::checkInputDevices()
temp.name = input->getControllerName(i);
temp.deviceType = INPUT_USE_GAMECONTROLLER;
availableInputDevices.push_back(temp);
std::cout << "Device " << (int)availableInputDevices.size() << " - " << temp.name.c_str() << std::endl;
if (options->console)
{
std::cout << "Device " << (int)availableInputDevices.size() << " - " << temp.name.c_str() << std::endl;
}
}
// Añade el teclado al final
@@ -1123,8 +1138,11 @@ void Title::checkInputDevices()
temp.name = "KEYBOARD";
temp.deviceType = INPUT_USE_KEYBOARD;
availableInputDevices.push_back(temp);
std::cout << "Device " << (int)availableInputDevices.size() << " - " << temp.name.c_str() << std::endl;
std::cout << std::endl;
if (options->console)
{
std::cout << "Device " << (int)availableInputDevices.size() << " - " << temp.name.c_str() << std::endl;
std::cout << std::endl;
}
}
// Recarga las texturas