stratagus-cvs
[Top][All Lists]
Advanced

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

[Stratagus-CVS] stratagus/src map/map.c include/pud.h game/game...


From: Russell Smith
Subject: [Stratagus-CVS] stratagus/src map/map.c include/pud.h game/game...
Date: Wed, 29 Oct 2003 07:58:38 -0500

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Russell Smith <address@hidden>  03/10/29 07:58:37

Modified files:
        src/map        : map.c 
        src/include    : pud.h 
        src/game       : game.c 
        src/clone      : Module.make ccl.c unit.c 
Removed files:
        src/clone      : scm.c 

Log message:
        Removed scm map types.

Patches:
Index: stratagus/src/clone/Module.make
diff -u stratagus/src/clone/Module.make:1.7 stratagus/src/clone/Module.make:1.8
--- stratagus/src/clone/Module.make:1.7 Thu Oct 23 14:38:34 2003
+++ stratagus/src/clone/Module.make     Wed Oct 29 07:58:36 2003
@@ -24,7 +24,7 @@
 
 MODULE= src/clone
 MSRC=  ccl.c ccl_player.c clone.c construct.c groups.c iolib.c mainloop.c \
-       mpq.c player.c pud.c scm.c selection.c spells.c unit.c unit_draw.c \
+       mpq.c player.c pud.c selection.c spells.c unit.c unit_draw.c \
        unit_find.c unitcache.c ccl_spell.c ccl_helpers.c
 
 SRC+=  $(addprefix $(MODULE)/,$(MSRC))
Index: stratagus/src/clone/ccl.c
diff -u stratagus/src/clone/ccl.c:1.120 stratagus/src/clone/ccl.c:1.121
--- stratagus/src/clone/ccl.c:1.120     Mon Oct 27 23:02:25 2003
+++ stratagus/src/clone/ccl.c   Wed Oct 29 07:58:36 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: ccl.c,v 1.120 2003/10/28 04:02:25 jsalmon3 Exp $
+//     $Id: ccl.c,v 1.121 2003/10/29 12:58:36 mr-russ Exp $
 
 //@{
 
@@ -755,10 +755,6 @@
     name = gh_scm2newstr(file, NULL);
     if (strcasestr(name, ".pud")) {
        LoadPud(LibraryFileName(name, buffer), &TheMap);
-    } else if (strcasestr(name, ".scm")) {
-       LoadScm(LibraryFileName(name, buffer), &TheMap);
-    } else if (strcasestr(name, ".chk")) {
-       LoadChk(LibraryFileName(name, buffer), &TheMap);
     }
     free(name);
 
@@ -1050,7 +1046,7 @@
     }
 
     fprintf(fd, ";;; -----------------------------------------\n");
-    fprintf(fd, ";;; $Id: ccl.c,v 1.120 2003/10/28 04:02:25 jsalmon3 Exp $\n");
+    fprintf(fd, ";;; $Id: ccl.c,v 1.121 2003/10/29 12:58:36 mr-russ Exp $\n");
 
     fprintf(fd, "(set-video-resolution! %d %d)\n", VideoWidth, VideoHeight);
     
@@ -1075,7 +1071,7 @@
     }
 
     fprintf(fd, ";;; -----------------------------------------\n");
