From d4c1672f2e51f17dd6d125c37ec2ef058faf5d69 Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Tue, 8 Oct 2019 12:24:49 +0200 Subject: [PATCH] Source rect for begin scene can be NULL --- src/IVideoDriver.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/IVideoDriver.cpp b/src/IVideoDriver.cpp index 517275d..86d7347 100644 --- a/src/IVideoDriver.cpp +++ b/src/IVideoDriver.cpp @@ -38,18 +38,21 @@ extern "C" { irr::video::SExposedVideoData vdata = irr::video::SExposedVideoData(); // Source rect - irr::core::rect rect = \ - irr::core::rect(sourceRect->x, - sourceRect->y, - sourceRect->x2, - sourceRect->y2); + irr::core::rect rect; + if (sourceRect != NULL) + { + rect = irr::core::rect(sourceRect->x, + sourceRect->y, + sourceRect->x2, + sourceRect->y2); + } // Begin scene return ((irr::video::IVideoDriver*)driver)->beginScene(backBuffer, - zBuffer, - col, - vdata, - &rect); + zBuffer, + col, + vdata, + sourceRect != NULL ? &rect : 0); } bool irr_video_IVideoDriver_endScene(void* driver) -- 2.39.5