axiosengine 

axiosengine Commit Details


Date:2012-06-23 17:23:39 (12 years 3 months ago)
Author:Natalie Adams
Branch:master
Commit:db369a362d6d9ba92613361341fc64ff5dbe7f3a
Parents: 575f1523a274613b0c332de18932c504c02daf33
Message:Adding double extension Adding Texture2D comments

Changes:

File differences

axios/Engine/Extensions/Double.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Axios.Engine.Extensions
{
public static class AxiosExtension_Double
{
//http://www.vcskicks.com/csharp_net_angles.php
public static double DegreeToRadian(this double angle)
{
return Math.PI * angle / 180.0;
}
//http://www.vcskicks.com/csharp_net_angles.php
public static double RadianToDegree(double angle)
{
return angle * (180.0 / Math.PI);
}
}
}
axios/Engine/Extensions/Texture2D.cs
2323
2424
2525
26
27
2628
2729
2830
/// <returns>A multidimensional array represting the rows/coulmns in the texture.</returns>
public static Texture2D[,] Split(this Texture2D original, int partWidth, int partHeight, out int xCount, out int yCount)
{
// This is buggy, there is an issue where it is out of bounds => r[curryidx, currxidx] = part;
// -- Nathan Adams [adamsna@datanethost.net] - 6/21/2012
yCount = original.Height / partHeight; //+ (partHeight % original.Height == 0 ? 0 : 1);//The number of textures in each horizontal row
xCount = original.Width / partWidth; //+(partWidth % original.Width == 0 ? 0 : 1);//The number of textures in each vertical column
Texture2D[,] r = new Texture2D[yCount,xCount];//Number of parts = (area of original) / (area of each part).

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.09838s using 14 queries.