AxiosEngine-old 

AxiosEngine-old Commit Details


Date:2014-05-26 17:07:00 (10 years 6 months ago)
Author:Natalie Adams
Branch:default
Commit:67ebb6b10501
Parents: bdbc7a063edc
Message:Adding AxiosEngineFactory which provides CreateFromList factory

Changes:
Aaxios/Engine/AxiosEngineFactory.cs (full)
Maxios/Axios_WP7.csproj (1 diff)
Maxios/Axios_Windows.csproj (1 diff)
Maxios/Axios_Xbox_360.csproj (1 diff)

File differences

axios/Axios_WP7.csproj
156156
157157
158158
159
159160
160161
161162
<Compile Include="Dynamics\World.cs" />
<Compile Include="Dynamics\WorldCallbacks.cs" />
<Compile Include="Engine\AxiosCommandConsole.cs" />
<Compile Include="Engine\AxiosEngineFactory.cs" />
<Compile Include="Engine\AxiosEvents.cs" />
<Compile Include="Engine\AxiosGameObject.cs" />
<Compile Include="Engine\AxiosGameScreen.cs" />
axios/Axios_Windows.csproj
9999
100100
101101
102
102103
103104
104105
<ItemGroup>
<Compile Include="Engine\AxiosBreakableGameObject.cs" />
<Compile Include="Engine\AxiosCommandConsole.cs" />
<Compile Include="Engine\AxiosEngineFactory.cs" />
<Compile Include="Engine\AxiosEvents.cs" />
<Compile Include="Axios_settings.cs" />
<Compile Include="Collision\Collision.cs" />
axios/Axios_Xbox_360.csproj
150150
151151
152152
153
153154
154155
155156
<Compile Include="Dynamics\WorldCallbacks.cs" />
<Compile Include="Engine\AxiosBreakableGameObject.cs" />
<Compile Include="Engine\AxiosCommandConsole.cs" />
<Compile Include="Engine\AxiosEngineFactory.cs" />
<Compile Include="Engine\AxiosEvents.cs" />
<Compile Include="Engine\AxiosGameObject.cs" />
<Compile Include="Engine\AxiosGameScreen.cs" />
axios/Engine/AxiosEngineFactory.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.Collections.Generic;
namespace Axios.Engine.Factories
{
public class Texture2DFactory
{
public static Texture2D CreateFromList(List<Texture2D> textures, int width, int height)
{
if (textures.Count <= 0)
return (Texture2D)null;
Texture2D texture2D1 = new Texture2D(textures[0].GraphicsDevice, width, height);
Color[] data1 = new Color[width * height];
texture2D1.GetData<Color>(data1);
Rectangle rectangle = new Rectangle(0, 0, textures[0].Width, textures[0].Height);
foreach (Texture2D texture2D2 in textures)
{
Color[] data2 = new Color[texture2D2.Width * texture2D2.Height];
texture2D2.GetData<Color>(data2);
texture2D1.SetData<Color>(0, new Rectangle?(rectangle), data2, 0, texture2D2.Width * texture2D2.Height);
rectangle.X += texture2D2.Width;
if (rectangle.X >= width)
{
rectangle.X = 0;
rectangle.Y += texture2D2.Height;
}
}
return texture2D1;
}
}
}

Archive Download the corresponding diff file

Page rendered in 0.41883s using 14 queries.