Browse Source

Fall back to relative path when unable to use SDL

pull/295/head
Anders Jenbo 7 years ago
parent
commit
bd2c08183c
  1. 11
      SourceX/storm/storm.cpp

11
SourceX/storm/storm.cpp

@ -35,6 +35,12 @@ static Mix_Chunk *SFileChunk;
void GetBasePath(char *buffer, size_t size)
{
char *path = SDL_GetBasePath();
if (path == NULL) {
SDL_Log(SDL_GetError());
buffer[0] = '\0';
return;
}
snprintf(buffer, size, "%s", path);
SDL_free(path);
}
@ -42,6 +48,11 @@ void GetBasePath(char *buffer, size_t size)
void GetPrefPath(char *buffer, size_t size)
{
char *path = SDL_GetPrefPath("diasurgical", "devilution");
if (path == NULL) {
buffer[0] = '\0';
return;
}
snprintf(buffer, size, "%s", path);
SDL_free(path);
}

Loading…
Cancel
Save