stratagus-cvs
[Top][All Lists]
Advanced

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

[Stratagus-CVS] stratagus/src map/minimap.c stratagus/mainloop....


From: address@hidden
Subject: [Stratagus-CVS] stratagus/src map/minimap.c stratagus/mainloop....
Date: 15 Jan 2004 11:57:02 +1100

CVSROOT:        /home/strat
Module name:    stratagus
Changes by:      <address@hidden>       04/01/15 11:57:01

Modified files:
        src/map        : minimap.c 
        src/stratagus  : mainloop.c 
        src/ui         : mainscr.c ui.c 

Log message:
        Allow Panels to be missing

Patches:
Index: stratagus/src/map/minimap.c
diff -u stratagus/src/map/minimap.c:1.90 stratagus/src/map/minimap.c:1.91
--- stratagus/src/map/minimap.c:1.90    Thu Jan 15 09:31:06 2004
+++ stratagus/src/map/minimap.c Thu Jan 15 11:56:59 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: minimap.c,v 1.90 2004/01/14 22:31:06 nobody_ Exp $
+//     $Id: minimap.c,v 1.91 2004/01/15 00:56:59 wizzard Exp $
 
 //@{
 
@@ -138,8 +138,10 @@
        srect.y = TheUI.MinimapPosY - TheUI.MinimapPanelY;
        srect.w = TheUI.MinimapW;
        srect.h = TheUI.MinimapH;
