Josh Engebretson 9 years ago
parent
commit
dd608b48cb

+ 0 - 16
AtomicNET/AtomicBlaster/Resources/Components/Spinner.js

@@ -1,16 +0,0 @@
-"atomic component";
-//inspector fields to make speed variable visible in editor
-var inspectorFields = {
-    speed: 1.0
-}
-
-exports.component = function(self) {
-    
-    //update function calls each frame
-    self.update = function(timeStep) {
-        //roll a node
-        self.node.roll(timeStep * 100);
-
-    }
-
-}

+ 0 - 7
AtomicNET/AtomicBlaster/Resources/Components/Spinner.js.asset

@@ -1,7 +0,0 @@
-{
-	"version": 1,
-	"guid": "9aaf7df74d0dfca2d6ffed3b60654d22",
-	"JavascriptImporter": {
-		"IsComponentFile": true
-	}
-}

+ 5 - 0
AtomicNET/AtomicBlaster/Resources/RenderPath.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "771bfdbc1e81e49b00634f6e9be35514",
+	"FolderImporter": {}
+}

+ 5 - 0
AtomicNET/AtomicBlaster/Resources/RenderPath/BloomHDR.xml.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "a1345ac6baa05adaf8fb50280b9f0e31",
+	"TextImporter": {}
+}

+ 5 - 0
AtomicNET/AtomicBlaster/Resources/RenderPath/Blur.xml.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "4addf5b5e04be37f7ec3036fc5fc301f",
+	"TextImporter": {}
+}

+ 0 - 5
AtomicNET/AtomicBlaster/Resources/Scenes.asset

@@ -1,5 +0,0 @@
-{
-	"version": 1,
-	"guid": "994eb6e514f2ce7743a03f57fdd07e08",
-	"FolderImporter": {}
-}

+ 0 - 60
AtomicNET/AtomicBlaster/Resources/Scenes/Scene.scene

@@ -1,60 +0,0 @@
-<?xml version="1.0"?>
-<scene id="1">
-	<attribute name="Name" value="" />
-	<attribute name="Time Scale" value="1" />
-	<attribute name="Smoothing Constant" value="50" />
-	<attribute name="Snap Threshold" value="5" />
-	<attribute name="Elapsed Time" value="0" />
-	<attribute name="Next Replicated Node ID" value="373" />
-	<attribute name="Next Replicated Component ID" value="1990" />
-	<attribute name="Next Local Node ID" value="16778496" />
-	<attribute name="Next Local Component ID" value="16777216" />
-	<attribute name="Variables" />
-	<attribute name="Variable Names" value="" />
-	<component type="PhysicsWorld" id="1" />
-	<component type="Octree" id="2" />
-	<component type="DebugRenderer" id="3" />
-	<component type="Renderer2D" id="1980" />
-	<node id="2">
-		<attribute name="Is Enabled" value="true" />
-		<attribute name="Name" value="Zone" />
-		<attribute name="Position" value="0 0 0" />
-		<attribute name="Rotation" value="1 0 0 0" />
-		<attribute name="Scale" value="1 1 1" />
-		<attribute name="Variables" />
-		<component type="Zone" id="4">
-			<attribute name="Bounding Box Min" value="-10000 -10000 -10000" />
-			<attribute name="Bounding Box Max" value="10000 10000 10000" />
-			<attribute name="Ambient Color" value="0.4 0.4 0.4 1" />
-		</component>
-	</node>
-	<node id="361">
-		<attribute name="Is Enabled" value="true" />
-		<attribute name="Name" value="Camera" />
-		<attribute name="Position" value="0 0 0" />
-		<attribute name="Rotation" value="1 0 0 0" />
-		<attribute name="Scale" value="1 1 1" />
-		<attribute name="Variables" />
-		<component type="Camera" id="1973">
-			<attribute name="Near Clip" value="0" />
-			<attribute name="Orthographic" value="true" />
-			<attribute name="Orthographic Size" value="1" />
-			<attribute name="Zoom" value="1" />
-		</component>
-	</node>
-	<node id="363">
-		<attribute name="Is Enabled" value="true" />
-		<attribute name="Name" value="Star" />
-		<attribute name="Position" value="0 0 0" />
-		<attribute name="Rotation" value="1 0 0 0" />
-		<attribute name="Scale" value="1e-06 1e-06 1e-06" />
-		<attribute name="Variables" />
-		<component type="JSComponent" id="1977">
-			<attribute name="ComponentFile" value="JSComponentFile;Components/Spinner.js" />
-		</component>
-		<component type="StaticSprite2D" id="1979">
-			<attribute name="Layer" value="-100" />
-			<attribute name="Sprite" value="Sprite2D;Sprites/star.png" />
-		</component>
-	</node>
-</scene>

+ 0 - 8
AtomicNET/AtomicBlaster/Resources/Scenes/Scene.scene.asset

@@ -1,8 +0,0 @@
-{
-	"version": 1,
-	"guid": "d993277faa2b13758d981808e37b90eb",
-	"SceneImporter": {
-		"sceneCamRotation": "0.707107 0.707107 0 0",
-		"sceneCamPosition": "1.61521 5 3.4"
-	}
-}

+ 3 - 11
AtomicNET/AtomicBlaster/Resources/Scripts/CustomRenderer.cs

@@ -105,15 +105,10 @@ namespace AtomicBlaster
                     if (batch.VertexCount == 0)
                     if (batch.VertexCount == 0)
                         continue;
                         continue;
 
 
