Merge pull request #18628 from hrydgard/remote-iso-fixes

Remote ISO: Allow streaming .chd, add reload button to game browser
This commit is contained in:
Henrik Rydgård 2023-12-29 01:19:46 +01:00 committed by GitHub
commit ecb7f93418
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 6 deletions

View file

@ -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;
}

View file

@ -22,6 +22,9 @@ public:
~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);

View file

@ -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.

View file

@ -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;
@ -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;
}

View file

@ -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);