Skip to content

Commit

Permalink
Merge pull request #18628 from hrydgard/remote-iso-fixes
Browse files Browse the repository at this point in the history
Remote ISO: Allow streaming .chd, add reload button to game browser
  • Loading branch information
hrydgard committed Dec 29, 2023
2 parents 2074ccd + 755b2a2 commit ecb7f93
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Common/File/Path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ bool Path::CanNavigateUp() const {
}
if (type_ == PathType::HTTP) {
size_t rootSlash = path_.find_first_of('/', strlen("https://"));
if (rootSlash == path_.npos || path_.size() < rootSlash + 1) {
if (rootSlash == path_.npos || path_.size() == rootSlash + 1) {
// This means, "http://server" or "http://server/". Can't go up.
return false;
}
Expand Down
3 changes: 3 additions & 0 deletions Common/File/PathBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ class PathBrowser {
~PathBrowser();

void SetPath(const Path &path);
void Refresh() {
HandlePath();
}
bool IsListingReady();
bool GetListing(std::vector<File::FileInfo> &fileInfo, const char *filter = nullptr, bool *cancel = nullptr);

Expand Down
2 changes: 1 addition & 1 deletion Core/WebServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ static bool RegisterServer(int port) {

bool RemoteISOFileSupported(const std::string &filename) {
// Disc-like files.
if (endsWithNoCase(filename, ".cso") || endsWithNoCase(filename, ".iso")) {
if (endsWithNoCase(filename, ".cso") || endsWithNoCase(filename, ".iso") || endsWithNoCase(filename, ".chd")) {
return true;
}
// May work - but won't have supporting files.
Expand Down
9 changes: 5 additions & 4 deletions UI/EmuScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1452,8 +1452,9 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
using namespace Draw;

DrawContext *draw = screenManager()->getDrawContext();
if (!draw)
if (!draw) {
return flags; // shouldn't really happen but I've seen a suspicious stack trace..
}

bool skipBufferEffects = g_Config.bSkipBufferEffects;

Expand Down Expand Up @@ -1494,10 +1495,10 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
PSP_BeginHostFrame();
gpu->CopyDisplayToOutput(true);
PSP_EndHostFrame();
draw->SetViewport(viewport);
draw->SetScissorRect(0, 0, g_display.pixel_xres, g_display.pixel_yres);
darken();
}
draw->SetViewport(viewport);
draw->SetScissorRect(0, 0, g_display.pixel_xres, g_display.pixel_yres);
darken();
return flags;
}

Expand Down
5 changes: 5 additions & 0 deletions UI/MainScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,11 @@ void GameBrowser::Refresh() {
layoutChoice->AddChoice(ImageID("I_LINES"));
layoutChoice->SetSelection(*gridStyle_ ? 0 : 1, false);
layoutChoice->OnChoice.Handle(this, &GameBrowser::LayoutChange);
topBar->Add(new Choice(ImageID("I_ROTATE_LEFT"), new LayoutParams(64.0f, 64.0f)))->OnClick.Add([=](UI::EventParams &e) {
path_.Refresh();
Refresh();
return UI::EVENT_DONE;
});
topBar->Add(new Choice(ImageID("I_GEAR"), new LayoutParams(64.0f, 64.0f)))->OnClick.Handle(this, &GameBrowser::GridSettingsClick);
Add(topBar);

Expand Down

0 comments on commit ecb7f93

Please sign in to comment.