[host] dxgi: remove uneeded variable + minor cosmetic changes

This commit is contained in:
Geoffrey McRae 2023-11-12 06:36:04 +11:00
parent 7321ca6768
commit b14aad7118

View File

@ -155,7 +155,7 @@ struct DXGIInterface
int lastPointerX, lastPointerY; int lastPointerX, lastPointerY;
bool lastPointerVisible; bool lastPointerVisible;
struct FrameDamage frameDamage[LGMP_Q_FRAME_LEN]; FrameDamage frameDamage[LGMP_Q_FRAME_LEN];
}; };
// locals // locals
@ -1429,13 +1429,15 @@ static CaptureResult dxgi_getFrame(FrameBuffer * frame, int frameIndex)
DEBUG_ASSERT(this->initialized); DEBUG_ASSERT(this->initialized);
Texture * tex = &this->texture[this->texRIndex]; Texture * tex = &this->texture[this->texRIndex];
FrameDamage * damage = &this->frameDamage[frameIndex];
struct FrameDamage * damage = this->frameDamage + frameIndex; if (tex->damageRectsCount == 0 ||
bool damageAll = tex->damageRectsCount == 0 || damage->count < 0 || damage->count < 0 ||
damage->count + tex->damageRectsCount > KVMFR_MAX_DAMAGE_RECTS; damage->count + tex->damageRectsCount > KVMFR_MAX_DAMAGE_RECTS)
{
if (damageAll) // damage all
framebuffer_write(frame, tex->map, this->pitch * this->dataHeight); framebuffer_write(frame, tex->map, this->pitch * this->dataHeight);
}
else else
{ {
memcpy(damage->rects + damage->count, tex->damageRects, memcpy(damage->rects + damage->count, tex->damageRects,