From 6131e8497f63c2d6d37ab6d545de209d33ef3e44 Mon Sep 17 00:00:00 2001
From: tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Mon, 21 Jul 2008 10:03:15 +0000
Subject: usage of glPushAttrib(GL_VIEWPORT_BIT) to save the viewport settings.

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1219 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 Game/Code/Menu/UDisplay.pas | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

(limited to 'Game')

diff --git a/Game/Code/Menu/UDisplay.pas b/Game/Code/Menu/UDisplay.pas
index 953282d7..67eed740 100644
--- a/Game/Code/Menu/UDisplay.pas
+++ b/Game/Code/Menu/UDisplay.pas
@@ -177,7 +177,8 @@ begin
         //Create Fading texture if we're just starting
         if FadeState = 0 then
         begin
-          // resize viewport to fit texture
+          // save old viewport and resize to fit texture
+          glPushAttrib(GL_VIEWPORT_BIT);
           glViewPort(0, 0, 512, 512);
 
           // draw screen that will be faded
@@ -196,7 +197,9 @@ begin
             FadeFailed := true;
             Log.LogWarn('Fading disabled: ' + gluErrorString(glError), 'TDisplay.Draw');
           end;
-          glViewPort((S-1) * ScreenW div Screens, 0, ScreenW div Screens, ScreenH);
+
+          // restore viewport
+          glPopAttrib();
 
           // blackscreen-hack
           if not BlackScreen then
-- 
cgit v1.2.3