-    fprintf(fd, ";;; $Id: ccl.c,v 1.120 2003/10/28 04:02:25 jsalmon3 Exp $\n");
+    fprintf(fd, ";;; $Id: ccl.c,v 1.121 2003/10/29 12:58:36 mr-russ Exp $\n");
 
     // Global options
     if (OriginalFogOfWar) {
@@ -1186,7 +1182,7 @@
     extern SCM oblistvar;
 
     CLprintf(file, "\n;;; -----------------------------------------\n");
-    CLprintf(file, ";;; MODULE: CCL $Id: ccl.c,v 1.120 2003/10/28 04:02:25 
jsalmon3 Exp $\n\n");
+    CLprintf(file, ";;; MODULE: CCL $Id: ccl.c,v 1.121 2003/10/29 12:58:36 
mr-russ Exp $\n\n");
 
     for (list = oblistvar; gh_list_p(list); list = gh_cdr(list)) {
        SCM sym;
Index: stratagus/src/clone/unit.c
diff -u stratagus/src/clone/unit.c:1.321 stratagus/src/clone/unit.c:1.322
--- stratagus/src/clone/unit.c:1.321    Tue Oct 28 16:56:14 2003
+++ stratagus/src/clone/unit.c  Wed Oct 29 07:58:37 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: unit.c,v 1.321 2003/10/28 21:56:14 n0body Exp $
+//     $Id: unit.c,v 1.322 2003/10/29 12:58:37 mr-russ Exp $
 
 //@{
 
@@ -1751,6 +1751,8 @@
     int x;
     int y;
     int i;
+    int w;
+    int h;
     int mask;
 
     //FIXME: vladi: this debug check fails when used for teleporting...
@@ -1768,6 +1770,8 @@
 
 
     mask = UnitMovementMask(unit);
+    w = unit->Type->TileWidth;
+    h = unit->Type->TileHeight;
 
     if (heading < LookingNE || heading > LookingNW) {
        x += addx - 1;
@@ -1790,28 +1794,28 @@
     for (;;) {
 startw:
        for (i = addy; i--; ++y) {
-           if (CheckedCanMoveToMask(x, y, mask)) {
+           if (CanMoveToMask(x, y, w, h,mask)) {
                goto found;
            }
        }
        ++addx;
 starts:
        for (i = addx; i--; ++x) {
-           if (CheckedCanMoveToMask(x, y, mask)) {
+           if (CanMoveToMask(x, y, w, h,mask)) {
                goto found;
            }
        }
        ++addy;
 starte:
        for (i = addy; i--; --y) {
-           if (CheckedCanMoveToMask(x, y, mask)) {
+           if (CanMoveToMask(x, y, w, h,mask)) {
                goto found;
            }
        }
        ++addx;
 startn:
        for (i = addx; i--; --x) {
-           if (CheckedCanMoveToMask(x, y, mask)) {
+           if (CanMoveToMask(x, y, w, h,mask)) {
                goto found;
            }
        }
@@ -1842,6 +1846,8 @@
     int besty;
     int bestd;
     int mask;
+    int w;
+    int h;
     int n;
 
     DebugLevel3Fn("%d\n" _C_ UnitNumber(unit));
@@ -1859,6 +1865,8 @@
 
     DebugCheck(x == -1 || y == -1);
     mask = UnitMovementMask(unit);
+    w = unit->Type->TileWidth;
+    h = unit->Type->TileHeight;
 
     bestd = 99999;
 #ifdef DEBUG
@@ -1869,7 +1877,7 @@
     --x;
     for (;;) {
        for (i = addy; i--; ++y) {      // go down
-           if (CheckedCanMoveToMask(x, y, mask)) {
+           if (CanMoveToMask(x, y, w, h, mask)) {
                n = MapDistance(gx, gy, x, y);
                DebugLevel3("Distance %d,%d %d\n" _C_ x _C_ y _C_ n);
                if (n < bestd) {
@@ -1881,7 +1889,7 @@
        }
        ++addx;
        for (i = addx; i--; ++x) {      // go right
-           if (CheckedCanMoveToMask(x, y, mask)) {
+           if (CanMoveToMask(x, y, w, h, mask)) {
                n = MapDistance(gx, gy, x, y);
                DebugLevel3("Distance %d,%d %d\n" _C_ x _C_ y _C_ n);
                if (n < bestd) {
@@ -1893,7 +1901,7 @@
        }
        ++addy;
        for (i = addy; i--; --y) {      // go up
-           if (CheckedCanMoveToMask(x, y, mask)) {
+           if (CanMoveToMask(x, y, w, h, mask)) {
                n = MapDistance(gx, gy, x, y);
                DebugLevel3("Distance %d,%d %d\n" _C_ x _C_ y _C_ n);
                if (n < bestd) {
@@ -1905,7 +1913,7 @@
        }
        ++addx;
        for (i = addx; i--; --x) {      // go left
-           if (CheckedCanMoveToMask(x, y, mask)) {
+           if (CanMoveToMask(x, y, w, h, mask)) {
                n = MapDistance(gx, gy, x, y);
                DebugLevel3("Distance %d,%d %d\n" _C_ x _C_ y _C_ n);
                if (n < bestd) {
@@ -2314,13 +2322,13 @@
                    continue;
                }
                //      Look if found what was required.
-               if (rvresult ? CanMoveToMask(x, y, resmask) : !CanMoveToMask(x, 
y, resmask)) {
+               if (rvresult ? CanMoveToMask(x, y, 1, 1, resmask) : 
!CanMoveToMask(x, y, 1, 1, resmask)) {
                    *px = x;
                    *py = y;
                    DebugLevel3("Found it! %X %X\n" _C_ 
TheMap.Fields[x+y*TheMap.Width].Flags _C_ resmask);
                    return 1;
                }
-               if (CanMoveToMask(x, y, movemask)) {    // reachable
+               if (CanMoveToMask(x, y, 1, 1, movemask)) {      // reachable
                    *m = 1;
                    points[wp].X = x;           // push the point
                    points[wp].Y = y;
@@ -2382,6 +2390,8 @@
     int ep;
     int i;
     int w;
+    int uw;
+    int uh;
     int n;
     unsigned char* m;
     unsigned char* matrix;
@@ -2409,6 +2419,8 @@
     matrix += w + w + 2;
     //  Unit movement mask
     mask = UnitMovementMask(unit);
+    uw = unit->Type->TileWidth;
+    uh = unit->Type->TileHeight;
     //  Ignore all units along the way. Might seem wierd, but otherwise
     //  peasants would lock at a mine with a lot of workers.
     mask &= ~(MapFieldLandUnit | MapFieldSeaUnit | MapFieldAirUnit);
@@ -2460,7 +2472,7 @@
                    }
                }
 
-               if (CanMoveToMask(x, y, mask)) {        // reachable
+               if (CanMoveToMask(x, y, uw, uh, mask)) {        // reachable
                    *m = 1;
                    points[wp].X = x;           // push the point
                    points[wp].Y = y;
@@ -2526,6 +2538,8 @@
     int ep;
     int i;
     int w;
+    int uw;
+    int uh;
     int nodes_searched;
     unsigned char* m;
     unsigned char* matrix;
@@ -2547,6 +2561,8 @@
     matrix += w + w + 2;
     //  Unit movement mask
     mask = UnitMovementMask(unit);
+    uw = unit->Type->TileWidth;
+    uh = unit->Type->TileHeight;
     //  Ignore all units along the way. Might seem wierd, but otherwise
     //  peasants would lock at a mine with a lot of workers.
     mask &= ~(MapFieldLandUnit | MapFieldSeaUnit | MapFieldAirUnit | 
MapFieldBuilding);
@@ -2590,7 +2606,7 @@
                    DebugLevel3("Found a resource deposit at %d,%d\n" _C_ x _C_ 
y);
                    return depot;
                }
-               if (CanMoveToMask(x, y, mask)) {        // reachable
+               if (CanMoveToMask(x, y, uw, uh, mask)) {        // reachable
                    *m = 1;
                    points[wp].X = x;           // push the point
                    points[wp].Y = y;
@@ -3743,7 +3759,7 @@
     int RunStart;
 
     CLprintf(file, "\n;;; -----------------------------------------\n");
-    CLprintf(file, ";;; MODULE: units $Id: unit.c,v 1.321 2003/10/28 21:56:14 
n0body Exp $\n\n");
+    CLprintf(file, ";;; MODULE: units $Id: unit.c,v 1.322 2003/10/29 12:58:37 
mr-russ Exp $\n\n");
 
     //
     // Local variables
Index: stratagus/src/game/game.c
diff -u stratagus/src/game/game.c:1.108 stratagus/src/game/game.c:1.109
--- stratagus/src/game/game.c:1.108     Tue Oct  7 20:06:42 2003
+++ stratagus/src/game/game.c   Wed Oct 29 07:58:36 2003
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: game.c,v 1.108 2003/10/08 00:06:42 jsalmon3 Exp $
+//     $Id: game.c,v 1.109 2003/10/29 12:58:36 mr-russ Exp $
 
 //@{
 
@@ -154,10 +154,6 @@
     // ARI: This bombs out, if no pud, so will be safe.
     if (strcasestr(filename, ".pud")) {
        LoadPud(filename, map);
-    } else if (strcasestr(filename, ".scm")) {
-       LoadScm(filename, map);
-    } else if (strcasestr(filename, ".chk")) {
-       LoadChk(filename, map);
     }
 }
 
Index: stratagus/src/include/pud.h
diff -u stratagus/src/include/pud.h:1.24 stratagus/src/include/pud.h:1.25
--- stratagus/src/include/pud.h:1.24    Fri Jul 11 10:35:30 2003
+++ stratagus/src/include/pud.h Wed Oct 29 07:58:35 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: pud.h,v 1.24 2003/07/11 14:35:30 n0body Exp $
+//     $Id: pud.h,v 1.25 2003/10/29 12:58:35 mr-russ Exp $
 
 #ifndef __PUD_H__
 #define __PUD_H__
@@ -84,8 +84,6 @@
 #define WC_StartLocationHuman  0x5E    /// start location human
 #define WC_StartLocationOrc    0x5F    /// start location orc
 
-#define SC_StartLocation       214     /// sc start location
-
 /*----------------------------------------------------------------------------
 --     Declarations
 ----------------------------------------------------------------------------*/
@@ -103,10 +101,6 @@
 
     /// Load a pud file
 extern void LoadPud(const char* pud,WorldMap* map);
-    /// Load a scm file
-extern void LoadScm(const char* scm,WorldMap* map);
-    /// Load a chk file
-extern void LoadChk(const char* chk,WorldMap* map);
 
     /// Save a pud file
 extern int SavePud(const char* pud,const WorldMap* map);
@@ -115,10 +109,6 @@
 
     /// Clean the pud module
 extern void CleanPud(void);
-    /// Clean the scm module
-extern void CleanScm(void);
-    /// Clean the chk module
-extern void CleanChk(void);
 
 //@}
 
Index: stratagus/src/map/map.c
diff -u stratagus/src/map/map.c:1.59 stratagus/src/map/map.c:1.60
--- stratagus/src/map/map.c:1.59        Sat Sep 27 01:31:00 2003
+++ stratagus/src/map/map.c     Wed Oct 29 07:58:34 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: map.c,v 1.59 2003/09/27 05:31:00 jsalmon3 Exp $
+//     $Id: map.c,v 1.60 2003/10/29 12:58:34 mr-russ Exp $
 
 //@{
 
@@ -650,10 +650,7 @@
 
     CleanMapFogOfWar();
 
-    // FIXME: don't need to call all of these
     CleanPud();
-    CleanScm();
-    CleanChk();
 }
 
 //@}




reply via email to

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