mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
FramebufferManagerBase: Compress a loop into a find_if
This commit is contained in:
parent
0ba7a65f08
commit
401f765462
@ -2,7 +2,7 @@
|
|||||||
// Licensed under GPLv2+
|
// Licensed under GPLv2+
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include "VideoCommon/FramebufferManagerBase.h"
|
#include "VideoCommon/FramebufferManagerBase.h"
|
||||||
#include "VideoCommon/RenderBase.h"
|
#include "VideoCommon/RenderBase.h"
|
||||||
#include "VideoCommon/VideoConfig.h"
|
#include "VideoCommon/VideoConfig.h"
|
||||||
@ -182,17 +182,12 @@ FramebufferManagerBase::VirtualXFBListType::iterator FramebufferManagerBase::Fin
|
|||||||
const u32 srcLower = xfbAddr;
|
const u32 srcLower = xfbAddr;
|
||||||
const u32 srcUpper = xfbAddr + 2 * width * height;
|
const u32 srcUpper = xfbAddr + 2 * width * height;
|
||||||
|
|
||||||
VirtualXFBListType::iterator it = m_virtualXFBList.begin();
|
return std::find_if(m_virtualXFBList.begin(), m_virtualXFBList.end(), [srcLower, srcUpper](const VirtualXFB& xfb) {
|
||||||
for (; it != m_virtualXFBList.end(); ++it)
|
const u32 dstLower = xfb.xfbAddr;
|
||||||
{
|
const u32 dstUpper = xfb.xfbAddr + 2 * xfb.xfbWidth * xfb.xfbHeight;
|
||||||
const u32 dstLower = it->xfbAddr;
|
|
||||||
const u32 dstUpper = it->xfbAddr + 2 * it->xfbWidth * it->xfbHeight;
|
|
||||||
|
|
||||||
if (dstLower >= srcLower && dstUpper <= srcUpper)
|
return dstLower >= srcLower && dstUpper <= srcUpper;
|
||||||
break;
|
});
|
||||||
}
|
|
||||||
|
|
||||||
return it;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FramebufferManagerBase::ReplaceVirtualXFB()
|
void FramebufferManagerBase::ReplaceVirtualXFB()
|
||||||
|
Loading…
Reference in New Issue
Block a user