Fix: Buscar resources.pack relativo al ejecutable, no al working directory
- Movido getExecutableDirectory() a defines.h como función inline - Actualizado main.cpp para construir path absoluto a resources.pack - Eliminadas definiciones duplicadas en engine.cpp y main.cpp - Ahora funciona correctamente ejecutando desde cualquier carpeta (ej. build/) TEST confirmado: - Ejecutar desde raíz: ✅ Carga resources.pack - Ejecutar desde build/: ✅ Carga resources.pack 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
#include <cstring>
|
||||
#include "engine.h"
|
||||
|
||||
// getExecutableDirectory() ya está definido en defines.h como inline
|
||||
|
||||
void printHelp() {
|
||||
std::cout << "ViBe3 Physics - Simulador de físicas avanzadas\n";
|
||||
std::cout << "\nUso: vibe3_physics [opciones]\n\n";
|
||||
@@ -73,7 +75,9 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
// Inicializar sistema de recursos empaquetados (intentar cargar resources.pack)
|
||||
Texture::initResourceSystem("resources.pack");
|
||||
std::string exe_dir = getExecutableDirectory();
|
||||
std::string pack_path = exe_dir + "/resources.pack";
|
||||
Texture::initResourceSystem(pack_path);
|
||||
|
||||
Engine engine;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user