Skip to content

Commit

Permalink
+ SDL version store config & files from web inside /home/pi/.usp/ folder
Browse files Browse the repository at this point in the history
  • Loading branch information
djdron committed Jun 25, 2016
1 parent 9778d5d commit a5a6bb7
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions platform/sdl/sdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <SDL.h>
#include "../../options_common.h"
#include "../../tools/tick.h"
#include "../io.h"

namespace xPlatform
{
Expand All @@ -45,9 +46,22 @@ static SDL_Joystick* joystick = NULL;
static bool Init()
{
#ifndef SDL_DEFAULT_FOLDER
#define SDL_DEFAULT_FOLDER "/"
#endif//SDL_DEFAULT_FOLDER
char usp_folder[xIo::MAX_PATH_LEN];
const char* h = getenv("HOME");
if(h)
{
strcpy(usp_folder, h);
strcat(usp_folder, "/.usp/");
xIo::PathCreate(usp_folder);
}
else
strcpy(usp_folder, "/");
xIo::SetProfilePath(usp_folder);
// xIo::SetRootPath(usp_folder);
OpLastFile(usp_folder);
#else//SDL_DEFAULT_FOLDER
OpLastFile(SDL_DEFAULT_FOLDER);
#endif//SDL_DEFAULT_FOLDER
Handler()->OnInit();

Uint32 init_flags = SDL_INIT_VIDEO|SDL_INIT_AUDIO;
Expand Down

0 comments on commit a5a6bb7

Please sign in to comment.