git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1109 993157c7-ee19-0410-b2c4-bb4e9862e678
This commit is contained in:
@@ -44,6 +44,7 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="TileSheetBuilder.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\OpenRa.FileFormats\OpenRa.FileFormats.csproj">
|
<ProjectReference Include="..\OpenRa.FileFormats\OpenRa.FileFormats.csproj">
|
||||||
|
|||||||
45
OpenRa.Game/TileSheetBuilder.cs
Normal file
45
OpenRa.Game/TileSheetBuilder.cs
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using System.Drawing;
|
||||||
|
|
||||||
|
namespace OpenRa.Game
|
||||||
|
{
|
||||||
|
// T is probably going to be BluntDirectX.Direct3D.Texture
|
||||||
|
|
||||||
|
|
||||||
|
public delegate T Provider<T>();
|
||||||
|
|
||||||
|
class TileSheetBuilder<T>
|
||||||
|
where T : class
|
||||||
|
{
|
||||||
|
readonly Size pageSize;
|
||||||
|
readonly Provider<T> pageProvider;
|
||||||
|
|
||||||
|
public TileSheetBuilder(Size pageSize, Provider<T> pageProvider)
|
||||||
|
{
|
||||||
|
this.pageSize = pageSize;
|
||||||
|
this.pageProvider = pageProvider;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SheetRectangle<T> AddImage(Size imageSize)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SheetRectangle<T>
|
||||||
|
where T : class
|
||||||
|
{
|
||||||
|
readonly PointF origin;
|
||||||
|
readonly SizeF size;
|
||||||
|
readonly T sheet;
|
||||||
|
|
||||||
|
internal SheetRectangle(T sheet, PointF origin, SizeF size)
|
||||||
|
{
|
||||||
|
this.origin = origin;
|
||||||
|
this.size = size;
|
||||||
|
this.sheet = sheet;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user