[Supertux-Commit] r6241 - in trunk/supertux-editor: libeditor/DataStructures libeditor/Drawing supertux-editor supertux-editor/Commands supertux-editor/LevelObjects supertux-editor/Tiles supertux-editor/Tools

anmaster at cummiskey.dreamhost.com anmaster at cummiskey.dreamhost.com
Fri Jan 1 07:07:16 PST 2010


Author: anmaster
Date: 2010-01-01 07:07:15 -0800 (Fri, 01 Jan 2010)
New Revision: 6241

Modified:
   trunk/supertux-editor/libeditor/DataStructures/Field.cs
   trunk/supertux-editor/libeditor/Drawing/Texture.cs
   trunk/supertux-editor/supertux-editor/Application.cs
   trunk/supertux-editor/supertux-editor/Commands/MultiCommand.cs
   trunk/supertux-editor/supertux-editor/Commands/SectorCommands.cs
   trunk/supertux-editor/supertux-editor/LevelObjects/Tilemap.cs
   trunk/supertux-editor/supertux-editor/ResizeDialog.cs
   trunk/supertux-editor/supertux-editor/Tiles/TileBlock.cs
   trunk/supertux-editor/supertux-editor/Tools/ObjectSelectTool.cs
   trunk/supertux-editor/supertux-editor/Tools/TileBrush.cs
   trunk/supertux-editor/supertux-editor/Tools/TileBrushTool.cs
   trunk/supertux-editor/supertux-editor/Tools/TilePaintTool.cs
   trunk/supertux-editor/supertux-editor/Tools/TileReplaceTool.cs
   trunk/supertux-editor/supertux-editor/Tools/TileToolBase.cs
   trunk/supertux-editor/supertux-editor/Tools/ToolBase.cs
   trunk/supertux-editor/supertux-editor/Tools/ZoomTool.cs
Log:
Trailing whitespace clean up in editor source.

