stratagus-cvs
[Top][All Lists]
Advanced

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

[Stratagus-CVS] stratagus data/ccl/stratagus.ccl src/include/ui...


From: Jimmy Salmon
Subject: [Stratagus-CVS] stratagus data/ccl/stratagus.ccl src/include/ui...
Date: Tue, 07 Oct 2003 12:27:21 -0400

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Jimmy Salmon <address@hidden>   03/10/07 12:27:20

Modified files:
        data/ccl       : stratagus.ccl 
        src/include    : ui.h 
        src/ui         : ccl_ui.c mainscr.c ui.c 

Log message:
        Removed original resources option

Patches:
Index: stratagus/data/ccl/stratagus.ccl
diff -u stratagus/data/ccl/stratagus.ccl:1.18 
stratagus/data/ccl/stratagus.ccl:1.19
--- stratagus/data/ccl/stratagus.ccl:1.18       Sat Sep 27 15:05:47 2003
+++ stratagus/data/ccl/stratagus.ccl    Tue Oct  7 12:27:17 2003
@@ -26,7 +26,7 @@
 ;;      along with this program; if not, write to the Free Software
 ;;      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  
USA
 ;;
-;;     $Id: stratagus.ccl,v 1.18 2003/09/27 19:05:47 n0body Exp $
+;;     $Id: stratagus.ccl,v 1.19 2003/10/07 16:27:17 jsalmon3 Exp $
 
 ;; For documentation see stratagus/doc/ccl/ccl.html
 
@@ -189,10 +189,6 @@
 (shadow-sprite "graphics/missiles/unit_shadow.png"     3 42    32 32)
 (spell-sprite "graphics/ui/bloodlust,haste,slow,invisible,shield.png"
   1 1  16 16)
