mirror of https://github.com/AxioDL/boo.git
D3D11: Invert conditional within setScissor()
Turns the condition into a guard clause, which allows unindenting all of the code within the function by one level.
This commit is contained in:
parent
f5afb028de
commit
532e58414c
|
@ -1072,7 +1072,10 @@ struct D3D11CommandQueue final : IGraphicsCommandQueue {
|
|||
}
|
||||
|
||||
void setScissor(const SWindowRect& rect) override {
|
||||
if (m_boundTarget) {
|
||||
if (!m_boundTarget) {
|
||||
return;
|
||||
}
|
||||
|
||||
int boundHeight = 0;
|
||||
switch (m_boundTarget->type()) {
|
||||
case TextureType::Render: {
|
||||
|
@ -1088,11 +1091,11 @@ struct D3D11CommandQueue final : IGraphicsCommandQueue {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
const D3D11_RECT d3drect = {LONG(rect.location[0]), LONG(boundHeight - rect.location[1] - rect.size[1]),
|
||||
LONG(rect.location[0] + rect.size[0]), LONG(boundHeight - rect.location[1])};
|
||||
m_deferredCtx->RSSetScissorRects(1, &d3drect);
|
||||
}
|
||||
}
|
||||
|
||||
std::unordered_map<D3D11TextureR*, std::pair<size_t, size_t>> m_texResizes;
|
||||
void resizeRenderTexture(const boo::ObjToken<ITextureR>& tex, size_t width, size_t height) override {
|
||||
|
|
Loading…
Reference in New Issue