Skip to content

Commit

Permalink
Launch path support
Browse files Browse the repository at this point in the history
  • Loading branch information
Daft-Freak committed Jan 8, 2021
1 parent a68277c commit 29376b0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mjpeg-player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ void init()
fileBrowser.set_display_rect(blit::Rect(0, 0, blit::screen.bounds.w, blit::screen.bounds.h));
fileBrowser.set_on_file_open(openFile);
fileBrowser.init();

auto launchPath = blit::get_launch_path();
if(launchPath)
{
std::string pathStr(launchPath);
auto pos = pathStr.find_last_of('/');
if(pos != std::string::npos)
fileBrowser.set_current_dir(pathStr.substr(0, pos));

openFile(launchPath);
}
}

void render(uint32_t time_ms)
Expand Down

0 comments on commit 29376b0

Please sign in to comment.