stratagus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Stratagus-CVS] stratagus doc/ChangeLog.html src/game/intro.c


From: Russell Smith
Subject: [Stratagus-CVS] stratagus doc/ChangeLog.html src/game/intro.c
Date: Sat, 20 Sep 2003 05:59:18 -0400

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Russell Smith <address@hidden>  03/09/20 05:59:17

Modified files:
        doc            : ChangeLog.html 
        src/game       : intro.c 

Log message:
        Allow victory/defeat backgrounds to not be set

Patches:
Index: stratagus/doc/ChangeLog.html
diff -u stratagus/doc/ChangeLog.html:1.534 stratagus/doc/ChangeLog.html:1.535
--- stratagus/doc/ChangeLog.html:1.534  Sat Sep 20 05:03:40 2003
+++ stratagus/doc/ChangeLog.html        Sat Sep 20 05:59:17 2003
@@ -2,7 +2,7 @@
 <html>
 <head>
 <!--
-----   $Id: ChangeLog.html,v 1.534 2003/09/20 09:03:40 mr-russ Exp $
+----   $Id: ChangeLog.html,v 1.535 2003/09/20 09:59:17 mr-russ Exp $
 
 ----   (c) Copyright 1998-2003 by Lutz Sammer
 
@@ -36,6 +36,7 @@
 <li>Future 1.19 Release<p>
     <ul>
     <li>++
+    <li>Allow victory/defeat backgrounds to not be set (from Russell Smith).
     <li>Removed 'tower CCL directive (from Russell Smith).
     <li>Fixed Save/Load bug when spaces in race display name (from Russell 
Smith).
     <li>Updated show-map-location to be more flexible (from Russell Smith).
Index: stratagus/src/game/intro.c
diff -u stratagus/src/game/intro.c:1.98 stratagus/src/game/intro.c:1.99
--- stratagus/src/game/intro.c:1.98     Sun Aug 17 11:57:07 2003
+++ stratagus/src/game/intro.c  Sat Sep 20 05:59:17 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: intro.c,v 1.98 2003/08/17 15:57:07 n0body Exp $
+//     $Id: intro.c,v 1.99 2003/09/20 09:59:17 mr-russ Exp $
 
 //@{
 
@@ -1279,19 +1279,31 @@
     callbacks.SoundReady=WriteSound;
 
     if (GameResult==GameVictory) {
-       background=LoadGraphic(TheUI.VictoryBackground.File);
+       if ( TheUI.VictoryBackground.File ) {
+           background=LoadGraphic(TheUI.VictoryBackground.File);
+       } else {
+           background=NULL;
+       }
     } else {
-       background=LoadGraphic(TheUI.DefeatBackground.File);
+       if ( TheUI.DefeatBackground.File ) {
+           background=LoadGraphic(TheUI.DefeatBackground.File);
+       } else {
+           background=NULL;
+       }
     }
-    ResizeGraphic(background,VideoWidth,VideoHeight);
+    if (background) {
+       ResizeGraphic(background,VideoWidth,VideoHeight);
 #ifdef USE_OPENGL
-    MakeTexture(background,background->Width,background->Height);
+       MakeTexture(background,background->Width,background->Height);
 #endif
+    }
 
     VideoLockScreen();
     VideoClearScreen();
-    VideoDrawSubClip(background,0,0,background->Width,background->Height,
-       (VideoWidth-background->Width)/2,(VideoHeight-background->Height)/2);
+    if (background) {
+       VideoDrawSubClip(background,0,0,background->Width,background->Height,
+           
(VideoWidth-background->Width)/2,(VideoHeight-background->Height)/2);
+    }
     VideoUnlockScreen();
 
     UseContinueButton=1;
@@ -1307,8 +1319,10 @@
        VideoLockScreen();
        HideAnyCursor();
 #ifdef USE_OPENGL
-       VideoDrawSubClip(background,0,0,background->Width,background->Height,
-           
(VideoWidth-background->Width)/2,(VideoHeight-background->Height)/2);
+       if (background) {
+           
VideoDrawSubClip(background,0,0,background->Width,background->Height,
+               
(VideoWidth-background->Width)/2,(VideoHeight-background->Height)/2);
+       }
        GameStatsDrawFunc(frame);
 #else
        if( !done ) {
@@ -1330,7 +1344,9 @@
        ++frame;
     }
 
-    VideoFree(background);
+    if( background ) {
+       VideoFree(background);
+    }
     VideoSyncSpeed=old_video_sync;
     SetVideoSync();
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]