[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src/ui icons.c
From: |
Jimmy Salmon |
Subject: |
[Stratagus-CVS] stratagus/src/ui icons.c |
Date: |
Tue, 07 Oct 2003 02:59:51 -0400 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: Jimmy Salmon <address@hidden> 03/10/07 02:59:51
Modified files:
src/ui : icons.c
Log message:
Fixed off by 1 bugs in DrawUnitIcon
Patches:
Index: stratagus/src/ui/icons.c
diff -u stratagus/src/ui/icons.c:1.46 stratagus/src/ui/icons.c:1.47
--- stratagus/src/ui/icons.c:1.46 Mon Sep 29 11:41:29 2003
+++ stratagus/src/ui/icons.c Tue Oct 7 02:59:50 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: icons.c,v 1.46 2003/09/29 15:41:29 jsalmon3 Exp $
+// $Id: icons.c,v 1.47 2003/10/07 06:59:50 jsalmon3 Exp $
//@{
@@ -380,7 +380,7 @@
//
// Black border around icon with gray border if active.
//
- color = (flags & IconActive) ? ColorGray : ColorBlack;
+ color = (flags & (IconActive | IconClicked)) ? ColorGray : ColorBlack;
width = icon->Width;
height = icon->Height;
@@ -389,32 +389,32 @@
width + 5, height + 5);
// _| Shadow
- VideoDrawVLine(ColorGray, x + width + 4, y + 5, height - 1);
- VideoDrawVLine(ColorGray, x + width + 5, y + 5, height - 1);
- VideoDrawHLine(ColorGray, x + 5, y + height + 4, width + 1);
- VideoDrawHLine(ColorGray, x + 5, y + height + 5, width + 1);
+ VideoDrawVLine(ColorGray, x + width + 3, y + 2, height + 1);
+ VideoDrawVLine(ColorGray, x + width + 4, y + 2, height + 1);
+ VideoDrawHLine(ColorGray, x + 2, y + height + 3, width + 3);
+ VideoDrawHLine(ColorGray, x + 2, y + height + 4, width + 3);
// |~ Light
color = (flags & IconClicked) ? ColorGray : ColorWhite;
- VideoDrawHLine(color, x + 5, y + 3, width + 1);
- VideoDrawHLine(color, x + 5, y + 4, width + 1);
- VideoDrawVLine(color, x + 3, y + 3, height + 3);
- VideoDrawVLine(color, x + 4, y + 3, height + 3);
+ VideoDrawHLine(color, x + 4, y + 2, width - 1);
+ VideoDrawHLine(color, x + 4, y + 3, width - 1);
+ VideoDrawVLine(color, x + 2, y + 2, height + 1);
+ VideoDrawVLine(color, x + 3, y + 2, height + 1);
if (flags & IconClicked) {
- x += 5;
- y += 5;
- } else {
x += 4;
y += 4;
+ } else {
+ x += 3;
+ y += 3;
}
DrawIcon(player, icon, x, y);
if (flags & IconSelected) {
- VideoDrawRectangleClip(ColorGreen, x, y, width, height);
+ VideoDrawRectangleClip(ColorGreen, x - 1, y - 1, width + 1, height + 1);
} else if (flags & IconAutoCast) {
- VideoDrawRectangleClip(ColorBlue, x, y, width, height);
+ VideoDrawRectangleClip(ColorBlue, x - 1, y - 1, width + 1, height + 1);
}
}
@@ -429,7 +429,7 @@
int i;
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: icons $Id: icons.c,v 1.46 2003/09/29 15:41:29
jsalmon3 Exp $\n\n");
+ CLprintf(file, ";;; MODULE: icons $Id: icons.c,v 1.47 2003/10/07 06:59:50
jsalmon3 Exp $\n\n");
//
// Mapping the original icon numbers in puds to our internal strings
- [Stratagus-CVS] stratagus/src/ui icons.c,
Jimmy Salmon <=