neteja tidy a source/core i encamina Texture::loadFromFile pel ResourceHelper
This commit is contained in:
@@ -24,15 +24,13 @@ auto Lang::get() -> Lang * {
|
||||
}
|
||||
|
||||
// Constructor
|
||||
Lang::Lang() {
|
||||
}
|
||||
Lang::Lang() = default;
|
||||
|
||||
// Destructor
|
||||
Lang::~Lang() {
|
||||
}
|
||||
Lang::~Lang() = default;
|
||||
|
||||
// Inicializa los textos del juego en el idioma seleccionado
|
||||
bool Lang::setLang(Uint8 lang) {
|
||||
auto Lang::setLang(Uint8 lang) -> bool {
|
||||
std::string file;
|
||||
|
||||
switch (lang) {
|
||||
@@ -53,8 +51,9 @@ bool Lang::setLang(Uint8 lang) {
|
||||
break;
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAX_TEXT_STRINGS; i++)
|
||||
mTextStrings[i] = "";
|
||||
for (auto &mTextString : mTextStrings) {
|
||||
mTextString = "";
|
||||
}
|
||||
|
||||
// Lee el fichero via ResourceHelper (pack o filesystem)
|
||||
auto bytes = ResourceHelper::loadFile(file);
|
||||
@@ -90,6 +89,6 @@ bool Lang::setLang(Uint8 lang) {
|
||||
}
|
||||
|
||||
// Obtiene la cadena de texto del indice
|
||||
std::string Lang::getText(int index) {
|
||||
auto Lang::getText(int index) -> std::string {
|
||||
return mTextStrings[index];
|
||||
}
|
||||
Reference in New Issue
Block a user