Commits

André Schnabel  committed 6e2c80c

Adapted to Kosu changes

  • Participants
  • Parent commits edc87dd

Comments (0)

Files changed (11)

File DoorManager.cs

 using System.Collections.Generic;
 using System.Linq;
 using Kosu;
-using OpenTK;
+using Kosu.Math;
 using WeltraumsoldatKosu.Entities;
 using WeltraumsoldatKosu.Framework;
 using WeltraumsoldatKosu.Rendering;

File Entities/Door.cs

-using Kosu.Utilities;
-using OpenTK;
+using Kosu.Math;
+using Kosu.Utilities;
 
 namespace WeltraumsoldatKosu.Entities {
 	public class Door {

File Entities/Enemy.cs

 using Kosu;
-using OpenTK;
 using Kosu.Audio;
+using Kosu.Math;
 
 namespace WeltraumsoldatKosu.Entities {
 	public class Enemy : Rendering.Sprite.Sprite {

File Entities/PlasmaShot.cs

-using OpenTK;
+using Kosu.Math;
 
 namespace WeltraumsoldatKosu.Entities {
 	public class PlasmaShot : Rendering.Sprite.Sprite {

File Framework/Utils.cs

 using System.Globalization;
 using Kosu.Cameras;
 using Kosu.Rendering.Sprites;
-using OpenTK;
+using Kosu.Utilities;
+using Vector3 = Kosu.Math.Vector3;
 
 namespace WeltraumsoldatKosu.Framework {
 	public static class Utils {
 		}
 
 		private static Vector3 tmpCamToSpr = new Vector3();
-		private static readonly float FOV_THRESHOLD = (float) MathHelper.DegreesToRadians((float) Math.Cos((Constants.FOV + 10.0f)/2.0f*Constants.ASPECT));
+		private static readonly float FOV_THRESHOLD = (float) MathUtils.DegreesToRadians((float) Math.Cos((Constants.FOV + 10.0f)/2.0f*Constants.ASPECT));
 
 		public static QuadMesh GenQMesh(String imgName, SpriteSheet atlas, int width = -1, int height = -1) {
 			Sprite reg = atlas[(imgName)];
 		}
 
 		public static float GetYawOfCam(PerspectiveCamera cam) {
-			return (float) (MathHelper.RadiansToDegrees((float) Math.Atan2(cam.Normal.X, cam.Normal.Z)) + 180.0f);
+			return (float) (MathUtils.RadiansToDegrees((float) Math.Atan2(cam.Normal.X, cam.Normal.Z)) + 180.0f);
 		}
 
 		public static bool SpriteInFrustum(PerspectiveCamera cam, float spriteX, float spriteZ) {

File GameScreen.cs

 using Kosu.Cameras;
 using Kosu.Rendering.Sprites;
 using Kosu.Utilities;
-using OpenTK;
 using System.Collections.Generic;
 using Kosu.Audio;
 
 using WeltraumsoldatKosu.Rendering.Sprite;
 #if !MOBILE
 using Key = OpenTK.Input.Key;
+using Vector3 = Kosu.Math.Vector3;
 
 #endif
 
 namespace WeltraumsoldatKosu {
 	public class GameScreen : State {
 		private const string SavegameFilename = "weltraumsoldat3Dsavegame";
-		private readonly PerspectiveCamera cam = new PerspectiveCamera(Vector3.Zero, new Vector3(0, -1, 0), Vector3.UnitY, MathHelper.DegreesToRadians(Constants.FOV), Constants.ASPECT);
+		private readonly PerspectiveCamera cam = new PerspectiveCamera(Vector3.Zero, new Vector3(0, -1, 0), Vector3.UnitY, MathUtils.DegreesToRadians(Constants.FOV), Constants.ASPECT);
 		private readonly string[] instructions = {"Welcome to Weltraumsoldat3D.", /*"Use the top diplay border to walk forward.",
 			"Use the bottom display border to walk backward.",
 			"Use the Left and Right display borders to rotate.",
 
 		private void ResetCam() {
 			cam.Normal = new Vector3(0, 0, 1);
-			cam.Rotate(Vector3.UnitY, MathHelper.DegreesToRadians(45.0f));
+			cam.Rotate(Vector3.UnitY, MathUtils.DegreesToRadians(45.0f));
 		}
 
 		private void LoadMap(int pCurMap) {
 using System;
 using Kosu;
 using Kosu.Cameras;
-using OpenTK;
 #if !MOBILE
+using Kosu.Utilities;
 using OpenTK.Input;
 using Key = OpenTK.Input.Key;
 #endif
 using WeltraumsoldatKosu.Entities;
+using Kosu.Math;
 
 namespace WeltraumsoldatKosu {
 	public class Movement {
 		}
 
 		private void RotateLeft(float delta) {
-			cam.Rotate(Vector3.UnitY, MathHelper.DegreesToRadians(Constants.ROT_SPEED*delta*6));
+			cam.Rotate(Vector3.UnitY, MathUtils.DegreesToRadians(Constants.ROT_SPEED*delta*6));
 		}
 
 		private void RotateRight(float delta) {
-			cam.Rotate(Vector3.UnitY, MathHelper.DegreesToRadians(-Constants.ROT_SPEED*delta*6));
+			cam.Rotate(Vector3.UnitY, MathUtils.DegreesToRadians(-Constants.ROT_SPEED*delta*6));
 		}
 
 		public bool ProcessTouchInput(float delta, int tX, int tY) {
 				TryToShoot();
 
 			if(dx > 0 || dx < 0)
-				cam.Rotate(Vector3.UnitY, MathHelper.DegreesToRadians(Constants.ROT_SPEED*(0.25f)*-dx*delta));
+				cam.Rotate(Vector3.UnitY, MathUtils.DegreesToRadians(Constants.ROT_SPEED*(0.25f)*-dx*delta));
 		}
 
 		public void ResetPos() {

File Rendering/Map/DoorAnimationManager.cs

 using System.Collections.Generic;
 using Kosu;
-using OpenTK;
+using Kosu.Math;
 using WeltraumsoldatKosu.Framework;
 using Kosu.Audio;
 

File Rendering/Sprite/Sprite.cs

-using Kosu.Rendering.Sprites;
-using OpenTK;
+using Kosu.Math;
+using Kosu.Rendering.Sprites;
 #if !MOBILE
 using OpenTK.Graphics.OpenGL;
 #else

File Rendering/Sprite/SpriteManager.cs

 using Kosu.Cameras;
 using Kosu.Math;
 using Kosu.Rendering.Sprites;
-using OpenTK;
 #if !MOBILE
 using OpenTK.Graphics.OpenGL;
 #else
 using TextureParameterName = OpenTK.Graphics.ES11.All;
 using TextureMinFilter = OpenTK.Graphics.ES11.All;
 using TextureMagFilter = OpenTK.Graphics.ES11.All;
-
 #endif
 using WeltraumsoldatKosu.Entities;
 using WeltraumsoldatKosu.Framework;

File WeltraumsoldatKosu.csproj

     <Compile Include="Rendering\Sprite\SpriteManager.cs" />
   </ItemGroup>
   <ItemGroup>
-    <ProjectReference Include="..\Kosu\Kosu.csproj">
-      <Project>{8C30FFF3-FB86-4DD9-9F1C-9E24C972D543}</Project>
-      <Name>Kosu</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
     <BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
       <Visible>False</Visible>
       <ProductName>Microsoft .NET Framework 4 Client Profile %28x86 und x64%29</ProductName>
       <Install>true</Install>
     </BootstrapperPackage>
   </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\Kosu\Kosu.csproj">
+      <Project>{8C30FFF3-FB86-4DD9-9F1C-9E24C972D543}</Project>
+      <Name>Kosu</Name>
+    </ProjectReference>
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.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.