corregit: asset::checkFile() fallava desde fora del directori
This commit is contained in:
@@ -80,9 +80,9 @@ void Director::init() {
|
||||
Asset::init(executable_path_); // Inicializa el sistema de gestión de archivos
|
||||
|
||||
#ifdef MACOS_BUNDLE
|
||||
ResourceHelper::initializeResourceSystem(executable_path_ + "/../Resources/resources.pack");
|
||||
ResourceHelper::initializeResourceSystem(executable_path_ + "../Resources/resources.pack");
|
||||
#else
|
||||
ResourceHelper::initializeResourceSystem("resources.pack");
|
||||
ResourceHelper::initializeResourceSystem(executable_path_ + "resources.pack");
|
||||
#endif
|
||||
loadAssets(); // Crea el índice de archivos
|
||||
Input::init(Asset::get()->get("gamecontrollerdb.txt"), Asset::get()->get("controllers.json")); // Carga configuración de controles
|
||||
@@ -174,8 +174,14 @@ void Director::loadAssets() {
|
||||
|
||||
// Comprueba los parametros del programa
|
||||
void Director::checkProgramArguments(int argc, std::span<char *> argv) {
|
||||
// Establece la ruta del programa
|
||||
executable_path_ = getPath(argv[0]);
|
||||
// Obtener la ruta absoluta del ejecutable
|
||||
std::filesystem::path exe_path = std::filesystem::absolute(argv[0]);
|
||||
executable_path_ = exe_path.parent_path().string();
|
||||
|
||||
// Asegurar que termine con separador de directorio
|
||||
if (!executable_path_.empty() && executable_path_.back() != '/' && executable_path_.back() != '\\') {
|
||||
executable_path_ += "/";
|
||||
}
|
||||
|
||||
// Comprueba el resto de parámetros
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
|
||||
Reference in New Issue
Block a user