stratagus-cvs
[Top][All Lists]
Advanced

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

[Stratagus-CVS] stratagus/src/map map_save.c tileset.c


From: address@hidden
Subject: [Stratagus-CVS] stratagus/src/map map_save.c tileset.c
Date: 3 Jan 2004 11:28:18 +1100

CVSROOT:        /home/strat
Module name:    stratagus
Changes by:      <address@hidden>       04/01/03 11:28:18

Modified files:
        src/map        : map_save.c tileset.c 

Log message:
        Load/Save updates

Patches:
Index: stratagus/src/map/map_save.c
diff -u stratagus/src/map/map_save.c:1.21 stratagus/src/map/map_save.c:1.22
--- stratagus/src/map/map_save.c:1.21   Sat Dec 20 16:33:32 2003
+++ stratagus/src/map/map_save.c        Sat Jan  3 11:28:17 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: map_save.c,v 1.21 2003/12/20 05:33:32 jsalmon3 Exp $
+//     $Id: map_save.c,v 1.22 2004/01/03 00:28:17 jsalmon3 Exp $
 
 //@{
 
@@ -67,92 +67,92 @@
        int h;
        int i;
 
-       CLprintf(file, "\n;;; -----------------------------------------\n");
-       CLprintf(file, ";;; MODULE: map $Id: map_save.c,v 1.21 2003/12/20 
05:33:32 jsalmon3 Exp $\n");
+       CLprintf(file, "\n--- -----------------------------------------\n");
+       CLprintf(file, "--- MODULE: map $Id: map_save.c,v 1.22 2004/01/03 
00:28:17 jsalmon3 Exp $\n");
 
-       CLprintf(file, "(stratagus-map\n");
+       CLprintf(file, "StratagusMap(\n");
 
-       CLprintf(file, "  'version \"" StratagusFormatString "\"\n",
+       CLprintf(file, "  \"version\", \"" StratagusFormatString "\",\n",
                StratagusFormatArgs(StratagusVersion));
-       CLprintf(file, "  'description \"%s\"\n", TheMap.Description);
+       CLprintf(file, "  \"description\", \"%s\",\n", TheMap.Description);
 
-       CLprintf(file, "  'the-map '(\n");
+       CLprintf(file, "  \"the-map\", {\n");
 
        // FIXME: Why terrain? TheMap->Tileset->Class should be correct
-       CLprintf(file, "  terrain (%s \"%s\")\n",
+       CLprintf(file, "  \"terrain\", {\"%s\", \"%s\"},\n",
                TheMap.TerrainName,Tilesets[TheMap.Terrain]->Class);
 
-       CLprintf(file, "  size (%d %d)\n", TheMap.Width, TheMap.Height);
-       CLprintf(file, "  %s\n", TheMap.NoFogOfWar ? "no-fog-of-war" : 
"fog-of-war");
+       CLprintf(file, "  \"size\", {%d, %d},\n", TheMap.Width, TheMap.Height);
+       CLprintf(file, "  \"%s\",\n", TheMap.NoFogOfWar ? "no-fog-of-war" : 
"fog-of-war");
 
-       CLprintf(file, "  map-fields (\n");
+       CLprintf(file, "  \"map-fields\", {\n");
        for (h = 0; h < TheMap.Height; ++h) {
-               CLprintf(file, "  ; %d\n", h);
+               CLprintf(file, "  -- %d\n", h);
                for (w = 0; w < TheMap.Width; ++w) {
                        MapField* mf;
 
                        mf = &TheMap.Fields[h * TheMap.Width + w];
-                       CLprintf(file, "  (%3d %3d", mf->Tile, mf->SeenTile);
+                       CLprintf(file, "  {%3d, %3d,", mf->Tile, mf->SeenTile);
                        if (mf->Value) {
-                               CLprintf(file, " %d", mf->Value);
+                               CLprintf(file, " %d,", mf->Value);
                        }
                        for (i = 0; i < PlayerMax; ++i) {
                                if (mf->Visible[i] == 1) {
-                                       CLprintf(file, " explored %d", i);
+                                       CLprintf(file, " \"explored\", %d,", i);
                                }
                        }
                        if (mf->Flags & MapFieldHuman) {
-                               CLprintf(file, " human");
+                               CLprintf(file, " \"human\",");
                        }
                        if (mf->Flags & MapFieldLandAllowed) {
-                               CLprintf(file, " land");
+                               CLprintf(file, " \"land\",");
                        }
                        if (mf->Flags & MapFieldCoastAllowed) {
-                               CLprintf(file, " coast");
+                               CLprintf(file, " \"coast\",");
                        }
                        if (mf->Flags & MapFieldWaterAllowed) {
-                               CLprintf(file, " water");
+                               CLprintf(file, " \"water\",");
                        }
                        if (mf->Flags & MapFieldNoBuilding) {
-                               CLprintf(file, " mud");
+                               CLprintf(file, " \"mud\",");
                        }
                        if (mf->Flags & MapFieldUnpassable) {
-                               CLprintf(file, " block");
+                               CLprintf(file, " \"block\",");
                        }
-                       if (mf->Flags&MapFieldWall) {
-                               CLprintf(file, " wall");
+                       if (mf->Flags & MapFieldWall) {
+                               CLprintf(file, " \"wall\",");
                        }
                        if (mf->Flags & MapFieldRocks) {
-                               CLprintf(file, " rock");
+                               CLprintf(file, " \"rock\",");
                        }
                        if (mf->Flags & MapFieldForest) {
-                               CLprintf(file, " wood");
+                               CLprintf(file, " \"wood\",");
                        }
 #if 1
                        // Not Required for save
                        // These are required for now, UnitType::FieldFlags is 
0 until
                        // UpdateStats is called which is after the game is 
loaded
                        if (mf->Flags & MapFieldLandUnit) {
-                               CLprintf(file, " ground");
+                               CLprintf(file, " \"ground\",");
                        }
                        if (mf->Flags & MapFieldAirUnit) {
-                               CLprintf(file, " air");
+                               CLprintf(file, " \"air\",");
                        }
                        if (mf->Flags & MapFieldSeaUnit) {
-                               CLprintf(file, " sea");
+                               CLprintf(file, " \"sea\",");
                        }
-                       if (mf->Flags&MapFieldBuilding) {
-                               CLprintf(file, " building");
+                       if (mf->Flags & MapFieldBuilding) {
+                               CLprintf(file, " \"building\",");
                        }
 #endif
                        if (w & 1) {
-                               CLprintf(file, ")\n");
+                               CLprintf(file, "},\n");
                        } else {
-                               CLprintf(file, ")\t");
+                               CLprintf(file, "}, ");
                        }
                }
        }
-       CLprintf(file, ")))\n");
+       CLprintf(file, "}})\n");
 }
 
 //@}
Index: stratagus/src/map/tileset.c
diff -u stratagus/src/map/tileset.c:1.59 stratagus/src/map/tileset.c:1.60
--- stratagus/src/map/tileset.c:1.59    Fri Jan  2 08:24:09 2004
+++ stratagus/src/map/tileset.c Sat Jan  3 11:28:17 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: tileset.c,v 1.59 2004/01/01 21:24:09 jsalmon3 Exp $
+//     $Id: tileset.c,v 1.60 2004/01/03 00:28:17 jsalmon3 Exp $
 
 //@{
 
@@ -741,11 +741,12 @@
 */
 global void SaveTilesets(CLFile* file)
 {
+#if 0
        int i;
        char** sp;
 
        CLprintf(file, "\n;;; -----------------------------------------\n");
-       CLprintf(file, ";;; MODULE: tileset $Id: tileset.c,v 1.59 2004/01/01 
21:24:09 jsalmon3 Exp $\n\n");
+       CLprintf(file, ";;; MODULE: tileset $Id: tileset.c,v 1.60 2004/01/03 
00:28:17 jsalmon3 Exp $\n\n");
 
        //  Original number to internal tileset name
 
@@ -763,6 +764,7 @@
        for (i = 0; i < NumTilesets; ++i) {
                SaveTileset(file, Tilesets[i]);
        }
+#endif
 }
 
 /**




reply via email to

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