Modified: trunk/supertux-editor/libeditor/DataStructures/Field.cs
===================================================================
--- trunk/supertux-editor/libeditor/DataStructures/Field.cs	2010-01-01 15:05:06 UTC (rev 6240)
+++ trunk/supertux-editor/libeditor/DataStructures/Field.cs	2010-01-01 15:07:15 UTC (rev 6241)
@@ -158,10 +158,10 @@
 			else
 			{
 				List<T> newElements = new List<T>();
-			
-				for(int y = 0; y < newHeight; ++y) 
+
+				for(int y = 0; y < newHeight; ++y)
 				{
-					for(int x = 0; x < newWidth; ++x) 
+					for(int x = 0; x < newWidth; ++x)
 					{
 						int tX = x - xOffset;
 						int tY = y - yOffset;

Modified: trunk/supertux-editor/libeditor/Drawing/Texture.cs
===================================================================
--- trunk/supertux-editor/libeditor/Drawing/Texture.cs	2010-01-01 15:05:06 UTC (rev 6240)
+++ trunk/supertux-editor/libeditor/Drawing/Texture.cs	2010-01-01 15:07:15 UTC (rev 6241)
@@ -69,7 +69,7 @@
 			Sdl.Surface* surface = (Sdl.Surface*) surfacep;
 			this.width = (uint) surface->w;
 			this.height = (uint) surface->h;
-			
+
 			// Not needed on newer OpenGL
 			if (false)
 			{

Modified: trunk/supertux-editor/supertux-editor/Application.cs
===================================================================
--- trunk/supertux-editor/supertux-editor/Application.cs	2010-01-01 15:05:06 UTC (rev 6240)
+++ trunk/supertux-editor/supertux-editor/Application.cs	2010-01-01 15:07:15 UTC (rev 6241)
@@ -253,11 +253,11 @@
 
 		//Setup drag destination for "files"
 		Gtk.Drag.DestSet(MainWindow, Gtk.DestDefaults.All, target_table,
-				 Gdk.DragAction.Default | 
-				 Gdk.DragAction.Copy | 
-				 Gdk.DragAction.Move | 
-				 Gdk.DragAction.Link | 
-				 Gdk.DragAction.Private | 
+				 Gdk.DragAction.Default |
+				 Gdk.DragAction.Copy |
+				 Gdk.DragAction.Move |
+				 Gdk.DragAction.Link |
+				 Gdk.DragAction.Private |
 				 Gdk.DragAction.Ask);
 		MainWindow.DragDataReceived += OnDragDataReceived;
 
@@ -435,7 +435,7 @@
 		}
 	}
 
-	protected void OnToolZoom(object o, EventArgs args) 
+	protected void OnToolZoom(object o, EventArgs args)
 	{
 		if (ToolZoom.Active) {
 			PrintStatus("Tool: Zoom");
@@ -559,7 +559,7 @@
 
 	protected void OnZoomFit(object o, EventArgs args) {
 		if( sectorSwitchNotebook.CurrentRenderer != null ) {
-			sectorSwitchNotebook.CurrentRenderer.ZoomTo(new RectangleF(0, 0, 
+			sectorSwitchNotebook.CurrentRenderer.ZoomTo(new RectangleF(0, 0,
 										   CurrentSector.Width*32, CurrentSector.Height*32));
 		}
 	}
@@ -1114,7 +1114,7 @@
 			}
 			index += 5;									//move pointer after next "file:" to reach filename
 			string uri = data.Substring(index, data.IndexOf('\n', index) - index -1 );
-			filename = Uri.UnescapeDataString(uri);						//convert excape sequences ("%2b" = "+") to normal text 
+			filename = Uri.UnescapeDataString(uri);						//convert excape sequences ("%2b" = "+") to normal text
 			LogManager.Log(LogLevel.Debug, "		Found filename: {0}", filename);
 		}
 

Modified: trunk/supertux-editor/supertux-editor/Commands/MultiCommand.cs
===================================================================
--- trunk/supertux-editor/supertux-editor/Commands/MultiCommand.cs	2010-01-01 15:05:06 UTC (rev 6240)
+++ trunk/supertux-editor/supertux-editor/Commands/MultiCommand.cs	2010-01-01 15:07:15 UTC (rev 6241)
@@ -17,14 +17,14 @@
 using System.Collections.Generic;
 namespace Undo {
 
-	internal sealed class MultiCommand : Command 
+	internal sealed class MultiCommand : Command
 	{
 		/// <summary>
 		/// List of commands in this group.
 		/// </summary>
 		private List<Command> commandList;
 
-		public void Add(Command command) 
+		public void Add(Command command)
 		{
 			commandList.Add(command);
 		}
@@ -46,7 +46,7 @@
 		}
 
 		public MultiCommand(string title, List<Command> commandList)
-			: base(title) 
+			: base(title)
 		{
 			this.commandList = commandList;
 		}

Modified: trunk/supertux-editor/supertux-editor/Commands/SectorCommands.cs
===================================================================
--- trunk/supertux-editor/supertux-editor/Commands/SectorCommands.cs	2010-01-01 15:05:06 UTC (rev 6240)
+++ trunk/supertux-editor/supertux-editor/Commands/SectorCommands.cs	2010-01-01 15:07:15 UTC (rev 6241)
@@ -18,21 +18,21 @@
 using System.Collections.Generic;
 using DataStructures;
 
-namespace Undo 
+namespace Undo
 {
-	public abstract class SectorCommand : Command 
+	public abstract class SectorCommand : Command
 	{
 		protected Sector sector;
-		protected SectorCommand(string title, Sector sector) : base(title) 
+		protected SectorCommand(string title, Sector sector) : base(title)
 		{
 			this.sector = sector;
 		}
 	}
 
 
-	internal sealed class SectorSizeChangeCommand : SectorCommand 
+	internal sealed class SectorSizeChangeCommand : SectorCommand
 	{
-		private struct TilemapData 
+		private struct TilemapData
 		{
 			public TileBlock.StateData OldState;
 			public Tilemap Tilemap;
@@ -42,13 +42,13 @@
 				this.Tilemap = Tilemap;
 			}
 		}
-		
+
 		private struct ObjectData
 		{
 			public RectangleF OldArea;
 			public RectangleF NewArea;
 			public IObject    Object;
-			
+
 			public ObjectData(RectangleF OldArea,
 					  RectangleF NewArea,
 					  IObject    Object)
@@ -69,7 +69,7 @@
 		private uint minWidth;
 		private uint minHeight;
 
-		public override void Do() 
+		public override void Do()
 		{
 			foreach(ObjectData obj in objects) {
 				obj.Object.ChangeArea(obj.NewArea);
@@ -84,7 +84,7 @@
 			sector.EmitSizeChanged();
 		}
 
-		public override void Undo() 
+		public override void Undo()
 		{
 			foreach(ObjectData obj in objects) {
 				obj.Object.ChangeArea(obj.OldArea);
@@ -106,11 +106,11 @@
 		/// <param name="newHeight"> Height that we want to apply </param>
 		/// <param name="oldWidth"> Used when you want to set different value </param>
 		/// <param name="oldHeight"> Used when you want to set different value </param>
-		internal SectorSizeChangeCommand(string title, Sector sector, Tilemap tilemap, 
+		internal SectorSizeChangeCommand(string title, Sector sector, Tilemap tilemap,
 						 int xOffset, int yOffset,
-						 uint newWidth, uint newHeight, 
+						 uint newWidth, uint newHeight,
 						 uint oldWidth, uint oldHeight)
-			: base(title, sector) 
+			: base(title, sector)
 		{
 			this.xOffset = xOffset;
 			this.yOffset = yOffset;
@@ -129,7 +129,7 @@
 				}
 			}
 
-			foreach(IObject obj in sector.GetObjects(typeof(IObject))) 
+			foreach(IObject obj in sector.GetObjects(typeof(IObject)))
 			{
 				RectangleF newArea = obj.Area;
 				newArea.Move(new Vector(xOffset * 32, yOffset * 32));
@@ -137,7 +137,7 @@
 			}
 		}
 
-		internal SectorSizeChangeCommand(string title, Sector sector, 
+		internal SectorSizeChangeCommand(string title, Sector sector,
 						 int xOffset, int yOffset, uint newWidth, uint newHeight)
 			:this(title, sector, null, xOffset, yOffset, newWidth, newHeight, sector.Width, sector.Height)
 		{ }
@@ -151,19 +151,19 @@
 	public delegate void SectorsAddRemoveHandler(Sector sector);
 
 
-	public abstract class SectorAddRemoveCommand : SectorCommand 
+	public abstract class SectorAddRemoveCommand : SectorCommand
 	{
 		protected Level level;
 		public event SectorsAddRemoveHandler OnSectorAdd;
 		public event SectorsAddRemoveHandler OnSectorRemove;
 
-		public override void Do() 
+		public override void Do()
 		{
 			if (OnSectorAdd != null)
 				OnSectorAdd(sector);
 		}
 
-		public override void Undo() 
+		public override void Undo()
 		{
 			if (OnSectorRemove != null)
 				OnSectorRemove(sector);
@@ -176,15 +176,15 @@
 
 	}
 
-	public class SectorAddCommand : SectorAddRemoveCommand 
+	public class SectorAddCommand : SectorAddRemoveCommand
 	{
-		public override void Do() 
+		public override void Do()
 		{
 			level.Sectors.Add(sector);
 			base.Do();
 		}
 
-		public override void Undo() 
+		public override void Undo()
 		{
 			level.Sectors.Remove(sector);
 			base.Undo();
@@ -193,14 +193,14 @@
 		public SectorAddCommand(string title, Sector sector, Level level) : base(title, sector, level) { }
 	}
 
-	public sealed class SectorRemoveCommand : SectorAddCommand 
+	public sealed class SectorRemoveCommand : SectorAddCommand
 	{
-		public override void Do() 
+		public override void Do()
 		{
 			base.Undo();
 		}
 
-		public override void Undo() 
+		public override void Undo()
 		{
 			base.Do();
 		}

Modified: trunk/supertux-editor/supertux-editor/LevelObjects/Tilemap.cs
===================================================================
--- trunk/supertux-editor/supertux-editor/LevelObjects/Tilemap.cs	2010-01-01 15:05:06 UTC (rev 6240)
+++ trunk/supertux-editor/supertux-editor/LevelObjects/Tilemap.cs	2010-01-01 15:07:15 UTC (rev 6241)
@@ -24,7 +24,7 @@
 		//tilemaps are no longer created as badguys, it is looking bad
 [SupertuxObject("tilemap", "images/engine/editor/tilemap.png",
                 Target = SupertuxObjectAttribute.Usage.None)]
-public sealed class Tilemap : TileBlock, IGameObject, IPathObject, IDrawableLayer 
+public sealed class Tilemap : TileBlock, IGameObject, IPathObject, IDrawableLayer
 {
 	//TODO: If we want to store X coordinate to level file, we must uncomment this and add support for it
 	//If you do that, please remove " else X = Y = 0;" in UpdatePos();
@@ -71,7 +71,7 @@
 
 	private Path path;
 	[LispChild("path", Optional = true, Default = null)]
-	public Path Path 
+	public Path Path
 	{
 		get {
 			return path;
@@ -81,12 +81,12 @@
 		}
 	}
 
-	public bool PathRemovable 
+	public bool PathRemovable
 	{
 		get { return true; }
 	}
 
-	public enum DrawTargets 
+	public enum DrawTargets
 	{
 		/// <summary>
 		/// Normal tilemap.
@@ -119,7 +119,7 @@
 		} else X = Y = 0;
 	}
 
-	public Node GetSceneGraphNode() 
+	public Node GetSceneGraphNode()
 	{
 		return null;	//Tilemap can't create it's node
 	}

Modified: trunk/supertux-editor/supertux-editor/ResizeDialog.cs
===================================================================
--- trunk/supertux-editor/supertux-editor/ResizeDialog.cs	2010-01-01 15:05:06 UTC (rev 6240)
+++ trunk/supertux-editor/supertux-editor/ResizeDialog.cs	2010-01-01 15:07:15 UTC (rev 6241)
@@ -44,10 +44,10 @@
 		Glade.XML gxml = new Glade.XML("editor.glade", "resizeDialog");
 		gxml.Autoconnect(this);
 
-		if (resizeDialog == null || 
+		if (resizeDialog == null ||
 		    XOffsetEntry == null ||
 		    YOffsetEntry == null ||
-		    WidthEntry   == null || 
+		    WidthEntry   == null ||
 		    HeightEntry  == null)
 		{
 			throw new Exception("Couldn't load resize Dialog");

Modified: trunk/supertux-editor/supertux-editor/Tiles/TileBlock.cs
===================================================================
--- trunk/supertux-editor/supertux-editor/Tiles/TileBlock.cs	2010-01-01 15:05:06 UTC (rev 6240)
+++ trunk/supertux-editor/supertux-editor/Tiles/TileBlock.cs	2010-01-01 15:07:15 UTC (rev 6241)
@@ -158,7 +158,7 @@
         x=x*23+Elements.GetHashCode();
         return x;
     }
-	
+
 	#endregion
 
 	internal struct StateData {

Modified: trunk/supertux-editor/supertux-editor/Tools/ObjectSelectTool.cs
===================================================================
--- trunk/supertux-editor/supertux-editor/Tools/ObjectSelectTool.cs	2010-01-01 15:05:06 UTC (rev 6240)
+++ trunk/supertux-editor/supertux-editor/Tools/ObjectSelectTool.cs	2010-01-01 15:07:15 UTC (rev 6241)
@@ -99,7 +99,7 @@
 		if (button == 1) {
 			IObject obj = FindObjectAt(mousePos);
 
-			if (obj == null) 
+			if (obj == null)
 			{
 				// Start drawing the select rectangle
 				state = State.SELECTING;
@@ -120,7 +120,7 @@
 					}
 				}
 				else
-				{				
+				{
 					if (!selectedObjects.Contains(obj))
 					{
 						selectedObjects.Clear();
@@ -140,7 +140,7 @@
 			PopupMenu(button);
 		}
 		Redraw();
-		
+
 		if (false)
 		{
 			if (state == State.SELECTING) {
@@ -183,7 +183,7 @@
 				}
 			}
 			Redraw();
-		
+
 			if (button == 3) {
 				if (state == State.DRAGGING) {				//both buttons => drag canceled => calculate current delta and shift all objects back
 					Vector shift = originalPosition - new Vector (activeObject.Area.Left, activeObject.Area.Top);
@@ -214,7 +214,7 @@
 				// Add objects in the selected area to selectedObjects
 
                                 // Flush selected objects if it's not CTRL+select
-				if ((Modifiers & ModifierType.ControlMask) == 0) 
+				if ((Modifiers & ModifierType.ControlMask) == 0)
 				{
 					selectedObjects.Clear();
 				}
@@ -222,7 +222,7 @@
 				RectangleF selectedArea = new RectangleF(pressPoint, mousePos);
 				foreach(IObject Object in sector.GetObjects(typeof(IObject)))
 				{
-					if (selectedArea.Contains(Object.Area)) 
+					if (selectedArea.Contains(Object.Area))
 					{
 						if (selectedObjects.Contains(Object))
 						{
@@ -236,15 +236,15 @@
 				}
 
 				if (selectedObjects.Count == 1)
-				{	
+				{
 					//show properties
 					MakeActive(selectedObjects[0]);
 					//application.EditProperties(selectedObjects[0], selectedObjects[0].GetType().Name);
 				}
-				else 
+				else
 				{
 					// resizing is unavailable if more objects are selected
-					activeObject = null;					
+					activeObject = null;
 					controlPoints.Clear();
 					application.EditProperties(selectedObjects, "Group of " + selectedObjects.Count.ToString() + " objects");
 				}
@@ -258,10 +258,10 @@
 					Vector totalShift = newPosition - originalPosition;
 					MultiCommand multi_command = new MultiCommand("Moved " + selectedObjects.Count + " objects");
 
-					foreach (IObject selectedObject in selectedObjects) 
+					foreach (IObject selectedObject in selectedObjects)
 					{
 						// copy new area to variable
-						RectangleF oldArea = selectedObject.Area; 
+						RectangleF oldArea = selectedObject.Area;
 
 						// and shift it to it's oreginal location
 						oldArea.Move(-totalShift);
@@ -275,7 +275,7 @@
 
 					UndoManager.AddCommand(multi_command);
 				}
-				
+
 				break;
 			}
 
@@ -323,7 +323,7 @@
 					bool hit = false;
 					foreach (IObject selectedObject in selectedObjects) {
 						hit |= selectedObject.Area.Contains(mousePos);
-					}				
+					}
 					if (!hit) {
 						MakeActive(FindObjectAt(mousePos));
 						Redraw();
@@ -367,7 +367,7 @@
 		case State.DRAGGING:
 			moveObjects(mousePos, SnapValue(Modifiers));
 			break;
-			
+
 		case State.SELECTING:
 			// store mouse position for drawin routine
 			mousePoint = mousePos;

Modified: trunk/supertux-editor/supertux-editor/Tools/TileBrush.cs
===================================================================
--- trunk/supertux-editor/supertux-editor/Tools/TileBrush.cs	2010-01-01 15:05:06 UTC (rev 6240)
+++ trunk/supertux-editor/supertux-editor/Tools/TileBrush.cs	2010-01-01 15:07:15 UTC (rev 6241)
@@ -49,8 +49,8 @@
 	protected Tileset tileset;
 
 	protected Hashtable cache = new Hashtable();
-		
-		
+
+
 	/// <summary>
 	/// Create a new brush from a given list of patterns
 	/// </summary>

Modified: trunk/supertux-editor/supertux-editor/Tools/TileBrushTool.cs
===================================================================
--- trunk/supertux-editor/supertux-editor/Tools/TileBrushTool.cs	2010-01-01 15:05:06 UTC (rev 6240)
+++ trunk/supertux-editor/supertux-editor/Tools/TileBrushTool.cs	2010-01-01 15:07:15 UTC (rev 6241)
@@ -41,7 +41,7 @@
 	private bool LastPreviewIsChange;
 
 	public TileBrushTool(Application application, Tileset Tileset, string brushFile)
-		: base(application, Tileset, new TileSelection()) 
+		: base(application, Tileset, new TileSelection())
 	{
 		brush = TileBrush.loadFromFile(brushFile, Tileset);
 		ActionName = "Tile Brush";

Modified: trunk/supertux-editor/supertux-editor/Tools/TilePaintTool.cs
===================================================================
--- trunk/supertux-editor/supertux-editor/Tools/TilePaintTool.cs	2010-01-01 15:05:06 UTC (rev 6240)
+++ trunk/supertux-editor/supertux-editor/Tools/TilePaintTool.cs	2010-01-01 15:07:15 UTC (rev 6241)
@@ -20,7 +20,7 @@
 public sealed class TilePaintTool : TileToolBase, ITool
 {
 	public TilePaintTool(Application application, Tileset Tileset, TileSelection selection)
-		: base(application, Tileset, selection) 
+		: base(application, Tileset, selection)
 	{
 		ActionName = "Change Tiles";
 	}

Modified: trunk/supertux-editor/supertux-editor/Tools/TileReplaceTool.cs
===================================================================
--- trunk/supertux-editor/supertux-editor/Tools/TileReplaceTool.cs	2010-01-01 15:05:06 UTC (rev 6240)
+++ trunk/supertux-editor/supertux-editor/Tools/TileReplaceTool.cs	2010-01-01 15:07:15 UTC (rev 6241)
@@ -20,12 +20,12 @@
 public sealed class TileReplaceTool : TileToolBase, ITool
 {
 	public TileReplaceTool(Application application, Tileset Tileset, TileSelection selection)
-		: base(application, Tileset, selection) 
+		: base(application, Tileset, selection)
 	{
 		ActionName = "Replace Tiles";
 	}
 
-	private void Replace(int oldId, int newId) 
+	private void Replace(int oldId, int newId)
 	{
 		for (int x = 0; x < application.CurrentTilemap.Width; x++) {
 			for (int y = 0; y < application.CurrentTilemap.Height; y++) {

Modified: trunk/supertux-editor/supertux-editor/Tools/TileToolBase.cs
===================================================================
--- trunk/supertux-editor/supertux-editor/Tools/TileToolBase.cs	2010-01-01 15:05:06 UTC (rev 6240)
+++ trunk/supertux-editor/supertux-editor/Tools/TileToolBase.cs	2010-01-01 15:07:15 UTC (rev 6241)
@@ -23,7 +23,7 @@
 /// <summary>
 /// Base class for editors editing tilemaps.
 /// </summary>
-public abstract class TileToolBase : ToolBase, IDisposable 
+public abstract class TileToolBase : ToolBase, IDisposable
 {
 	public event RedrawEventHandler Redraw;
 
@@ -165,7 +165,7 @@
 
 		UpdateMouseTilePos(mousePos);
 		LastDrawPos = MouseTilePos;
-		
+
 		if(button == 3) {
 			if (state == State.DRAWING) {	//both buttons => cancel drawing
 				state = State.NONE;

Modified: trunk/supertux-editor/supertux-editor/Tools/ToolBase.cs
===================================================================
--- trunk/supertux-editor/supertux-editor/Tools/ToolBase.cs	2010-01-01 15:05:06 UTC (rev 6240)
+++ trunk/supertux-editor/supertux-editor/Tools/ToolBase.cs	2010-01-01 15:07:15 UTC (rev 6241)
@@ -24,7 +24,7 @@
 /// <summary>
 /// Base class for all editors.
 /// </summary>
-public abstract class ToolBase 
+public abstract class ToolBase
 {
 	protected Application application;
 }

Modified: trunk/supertux-editor/supertux-editor/Tools/ZoomTool.cs
===================================================================
--- trunk/supertux-editor/supertux-editor/Tools/ZoomTool.cs	2010-01-01 15:05:06 UTC (rev 6240)
+++ trunk/supertux-editor/supertux-editor/Tools/ZoomTool.cs	2010-01-01 15:07:15 UTC (rev 6241)
@@ -37,7 +37,7 @@
 	{
 		this.application = application;
 		this.state = State.NONE;
-		
+
 	}
 
 	public void Draw(Gdk.Rectangle cliprect)
@@ -69,7 +69,7 @@
 			gl.Color4f(1, 1, 1, 1);
 		}
 	}
-	
+
 	public void OnMouseButtonPress(Vector mousePos, int button, ModifierType Modifiers)
 	{
 		switch (button)
@@ -80,7 +80,7 @@
 			mousePoint = mousePos;
 			Redraw();
 			break;
-			
+
 		case 3:
 			application.CurrentRenderer.ZoomTo(mousePos, (float)(1.0/Math.Sqrt(2.0)));
 			Redraw();



More information about the Supertux-Commit mailing list