-       SDL_BlitSurface(TheUI.MinimapPanel.Graphic->Surface, &srect,
-               MinimapSurface, NULL);
+       if (TheUI.MinimapPanel.Graphic) {
+               SDL_BlitSurface(TheUI.MinimapPanel.Graphic->Surface, &srect,
+                       MinimapSurface, NULL);
+       }
 
        if (!TheUI.MinimapTransparent) {
                VideoFillRectangle(ColorBlack, MinimapX, MinimapY,
Index: stratagus/src/stratagus/mainloop.c
diff -u stratagus/src/stratagus/mainloop.c:1.177 
stratagus/src/stratagus/mainloop.c:1.178
--- stratagus/src/stratagus/mainloop.c:1.177    Thu Jan 15 09:31:08 2004
+++ stratagus/src/stratagus/mainloop.c  Thu Jan 15 11:57:00 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: mainloop.c,v 1.177 2004/01/14 22:31:08 nobody_ Exp $
+//     $Id: mainloop.c,v 1.178 2004/01/15 00:57:00 wizzard Exp $
 
 //@{
 
@@ -535,6 +535,27 @@
 
        if (MustRedraw & RedrawMap) {
                DrawMapArea();
+
+               //
+               // Force Redraw Items that are ontop of map, they don't have a 
panel
+               //
+               if (!TheUI.MinimapPanel.Graphic) {
+                       MustRedraw |= RedrawMinimapBorder;
+                       MustRedraw |= RedrawMinimap;
+               }
+               if (!TheUI.InfoPanel.Graphic) {
+                       MustRedraw |= RedrawInfoPanel;
+               }
+               if (!TheUI.ButtonPanel.Graphic) {
+                       MustRedraw |= RedrawButtonPanel;
+               }
+               if (!TheUI.Resource.Graphic) {
+                       MustRedraw |= RedrawResources;
+               }
+               if (!TheUI.StatusLine.Graphic) {
+                       MustRedraw |= RedrawStatusLine;
+               }
+               
        }
 
        if (MustRedraw & (RedrawMessage | RedrawMap)) {
@@ -556,10 +577,16 @@
                DrawMenuButtonArea();
        }
        if (MustRedraw & RedrawMinimapBorder) {
-               VideoDrawSubClip(TheUI.MinimapPanel.Graphic, 0, 0,
-                       TheUI.MinimapPanel.Graphic->Width,
-                       TheUI.MinimapPanel.Graphic->Height,
-                       TheUI.MinimapPanelX, TheUI.MinimapPanelY);
+               if (TheUI.MinimapPanel.Graphic) {
+                       VideoDrawSubClip(TheUI.MinimapPanel.Graphic, 0, 0,
+                               TheUI.MinimapPanel.Graphic->Width,
+                               TheUI.MinimapPanel.Graphic->Height,
+                               TheUI.MinimapPanelX, TheUI.MinimapPanelY);
+               } else {
+                       VideoDrawRectangle(TheUI.CompletedBarColor,
+                               TheUI.MinimapPosX - 1, TheUI.MinimapPosY - 1,
+                               TheUI.MinimapW + 2, TheUI.MinimapH + 2);
+               }
        }
 
        if (MustRedraw & RedrawMinimap) {
@@ -654,10 +681,12 @@
                        }
                }
                if (MustRedraw & RedrawMinimapBorder) {
-                       InvalidateAreaAndCheckCursor(
-                               TheUI.MinimapPanelX, TheUI.MinimapPanelY,
-                               TheUI.MinimapPanel.Graphic->Width,
-                               TheUI.MinimapPanel.Graphic->Height);
+                       if (TheUI.MinimapPanel.Graphic) {
+                               InvalidateAreaAndCheckCursor(
+                                       TheUI.MinimapPanelX, 
TheUI.MinimapPanelY,
+                                       TheUI.MinimapPanel.Graphic->Width,
+                                       TheUI.MinimapPanel.Graphic->Height);
+                       }
                } else if ((MustRedraw & RedrawMinimap) ||
                                (MustRedraw & RedrawMinimapCursor)) {
                        // FIXME: Redraws too much of the minimap
Index: stratagus/src/ui/mainscr.c
diff -u stratagus/src/ui/mainscr.c:1.151 stratagus/src/ui/mainscr.c:1.152
--- stratagus/src/ui/mainscr.c:1.151    Thu Jan 15 09:31:09 2004
+++ stratagus/src/ui/mainscr.c  Thu Jan 15 11:57:00 2004
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: mainscr.c,v 1.151 2004/01/14 22:31:09 nobody_ Exp $
+//     $Id: mainscr.c,v 1.152 2004/01/15 00:57:00 wizzard Exp $
 
 //@{
 
@@ -940,9 +940,14 @@
        }
        if (StatusLine[0]) {
                PushClipping();
-               SetClipping(TheUI.StatusLineTextX, TheUI.StatusLineTextY,
-                       TheUI.StatusLineX + TheUI.StatusLine.Graphic->Width - 1,
-                       TheUI.StatusLineY + TheUI.StatusLine.Graphic->Height - 
1);
+               if (TheUI.StatusLine.Graphic) {
+                       SetClipping(TheUI.StatusLineTextX, 
TheUI.StatusLineTextY,
+                               TheUI.StatusLineX + 
TheUI.StatusLine.Graphic->Width - 1,
+                               TheUI.StatusLineY + 
TheUI.StatusLine.Graphic->Height - 1);
+               } else {
+                       SetClipping(TheUI.StatusLineTextX, 
TheUI.StatusLineTextY,
+                               VideoWidth - 1, VideoHeight - 1);
+               }
                VideoDrawTextClip(TheUI.StatusLineTextX, TheUI.StatusLineTextY,
                        TheUI.StatusLineFont, StatusLine);
                PopClipping();
Index: stratagus/src/ui/ui.c
diff -u stratagus/src/ui/ui.c:1.97 stratagus/src/ui/ui.c:1.98
--- stratagus/src/ui/ui.c:1.97  Thu Jan 15 04:50:04 2004
+++ stratagus/src/ui/ui.c       Thu Jan 15 11:57:01 2004
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: ui.c,v 1.97 2004/01/14 17:50:04 jsalmon3 Exp $
+//      $Id: ui.c,v 1.98 2004/01/15 00:57:01 wizzard Exp $
 
 //@{
 
@@ -219,7 +219,7 @@
 #endif
                }
        }
-       if (TheUI.Resource.File) {
+       if (TheUI.Resource.File && *TheUI.Resource.File) {
                TheUI.Resource.Graphic = LoadGraphic(TheUI.Resource.File);
 #ifdef USE_OPENGL
                MakeTexture(TheUI.Resource.Graphic, 
TheUI.Resource.Graphic->Width,
@@ -687,7 +687,7 @@
        int i;
 
        CLprintf(file, "\n;;; -----------------------------------------\n");
-       CLprintf(file, ";;; MODULE: ui $Id: ui.c,v 1.97 2004/01/14 17:50:04 
jsalmon3 Exp $\n\n");
+       CLprintf(file, ";;; MODULE: ui $Id: ui.c,v 1.98 2004/01/15 00:57:01 
wizzard Exp $\n\n");
 
        // Scrolling
        CLprintf(file, "(set-mouse-scroll! %s)\n", TheUI.MouseScroll ? "#t" : 
"#f");




reply via email to

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