using namespace std en todos los ficheros

This commit is contained in:
2023-05-23 17:40:12 +02:00
parent 5a5bbf7f73
commit c31bfc6cae
15 changed files with 218 additions and 197 deletions

View File

@@ -2,7 +2,7 @@
#include <iostream>
// Constructor
Input::Input(std::string file)
Input::Input(string file)
{
// Fichero gamecontrollerdb.txt
dbPath = file;
@@ -201,7 +201,7 @@ bool Input::discoverGameController()
{
if (verbose)
{
std::cout << "Error, could not load " << dbPath.c_str() << " file: " << SDL_GetError() << std::endl;
cout << "Error, could not load " << dbPath.c_str() << " file: " << SDL_GetError() << endl;
}
}
@@ -219,8 +219,8 @@ bool Input::discoverGameController()
if (verbose)
{
std::cout << "\nChecking for game controllers...\n";
std::cout << nJoysticks << " joysticks found, " << numGamepads << " are gamepads\n";
cout << "\nChecking for game controllers...\n";
cout << nJoysticks << " joysticks found, " << numGamepads << " are gamepads\n";
}
if (numGamepads > 0)
@@ -234,13 +234,13 @@ bool Input::discoverGameController()
if (SDL_GameControllerGetAttached(pad) == 1)
{
connectedControllers.push_back(pad);
const std::string separator(" #");
std::string name = SDL_GameControllerNameForIndex(i);
const string separator(" #");
string name = SDL_GameControllerNameForIndex(i);
name.resize(25);
name = name + separator + std::to_string(i);
name = name + separator + to_string(i);
if (verbose)
{
std::cout << name << std::endl;
cout << name << endl;
}
controllerNames.push_back(name);
}
@@ -248,7 +248,7 @@ bool Input::discoverGameController()
{
if (verbose)
{
std::cout << "SDL_GetError() = " << SDL_GetError() << std::endl;
cout << "SDL_GetError() = " << SDL_GetError() << endl;
}
}
}
@@ -273,7 +273,7 @@ bool Input::gameControllerFound()
}
// Obten el nombre de un mando de juego
std::string Input::getControllerName(int index)
string Input::getControllerName(int index)
{
if (numGamepads > 0)
{