Initial support for custom tile sizes
This commit is contained in:
@@ -201,7 +201,7 @@ namespace OpenRA.Editor
|
||||
var template = ts.Templates[n];
|
||||
var tile = ts.Tiles[n];
|
||||
|
||||
var bitmap = new Bitmap(24 * template.Size.X, 24 * template.Size.Y);
|
||||
var bitmap = new Bitmap(ts.TileSize * template.Size.X, ts.TileSize * template.Size.Y);
|
||||
var data = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height),
|
||||
ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
|
||||
|
||||
@@ -215,15 +215,15 @@ namespace OpenRA.Editor
|
||||
if (tile.TileBitmapBytes[u + v * template.Size.X] != null)
|
||||
{
|
||||
var rawImage = tile.TileBitmapBytes[u + v * template.Size.X];
|
||||
for (var i = 0; i < 24; i++)
|
||||
for (var j = 0; j < 24; j++)
|
||||
q[(v * 24 + j) * stride + u * 24 + i] = p.GetColor(rawImage[i + 24 * j]).ToArgb();
|
||||
for (var i = 0; i < ts.TileSize; i++)
|
||||
for (var j = 0; j < ts.TileSize; j++)
|
||||
q[(v * ts.TileSize + j) * stride + u * ts.TileSize + i] = p.GetColor(rawImage[i + ts.TileSize * j]).ToArgb();
|
||||
}
|
||||
else
|
||||
{
|
||||
for (var i = 0; i < 24; i++)
|
||||
for (var j = 0; j < 24; j++)
|
||||
q[(v * 24 + j) * stride + u * 24 + i] = Color.Transparent.ToArgb();
|
||||
for (var i = 0; i < ts.TileSize; i++)
|
||||
for (var j = 0; j < ts.TileSize; j++)
|
||||
q[(v * ts.TileSize + j) * stride + u * ts.TileSize + i] = Color.Transparent.ToArgb();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -346,7 +346,7 @@ namespace OpenRA.Editor
|
||||
Bitmap RenderChunk(int u, int v)
|
||||
{
|
||||
|
||||
var bitmap = new Bitmap(ChunkSize * 24, ChunkSize * 24);
|
||||
var bitmap = new Bitmap(ChunkSize * TileSet.TileSize, ChunkSize * TileSet.TileSize);
|
||||
bitmap.SetPixel(0, 0, Color.Green);
|
||||
|
||||
var data = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height),
|
||||
@@ -364,9 +364,9 @@ namespace OpenRA.Editor
|
||||
var tile = TileSet.Tiles[tr.type];
|
||||
var index = (tr.image < tile.TileBitmapBytes.Count) ? tr.image : (byte)0;
|
||||
var rawImage = tile.TileBitmapBytes[index];
|
||||
for (var x = 0; x < 24; x++)
|
||||
for (var y = 0; y < 24; y++)
|
||||
p[(j * 24 + y) * stride + i * 24 + x] = Palette.GetColor(rawImage[x + 24 * y]).ToArgb();
|
||||
for (var x = 0; x < TileSet.TileSize; x++)
|
||||
for (var y = 0; y < TileSet.TileSize; y++)
|
||||
p[(j * TileSet.TileSize + y) * stride + i * TileSet.TileSize + x] = Palette.GetColor(rawImage[x + TileSet.TileSize * y]).ToArgb();
|
||||
|
||||
if (Map.MapResources[u * ChunkSize + i, v * ChunkSize + j].type != 0)
|
||||
{
|
||||
@@ -377,12 +377,12 @@ namespace OpenRA.Editor
|
||||
int* q = (int*)srcdata.Scan0.ToPointer();
|
||||
var srcstride = srcdata.Stride >> 2;
|
||||
|
||||
for (var x = 0; x < 24; x++)
|
||||
for (var y = 0; y < 24; y++)
|
||||
for (var x = 0; x < TileSet.TileSize; x++)
|
||||
for (var y = 0; y < TileSet.TileSize; y++)
|
||||
{
|
||||
var c = q[y * srcstride + x];
|
||||
if ((c & 0xff000000) != 0) /* quick & dirty, i cbf doing real alpha */
|
||||
p[(j * 24 + y) * stride + i * 24 + x] = c;
|
||||
p[(j * TileSet.TileSize + y) * stride + i * TileSet.TileSize + x] = c;
|
||||
}
|
||||
|
||||
resourceImage.UnlockBits(srcdata);
|
||||
@@ -398,16 +398,16 @@ namespace OpenRA.Editor
|
||||
{
|
||||
var vX = (int)Math.Floor((MousePos.X - Offset.X) / Zoom);
|
||||
var vY = (int)Math.Floor((MousePos.Y - Offset.Y) / Zoom);
|
||||
return new int2(vX / 24, vY / 24);
|
||||
return new int2(vX / TileSet.TileSize, vY / TileSet.TileSize);
|
||||
}
|
||||
|
||||
void DrawActor(System.Drawing.Graphics g, int2 p, ActorTemplate t)
|
||||
{
|
||||
float OffsetX = t.Centered ? t.Bitmap.Width / 2 - 12 : 0;
|
||||
float DrawX = 24 * p.X * Zoom + Offset.X - OffsetX;
|
||||
float OffsetX = t.Centered ? t.Bitmap.Width / 2 - TileSet.TileSize/2 : 0;
|
||||
float DrawX = TileSet.TileSize * p.X * Zoom + Offset.X - OffsetX;
|
||||
|
||||
float OffsetY = t.Centered ? t.Bitmap.Height / 2 - 12 : 0;
|
||||
float DrawY = 24 * p.Y * Zoom + Offset.Y - OffsetY;
|
||||
float OffsetY = t.Centered ? t.Bitmap.Height / 2 - TileSet.TileSize/2 : 0;
|
||||
float DrawY = TileSet.TileSize * p.Y * Zoom + Offset.Y - OffsetY;
|
||||
|
||||
float width = t.Bitmap.Width * Zoom;
|
||||
float height = t.Bitmap.Height * Zoom;
|
||||
@@ -418,11 +418,11 @@ namespace OpenRA.Editor
|
||||
|
||||
void DrawImage(System.Drawing.Graphics g, Bitmap bmp, int2 location)
|
||||
{
|
||||
float OffsetX = bmp.Width / 2 - 12;
|
||||
float DrawX = 24 * location.X * Zoom + Offset.X - OffsetX;
|
||||
float OffsetX = bmp.Width / 2 - TileSet.TileSize / 2;
|
||||
float DrawX = TileSet.TileSize * location.X * Zoom + Offset.X - OffsetX;
|
||||
|
||||
float OffsetY = bmp.Height / 2 - 12;
|
||||
float DrawY = 24 * location.Y * Zoom + Offset.Y - OffsetY;
|
||||
float OffsetY = bmp.Height / 2 - TileSet.TileSize / 2;
|
||||
float DrawY = TileSet.TileSize * location.Y * Zoom + Offset.Y - OffsetY;
|
||||
|
||||
float width = bmp.Width * Zoom;
|
||||
float height = bmp.Height * Zoom;
|
||||
@@ -433,11 +433,11 @@ namespace OpenRA.Editor
|
||||
|
||||
void DrawActorBorder(System.Drawing.Graphics g, int2 p, ActorTemplate t)
|
||||
{
|
||||
float OffsetX = t.Centered ? t.Bitmap.Width / 2 - 12 : 0;
|
||||
float DrawX = 24 * p.X * Zoom + Offset.X - OffsetX;
|
||||
float OffsetX = t.Centered ? t.Bitmap.Width / 2 - TileSet.TileSize / 2 : 0;
|
||||
float DrawX = TileSet.TileSize * p.X * Zoom + Offset.X - OffsetX;
|
||||
|
||||
float OffsetY = t.Centered ? t.Bitmap.Height / 2 - 12 : 0;
|
||||
float DrawY = 24 * p.Y * Zoom + Offset.Y - OffsetY;
|
||||
float OffsetY = t.Centered ? t.Bitmap.Height / 2 - TileSet.TileSize / 2 : 0;
|
||||
float DrawY = TileSet.TileSize * p.Y * Zoom + Offset.Y - OffsetY;
|
||||
|
||||
float width = t.Bitmap.Width * Zoom;
|
||||
float height = t.Bitmap.Height * Zoom;
|
||||
@@ -461,32 +461,32 @@ namespace OpenRA.Editor
|
||||
|
||||
Bitmap bmp = Chunks[x];
|
||||
|
||||
float DrawX = 24.0f * (float)ChunkSize * (float)x.X * Zoom + Offset.X;
|
||||
float DrawY = 24.0f * (float)ChunkSize * (float)x.Y * Zoom + Offset.Y;
|
||||
float DrawX = TileSet.TileSize* 1f * (float)ChunkSize * (float)x.X * Zoom + Offset.X;
|
||||
float DrawY = TileSet.TileSize * 1f * (float)ChunkSize * (float)x.Y * Zoom + Offset.Y;
|
||||
RectangleF sourceRect = new RectangleF(0, 0, bmp.Width, bmp.Height);
|
||||
RectangleF destRect = new RectangleF(DrawX, DrawY, bmp.Width * Zoom, bmp.Height * Zoom);
|
||||
e.Graphics.DrawImage(bmp, destRect, sourceRect, GraphicsUnit.Pixel);
|
||||
}
|
||||
|
||||
e.Graphics.DrawRectangle(CordonPen,
|
||||
Map.XOffset * 24 * Zoom + Offset.X,
|
||||
Map.YOffset * 24 * Zoom + Offset.Y,
|
||||
Map.Width * 24 * Zoom,
|
||||
Map.Height * 24 * Zoom);
|
||||
Map.XOffset * TileSet.TileSize * Zoom + Offset.X,
|
||||
Map.YOffset * TileSet.TileSize * Zoom + Offset.Y,
|
||||
Map.Width * TileSet.TileSize * Zoom,
|
||||
Map.Height * TileSet.TileSize * Zoom);
|
||||
|
||||
foreach (var ar in Map.Actors)
|
||||
DrawActor(e.Graphics, ar.Value.Location(), ActorTemplates[ar.Value.Type]);
|
||||
|
||||
foreach (var wp in Map.Waypoints)
|
||||
e.Graphics.DrawRectangle(Pens.LimeGreen,
|
||||
24 * wp.Value.X * Zoom + Offset.X + 4,
|
||||
24 * wp.Value.Y * Zoom + Offset.Y + 4,
|
||||
16 * Zoom, 16 * Zoom);
|
||||
TileSet.TileSize * wp.Value.X * Zoom + Offset.X + 4,
|
||||
TileSet.TileSize * wp.Value.Y * Zoom + Offset.Y + 4,
|
||||
(TileSet.TileSize - 8) * Zoom, (TileSet.TileSize - 8) * Zoom);
|
||||
|
||||
if (Brush != null)
|
||||
e.Graphics.DrawImage(Brush.Bitmap,
|
||||
24 * GetBrushLocation().X * Zoom + Offset.X,
|
||||
24 * GetBrushLocation().Y * Zoom + Offset.Y,
|
||||
TileSet.TileSize * GetBrushLocation().X * Zoom + Offset.X,
|
||||
TileSet.TileSize * GetBrushLocation().Y * Zoom + Offset.Y,
|
||||
Brush.Bitmap.Width * Zoom,
|
||||
Brush.Bitmap.Height * Zoom);
|
||||
|
||||
@@ -498,9 +498,9 @@ namespace OpenRA.Editor
|
||||
|
||||
if (Waypoint != null)
|
||||
e.Graphics.DrawRectangle(Pens.LimeGreen,
|
||||
24 * GetBrushLocation().X * Zoom + Offset.X + 4,
|
||||
24 * GetBrushLocation().Y * Zoom + Offset.Y + 4,
|
||||
16 * Zoom, 16 * Zoom);
|
||||
TileSet.TileSize * GetBrushLocation().X * Zoom + Offset.X + 4,
|
||||
TileSet.TileSize * GetBrushLocation().Y * Zoom + Offset.Y + 4,
|
||||
(TileSet.TileSize - 8) * Zoom, (TileSet.TileSize - 8) * Zoom);
|
||||
|
||||
if (Brush == null && Actor == null && Resource == null)
|
||||
{
|
||||
|
||||
@@ -17,15 +17,15 @@ namespace OpenRA.FileFormats
|
||||
{
|
||||
public readonly List<byte[]> TileBitmapBytes = new List<byte[]>();
|
||||
|
||||
public Terrain( Stream stream )
|
||||
public Terrain( Stream stream, int size )
|
||||
{
|
||||
// Try loading as a cnc .tem
|
||||
BinaryReader reader = new BinaryReader( stream );
|
||||
int Width = reader.ReadUInt16();
|
||||
int Height = reader.ReadUInt16();
|
||||
|
||||
if( Width != 24 || Height != 24 )
|
||||
throw new InvalidDataException( string.Format( "{0}x{1}", Width, Height ) );
|
||||
if( Width != size || Height != size )
|
||||
throw new InvalidDataException( string.Format( "Expected tile of size {0}x{1}, got {1}x{2]", size, size, Width, Height ) );
|
||||
|
||||
/*NumTiles = */reader.ReadUInt16();
|
||||
/*Zero1 = */reader.ReadUInt16();
|
||||
@@ -46,9 +46,7 @@ namespace OpenRA.FileFormats
|
||||
reader = new BinaryReader( stream );
|
||||
Width = reader.ReadUInt16();
|
||||
Height = reader.ReadUInt16();
|
||||
if( Width != 24 || Height != 24 )
|
||||
throw new InvalidDataException( string.Format( "{0}x{1}", Width, Height ) );
|
||||
|
||||
|
||||
/*NumTiles = */reader.ReadUInt16();
|
||||
reader.ReadUInt16();
|
||||
/*XDim = */reader.ReadUInt16();
|
||||
@@ -67,8 +65,8 @@ namespace OpenRA.FileFormats
|
||||
{
|
||||
if (b != 255)
|
||||
{
|
||||
stream.Position = ImgStart + b * 24 * 24;
|
||||
TileBitmapBytes.Add(new BinaryReader(stream).ReadBytes(24 * 24));
|
||||
stream.Position = ImgStart + b * size * size;
|
||||
TileBitmapBytes.Add(new BinaryReader(stream).ReadBytes(size * size));
|
||||
}
|
||||
else
|
||||
TileBitmapBytes.Add(null);
|
||||
|
||||
@@ -74,11 +74,12 @@ namespace OpenRA.FileFormats
|
||||
public string Name;
|
||||
public string Id;
|
||||
public string Palette;
|
||||
public int TileSize = 24;
|
||||
public string[] Extensions;
|
||||
public Dictionary<string, TerrainTypeInfo> Terrain = new Dictionary<string, TerrainTypeInfo>();
|
||||
public Dictionary<ushort, Terrain> Tiles = new Dictionary<ushort, Terrain>();
|
||||
public Dictionary<ushort, TileTemplate> Templates = new Dictionary<ushort, TileTemplate>();
|
||||
static List<string> fields = new List<string>() {"Name", "Id", "Palette", "Extensions"};
|
||||
static List<string> fields = new List<string>() {"Name", "TileSize", "Id", "Palette", "Extensions"};
|
||||
|
||||
public TileSet() {}
|
||||
public TileSet( string filepath )
|
||||
@@ -103,7 +104,7 @@ namespace OpenRA.FileFormats
|
||||
using( Stream s = FileSystem.OpenWithExts(t.Value.Image, Extensions) )
|
||||
{
|
||||
if( !Tiles.ContainsKey( t.Key ) )
|
||||
Tiles.Add( t.Key, new Terrain( s ) );
|
||||
Tiles.Add( t.Key, new Terrain( s, TileSize ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +145,7 @@ namespace OpenRA.FileFormats
|
||||
if( Tiles.TryGetValue( r.type, out tile ) )
|
||||
return tile.TileBitmapBytes[ r.image ];
|
||||
|
||||
byte[] missingTile = new byte[ 24 * 24 ];
|
||||
byte[] missingTile = new byte[ TileSize * TileSize ];
|
||||
for( int i = 0 ; i < missingTile.Length ; i++ )
|
||||
missingTile[ i ] = 0x36;
|
||||
|
||||
|
||||
@@ -68,9 +68,9 @@ namespace OpenRA.Graphics
|
||||
int indicesPerRow = map.Width * 6;
|
||||
int verticesPerRow = map.Width * 4;
|
||||
|
||||
int visibleRows = (int)(viewport.Height / 24.0f + 2);
|
||||
int visibleRows = (int)(viewport.Height * 1f / Game.CellSize + 2);
|
||||
|
||||
int firstRow = (int)((viewport.Location.Y) / 24.0f - map.YOffset);
|
||||
int firstRow = (int)(viewport.Location.Y * 1f / Game.CellSize - map.YOffset);
|
||||
int lastRow = firstRow + visibleRows;
|
||||
|
||||
if (lastRow < 0 || firstRow > map.Height)
|
||||
|
||||
@@ -142,8 +142,8 @@ namespace OpenRA.Graphics
|
||||
for (var j = 0; j < world.Map.MapSize.Y;
|
||||
j += world.WorldActor.Info.Traits.Get<SpatialBinsInfo>().BinSize)
|
||||
{
|
||||
Game.Renderer.LineRenderer.DrawLine(new float2(0, j * 24), new float2(world.Map.MapSize.X * 24, j * 24), Color.Black, Color.Black);
|
||||
Game.Renderer.LineRenderer.DrawLine(new float2(j * 24, 0), new float2(j * 24, world.Map.MapSize.Y * 24), Color.Black, Color.Black);
|
||||
Game.Renderer.LineRenderer.DrawLine(new float2(0, j * Game.CellSize), new float2(world.Map.MapSize.X * Game.CellSize, j * Game.CellSize), Color.Black, Color.Black);
|
||||
Game.Renderer.LineRenderer.DrawLine(new float2(j * Game.CellSize, 0), new float2(j * Game.CellSize, world.Map.MapSize.Y * Game.CellSize), Color.Black, Color.Black);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace OpenRA.Traits
|
||||
var cp = Game.viewport.Location
|
||||
+ .5f * new float2(Game.viewport.Width, Game.viewport.Height);
|
||||
|
||||
var intensity = 24 * 24 * 100 * shakeEffects.Sum(
|
||||
var intensity = Game.CellSize * Game.CellSize * 100 * shakeEffects.Sum(
|
||||
e => e.Intensity / (e.Position - cp).LengthSquared);
|
||||
|
||||
return Math.Min(intensity, 10);
|
||||
|
||||
@@ -23,14 +23,16 @@ namespace OpenRA.TilesetBuilder
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
string srcfile;
|
||||
public Form1( string src )
|
||||
int TileSize;
|
||||
public Form1( string src, int size )
|
||||
{
|
||||
srcfile = src;
|
||||
|
||||
TileSize = size;
|
||||
InitializeComponent();
|
||||
|
||||
surface1.TileSize = TileSize;
|
||||
surface1.Image = (Bitmap)Image.FromFile(src);
|
||||
surface1.TerrainTypes = new int[surface1.Image.Width / 24, surface1.Image.Height / 24]; /* all passable by default */
|
||||
surface1.TerrainTypes = new int[surface1.Image.Width / size, surface1.Image.Height / size]; /* all passable by default */
|
||||
surface1.Templates = new List<Template>();
|
||||
surface1.Size = surface1.Image.Size;
|
||||
|
||||
@@ -123,6 +125,7 @@ namespace OpenRA.TilesetBuilder
|
||||
{
|
||||
Name = "Arrakis",
|
||||
Id = "ARRAKIS",
|
||||
TileSize = this.TileSize,
|
||||
Palette = "arrakis.pal",
|
||||
Extensions = new string[] {".arr", ".shp"}
|
||||
};
|
||||
@@ -197,8 +200,8 @@ namespace OpenRA.TilesetBuilder
|
||||
var ms = new MemoryStream();
|
||||
using (var bw = new BinaryWriter(ms))
|
||||
{
|
||||
bw.Write((ushort)24);
|
||||
bw.Write((ushort)24);
|
||||
bw.Write((ushort)TileSize);
|
||||
bw.Write((ushort)TileSize);
|
||||
bw.Write((uint)totalTiles);
|
||||
bw.Write((ushort)t.Width);
|
||||
bw.Write((ushort)t.Height);
|
||||
@@ -225,13 +228,13 @@ namespace OpenRA.TilesetBuilder
|
||||
{
|
||||
if (t.Cells.ContainsKey(new int2(u + t.Left, v + t.Top)))
|
||||
{
|
||||
byte* q = p + data.Stride * 24 * (v + t.Top) + 24 * (u + t.Left);
|
||||
for (var j = 0; j < 24; j++)
|
||||
for (var i = 0; i < 24; i++)
|
||||
byte* q = p + data.Stride * TileSize * (v + t.Top) + TileSize * (u + t.Left);
|
||||
for (var j = 0; j < TileSize; j++)
|
||||
for (var i = 0; i < TileSize; i++)
|
||||
bw.Write(q[i + j * data.Stride]);
|
||||
}
|
||||
else
|
||||
for (var x = 0; x < 24 * 24; x++)
|
||||
for (var x = 0; x < TileSize * TileSize; x++)
|
||||
bw.Write((byte)0); /* todo: don't fill with air */
|
||||
}
|
||||
}
|
||||
@@ -292,7 +295,8 @@ namespace OpenRA.TilesetBuilder
|
||||
public List<Template> Templates = new List<Template>();
|
||||
public bool ShowTerrainTypes = true;
|
||||
public string InputMode;
|
||||
|
||||
public int TileSize;
|
||||
|
||||
Template CurrentTemplate;
|
||||
|
||||
public Surface()
|
||||
@@ -319,9 +323,9 @@ namespace OpenRA.TilesetBuilder
|
||||
for (var j = 0; j <= TerrainTypes.GetUpperBound(1); j++)
|
||||
if (TerrainTypes[i, j] != 0)
|
||||
{
|
||||
e.Graphics.FillRectangle(Brushes.Black, 24 * i + 10, 24 * j + 10, 10, 10);
|
||||
e.Graphics.FillRectangle(Brushes.Black, TileSize * i + 10, TileSize * j + 10, 10, 10);
|
||||
e.Graphics.DrawString(TerrainTypes[i, j].ToString(),
|
||||
Font, Brushes.LimeGreen, 24 * i + 10, 24 * j + 10);
|
||||
Font, Brushes.LimeGreen, TileSize * i + 10, TileSize * j + 10);
|
||||
}
|
||||
|
||||
/* draw template outlines */
|
||||
@@ -330,23 +334,23 @@ namespace OpenRA.TilesetBuilder
|
||||
foreach (var c in t.Cells.Keys)
|
||||
{
|
||||
if (CurrentTemplate == t)
|
||||
e.Graphics.FillRectangle(currentBrush, 24 * c.X, 24 * c.Y, 24, 24);
|
||||
e.Graphics.FillRectangle(currentBrush, TileSize * c.X, TileSize * c.Y, TileSize, TileSize);
|
||||
|
||||
if (!t.Cells.ContainsKey(c + new int2(-1, 0)))
|
||||
e.Graphics.DrawLine(Pens.Red, (24 * c).ToPoint(), (24 * (c + new int2(0, 1))).ToPoint());
|
||||
e.Graphics.DrawLine(Pens.Red, (TileSize * c).ToPoint(), (TileSize * (c + new int2(0, 1))).ToPoint());
|
||||
if (!t.Cells.ContainsKey(c + new int2(+1, 0)))
|
||||
e.Graphics.DrawLine(Pens.Red, (24 * (c + new int2(1, 0))).ToPoint(), (24 * (c + new int2(1, 1))).ToPoint());
|
||||
e.Graphics.DrawLine(Pens.Red, (TileSize * (c + new int2(1, 0))).ToPoint(), (TileSize * (c + new int2(1, 1))).ToPoint());
|
||||
if (!t.Cells.ContainsKey(c + new int2(0, +1)))
|
||||
e.Graphics.DrawLine(Pens.Red, (24 * (c + new int2(0, 1))).ToPoint(), (24 * (c + new int2(1, 1))).ToPoint());
|
||||
e.Graphics.DrawLine(Pens.Red, (TileSize * (c + new int2(0, 1))).ToPoint(), (TileSize * (c + new int2(1, 1))).ToPoint());
|
||||
if (!t.Cells.ContainsKey(c + new int2(0, -1)))
|
||||
e.Graphics.DrawLine(Pens.Red, (24 * c).ToPoint(), (24 * (c + new int2(1, 0))).ToPoint());
|
||||
e.Graphics.DrawLine(Pens.Red, (TileSize * c).ToPoint(), (TileSize * (c + new int2(1, 0))).ToPoint());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnMouseDown(MouseEventArgs e)
|
||||
{
|
||||
var pos = new int2( e.X / 24, e.Y / 24 );
|
||||
var pos = new int2( e.X / TileSize, e.Y / TileSize );
|
||||
|
||||
if (InputMode == null)
|
||||
{
|
||||
@@ -375,7 +379,7 @@ namespace OpenRA.TilesetBuilder
|
||||
|
||||
protected override void OnMouseMove(MouseEventArgs e)
|
||||
{
|
||||
var pos = new int2(e.X / 24, e.Y / 24);
|
||||
var pos = new int2(e.X / TileSize, e.Y / TileSize);
|
||||
|
||||
if (InputMode == null)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,8 @@ namespace OpenRA.TilesetBuilder
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new Form1(args.First()));
|
||||
Console.WriteLine("{0} {1}",args[0], args[1]);
|
||||
Application.Run(new Form1(args[0], int.Parse(args[1])));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user