[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src/ui ccl_ui.c mainscr.c
From: |
Jimmy Salmon |
Subject: |
[Stratagus-CVS] stratagus/src/ui ccl_ui.c mainscr.c |
Date: |
Sat, 04 Oct 2003 01:40:11 -0400 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: Jimmy Salmon <address@hidden> 03/10/04 01:40:11
Modified files:
src/ui : ccl_ui.c mainscr.c
Log message:
Don't require resource text
Patches:
Index: stratagus/src/ui/ccl_ui.c
diff -u stratagus/src/ui/ccl_ui.c:1.129 stratagus/src/ui/ccl_ui.c:1.130
--- stratagus/src/ui/ccl_ui.c:1.129 Sat Oct 4 01:26:50 2003
+++ stratagus/src/ui/ccl_ui.c Sat Oct 4 01:40:11 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ccl_ui.c,v 1.129 2003/10/04 05:26:50 jsalmon3 Exp $
+// $Id: ccl_ui.c,v 1.130 2003/10/04 05:40:11 jsalmon3 Exp $
//@{
@@ -1453,7 +1453,9 @@
ui->MinimapPosX = -1;
ui->MinimapPosY = -1;
-
+ for (i = 0; i < MaxCosts + 2; ++i) {
+ ui->Resources[i].TextX = -1;
+ }
//
// Parse the arguments, already the new tagged format.
// maxy: this could be much simpler
Index: stratagus/src/ui/mainscr.c
diff -u stratagus/src/ui/mainscr.c:1.126 stratagus/src/ui/mainscr.c:1.127
--- stratagus/src/ui/mainscr.c:1.126 Sat Oct 4 01:25:41 2003
+++ stratagus/src/ui/mainscr.c Sat Oct 4 01:40:11 2003
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: mainscr.c,v 1.126 2003/10/04 05:25:41 jsalmon3 Exp $
+// $Id: mainscr.c,v 1.127 2003/10/04 05:40:11 jsalmon3 Exp $
//@{
@@ -566,6 +566,8 @@
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,
@@ -578,13 +580,15 @@
TheUI.Resources[FoodCost].IconW,
TheUI.Resources[FoodCost].IconH,
TheUI.Resources[FoodCost].IconX,
TheUI.Resources[FoodCost].IconY);
}
- 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].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) {
@@ -593,10 +597,12 @@
TheUI.Resources[ScoreCost].IconW,
TheUI.Resources[ScoreCost].IconH,
TheUI.Resources[ScoreCost].IconX,
TheUI.Resources[ScoreCost].IconY);
}
- v = ThisPlayer->Score;
- VideoDrawNumber(TheUI.Resources[ScoreCost].TextX,
- TheUI.Resources[ScoreCost].TextY + (v > 99999) * 3,
- v > 99999 ? SmallFont : GameFont, v);
+ 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);
+ }
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Stratagus-CVS] stratagus/src/ui ccl_ui.c mainscr.c,
Jimmy Salmon <=