X-Git-Url: https://code.delx.au/refind/blobdiff_plain/4bb04fb4ee646fbfa209762ea238e531721b6b5e..ec097428f9fb581bb0842bb840b5713e176dd0f4:/refind/screen.c diff --git a/refind/screen.c b/refind/screen.c index 6aa04be..32711d6 100644 --- a/refind/screen.c +++ b/refind/screen.c @@ -33,6 +33,14 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* + * Modifications copyright (c) 2012 Roderick W. Smith + * + * Modifications distributed under the terms of the GNU General Public + * License (GPL) version 3 (GPLv3), a copy of which must be distributed + * with this source code or binaries made from it. + * + */ #include "global.h" #include "screen.h" @@ -59,6 +67,7 @@ BOOLEAN AllowGraphicsMode; EG_PIXEL StdBackgroundPixel = { 0xbf, 0xbf, 0xbf, 0 }; EG_PIXEL MenuBackgroundPixel = { 0xbf, 0xbf, 0xbf, 0 }; +EG_PIXEL DarkBackgroundPixel = { 0x0, 0x0, 0x0, 0 }; static BOOLEAN GraphicsScreenDirty; @@ -115,8 +124,8 @@ VOID SetupScreen(VOID) { GlobalConfig.RequestedTextMode = egSetTextMode(GlobalConfig.RequestedTextMode); - if ((GlobalConfig.RequestedScreenWidth > 0) && (GlobalConfig.RequestedScreenHeight > 0) && - egSetScreenSize(GlobalConfig.RequestedScreenWidth, GlobalConfig.RequestedScreenHeight)) { + if ((GlobalConfig.RequestedScreenWidth > 0) && + (egSetScreenSize(&GlobalConfig.RequestedScreenWidth, &GlobalConfig.RequestedScreenHeight))) { UGAWidth = GlobalConfig.RequestedScreenWidth; UGAHeight = GlobalConfig.RequestedScreenHeight; } // if user requested a particular screen resolution @@ -181,8 +190,6 @@ VOID FinishTextScreen(IN BOOLEAN WaitAlways) VOID BeginExternalScreen(IN BOOLEAN UseGraphicsMode, IN CHAR16 *Title) { - EG_PIXEL DarkBackgroundPixel = { 0x0, 0x0, 0x0, 0 }; - if (!AllowGraphicsMode) UseGraphicsMode = FALSE; @@ -194,9 +201,6 @@ VOID BeginExternalScreen(IN BOOLEAN UseGraphicsMode, IN CHAR16 *Title) DrawScreenHeader(Title); } // if/else - // show the header -// DrawScreenHeader(Title); - if (!UseGraphicsMode) SwitchToText(TRUE); @@ -214,6 +218,9 @@ VOID FinishExternalScreen(VOID) PauseForKey(); } + // Reset the screen resolution, in case external program changed it.... + SetupScreen(); + // reset error flag haveError = FALSE; } @@ -233,8 +240,9 @@ static VOID DrawScreenHeader(IN CHAR16 *Title) UINTN y; // clear to black background + egClearScreen(&DarkBackgroundPixel); // first clear in graphics mode refit_call2_wrapper(ST->ConOut->SetAttribute, ST->ConOut, ATTR_BASIC); - refit_call1_wrapper(ST->ConOut->ClearScreen, ST->ConOut); + refit_call1_wrapper(ST->ConOut->ClearScreen, ST->ConOut); // then clear in text mode // paint header background refit_call2_wrapper(ST->ConOut->SetAttribute, ST->ConOut, ATTR_BANNER);