Skip to content

Commit

Permalink
[PR 28] Fix NN and bilinear scalers after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
garbear committed Jan 27, 2020
1 parent 4614481 commit 8f34bcc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions xbmc/cores/RetroPlayer/rendering/RenderVideoSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ void CRenderVideoSettings::SetVideoFilter(const std::string &videoFilter)
if (videoFilter == VIDEO_FILTER_NEAREST)
{
m_scalingMethod = SCALINGMETHOD::NEAREST;
ResetShaderPreset();
}
else if (videoFilter == VIDEO_FILTER_LINEAR)
{
m_scalingMethod = SCALINGMETHOD::LINEAR;
ResetShaderPreset();
}
else
{
Expand All @@ -92,6 +94,11 @@ void CRenderVideoSettings::SetVideoFilter(const std::string &videoFilter)
}
}

void CRenderVideoSettings::ResetShaderPreset()
{
m_shaderPreset.clear();
}

bool CRenderVideoSettings::UsesShaderPreset() const
{
return !m_shaderPreset.empty() && m_scalingMethod == SCALINGMETHOD::AUTO;
Expand Down
1 change: 1 addition & 0 deletions xbmc/cores/RetroPlayer/rendering/RenderVideoSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ namespace RETRO

const std::string &GetShaderPreset() const { return m_shaderPreset; }
void SetShaderPreset(const std::string &shaderPreset) { m_shaderPreset = shaderPreset; }
void ResetShaderPreset();

unsigned int GetRenderRotation() const { return m_rotationDegCCW; }
void SetRenderRotation(unsigned int rotationDegCCW) { m_rotationDegCCW = rotationDegCCW; }
Expand Down
6 changes: 4 additions & 2 deletions xbmc/games/dialogs/osd/DialogGameVideoFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ void CDialogGameVideoFilter::InitScalingMethods()
{
if (m_gameVideoHandle->SupportsScalingMethod(scalingMethodProps.scalingMethod))
{
RETRO::CRenderVideoSettings videoSettings;
videoSettings.SetScalingMethod(scalingMethodProps.scalingMethod);

CFileItemPtr item = std::make_shared<CFileItem>(g_localizeStrings.Get(scalingMethodProps.nameIndex));
item->SetLabel2(g_localizeStrings.Get(scalingMethodProps.categoryIndex));
item->SetProperty("game.videofilter", CVariant{ PROPERTY_NO_VIDEO_FILTER });
item->SetProperty("game.scalingmethod", CVariant((int)scalingMethodProps.scalingMethod));
item->SetProperty("game.videofilter", CVariant{ videoSettings.GetVideoFilter() });
item->SetProperty("game.videofilterdescription", CVariant{ g_localizeStrings.Get(scalingMethodProps.descriptionIndex) });
m_items.Add(std::move(item));
}
Expand Down

0 comments on commit 8f34bcc

Please sign in to comment.