neteja tidy a source/core i encamina Texture::loadFromFile pel ResourceHelper
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <string> // for string, basic_string
|
||||
#include <vector> // for vector
|
||||
#include <cstdint> // for uint8_t
|
||||
#include <string> // for string, basic_string
|
||||
#include <vector> // for vector
|
||||
|
||||
enum assetType {
|
||||
enum assetType : std::uint8_t {
|
||||
t_bitmap,
|
||||
t_music,
|
||||
t_sound,
|
||||
@@ -28,16 +29,16 @@ class Asset {
|
||||
|
||||
private:
|
||||
// Variables
|
||||
int longestName; // Contiene la longitud del nombre de fichero mas largo
|
||||
int longestName{0}; // Contiene la longitud del nombre de fichero mas largo
|
||||
std::vector<item_t> fileList; // Listado con todas las rutas a los ficheros
|
||||
std::string executablePath; // Ruta al ejecutable
|
||||
bool verbose; // Indica si ha de mostrar información por pantalla
|
||||
bool verbose{true}; // Indica si ha de mostrar información por pantalla
|
||||
|
||||
// Comprueba que existe un fichero
|
||||
bool checkFile(const std::string &executablePath);
|
||||
[[nodiscard]] auto checkFile(const std::string &executablePath) const -> bool;
|
||||
|
||||
// Devuelve el nombre del tipo de recurso
|
||||
std::string getTypeName(int type);
|
||||
static auto getTypeName(int type) -> std::string;
|
||||
|
||||
// Constructor privado (usar Asset::init)
|
||||
explicit Asset(const std::string &path);
|
||||
@@ -55,13 +56,13 @@ class Asset {
|
||||
void add(const std::string &file, enum assetType type, bool required = true, bool absolute = false);
|
||||
|
||||
// Devuelve un elemento de la lista a partir de una cadena
|
||||
std::string get(const std::string &text);
|
||||
auto get(const std::string &text) -> std::string;
|
||||
|
||||
// Devuelve toda la lista de items registrados
|
||||
const std::vector<item_t> &getAll() const { return fileList; }
|
||||
[[nodiscard]] auto getAll() const -> const std::vector<item_t> & { return fileList; }
|
||||
|
||||
// Comprueba que existen todos los elementos
|
||||
bool check();
|
||||
auto check() -> bool;
|
||||
|
||||
// Establece si ha de mostrar texto por pantalla
|
||||
void setVerbose(bool value);
|
||||
|
||||
Reference in New Issue
Block a user