[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus data/ccl/human/ui.ccl data/ccl/orc/ui...
From: |
Jimmy Salmon |
Subject: |
[Stratagus-CVS] stratagus data/ccl/human/ui.ccl data/ccl/orc/ui... |
Date: |
Sat, 04 Oct 2003 01:26:50 -0400 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: Jimmy Salmon <address@hidden> 03/10/04 01:26:50
Modified files:
data/ccl/human : ui.ccl
data/ccl/orc : ui.ccl
src/clone : mainloop.c
src/editor : editloop.c
src/include : stratagus.h ui.h
src/map : minimap.c
src/ui : ccl_ui.c mouse.c ui.c
Log message:
Minimap size is configurable
Patches:
Index: stratagus/data/ccl/human/ui.ccl
diff -u stratagus/data/ccl/human/ui.ccl:1.38
stratagus/data/ccl/human/ui.ccl:1.39
--- stratagus/data/ccl/human/ui.ccl:1.38 Mon Sep 1 16:02:06 2003
+++ stratagus/data/ccl/human/ui.ccl Sat Oct 4 01:26:48 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: ui.ccl,v 1.38 2003/09/01 20:02:06 martinxyz Exp $
+;; $Id: ui.ccl,v 1.39 2003/10/04 05:26:48 jsalmon3 Exp $
(define-cursor 'cursor-point 'human
'image "ui/human/cursors/human_gauntlet.png"
@@ -99,8 +99,11 @@
'menu-panel (list "graphics/ui/human/menubutton.png" 0 0)
- 'minimap-panel (list "graphics/ui/human/minimap.png" 0 24)
- 'minimap-pos (list (+ 0 24) (+ 24 2))
+ 'minimap (list
+ 'file "graphics/ui/human/minimap.png"
+ 'panel-pos '(0 24)
+ 'pos (list (+ 0 24) (+ 24 2))
+ 'size '(128 128))
'status-line (list
'file (string-append "graphics/ui/human/"
Index: stratagus/data/ccl/orc/ui.ccl
diff -u stratagus/data/ccl/orc/ui.ccl:1.37 stratagus/data/ccl/orc/ui.ccl:1.38
--- stratagus/data/ccl/orc/ui.ccl:1.37 Mon Sep 1 16:02:07 2003
+++ stratagus/data/ccl/orc/ui.ccl Sat Oct 4 01:26:48 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: ui.ccl,v 1.37 2003/09/01 20:02:07 martinxyz Exp $
+;; $Id: ui.ccl,v 1.38 2003/10/04 05:26:48 jsalmon3 Exp $
(define-cursor 'cursor-point 'orc
'image "ui/orc/cursors/orcish_claw.png"
@@ -99,8 +99,11 @@
'menu-panel (list "graphics/ui/orc/menubutton.png" 0 0)
- 'minimap-panel (list "graphics/ui/orc/minimap.png" 0 24)
- 'minimap-pos (list (+ 0 24) (+ 24 2))
+ 'minimap (list
+ 'file "graphics/ui/orc/minimap.png"
+ 'panel-pos '(0 24)
+ 'pos (list (+ 0 24) (+ 24 2))
+ 'size '(128 128))
'status-line (list
'file (string-append "graphics/ui/orc/"
Index: stratagus/src/clone/mainloop.c
diff -u stratagus/src/clone/mainloop.c:1.144
stratagus/src/clone/mainloop.c:1.145
--- stratagus/src/clone/mainloop.c:1.144 Mon Sep 29 22:53:01 2003
+++ stratagus/src/clone/mainloop.c Sat Oct 4 01:26:48 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: mainloop.c,v 1.144 2003/09/30 02:53:01 jsalmon3 Exp $
+// $Id: mainloop.c,v 1.145 2003/10/04 05:26:48 jsalmon3 Exp $
//@{
@@ -689,7 +689,7 @@
// FIXME: Redraws too much of the minimap
InvalidateAreaAndCheckCursor(
TheUI.MinimapPosX,TheUI.MinimapPosY
- ,MINIMAP_W,MINIMAP_H);
+ ,TheUI.MinimapW,TheUI.MinimapH);
}
if( MustRedraw&RedrawInfoPanel ) {
InvalidateAreaAndCheckCursor(
Index: stratagus/src/editor/editloop.c
diff -u stratagus/src/editor/editloop.c:1.131
stratagus/src/editor/editloop.c:1.132
--- stratagus/src/editor/editloop.c:1.131 Fri Oct 3 13:53:29 2003
+++ stratagus/src/editor/editloop.c Sat Oct 4 01:26:48 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: editloop.c,v 1.131 2003/10/03 17:53:29 jsalmon3 Exp $
+// $Id: editloop.c,v 1.132 2003/10/04 05:26:48 jsalmon3 Exp $
//@{
@@ -1578,8 +1578,8 @@
//
// Minimap
//
- if (x >= TheUI.MinimapPosX && x < TheUI.MinimapPosX + MINIMAP_W &&
- y >= TheUI.MinimapPosY && y < TheUI.MinimapPosY + MINIMAP_H) {
+ if (x >= TheUI.MinimapPosX && x < TheUI.MinimapPosX + TheUI.MinimapW &&
+ y >= TheUI.MinimapPosY && y < TheUI.MinimapPosY + TheUI.MinimapH) {
CursorOn = CursorOnMinimap;
}
@@ -1731,8 +1731,8 @@
//
// Minimap
//
- if (x >= TheUI.MinimapPosX && x < TheUI.MinimapPosX + MINIMAP_W &&
- y >= TheUI.MinimapPosY && y < TheUI.MinimapPosY + MINIMAP_H) {
+ if (x >= TheUI.MinimapPosX && x < TheUI.MinimapPosX + TheUI.MinimapW &&
+ y >= TheUI.MinimapPosY && y < TheUI.MinimapPosY + TheUI.MinimapH) {
CursorOn = CursorOnMinimap;
return;
}
Index: stratagus/src/include/stratagus.h
diff -u stratagus/src/include/stratagus.h:1.16
stratagus/src/include/stratagus.h:1.17
--- stratagus/src/include/stratagus.h:1.16 Sat Sep 27 15:05:47 2003
+++ stratagus/src/include/stratagus.h Sat Oct 4 01:26:49 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: stratagus.h,v 1.16 2003/09/27 19:05:47 n0body Exp $
+// $Id: stratagus.h,v 1.17 2003/10/04 05:26:49 jsalmon3 Exp $
#ifndef __STRATAGUS_H__
#define __STRATAGUS_H__
@@ -355,9 +355,6 @@
// This is for 1600x1200
#define MAXMAP_W 50 /// Maximum map width in tiles on screen
#define MAXMAP_H 40 /// Maximum map height in tiles
-
-#define MINIMAP_W 128 /// Minimap width in pixels
-#define MINIMAP_H 128 /// Minimap height in pixels
/// Scrolling area (<= 15 y)
#define SCROLL_UP 15
Index: stratagus/src/include/ui.h
diff -u stratagus/src/include/ui.h:1.66 stratagus/src/include/ui.h:1.67
--- stratagus/src/include/ui.h:1.66 Wed Sep 3 09:30:43 2003
+++ stratagus/src/include/ui.h Sat Oct 4 01:26:49 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ui.h,v 1.66 2003/09/03 13:30:43 martinxyz Exp $
+// $Id: ui.h,v 1.67 2003/10/04 05:26:49 jsalmon3 Exp $
#ifndef __UI_H__
#define __UI_H__
@@ -261,6 +261,8 @@
GraphicConfig MinimapPanel; /// minimap panel background
int MinimapPanelX; /// minimap panel screen X
position
int MinimapPanelY; /// minimap panel screen Y
position
+ int MinimapW; /// minimap screen Width
+ int MinimapH; /// minimap screen Height
int MinimapPosX; /// minimap screen X position
int MinimapPosY; /// minimap screen Y position
int ViewportCursorColor; /// minimap cursor color
Index: stratagus/src/map/minimap.c
diff -u stratagus/src/map/minimap.c:1.66 stratagus/src/map/minimap.c:1.67
--- stratagus/src/map/minimap.c:1.66 Sat Sep 27 15:02:13 2003
+++ stratagus/src/map/minimap.c Sat Oct 4 01:26:50 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: minimap.c,v 1.66 2003/09/27 19:02:13 jsalmon3 Exp $
+// $Id: minimap.c,v 1.67 2003/10/04 05:26:50 jsalmon3 Exp $
//@{
@@ -54,8 +54,8 @@
local Graphic* MinimapTerrainGraphic; /// generated minimap terrain
local Graphic* MinimapGraphic; /// generated minimap
-local int Minimap2MapX[MINIMAP_W]; /// fast conversion table
-local int Minimap2MapY[MINIMAP_H]; /// fast conversion table
+local int* Minimap2MapX; /// fast conversion table
+local int* Minimap2MapY; /// fast conversion table
local int Map2MinimapX[MaxMapWidth]; /// fast conversion table
local int Map2MinimapY[MaxMapHeight]; /// fast conversion table
@@ -109,7 +109,7 @@
// Pixel 7,6 7,14, 15,6 15,14 are taken for the minimap picture.
//
ty *= TheMap.Width;
- for (my = MinimapY; my < MINIMAP_H - MinimapY; ++my) {
+ for (my = MinimapY; my < TheUI.MinimapH - MinimapY; ++my) {
y = Minimap2MapY[my];
if (y < ty) {
continue;
@@ -118,7 +118,7 @@
break;
}
- for (mx = MinimapX; mx < MINIMAP_W - MinimapX; ++mx) {
+ for (mx = MinimapX; mx < TheUI.MinimapW - MinimapX; ++mx) {
int tile;
x = Minimap2MapX[mx];
@@ -130,7 +130,7 @@
}
tile = TheMap.Fields[x + y].Tile;
- ((unsigned char*)MinimapTerrainGraphic->Frames)[mx + my *
MINIMAP_W] =
+ ((unsigned char*)MinimapTerrainGraphic->Frames)[mx + my *
TheUI.MinimapW] =
TheMap.Tiles[tile][7 + (mx % scale) * 8 + (6 + (my % scale) *
8) * TileSizeX];
}
}
@@ -156,12 +156,12 @@
//
// Pixel 7,6 7,14, 15,6 15,14 are taken for the minimap picture.
//
- for (my = MinimapY; my < MINIMAP_H - MinimapY; ++my) {
- for (mx = MinimapX; mx < MINIMAP_W - MinimapX; ++mx) {
+ for (my = MinimapY; my < TheUI.MinimapH - MinimapY; ++my) {
+ for (mx = MinimapX; mx < TheUI.MinimapW - MinimapX; ++mx) {
int tile;
tile = TheMap.Fields[Minimap2MapX[mx] + Minimap2MapY[my]].Tile;
- ((unsigned char*)MinimapTerrainGraphic->Frames)[mx + my *
MINIMAP_W] =
+ ((unsigned char*)MinimapTerrainGraphic->Frames)[mx + my *
TheUI.MinimapW] =
TheMap.Tiles[tile][7 + (mx % scale) * 8 + (6 + (my % scale) *
8) * TileSizeX];
}
}
@@ -181,12 +181,12 @@
} else {
n = TheMap.Height;
}
- MinimapScale = (MINIMAP_W * MINIMAP_FAC) / n;
+ MinimapScale = (TheUI.MinimapW * MINIMAP_FAC) / n;
- MinimapX = ((MINIMAP_W * MINIMAP_FAC) / MinimapScale - TheMap.Width) / 2;
- MinimapY = ((MINIMAP_H * MINIMAP_FAC) / MinimapScale - TheMap.Height) / 2;
- MinimapX = (MINIMAP_W - (TheMap.Width * MinimapScale) / MINIMAP_FAC) / 2;
- MinimapY = (MINIMAP_H - (TheMap.Height * MinimapScale) / MINIMAP_FAC) / 2;
+ MinimapX = ((TheUI.MinimapW * MINIMAP_FAC) / MinimapScale - TheMap.Width)
/ 2;
+ MinimapY = ((TheUI.MinimapH * MINIMAP_FAC) / MinimapScale - TheMap.Height)
/ 2;
+ MinimapX = (TheUI.MinimapW - (TheMap.Width * MinimapScale) / MINIMAP_FAC)
/ 2;
+ MinimapY = (TheUI.MinimapH - (TheMap.Height * MinimapScale) / MINIMAP_FAC)
/ 2;
DebugLevel0Fn("MinimapScale %d(%d), X off %d, Y off %d\n" _C_
MinimapScale / MINIMAP_FAC _C_ MinimapScale _C_ MinimapX _C_ MinimapY);
@@ -196,10 +196,12 @@
//
// FIXME: this needs to be recalculated during map load - the map size
// might have changed!
- for (n = MinimapX; n < MINIMAP_W - MinimapX; ++n) {
+ Minimap2MapX = calloc(sizeof(int), TheUI.MinimapW * TheUI.MinimapH);
+ Minimap2MapY = calloc(sizeof(int), TheUI.MinimapW * TheUI.MinimapH);
+ for (n = MinimapX; n < TheUI.MinimapW - MinimapX; ++n) {
Minimap2MapX[n] = ((n - MinimapX) * MINIMAP_FAC) / MinimapScale;
}
- for (n = MinimapY; n < MINIMAP_H - MinimapY; ++n) {
+ for (n = MinimapY; n < TheUI.MinimapH - MinimapY; ++n) {
Minimap2MapY[n] = (((n - MinimapY) * MINIMAP_FAC) / MinimapScale) *
TheMap.Width;
}
for (n = 0; n < TheMap.Width; ++n) {
@@ -209,11 +211,11 @@
Map2MinimapY[n] = (n * MinimapScale) / MINIMAP_FAC;
}
- MinimapTerrainGraphic = NewGraphic(8, MINIMAP_W, MINIMAP_H);
- memset(MinimapTerrainGraphic->Frames, 0, MINIMAP_W * MINIMAP_H);
- MinimapGraphic = NewGraphic(8, MINIMAP_W, MINIMAP_H);
+ MinimapTerrainGraphic = NewGraphic(8, TheUI.MinimapW, TheUI.MinimapH);
+ memset(MinimapTerrainGraphic->Frames, 0, TheUI.MinimapW * TheUI.MinimapH);
+ MinimapGraphic = NewGraphic(8, TheUI.MinimapW, TheUI.MinimapH);
MinimapGraphic->Pixels = VideoCreateNewPalette(GlobalPalette);
- memset(MinimapGraphic->Frames, 0, MINIMAP_W * MINIMAP_H);
+ memset(MinimapGraphic->Frames, 0, TheUI.MinimapW * TheUI.MinimapH);
UpdateMinimapTerrain();
}
@@ -231,8 +233,10 @@
}
VideoSaveFree(MinimapGraphic);
MinimapGraphic = NULL;
- memset(Minimap2MapX, 0, MINIMAP_W * sizeof(int));
- memset(Minimap2MapY, 0, MINIMAP_H * sizeof(int));
+ free(Minimap2MapX);
+ Minimap2MapX = NULL;
+ free(Minimap2MapY);
+ Minimap2MapY = NULL;
}
/**
@@ -263,20 +267,20 @@
// FIXME: make the image really use colorkey
// FIXME: I think this is only necessary on each map size change?
// Or maybe if you disable displaying terrain, too?
- memset(MinimapGraphic->Frames, 0, MINIMAP_W * MINIMAP_H);
+ memset(MinimapGraphic->Frames, 0, TheUI.MinimapW * TheUI.MinimapH);
//
// Draw the terrain
//
if (MinimapWithTerrain) {
- for (my = 0; my < MINIMAP_H; ++my) {
- for (mx = 0; mx < MINIMAP_W; ++mx) {
+ for (my = 0; my < TheUI.MinimapH; ++my) {
+ for (mx = 0; mx < TheUI.MinimapW; ++mx) {
if (IsMapFieldVisible(ThisPlayer, Minimap2MapX[mx],
Minimap2MapY[my] / TheMap.Width) ||
(IsMapFieldExplored(ThisPlayer,Minimap2MapX[mx],
Minimap2MapY[my] / TheMap.Width) &&
((mx & 1) == (my & 1))) ||
ReplayRevealMap) {
- ((unsigned char*)MinimapGraphic->Frames)[mx + my *
MINIMAP_W] =
- ((unsigned char*)MinimapTerrainGraphic->Frames)[mx + my
* MINIMAP_W];
+ ((unsigned char*)MinimapGraphic->Frames)[mx + my *
TheUI.MinimapW] =
+ ((unsigned char*)MinimapTerrainGraphic->Frames)[mx + my
* TheUI.MinimapW];
}
}
}
@@ -314,18 +318,18 @@
mx = 1 + MinimapX + Map2MinimapX[(*table)->X];
my = 1 + MinimapY + Map2MinimapY[(*table)->Y];
w = Map2MinimapX[type->TileWidth];
- if (mx + w >= MINIMAP_W) { // clip right side
- w = MINIMAP_W - mx;
+ if (mx + w >= TheUI.MinimapW) { // clip right side
+ w = TheUI.MinimapW - mx;
}
h0 = Map2MinimapY[type->TileHeight];
- if (my + h0 >= MINIMAP_H) { // clip bottom side
- h0 = MINIMAP_H - my;
+ if (my + h0 >= TheUI.MinimapH) { // clip bottom side
+ h0 = TheUI.MinimapH - my;
}
while (w-- >= 0) {
h = h0;
while (h-- >= 0) {
((unsigned char*)MinimapGraphic->Frames)[
- mx + w + (my + h) * MINIMAP_W] = color;
+ mx + w + (my + h) * TheUI.MinimapW] = color;
}
}
}
@@ -384,18 +388,18 @@
mx = 1 + MinimapX + Map2MinimapX[unit->X];
my = 1 + MinimapY + Map2MinimapY[unit->Y];
w = Map2MinimapX[type->TileWidth];
- if (mx + w >= MINIMAP_W) { // clip right side
- w = MINIMAP_W - mx;
+ if (mx + w >= TheUI.MinimapW) { // clip right side
+ w = TheUI.MinimapW - mx;
}
h0 = Map2MinimapY[type->TileHeight];
- if (my + h0 >= MINIMAP_H) { // clip bottom side
- h0 = MINIMAP_H - my;
+ if (my + h0 >= TheUI.MinimapH) { // clip bottom side
+ h0 = TheUI.MinimapH - my;
}
while (w-- >= 0) {
h = h0;
while (h-- >= 0) {
((unsigned char*)MinimapGraphic->Frames)[
- mx + w + (my + h) * MINIMAP_W] = color;
+ mx + w + (my + h) * TheUI.MinimapW] = color;
}
}
}
@@ -447,7 +451,6 @@
int i;
// Determine and save region below minimap cursor
- // FIXME: position of the minimap in the graphic is hardcoded (24x2)
OldMinimapCursorX = x =
TheUI.MinimapPosX + MinimapX + (vx * MinimapScale) / MINIMAP_FAC;
OldMinimapCursorY = y =
Index: stratagus/src/ui/ccl_ui.c
diff -u stratagus/src/ui/ccl_ui.c:1.128 stratagus/src/ui/ccl_ui.c:1.129
--- stratagus/src/ui/ccl_ui.c:1.128 Tue Sep 30 22:51:31 2003
+++ stratagus/src/ui/ccl_ui.c Sat Oct 4 01:26:50 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ccl_ui.c,v 1.128 2003/10/01 02:51:31 jsalmon3 Exp $
+// $Id: ccl_ui.c,v 1.129 2003/10/04 05:26:50 jsalmon3 Exp $
//@{
@@ -1643,17 +1643,35 @@
ui->MenuButtonGraphic.File = SCM_PopNewStr(&sublist);
ui->MenuButtonGraphicX = SCM_PopInt(&sublist);
ui->MenuButtonGraphicY = SCM_PopInt(&sublist);
- } else if (gh_eq_p(value, gh_symbol2scm("minimap-panel"))) {
+ } else if (gh_eq_p(value, gh_symbol2scm("minimap"))) {
sublist = gh_car(list);
list = gh_cdr(list);
- ui->MinimapPanel.File = SCM_PopNewStr(&sublist);
- ui->MinimapPanelX = SCM_PopInt(&sublist);
- ui->MinimapPanelY = SCM_PopInt(&sublist);
- } else if (gh_eq_p(value, gh_symbol2scm("minimap-pos"))) {
- sublist = gh_car(list);
- list = gh_cdr(list);
- ui->MinimapPosX = SCM_PopInt(&sublist);
- ui->MinimapPosY = SCM_PopInt(&sublist);
+ while (!gh_null_p(sublist)) {
+ value = gh_car(sublist);
+ sublist = gh_cdr(sublist);
+ if (gh_eq_p(value, gh_symbol2scm("file"))) {
+ value = gh_car(sublist);
+ sublist = gh_cdr(sublist);
+ ui->MinimapPanel.File = gh_scm2newstr(value, NULL);
+ } else if (gh_eq_p(value, gh_symbol2scm("panel-pos"))) {
+ value = gh_car(sublist);
+ sublist = gh_cdr(sublist);
+ ui->MinimapPanelX = gh_scm2int(gh_car(value));
+ ui->MinimapPanelY = gh_scm2int(gh_car(gh_cdr(value)));
+ } else if (gh_eq_p(value, gh_symbol2scm("pos"))) {
+ value = gh_car(sublist);
+ sublist = gh_cdr(sublist);
+ ui->MinimapPosX = gh_scm2int(gh_car(value));
+ ui->MinimapPosY = gh_scm2int(gh_car(gh_cdr(value)));
+ } else if (gh_eq_p(value, gh_symbol2scm("size"))) {
+ value = gh_car(sublist);
+ sublist = gh_cdr(sublist);
+ ui->MinimapW = gh_scm2int(gh_car(value));
+ ui->MinimapH = gh_scm2int(gh_car(gh_cdr(value)));
+ } else {
+ errl("Unsupported tag", value);
+ }
+ }
} else if (gh_eq_p(value, gh_symbol2scm("status-line"))) {
sublist = gh_car(list);
list = gh_cdr(list);
Index: stratagus/src/ui/mouse.c
diff -u stratagus/src/ui/mouse.c:1.150 stratagus/src/ui/mouse.c:1.151
--- stratagus/src/ui/mouse.c:1.150 Tue Sep 30 21:00:48 2003
+++ stratagus/src/ui/mouse.c Sat Oct 4 01:26:50 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: mouse.c,v 1.150 2003/10/01 01:00:48 jsalmon3 Exp $
+// $Id: mouse.c,v 1.151 2003/10/04 05:26:50 jsalmon3 Exp $
//@{
@@ -481,8 +481,8 @@
//
// Minimap
//
- if (x >= TheUI.MinimapPosX && x < TheUI.MinimapPosX + MINIMAP_W &&
- y >= TheUI.MinimapPosY && y < TheUI.MinimapPosY + MINIMAP_H) {
+ if (x >= TheUI.MinimapPosX && x < TheUI.MinimapPosX + TheUI.MinimapW &&
+ y >= TheUI.MinimapPosY && y < TheUI.MinimapPosY + TheUI.MinimapH) {
CursorOn = CursorOnMinimap;
return;
}
@@ -579,16 +579,16 @@
{
if (CursorX < TheUI.MinimapPosX) {
CursorStartX = TheUI.MinimapPosX;
- } else if (CursorX >= TheUI.MinimapPosX + MINIMAP_W) {
- CursorStartX = TheUI.MinimapPosX + MINIMAP_W - 1;
+ } else if (CursorX >= TheUI.MinimapPosX + TheUI.MinimapW) {
+ CursorStartX = TheUI.MinimapPosX + TheUI.MinimapW - 1;
} else {
CursorStartX = CursorX;
}
if (CursorY < TheUI.MinimapPosY) {
CursorStartY = TheUI.MinimapPosY;
- } else if (CursorY >= TheUI.MinimapPosY + MINIMAP_H) {
- CursorStartY = TheUI.MinimapPosY + MINIMAP_H - 1;
+ } else if (CursorY >= TheUI.MinimapPosY + TheUI.MinimapW) {
+ CursorStartY = TheUI.MinimapPosY + TheUI.MinimapH - 1;
} else {
CursorStartY = CursorY;
}
Index: stratagus/src/ui/ui.c
diff -u stratagus/src/ui/ui.c:1.74 stratagus/src/ui/ui.c:1.75
--- stratagus/src/ui/ui.c:1.74 Tue Sep 30 20:10:27 2003
+++ stratagus/src/ui/ui.c Sat Oct 4 01:26:50 2003
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ui.c,v 1.74 2003/10/01 00:10:27 jsalmon3 Exp $
+// $Id: ui.c,v 1.75 2003/10/04 05:26:50 jsalmon3 Exp $
//@{
@@ -372,12 +372,15 @@
ui->MenuButtonGraphic.File, ui->MenuButtonGraphicX,
ui->MenuButtonGraphicY);
- CLprintf(file, " ; Minimap background\n");
- CLprintf(file, " 'minimap-panel (list \"%s\" %d %d)\n",
- ui->MinimapPanel.File, ui->MinimapPanelX, ui->MinimapPanelY);
- CLprintf(file, " ; Minimap position\n");
- CLprintf(file, " 'minimap-pos (list %d %d)\n",
+ CLprintf(file, " ; Minimap\n");
+ CLprintf(file, " 'minimap-panel (list\n");
+ CLprintf(file, " 'file \"%s\"\n", ui->MinimapPanel.File);
+ CLprintf(file, " 'panel-pos (%d %d)\n",
+ ui->MinimapPanelX, ui->MinimapPanelY);
+ CLprintf(file, " 'pos (%d %d)\n",
ui->MinimapPosX, ui->MinimapPosY);
+ CLprintf(file, " 'size (%d %d))\n",
+ ui->MinimapW, ui->MinimapH);
CLprintf(file, "\n 'status-line '(");
CLprintf(file, "\n file \"%s\"",ui->StatusLine.File);
@@ -507,7 +510,7 @@
int i;
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: ui $Id: ui.c,v 1.74 2003/10/01 00:10:27
jsalmon3 Exp $\n\n");
+ CLprintf(file, ";;; MODULE: ui $Id: ui.c,v 1.75 2003/10/04 05:26:50
jsalmon3 Exp $\n\n");
// Contrast, Brightness, Saturation
CLprintf(file, "(set-contrast! %d)\n", TheUI.Contrast);
- [Stratagus-CVS] stratagus data/ccl/human/ui.ccl data/ccl/orc/ui...,
Jimmy Salmon <=