Use getcwd() instead of SDL_GetBasePath()

This commit is contained in:
Inori 2019-08-20 07:10:15 -04:00 committed by Inori
parent 9c08249992
commit cd04341d18
3 changed files with 9 additions and 5 deletions

View file

@ -269,7 +269,7 @@ Your results will be in `~/src/mkxp-z/build` . You can type `open ~/src/mkxp-z/b
sudo apt install build-essential git bison cmake meson autoconf libtool \
pkg-config xxd libsdl2* libvorbisfile3 libvorbis-dev libpixman-1* \
libboost-program-options1.65* libopenal1* libopenal-dev zlib1g* \
fluidsynth libfluidsynth-dev libsigc++-2.0* libogg-dev libboost-filesystem1.65*
fluidsynth libfluidsynth-dev libsigc++-2.0* libogg-dev
```
3. Build the rest from source:

View file

@ -39,6 +39,7 @@ extern "C"{
#include <SDL_sound.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <algorithm>
@ -726,13 +727,16 @@ char* FileSystem::normalize(const char *pathname, bool preferred, bool absolute)
if (cwk_path_is_relative(pathname) && absolute)
{
path_abs = new char[512];
char *bp = SDL_GetBasePath();
char bp[512] = {0};
getcwd(bp, 512);
cwk_path_join(bp, pathname, path_abs, 512);
SDL_free(bp);
}
char test[512] = {0};
getcwd(test, 512);
Debug() << test;
cwk_path_normalize((path_abs) ? path_abs : (char*)pathname, path_nml, 512);
if (path_abs) delete path_abs;
if (path_abs) delete path_abs;
return path_nml;
}

View file

@ -8,7 +8,7 @@ sdl2_image = dependency('SDL2_image')
sdl_sound = dependency('SDL_sound')
opengl = dependency('GL')
boost = dependency('boost', version: '>=1.49', modules: ['system', 'program_options', 'filesystem'])
boost = dependency('boost', version: '>=1.49', modules: 'program_options')
openal = dependency('openal')
zlib = dependency('zlib')