fix: init lists, scope reduit i rename vorbis_error

This commit is contained in:
2026-05-14 20:56:14 +02:00
parent f4dea6d39b
commit 0aa9f8fe0a
5 changed files with 24 additions and 25 deletions

View File

@@ -45,21 +45,24 @@
#include <pwd.h>
#endif
// Constructor
Director::Director() {
std::cout << "Game start" << '\n';
namespace {
auto getExecutablePath() -> std::string {
#ifdef __EMSCRIPTEN__
// En Emscripten els assets estan al root del filesystem virtual (/data, /config)
executable_path_ = "";
// En Emscripten els assets estan al root del filesystem virtual (/data, /config)
return "";
#else
// Obtiene la ruta del ejecutable
std::string base = SDL_GetBasePath();
if (!base.empty() && base.back() == '/') {
base.pop_back();
}
executable_path_ = base;
std::string base = SDL_GetBasePath();
if (!base.empty() && base.back() == '/') {
base.pop_back();
}
return base;
#endif
}
} // namespace
// Constructor
Director::Director() : executable_path_(getExecutablePath()) {
std::cout << "Game start" << '\n';
// Crea la carpeta del sistema donde guardar datos
createSystemFolder("jailgames");