cppcheck
This commit is contained in:
@@ -96,25 +96,25 @@ class Menu {
|
||||
std::string font_txt;
|
||||
|
||||
// Carga la configuración del menu desde un archivo de texto
|
||||
bool load(std::string file_path);
|
||||
bool load(const std::string &file_path);
|
||||
|
||||
// Parser compartido (recibe cualquier istream)
|
||||
bool parseFromStream(std::istream &file, const std::string &filename);
|
||||
|
||||
// Asigna variables a partir de dos cadenas
|
||||
bool setVars(std::string var, std::string value);
|
||||
bool setVars(const std::string &var, const std::string &value);
|
||||
|
||||
// Asigna variables a partir de dos cadenas
|
||||
bool setItem(item_t *item, std::string var, std::string value);
|
||||
bool setItem(item_t *item, const std::string &var, const std::string &value);
|
||||
|
||||
// Actualiza el menu para recolocarlo correctamente y establecer el tamaño
|
||||
void reorganize();
|
||||
|
||||
// Deja el menu apuntando al siguiente elemento
|
||||
bool increaseSelectorIndex();
|
||||
void increaseSelectorIndex();
|
||||
|
||||
// Deja el menu apuntando al elemento anterior
|
||||
bool decreaseSelectorIndex();
|
||||
void decreaseSelectorIndex();
|
||||
|
||||
// Actualiza la posicion y el estado del selector
|
||||
void updateSelector();
|
||||
@@ -142,7 +142,7 @@ class Menu {
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
Menu(SDL_Renderer *renderer, std::string file = "");
|
||||
explicit Menu(SDL_Renderer *renderer, const std::string &file = "");
|
||||
|
||||
// Destructor
|
||||
~Menu();
|
||||
@@ -151,10 +151,10 @@ class Menu {
|
||||
bool loadFromBytes(const std::vector<uint8_t> &bytes, const std::string &nameForLogs = "");
|
||||
|
||||
// Carga los ficheros de audio
|
||||
void loadAudioFile(std::string file, int sound);
|
||||
void loadAudioFile(const std::string &file, int sound);
|
||||
|
||||
// Obtiene el nombre del menu
|
||||
std::string getName();
|
||||
const std::string &getName() const;
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
int getItemSelected();
|
||||
@@ -193,7 +193,7 @@ class Menu {
|
||||
void addItem(item_t item);
|
||||
|
||||
// Cambia el texto de un item
|
||||
void setItemCaption(int index, std::string text);
|
||||
void setItemCaption(int index, const std::string &text);
|
||||
|
||||
// Establece el indice del item que se usará por defecto al cancelar el menu
|
||||
void setDefaultActionWhenCancel(int item);
|
||||
@@ -214,7 +214,7 @@ class Menu {
|
||||
void setVisible(int index, bool value);
|
||||
|
||||
// Establece el nombre del menu
|
||||
void setName(std::string name);
|
||||
void setName(const std::string &name);
|
||||
|
||||
// Establece la posición del menu
|
||||
void setPos(int x, int y);
|
||||
@@ -223,7 +223,7 @@ class Menu {
|
||||
void setBackgroundType(int value);
|
||||
|
||||
// Establece la fuente de texto que se utilizará
|
||||
void setText(std::string font_png, std::string font_txt);
|
||||
void setText(const std::string &font_png, const std::string &font_txt);
|
||||
|
||||
// Establece el rectangulo de fondo del menu
|
||||
void setRectSize(int w = 0, int h = 0);
|
||||
|
||||
Reference in New Issue
Block a user