-
-;;     Edit this to enable/disable the original game resource line.
-(set-original-resources! #f)
-;(set-original-resources! #t)
 
 ;;     Uncomment next, to enable fancy building (random mirroring buildings)
 (set-fancy-buildings! #t)
Index: stratagus/src/include/ui.h
diff -u stratagus/src/include/ui.h:1.69 stratagus/src/include/ui.h:1.70
--- stratagus/src/include/ui.h:1.69     Tue Oct  7 08:03:40 2003
+++ stratagus/src/include/ui.h  Tue Oct  7 12:27:18 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: ui.h,v 1.69 2003/10/07 12:03:40 martinxyz Exp $
+//     $Id: ui.h,v 1.70 2003/10/07 16:27:18 jsalmon3 Exp $
 
 #ifndef __UI_H__
 #define __UI_H__
@@ -183,8 +183,6 @@
     GraphicConfig Resource;            /// Resource background
     int                ResourceX;              /// Resource X position
     int                ResourceY;              /// Resource Y position
-
-    int                OriginalResources;      /// Original resource mode
 
     struct {
 #if 0
Index: stratagus/src/ui/ccl_ui.c
diff -u stratagus/src/ui/ccl_ui.c:1.132 stratagus/src/ui/ccl_ui.c:1.133
--- stratagus/src/ui/ccl_ui.c:1.132     Tue Oct  7 08:03:41 2003
+++ stratagus/src/ui/ccl_ui.c   Tue Oct  7 12:27:18 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: ccl_ui.c,v 1.132 2003/10/07 12:03:41 martinxyz Exp $
+//     $Id: ccl_ui.c,v 1.133 2003/10/07 16:27:18 jsalmon3 Exp $
 
 //@{
 
@@ -477,22 +477,6 @@
 }
 
 /**
-**     Enable/disable resource extension, use original resource display.
-**
-**     @param flag     True = turn on, false = off.
-**     @return         The old state of scrolling.
-*/
-local SCM CclSetOriginalResources(SCM flag)
-{
-    int old;
-
-    old = TheUI.OriginalResources;
-    TheUI.OriginalResources = gh_scm2bool(flag);
-
-    return gh_bool2scm(old);
-}
-
-/**
 **     Define a cursor.
 **
 **     FIXME: need some general data structure to make this parsing easier.
@@ -784,8 +768,6 @@
     ui->MouseAdjust = TheUI.MouseAdjust;
     ui->MouseScale = TheUI.MouseScale;
 
-    ui->OriginalResources = TheUI.OriginalResources;
-
     ui->Resource.File = NULL;
     ui->ResourceX = -1;
     ui->ResourceY = -1;
@@ -2966,8 +2948,6 @@
 
     gh_new_procedure1_0("display-picture", CclDisplayPicture);
     gh_new_procedure1_0("process-menu", CclProcessMenu);
-
-    gh_new_procedure1_0("set-original-resources!", CclSetOriginalResources);
 
     gh_new_procedureN("define-cursor", CclDefineCursor);
     gh_new_procedure1_0("set-game-cursor!", CclSetGameCursor);
Index: stratagus/src/ui/mainscr.c
diff -u stratagus/src/ui/mainscr.c:1.128 stratagus/src/ui/mainscr.c:1.129
--- stratagus/src/ui/mainscr.c:1.128    Tue Oct  7 08:03:41 2003
+++ stratagus/src/ui/mainscr.c  Tue Oct  7 12:27:19 2003
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: mainscr.c,v 1.128 2003/10/07 12:03:41 martinxyz Exp $
+//     $Id: mainscr.c,v 1.129 2003/10/07 16:27:19 jsalmon3 Exp $
 
 //@{
 
@@ -490,30 +490,30 @@
        }
 
     }
-       if (type->CanCastSpell) {
-           if (0) {
-               VideoDrawText(x + 59, y + 8 + 140 + 1, GameFont, "Magic:");
-               VideoDrawRectangleClip(ColorGray, x + 108, y + 8 + 140, 61, 14);
-               VideoDrawRectangleClip(ColorBlack, x + 108 + 1, y + 8 + 140 + 
1, 61 - 2, 14 - 2);
-               i = (100 * unit->Mana) / unit->Type->_MaxMana;
-               i = (i * (61 - 4)) / 100;
-               VideoFillRectangleClip(ColorBlue, x + 108 + 2, y + 8 + 140 + 2, 
i, 14 - 4);
+    if (type->CanCastSpell) {
+       if (0) {
+           VideoDrawText(x + 59, y + 8 + 140 + 1, GameFont, "Magic:");
+           VideoDrawRectangleClip(ColorGray, x + 108, y + 8 + 140, 61, 14);
+           VideoDrawRectangleClip(ColorBlack, x + 108 + 1, y + 8 + 140 + 1, 61 
- 2, 14 - 2);
+           i = (100 * unit->Mana) / unit->Type->_MaxMana;
+           i = (i * (61 - 4)) / 100;
+           VideoFillRectangleClip(ColorBlue, x + 108 + 2, y + 8 + 140 + 2, i, 
14 - 4);
 
-               VideoDrawNumber(x + 128, y + 8 + 140 + 1, GameFont, unit->Mana);
-           } else {
-               int w;
-               w = 140;
-               /* fix to display mana bar properly for any maxmana value */
-               /* max mana can vary for the unit */
-               i = (100 * unit->Mana) / unit->Type->_MaxMana;
-               i = (i * w) / 100;
-               VideoDrawRectangleClip(ColorGray, x + 16,     y + 8 + 140,     
w + 4, 16    );
-               VideoDrawRectangleClip(ColorBlack,x + 16 + 1, y + 8 + 140 + 1, 
w + 2, 16 - 2);
-               VideoFillRectangleClip(ColorBlue, x + 16 + 2, y + 8 + 140 + 2, 
i,     16 - 4);
+           VideoDrawNumber(x + 128, y + 8 + 140 + 1, GameFont, unit->Mana);
+       } else {
+           int w;
+           w = 140;
+           /* fix to display mana bar properly for any maxmana value */
+           /* max mana can vary for the unit */
+           i = (100 * unit->Mana) / unit->Type->_MaxMana;
+           i = (i * w) / 100;
+           VideoDrawRectangleClip(ColorGray, x + 16,     y + 8 + 140,     w + 
4, 16    );
+           VideoDrawRectangleClip(ColorBlack,x + 16 + 1, y + 8 + 140 + 1, w + 
2, 16 - 2);
+           VideoFillRectangleClip(ColorBlue, x + 16 + 2, y + 8 + 140 + 2, i,   
  16 - 4);
 
-               VideoDrawNumber(x + 16 + w / 2, y + 8 + 140 + 1, GameFont, 
unit->Mana);
-           }
+           VideoDrawNumber(x + 16 + w / 2, y + 8 + 140 + 1, GameFont, 
unit->Mana);
        }
+    }
 }
 
 /*----------------------------------------------------------------------------
@@ -536,73 +536,48 @@
            TheUI.ResourceX,TheUI.ResourceY);
     }
 
-    if (TheUI.OriginalResources) {
-       // FIXME: could write a sub function for this
-       VideoDrawSubClip(TheUI.Resources[GoldCost].Icon.Graphic, 0,
-           TheUI.Resources[GoldCost].IconRow * TheUI.Resources[GoldCost].IconH,
-           TheUI.Resources[GoldCost].IconW,
-           TheUI.Resources[GoldCost].IconH,
-           TheUI.ResourceX + 90, TheUI.ResourceY);
-       VideoDrawNumber(TheUI.ResourceX + 107, TheUI.ResourceY + 1,
-           GameFont, ThisPlayer->Resources[GoldCost]);
-       VideoDrawSubClip(TheUI.Resources[WoodCost].Icon.Graphic, 0,
-           TheUI.Resources[WoodCost].IconRow * TheUI.Resources[WoodCost].IconH,
-           TheUI.Resources[WoodCost].IconW,
-           TheUI.Resources[WoodCost].IconH,
-           TheUI.ResourceX + 178, TheUI.ResourceY);
-       VideoDrawNumber(TheUI.ResourceX + 195, TheUI.ResourceY + 1,
-           GameFont, ThisPlayer->Resources[WoodCost]);
-       VideoDrawSubClip(TheUI.Resources[OilCost].Icon.Graphic, 0,
-           TheUI.Resources[OilCost].IconRow * TheUI.Resources[OilCost].IconH,
-           TheUI.Resources[OilCost].IconW,
-           TheUI.Resources[OilCost].IconH,
-           TheUI.ResourceX + 266, TheUI.ResourceY);
-       VideoDrawNumber(TheUI.ResourceX + 283, TheUI.ResourceY + 1,
-           GameFont, ThisPlayer->Resources[OilCost]);
-    } else {
-       for (i = 0; i < MaxCosts; ++i) {
-           if (TheUI.Resources[i].Icon.Graphic) {
-               VideoDrawSubClip(TheUI.Resources[i].Icon.Graphic, 0,
-                   TheUI.Resources[i].IconRow * TheUI.Resources[i].IconH,
-                   TheUI.Resources[i].IconW, TheUI.Resources[i].IconH,
-                   TheUI.Resources[i].IconX, TheUI.Resources[i].IconY);
-           }
-           if (TheUI.Resources[i].TextX != -1) {
-               v = ThisPlayer->Resources[i];
-               VideoDrawNumber(TheUI.Resources[i].TextX,
-                   TheUI.Resources[i].TextY + (v > 99999) * 3,
-                   v > 99999 ? SmallFont : GameFont, v);
-           }
+    for (i = 0; i < MaxCosts; ++i) {
+       if (TheUI.Resources[i].Icon.Graphic) {
+           VideoDrawSubClip(TheUI.Resources[i].Icon.Graphic, 0,
+               TheUI.Resources[i].IconRow * TheUI.Resources[i].IconH,
+               TheUI.Resources[i].IconW, TheUI.Resources[i].IconH,
+               TheUI.Resources[i].IconX, TheUI.Resources[i].IconY);
+       }
+       if (TheUI.Resources[i].TextX != -1) {
+           v = ThisPlayer->Resources[i];
+           VideoDrawNumber(TheUI.Resources[i].TextX,
+               TheUI.Resources[i].TextY + (v > 99999) * 3,
+               v > 99999 ? SmallFont : GameFont, v);
        }
-       if (TheUI.Resources[FoodCost].Icon.Graphic) {
-           VideoDrawSubClip(TheUI.Resources[FoodCost].Icon.Graphic, 0,
-               TheUI.Resources[FoodCost].IconRow * 
TheUI.Resources[FoodCost].IconH,
-               TheUI.Resources[FoodCost].IconW, 
TheUI.Resources[FoodCost].IconH,
-               TheUI.Resources[FoodCost].IconX, 
TheUI.Resources[FoodCost].IconY);
-       }
-       if (TheUI.Resources[FoodCost].TextX != -1) {
-           sprintf(tmp, "%d/%d", ThisPlayer->NumFoodUnits, ThisPlayer->Food);
-           if (ThisPlayer->Food < ThisPlayer->NumFoodUnits) {
-               VideoDrawReverseText(TheUI.Resources[FoodCost].TextX,
-                   TheUI.Resources[FoodCost].TextY, GameFont, tmp);
-           } else {
-               VideoDrawText(TheUI.Resources[FoodCost].TextX,
-                   TheUI.Resources[FoodCost].TextY, GameFont, tmp);
-           }
+    }
+    if (TheUI.Resources[FoodCost].Icon.Graphic) {
+       VideoDrawSubClip(TheUI.Resources[FoodCost].Icon.Graphic, 0,
+           TheUI.Resources[FoodCost].IconRow * TheUI.Resources[FoodCost].IconH,
+           TheUI.Resources[FoodCost].IconW, TheUI.Resources[FoodCost].IconH,
+           TheUI.Resources[FoodCost].IconX, TheUI.Resources[FoodCost].IconY);
+    }
+    if (TheUI.Resources[FoodCost].TextX != -1) {
+       sprintf(tmp, "%d/%d", ThisPlayer->NumFoodUnits, ThisPlayer->Food);
+       if (ThisPlayer->Food < ThisPlayer->NumFoodUnits) {
+           VideoDrawReverseText(TheUI.Resources[FoodCost].TextX,
+               TheUI.Resources[FoodCost].TextY, GameFont, tmp);
+       } else {
+           VideoDrawText(TheUI.Resources[FoodCost].TextX,
+               TheUI.Resources[FoodCost].TextY, GameFont, tmp);
        }
+    }
 
-       if (TheUI.Resources[ScoreCost].Icon.Graphic) {
-           VideoDrawSubClip(TheUI.Resources[ScoreCost].Icon.Graphic, 0,
-               TheUI.Resources[ScoreCost].IconRow * 
TheUI.Resources[ScoreCost].IconH,
-               TheUI.Resources[ScoreCost].IconW, 
TheUI.Resources[ScoreCost].IconH,
-               TheUI.Resources[ScoreCost].IconX, 
TheUI.Resources[ScoreCost].IconY);
-       }
-       if (TheUI.Resources[ScoreCost].TextX != -1) {
-           v = ThisPlayer->Score;
-           VideoDrawNumber(TheUI.Resources[ScoreCost].TextX,
-               TheUI.Resources[ScoreCost].TextY + (v > 99999) * 3,
-               v > 99999 ? SmallFont : GameFont, v);
-       }
+    if (TheUI.Resources[ScoreCost].Icon.Graphic) {
+       VideoDrawSubClip(TheUI.Resources[ScoreCost].Icon.Graphic, 0,
+           TheUI.Resources[ScoreCost].IconRow * 
TheUI.Resources[ScoreCost].IconH,
+           TheUI.Resources[ScoreCost].IconW, TheUI.Resources[ScoreCost].IconH,
+           TheUI.Resources[ScoreCost].IconX, TheUI.Resources[ScoreCost].IconY);
+    }
+    if (TheUI.Resources[ScoreCost].TextX != -1) {
+       v = ThisPlayer->Score;
+       VideoDrawNumber(TheUI.Resources[ScoreCost].TextX,
+           TheUI.Resources[ScoreCost].TextY + (v > 99999) * 3,
+           v > 99999 ? SmallFont : GameFont, v);
     }
 }
 
Index: stratagus/src/ui/ui.c
diff -u stratagus/src/ui/ui.c:1.76 stratagus/src/ui/ui.c:1.77
--- stratagus/src/ui/ui.c:1.76  Mon Oct  6 16:54:15 2003
+++ stratagus/src/ui/ui.c       Tue Oct  7 12:27:20 2003
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: ui.c,v 1.76 2003/10/06 20:54:15 martinxyz Exp $
+//     $Id: ui.c,v 1.77 2003/10/07 16:27:20 jsalmon3 Exp $
 
 //@{
 
@@ -512,7 +512,7 @@
     int i;
 
     CLprintf(file, "\n;;; -----------------------------------------\n");
-    CLprintf(file, ";;; MODULE: ui $Id: ui.c,v 1.76 2003/10/06 20:54:15 
martinxyz Exp $\n\n");
+    CLprintf(file, ";;; MODULE: ui $Id: ui.c,v 1.77 2003/10/07 16:27:20 
jsalmon3 Exp $\n\n");
 
     // Contrast, Brightness, Saturation
     CLprintf(file, "(set-contrast! %d)\n", TheUI.Contrast);
@@ -528,9 +528,6 @@
 
     CLprintf(file, "(set-mouse-adjust! %d)\n", TheUI.MouseAdjust);
     CLprintf(file, "(set-mouse-scale! %d)\n\n", TheUI.MouseScale);
-
-    CLprintf(file, "(set-original-resources! %s)\n\n",
-       TheUI.OriginalResources ? "#t" : "#f");
 
     // Save the UIs for all resolutions
     for (i = 0; UI_Table[i]; ++i) {




reply via email to

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