+                    // faster blit possible?
                     for (uint i = 0; i < batch.VertexCount; i++, vout++)
                     for (uint i = 0; i < batch.VertexCount; i++, vout++)
                     {
                     {
                         *vout = batch.Vertices[i];
                         *vout = batch.Vertices[i];
-
-                        //vout->X -= 1280.0f / 2.0f;
-                        //vout->Y -= 720.0f / 2.0f;
-
-                        //vout->X /= 1280.0f / 2.0f;
-                        //vout->Y /= 720.0f / 2.0f;
                     }
                     }
 
 
                     var item = new DrawItem();
                     var item = new DrawItem();
@@ -149,10 +144,7 @@ namespace AtomicBlaster
             graphics.SetFillMode(FillMode.FILL_SOLID);
             graphics.SetFillMode(FillMode.FILL_SOLID);
             graphics.SetDepthTest(CompareMode.CMP_ALWAYS);
             graphics.SetDepthTest(CompareMode.CMP_ALWAYS);
 
 
-            camera.Zoom = .027f;
-            camera.OrthoSize = 20f;
-            camera.AspectRatio = 1280.0f / 720.0f;
-            camera.Node.Position = new Vector3(1280.0f / 2.0f, 720.0f / 2.0f, 0.0f);
+            graphics.SetShaderParameter(ShaderParams.PSP_MATDIFFCOLOR, Color.White);
 
 
             view.SetCameraShaderParameters(camera, true);
             view.SetCameraShaderParameters(camera, true);
             graphics.SetShaderParameter(ShaderParams.VSP_MODEL, Matrix3x4.IDENTITY);
             graphics.SetShaderParameter(ShaderParams.VSP_MODEL, Matrix3x4.IDENTITY);
@@ -165,7 +157,7 @@ namespace AtomicBlaster
                 graphics.Draw(PrimitiveType.TRIANGLE_LIST, item.StartVertex, item.VertexCount);
                 graphics.Draw(PrimitiveType.TRIANGLE_LIST, item.StartVertex, item.VertexCount);
             }
             }
 
 
-            // graphics.SetTexture(0, null);
+            graphics.SetTexture(0, null);
 
 
 
 
         }
         }

+ 17 - 8
AtomicNET/AtomicBlaster/Resources/Scripts/GameRoot.cs

@@ -29,9 +29,10 @@ namespace AtomicBlaster
             Art.Load();
             Art.Load();
 
 
             var graphics = AtomicNET.GetSubsystem<Graphics>();
             var graphics = AtomicNET.GetSubsystem<Graphics>();
+            float width = graphics.Width;
+            float height = graphics.Height;
 
 
-            ScreenSize = new Vector2(graphics.Width, graphics.Height);
-
+            ScreenSize = new Vector2(width, height);
             ScreenBounds = new IntRect(0, 0, (int)ScreenSize.X, (int)ScreenSize.Y);
             ScreenBounds = new IntRect(0, 0, (int)ScreenSize.X, (int)ScreenSize.Y);
 
 
             ParticleManager = new ParticleManager<ParticleState>(1024 * 20, ParticleState.UpdateParticle);
             ParticleManager = new ParticleManager<ParticleState>(1024 * 20, ParticleState.UpdateParticle);
@@ -43,12 +44,6 @@ namespace AtomicBlaster
 
 
             EntityManager.Add(PlayerShip.Instance);
             EntityManager.Add(PlayerShip.Instance);
 
 
-            SubscribeToEvent("Update", HandleUpdate);
-
-            SubscribeToEvent("RenderPathEvent", HandleRenderPathEvent);
-
-            Scene = AtomicNET.GetSubsystem<Player>().LoadScene("Scenes/Scene.scene");
-
             var renderer = AtomicNET.GetSubsystem<Renderer>();
             var renderer = AtomicNET.GetSubsystem<Renderer>();
             var viewport = renderer.GetViewport(0);
             var viewport = renderer.GetViewport(0);
 
 
@@ -59,8 +54,22 @@ namespace AtomicBlaster
             renderpath.Append(AtomicNET.Cache.GetResource<XMLFile>("RenderPath/Blur.xml"));
             renderpath.Append(AtomicNET.Cache.GetResource<XMLFile>("RenderPath/Blur.xml"));
             viewport.SetRenderPath(renderpath);
             viewport.SetRenderPath(renderpath);
 
 
+            Scene = new Scene();
+            Scene.CreateComponent<Octree>();
+            var camera = Scene.CreateChild("Camera").CreateComponent<Camera>();
+                        
+            camera.Node.Position = new Vector3(width / 2.0f, height / 2.0f, 0.0f);
+            camera.Orthographic = true;
+            camera.OrthoSize = height;
+
+            viewport.Scene = Scene;
+            viewport.Camera = camera;
+
             CustomRenderer.Initialize();
             CustomRenderer.Initialize();
 
 
+            SubscribeToEvent("Update", HandleUpdate);
+            SubscribeToEvent("RenderPathEvent", HandleRenderPathEvent);
+
         }
         }
 
 
         void HandleRenderPathEvent(uint eventType, ScriptVariantMap eventData)
         void HandleRenderPathEvent(uint eventType, ScriptVariantMap eventData)

BIN
AtomicNET/AtomicBlaster/Resources/Sprites/star.png


+ 0 - 5
AtomicNET/AtomicBlaster/Resources/Sprites/star.png.asset

@@ -1,5 +0,0 @@
-{
-	"version": 1,
-	"guid": "31d5e005cabe27f60647087063a464c5",
-	"TextureImporter": {}
-}

+ 14 - 0
AtomicNET/AtomicBlaster/Settings/Engine.json

@@ -0,0 +1,14 @@
+{
+  "desktop": {
+
+    "window" : {
+      "title" : "Atomic Blaster",
+      "fullscreen" : false,
+      "resizable" : false,
+      "width" : 1280,
+      "height" : 720
+    }
+
+  }
+
+}