[Supertux-Commit] r5784 - trunk/supertux-editor/supertux-editor/Tiles

mmlosh at millhouse.dreamhost.com mmlosh at millhouse.dreamhost.com
Thu Sep 25 10:33:04 PDT 2008


Author: mmlosh
Date: 2008-09-25 10:33:00 -0700 (Thu, 25 Sep 2008)
New Revision: 5784

Modified:
   trunk/supertux-editor/supertux-editor/Tiles/Tileset.cs
Log:
added DATAs support for more-tiles-in-one-image cases


Modified: trunk/supertux-editor/supertux-editor/Tiles/Tileset.cs
===================================================================
--- trunk/supertux-editor/supertux-editor/Tiles/Tileset.cs	2008-09-25 17:22:57 UTC (rev 5783)
+++ trunk/supertux-editor/supertux-editor/Tiles/Tileset.cs	2008-09-25 17:33:00 UTC (rev 5784)
@@ -132,12 +132,16 @@
 
 		List<int> ids = new List<int> ();
 		List<uint> attributes = new List<uint> ();
+		List<uint> datas = new List<uint> ();
 		props.GetIntList("ids", ids);
 		props.GetUIntList("attributes", attributes);
+		props.GetUIntList("datas", datas);
 		if(ids.Count != width * height)
 			throw new ApplicationException("Must have width*height ids in tiles block");
 		if((attributes.Count != width * height) && attributes.Count > 0)	//missing atributes == all-are-0-attributes
 			throw new ApplicationException("Must have width*height attributes in tiles block");
+		if((datas.Count != width * height) && datas.Count > 0)	//missing DATAs == all-are-0-DATAs
+			throw new ApplicationException("Must have width*height DATAs in tiles block");
 
 		int id = 0;
 		for(int y = 0; y < height; ++y) {
@@ -155,6 +159,7 @@
 					tile.Images.Add(res);
 					tile.Id = ids[id];
 					tile.Attributes = (attributes.Count > 0)?(Tile.Attribute) attributes[id]:0;	//missing atributes == all-are-0-attributes
+					tile.Data = (datas.Count > 0)?(int) datas[id]:0;	//missing DATAs == all-are-0-DATAs
 
 					while(tiles.Count <= tile.Id)
 						tiles.Add(null);



More information about the Supertux-Commit mailing list