Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c68215
commit 2f388a0
Showing
113 changed files
with
3,290 additions
and
28 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<ProjectGuid>{9FEEB631-277E-404E-B95D-49B1F4F0A2F3}</ProjectGuid> | ||
<ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">Windows Phone</Platform> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>ArtemisXbox</RootNamespace> | ||
<AssemblyName>ArtemisXbox</AssemblyName> | ||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> | ||
<TargetFrameworkProfile>Client</TargetFrameworkProfile> | ||
<XnaFrameworkVersion>v4.0</XnaFrameworkVersion> | ||
<XnaPlatform>Windows Phone</XnaPlatform> | ||
<XnaProfile>Reach</XnaProfile> | ||
<XnaCrossPlatformGroupID>0772fe00-2dbb-4c80-a11e-4a9736431d1a</XnaCrossPlatformGroupID> | ||
<XnaOutputType>Library</XnaOutputType> | ||
<XnaRefreshLevel>1</XnaRefreshLevel> | ||
<XapFilename Condition="$(XnaOutputType)=='Game'">$(AssemblyName).xap</XapFilename> | ||
<SilverlightManifestTemplate Condition="$(XnaOutputType)=='Game'">Properties\AppManifest.xml</SilverlightManifestTemplate> | ||
<XnaWindowsPhoneManifestTemplate Condition="$(XnaOutputType)=='Game'">Properties\WMAppManifest.xml</XnaWindowsPhoneManifestTemplate> | ||
<TileImage Condition="$(XnaOutputType)=='Game'">Background.png</TileImage> | ||
<TileTitle Condition="$(XnaOutputType)=='Game'">$(AssemblyName)</TileTitle> | ||
<Thumbnail>PhoneGameThumb.png</Thumbnail> | ||
<SupportedCultures /> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Windows Phone' "> | ||
<OutputPath>bin\Windows Phone\Release</OutputPath> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<NoStdLib>true</NoStdLib> | ||
<UseVSHostingProcess>false</UseVSHostingProcess> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<DefineConstants>TRACE;WINDOWS_PHONE</DefineConstants> | ||
<XnaCompressContent>false</XnaCompressContent> | ||
<LangVersion>default</LangVersion> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Windows Phone' "> | ||
<OutputPath>bin\Windows Phone\Debug</OutputPath> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<NoStdLib>true</NoStdLib> | ||
<UseVSHostingProcess>false</UseVSHostingProcess> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<DefineConstants>DEBUG;TRACE;WINDOWS_PHONE</DefineConstants> | ||
<XnaCompressContent>false</XnaCompressContent> | ||
<LangVersion>default</LangVersion> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<None Include="Background.png"> | ||
<XnaPlatformSpecific>true</XnaPlatformSpecific> | ||
</None> | ||
<None Include="PhoneGameThumb.png"> | ||
<XnaPlatformSpecific>true</XnaPlatformSpecific> | ||
</None> | ||
<None Include="Properties\AppManifest.xml"> | ||
<XnaPlatformSpecific>true</XnaPlatformSpecific> | ||
</None> | ||
<None Include="Properties\WMAppManifest.xml"> | ||
<XnaPlatformSpecific>true</XnaPlatformSpecific> | ||
</None> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Component.cs" /> | ||
<Compile Include="ComponentMapper.cs" /> | ||
<Compile Include="ComponentType.cs" /> | ||
<Compile Include="ComponentTypeManager.cs" /> | ||
<Compile Include="DelayedEntityProcessingSystem.cs" /> | ||
<Compile Include="DelayedEntitySystem.cs" /> | ||
<Compile Include="Entity.cs" /> | ||
<Compile Include="EntityManager.cs" /> | ||
<Compile Include="EntityProcessingSystem.cs" /> | ||
<Compile Include="EntitySystem.cs" /> | ||
<Compile Include="EntityWorld.cs" /> | ||
<Compile Include="GroupManager.cs" /> | ||
<Compile Include="GroupSystem.cs" /> | ||
<Compile Include="IntervalEntityProcessingSystem.cs" /> | ||
<Compile Include="IntervalEntitySystem.cs" /> | ||
<Compile Include="IntervalGroupSystem.cs" /> | ||
<Compile Include="IntervalTagSystem.cs" /> | ||
<Compile Include="Manager.cs" /> | ||
<Compile Include="ParallelEntityProcessingSystem.cs" /> | ||
<Compile Include="Pool.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="SystemBitManager.cs" /> | ||
<Compile Include="SystemManager.cs" /> | ||
<Compile Include="TagManager.cs" /> | ||
<Compile Include="TagSystem.cs" /> | ||
<Compile Include="Utils\Bag.cs" /> | ||
<Compile Include="Utils\FastMath.cs" /> | ||
<Compile Include="Utils\Timer.cs" /> | ||
<Compile Include="Utils\TrigLUT.cs" /> | ||
<Compile Include="Utils\Utils.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Reference Include="Microsoft.Xna.Framework" /> | ||
<Reference Include="Microsoft.Xna.Framework.Avatar" /> | ||
<Reference Include="Microsoft.Xna.Framework.Game" /> | ||
<Reference Include="Microsoft.Xna.Framework.GamerServices" /> | ||
<Reference Include="Microsoft.Xna.Framework.Graphics" /> | ||
<Reference Include="mscorlib" /> | ||
<Reference Include="ParallelTasks"> | ||
<HintPath>Dll\Phone7\ParallelTasks.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Net" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | ||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" /> | ||
<!-- | ||
To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<XNASelectedDeployDevice>5E7661DF-D928-40ff-B747-A4B1957194F9</XNASelectedDeployDevice> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<ProjectGuid>{E890BAD4-64C6-442F-B466-7321A0BFA1A1}</ProjectGuid> | ||
<ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">Xbox 360</Platform> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>ArtemisXbox</RootNamespace> | ||
<AssemblyName>ArtemisXbox</AssemblyName> | ||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> | ||
<TargetFrameworkProfile>Client</TargetFrameworkProfile> | ||
<XnaFrameworkVersion>v4.0</XnaFrameworkVersion> | ||
<XnaPlatform>Xbox 360</XnaPlatform> | ||
<XnaProfile>HiDef</XnaProfile> | ||
<XnaCrossPlatformGroupID>0772fe00-2dbb-4c80-a11e-4a9736431d1a</XnaCrossPlatformGroupID> | ||
<XnaOutputType>Library</XnaOutputType> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Xbox 360' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Xbox 360\Debug</OutputPath> | ||
<DefineConstants>DEBUG;TRACE;XBOX;XBOX360</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<NoStdLib>true</NoStdLib> | ||
<UseVSHostingProcess>false</UseVSHostingProcess> | ||
<XnaCompressContent>true</XnaCompressContent> | ||
<LangVersion>default</LangVersion> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Xbox 360' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Xbox 360\Release</OutputPath> | ||
<DefineConstants>TRACE;XBOX;XBOX360</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<NoStdLib>true</NoStdLib> | ||
<UseVSHostingProcess>false</UseVSHostingProcess> | ||
<XnaCompressContent>true</XnaCompressContent> | ||
<LangVersion>default</LangVersion> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Microsoft.Xna.Framework" /> | ||
<Reference Include="Microsoft.Xna.Framework.Game" /> | ||
<Reference Include="Microsoft.Xna.Framework.Graphics" /> | ||
<Reference Include="Microsoft.Xna.Framework.GamerServices" /> | ||
<Reference Include="Microsoft.Xna.Framework.Xact" /> | ||
<Reference Include="Microsoft.Xna.Framework.Video" /> | ||
<Reference Include="Microsoft.Xna.Framework.Avatar" /> | ||
<Reference Include="Microsoft.Xna.Framework.Net" /> | ||
<Reference Include="Microsoft.Xna.Framework.Storage" /> | ||
<Reference Include="mscorlib" /> | ||
<Reference Include="ParallelTasks"> | ||
<HintPath>Dll\ParallelTasks.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="System.Core"> | ||
<RequiredTargetFramework>4.0</RequiredTargetFramework> | ||
</Reference> | ||
<Reference Include="System.Xml.Linq"> | ||
<RequiredTargetFramework>4.0</RequiredTargetFramework> | ||
</Reference> | ||
<Reference Include="System.Net" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Component.cs" /> | ||
<Compile Include="ComponentMapper.cs" /> | ||
<Compile Include="ComponentType.cs" /> | ||
<Compile Include="ComponentTypeManager.cs" /> | ||
<Compile Include="DelayedEntityProcessingSystem.cs" /> | ||
<Compile Include="DelayedEntitySystem.cs" /> | ||
<Compile Include="Entity.cs" /> | ||
<Compile Include="EntityManager.cs" /> | ||
<Compile Include="EntityProcessingSystem.cs" /> | ||
<Compile Include="EntitySystem.cs" /> | ||
<Compile Include="EntityWorld.cs" /> | ||
<Compile Include="GroupManager.cs" /> | ||
<Compile Include="GroupSystem.cs" /> | ||
<Compile Include="IntervalEntityProcessingSystem.cs" /> | ||
<Compile Include="IntervalEntitySystem.cs" /> | ||
<Compile Include="IntervalGroupSystem.cs" /> | ||
<Compile Include="IntervalTagSystem.cs" /> | ||
<Compile Include="Manager.cs" /> | ||
<Compile Include="ParallelEntityProcessingSystem.cs" /> | ||
<Compile Include="Pool.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="SystemBitManager.cs" /> | ||
<Compile Include="SystemManager.cs" /> | ||
<Compile Include="TagManager.cs" /> | ||
<Compile Include="TagSystem.cs" /> | ||
<Compile Include="Utils\Bag.cs" /> | ||
<Compile Include="Utils\FastMath.cs" /> | ||
<Compile Include="Utils\Timer.cs" /> | ||
<Compile Include="Utils\TrigLUT.cs" /> | ||
<Compile Include="Utils\Utils.cs" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | ||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" /> | ||
<!-- | ||
To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
#if WINDOWS | ||
using System.Threading.Tasks; | ||
#else | ||
using ParallelTasks; | ||
#endif | ||
namespace Artemis | ||
{ | ||
public abstract class ParallelEntityProcessingSystem : EntitySystem | ||
{ | ||
|
||
/** | ||
* Create a new EntityProcessingSystem. It requires at least one component. | ||
* @param requiredType the required component type. | ||
* @param otherTypes other component types. | ||
*/ | ||
public ParallelEntityProcessingSystem(Type requiredType, params Type[] otherTypes) | ||
: base(GetMergedTypes(requiredType, otherTypes)) | ||
{ | ||
} | ||
|
||
/** | ||
* Process a entity this system is interested in. | ||
* @param e the entity to process. | ||
*/ | ||
public abstract void Process(Entity e); | ||
|
||
#if WINDOWS | ||
TaskFactory factory = new TaskFactory(TaskScheduler.Default); | ||
#endif | ||
|
||
protected override void ProcessEntities(Dictionary<int, Entity> entities) | ||
{ | ||
float simultaneous = Environment.ProcessorCount *2; | ||
int perThread = (int) Math.Ceiling(((float)entities.Values.Count) / simultaneous); | ||
Entity[] ents = new Entity[entities.Values.Count]; | ||
entities.Values.CopyTo(ents,0); | ||
int num = entities.Values.Count - 1; | ||
List<Task> tasks = new List<Task>(); | ||
|
||
|
||
|
||
for (int j = 0; j < simultaneous; j++) | ||
{ | ||
int initial = num; | ||
#if WINDOWS | ||
tasks.Add(factory.StartNew( | ||
#else | ||
tasks.Add(Parallel.Start( | ||
#endif | ||
() => | ||
{ | ||
for (int i = initial; i > initial - perThread && i >= 0; i--) | ||
{ | ||
Process(ents[i]); | ||
} | ||
} | ||
)); | ||
num -= perThread; | ||
} | ||
|
||
#if WINDOWS | ||
Task.WaitAll(tasks.ToArray()); | ||
#else | ||
foreach (var item in tasks) | ||
{ | ||
item.Wait(); | ||
} | ||
#endif | ||
|
||
} | ||
} | ||
} | ||
|
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
> | ||
<Deployment.Parts> | ||
</Deployment.Parts> | ||
</Deployment> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("ArtemisXbox")] | ||
[assembly: AssemblyProduct("ArtemisXbox")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyCompany("Microsoft")] | ||
[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. Only Windows | ||
// assemblies support COM. | ||
[assembly: ComVisible(false)] | ||
|
||
// On Windows, the following GUID is for the ID of the typelib if this | ||
// project is exposed to COM. On other platforms, it unique identifies the | ||
// title storage container when deploying this assembly to the device. | ||
[assembly: Guid("1ce79e1e-1e8a-472c-a84e-c245e9695ce0")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
[assembly: AssemblyVersion("1.0.0.0")] |
Oops, something went wrong.