input: optimizado el constructor
This commit is contained in:
6
main.cpp
6
main.cpp
@@ -90,10 +90,8 @@ int main(int argc, char *argv[])
|
|||||||
screen->addNotifier(asset->get("notify.png"), asset->get("smb2.png"), asset->get("smb2.txt"), asset->get("notify.wav"));
|
screen->addNotifier(asset->get("notify.png"), asset->get("smb2.png"), asset->get("smb2.txt"), asset->get("notify.wav"));
|
||||||
|
|
||||||
// Inicializa el objeto input
|
// Inicializa el objeto input
|
||||||
Input *input = new Input(asset->get("gamecontrollerdb.txt"));
|
Input *input = new Input(asset->get("gamecontrollerdb.txt"), options->console);
|
||||||
input->setVerbose(options->console);
|
string controllerName = input->getControllerName(0);
|
||||||
input->discoverGameController();
|
|
||||||
string controllerName = input->getNumControllers() > 0 ? input->getControllerName(0) : "";
|
|
||||||
|
|
||||||
// Inicializa el texto
|
// Inicializa el texto
|
||||||
Text *text = new Text(asset->get("smb2.txt"), asset->get("smb2.png"), renderer);
|
Text *text = new Text(asset->get("smb2.txt"), asset->get("smb2.png"), renderer);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
Input::Input(string file)
|
Input::Input(string file, bool verbose)
|
||||||
{
|
{
|
||||||
// Fichero gamecontrollerdb.txt
|
// Fichero gamecontrollerdb.txt
|
||||||
dbPath = file;
|
dbPath = file;
|
||||||
@@ -18,10 +18,11 @@ Input::Input(string file)
|
|||||||
gcb.active = false;
|
gcb.active = false;
|
||||||
gameControllerBindings.resize(INPUT_TOTAL, gcb);
|
gameControllerBindings.resize(INPUT_TOTAL, gcb);
|
||||||
|
|
||||||
verbose = true;
|
this->verbose = verbose;
|
||||||
enabled = true;
|
enabled = true;
|
||||||
|
|
||||||
setDefaultBindings();
|
setDefaultBindings();
|
||||||
|
discoverGameController();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actualiza el estado del objeto
|
// Actualiza el estado del objeto
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
Input(string file);
|
Input(string file, bool verbose=true);
|
||||||
|
|
||||||
// Actualiza el estado del objeto
|
// Actualiza el estado del objeto
|
||||||
void update();
|
void update();
|
||||||
|
|||||||
Reference in New Issue
Block a user