Changeset 5693
- Timestamp:
- 2014-07-25 12:35:58 (9 years ago)
- Location:
- 2014/30/MikkoI
- Files:
-
- 17 added
- 4 deleted
- 37 edited
Legend:
- Unmodified
- Added
- Removed
-
2014/30/MikkoI/WindowsGame1/WindowsGame1.sln
r5558 r5693 2 2 Microsoft Visual Studio Solution File, Format Version 11.00 3 3 # Visual Studio 2010 4 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = " WindowsGame1", "WindowsGame1\WindowsGame1\WindowsGame1.csproj", "{ADEF2337-A726-4041-B783-51541FEF022B}"4 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "shadowSimulator2014", "WindowsGame1\WindowsGame1\shadowSimulator2014.csproj", "{ADEF2337-A726-4041-B783-51541FEF022B}" 5 5 EndProject 6 Project("{ 96E2B04D-8817-42C6-938A-82C39BA4D311}") = "WindowsGame1Content", "WindowsGame1\WindowsGame1Content\WindowsGame1Content.contentproj", "{97A5BC4F-C40A-4D52-BF03-8923DFD60CA0}"6 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsGame1Content", "WindowsGame1\WindowsGame1Content\WindowsGame1Content.contentproj", "{97A5BC4F-C40A-4D52-BF03-8923DFD60CA0}" 7 7 EndProject 8 8 Global -
2014/30/MikkoI/WindowsGame1/WindowsGame1/WindowsGame1/Camera/Camera.cs
r5626 r5693 6 6 using Microsoft.Xna.Framework.Graphics; 7 7 8 namespace WindowsGame18 namespace ShadowSimulator2014 9 9 { 10 10 public class Camera … … 21 21 public Matrix getMatrix(Vector2 gridSize, Vector2 mapSize) 22 22 { 23 //viewPortBounds();23 viewPortBounds(); 24 24 25 25 Vector3 pixelMapSize = new Vector3((gridSize.X * mapSize.X / 2), (gridSize.Y * mapSize.Y / 2), 0); -
2014/30/MikkoI/WindowsGame1/WindowsGame1/WindowsGame1/Game1.cs
r5626 r5693 10 10 using Microsoft.Xna.Framework.Media; 11 11 12 namespace WindowsGame112 namespace ShadowSimulator2014 13 13 { 14 14 /// <summary> 15 15 /// This is the main type for your game 16 16 /// </summary> 17 public class Pikseli: Microsoft.Xna.Framework.Game17 public class shadowSimulator : Microsoft.Xna.Framework.Game 18 18 { 19 19 GraphicsDeviceManager graphics; … … 36 36 BasicEffect effect; 37 37 38 public static PikseliInstance;38 public static shadowSimulator Instance; 39 39 public GameTime gameTime; 40 40 41 public Pikseli()41 public shadowSimulator() 42 42 { 43 43 Instance = this; … … 101 101 spriteBatch = new SpriteBatch(GraphicsDevice); 102 102 103 allMaps.Add(new Map(new Texture2D(GraphicsDevice, 1, 1), 20, 20));103 allMaps.Add(new Map(new Texture2D(GraphicsDevice, 1, 1), 50, 50)); 104 104 105 105 masterRenderer = new MasterRenderer(spriteBatch, allMaps[currentMapIndex], camera); -
2014/30/MikkoI/WindowsGame1/WindowsGame1/WindowsGame1/Map/Map.cs
r5626 r5693 10 10 using Microsoft.Xna.Framework.Media; 11 11 12 namespace WindowsGame112 namespace ShadowSimulator2014 13 13 { 14 14 public class Map … … 41 41 { 42 42 Tiles[x, y] = new Tile("testitile");//jotain shittiä myöhemmin 43 if ( Pikseli.Instance.random.NextDouble() > 0.1) { continue; }43 if (shadowSimulator.Instance.random.NextDouble() > 0.1) { continue; } 44 44 45 45 string textureId = ""; float shadowOffset = 0; 46 switch ((int)Math.Floor((double)( Pikseli.Instance.random.NextDouble() * 4)))46 switch ((int)Math.Floor((double)(shadowSimulator.Instance.random.NextDouble() * 4))) 47 47 { 48 48 case 0: -
2014/30/MikkoI/WindowsGame1/WindowsGame1/WindowsGame1/Map/MapObject.cs
r5626 r5693 6 6 using Microsoft.Xna.Framework.Graphics; 7 7 8 namespace WindowsGame18 namespace ShadowSimulator2014 9 9 { 10 10 public class MapObject -
2014/30/MikkoI/WindowsGame1/WindowsGame1/WindowsGame1/Map/Tile.cs
r5581 r5693 6 6 using Microsoft.Xna.Framework.Graphics; 7 7 8 namespace WindowsGame18 namespace ShadowSimulator2014 9 9 { 10 10 public class Tile -
2014/30/MikkoI/WindowsGame1/WindowsGame1/WindowsGame1/Map/Unit.cs
r5607 r5693 6 6 using Microsoft.Xna.Framework.Graphics; 7 7 8 namespace WindowsGame18 namespace ShadowSimulator2014 9 9 { 10 10 //olento -
2014/30/MikkoI/WindowsGame1/WindowsGame1/WindowsGame1/Program.cs
r5558 r5693 1 1 using System; 2 2 3 namespace WindowsGame13 namespace ShadowSimulator2014 4 4 { 5 5 #if WINDOWS || XBOX … … 11 11 static void Main(string[] args) 12 12 { 13 using ( Pikseli game = new Pikseli())13 using (shadowSimulator game = new shadowSimulator()) 14 14 { 15 15 game.Run(); -
2014/30/MikkoI/WindowsGame1/WindowsGame1/WindowsGame1/Render/GuiRenderer.cs
r5626 r5693 6 6 using Microsoft.Xna.Framework.Graphics; 7 7 8 namespace WindowsGame18 namespace ShadowSimulator2014 9 9 { 10 10 public class GuiRenderer … … 39 39 r.spriteBatch.End();*/ 40 40 r.spriteBatch.Begin(); 41 r.spriteBatch.Draw( Pikseli.Instance.textures["gui/cursor"], Pikseli.Instance.mousePos, Color.White);41 r.spriteBatch.Draw(shadowSimulator.Instance.textures["gui/cursor"], shadowSimulator.Instance.mousePos, Color.White); 42 42 r.spriteBatch.End(); 43 43 } -
2014/30/MikkoI/WindowsGame1/WindowsGame1/WindowsGame1/Render/MapRenderer.cs
r5626 r5693 6 6 using Microsoft.Xna.Framework.Graphics; 7 7 8 namespace WindowsGame18 namespace ShadowSimulator2014 9 9 { 10 10 class MapRenderer … … 17 17 18 18 float sunAngle = 24; 19 Vector3 sunPosition = Vector3.Zero;19 Vector3 sunPosition = new Vector3(-100, -100, 40); 20 20 21 21 public MapRenderer(RendererBase r, Map map, Camera camera) … … 27 27 } 28 28 29 void renderGroundObjects(Matrix matrix) { 29 void renderGroundObjects(Matrix matrix) 30 { 30 31 //renderöi kaikki maassa olevat dynaamiset objektit, eli puut, olennot ym. 31 32 r.spriteBatch.Begin(SpriteSortMode.FrontToBack, null, null, null, null, null, matrix); … … 34 35 foreach (MapObject obj in map.Objects) 35 36 { 36 Texture2D texture = Pikseli.Instance.textures[obj.textureId];37 Texture2D texture = shadowSimulator.Instance.textures[obj.textureId]; 37 38 Vector2 size = new Vector2(texture.Width, texture.Height) * camera.zoomFactor;//ditto 38 39 … … 57 58 foreach (MapObject obj in map.Objects) 58 59 { 59 Texture2D texture = Pikseli.Instance.textures[obj.textureId];60 Texture2D texture = shadowSimulator.Instance.textures[obj.textureId]; 60 61 Vector2 size = new Vector2(texture.Width, texture.Height) * camera.zoomFactor;//ditto 61 62 r.renderGroundObject(texture, (int)obj.position.X, (int)obj.position.Y, size, matrix, camera); 62 63 } 64 sunAngle += 1 / 3000.0f;//auringon pyörimisnopeus 65 66 if (sunPosition.X < 30) 67 { 68 sunPosition.X += 0.2f; 69 sunPosition.Y += 0.2f; 70 } 71 else 72 { 73 if (sunPosition.Z > 5) 74 { 75 sunPosition.Z -= 0.2f; 76 } 77 78 } 79 80 Vector3 fixedSun = sunPosition; 81 fixedSun.Z *= -1.0f; 82 83 Texture2D sunTexture = shadowSimulator.Instance.textures["taivas/aurinko"]; 84 r.renderDistantSprite(sunTexture, fixedSun, new Vector2(sunTexture.Width * camera.zoomFactor * 5, sunTexture.Height * camera.zoomFactor * 5), matrix, camera); 63 85 64 86 r.spriteBatch.End(); 65 87 } 66 88 67 void renderSky(Matrix matrix) { 89 void renderSky(Matrix matrix) 90 { 68 91 r.spriteBatch.Begin(SpriteSortMode.FrontToBack, BlendState.AlphaBlend); 69 92 70 Texture2D starBackground = Pikseli.Instance.textures["taivas/tähdet"];93 Texture2D starBackground = shadowSimulator.Instance.textures["taivas/tähdet"]; 71 94 72 r.renderBackground(starBackground, new Vector2(starBackground.Width, starBackground.Height));95 //r.renderBackground(starBackground, new Vector2(starBackground.Width, starBackground.Height)); 73 96 74 97 r.spriteBatch.End(); … … 84 107 for (var y = 0; y < map.Size.Y; y++) 85 108 { 86 r.renderGroundTile( Pikseli.Instance.textures[map.Tiles[x, y].textureId], x, y);109 r.renderGroundTile(shadowSimulator.Instance.textures[map.Tiles[x, y].textureId], x, y); 87 110 } 88 111 } … … 90 113 91 114 renderGroundObjects(matrix); 92 93 r.spriteBatch.Begin();94 95 sunAngle += 1 / 3000.0f;//auringon pyörimisnopeus96 97 sunPosition = baseSunPosition + new Vector3((float)Math.Sin(sunAngle), (float)Math.Cos(sunAngle), 0) * 100;98 99 Vector3 fixedSun = sunPosition;100 fixedSun.Z *= -1.0f;101 fixedSun.Z += 22;//alaspäin että näkyy pelissä102 103 Texture2D sunTexture = Pikseli.Instance.textures["taivas/aurinko"];104 105 r.renderDistantSprite(sunTexture, fixedSun, new Vector2(sunTexture.Width * camera.zoomFactor * 5, sunTexture.Height * camera.zoomFactor * 5), matrix);106 r.spriteBatch.End();107 115 } 108 116 } -
2014/30/MikkoI/WindowsGame1/WindowsGame1/WindowsGame1/Render/MasterRenderer.cs
r5626 r5693 6 6 using Microsoft.Xna.Framework.Graphics; 7 7 8 namespace WindowsGame18 namespace ShadowSimulator2014 9 9 { 10 10 public class MasterRenderer -
2014/30/MikkoI/WindowsGame1/WindowsGame1/WindowsGame1/Render/RendererBase.cs
r5626 r5693 6 6 using Microsoft.Xna.Framework.Graphics; 7 7 8 namespace WindowsGame18 namespace ShadowSimulator2014 9 9 { 10 10 public class RendererBase … … 24 24 spriteBatch.Draw(texture, new Rectangle((int)position.X, (int)position.Y, (int)size.X, (int)size.Y), null, Color.White, 0, Vector2.Zero, SpriteEffects.None, (position.Y + size.Y) / (camera.size.Y + 256*camera.zoomFactor/*128 on suurimman objektin korkeus*/)); 25 25 } 26 public void renderDistantSprite(Texture2D texture, Vector3 position, Vector2 size, Matrix matrix )26 public void renderDistantSprite(Texture2D texture, Vector3 position, Vector2 size, Matrix matrix, Camera camera) 27 27 {//Renderöi kaukaisia juttuja kuten auringon ja tähdet 28 28 Vector3 calcPosition = Vector3.Transform(position * 64.0f, matrix); 29 spriteBatch.Draw(texture, new Rectangle((int)(calcPosition.X), (int)(calcPosition.Y), (int)size.X, (int)size.Y), null, Color.White, 0f, new Vector2(texture.Width / 2, texture.Height / 2), SpriteEffects.None, 1f);29 spriteBatch.Draw(texture, new Rectangle((int)(calcPosition.X), (int)(calcPosition.Y), (int)size.X, (int)size.Y), null, Color.White, 0f, new Vector2(texture.Width / 2, texture.Height / 2), SpriteEffects.None, (calcPosition.Y + size.Y) / (camera.size.Y + 256 * camera.zoomFactor/*128 on suurimman objektin korkeus*/)); 30 30 } 31 31 public void renderBackground(Texture2D texture, Vector2 size) -
2014/30/MikkoI/frakt/frakt.sln
r5558 r5693 4 4 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "frakt", "frakt\frakt\frakt.csproj", "{F9E4E698-C16A-4607-A0C5-F26305364268}" 5 5 EndProject 6 Project("{ 96E2B04D-8817-42C6-938A-82C39BA4D311}") = "fraktContent", "frakt\fraktContent\fraktContent.contentproj", "{223295BE-ACF3-44C6-B8A3-41C3A9AB2E31}"6 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "fraktContent", "frakt\fraktContent\fraktContent.contentproj", "{223295BE-ACF3-44C6-B8A3-41C3A9AB2E31}" 7 7 EndProject 8 8 Global -
2014/30/MikkoI/frakt/frakt/frakt/Game1.cs
r5656 r5693 10 10 using Microsoft.Xna.Framework.Input; 11 11 using Microsoft.Xna.Framework.Media; 12 using System.IO; 12 13 13 14 namespace frakt … … 28 29 SpriteFont command; 29 30 31 Vector2 imageSize = Vector2.Zero; 32 30 33 Texture2D pixel; 31 Texture2D image; 34 System.Drawing.Bitmap image; 35 Texture2D referenceImage; 32 36 33 37 string commandStr = ""; 34 38 bool infoHide = false; 39 string errorMessage = ""; 35 40 36 41 decimal[,][] pointData; … … 65 70 pixel.SetData(new UInt32[] { UInt32.MaxValue }); 66 71 67 image = new Texture2D(GraphicsDevice, 1, 1);68 69 72 base.Initialize(); 70 73 … … 76 79 GraphicsDevice.Textures[0] = null; 77 80 78 image = new Texture2D(GraphicsDevice, (int)calcResolution[0], (int)calcResolution[1]); 81 //if (calcResolution[0] > 2048) { calcResolution[0] = 2048; } 82 //if (calcResolution[1] > 2048) { calcResolution[1] = 2048; } 83 84 int threads = 1; 85 86 imageSize = new Vector2(calcResolution[0], calcResolution[1]); 87 if (image!=null) image.Dispose(); 88 System.Drawing.Bitmap[] images = new System.Drawing.Bitmap[threads]; 79 89 80 90 //alusta fraktaalin numeerinen data 81 this.pointData = new decimal[image.Width, image.Height][]; 82 83 int threads = 4; 91 this.pointData = new decimal[(int)imageSize.X, (int)imageSize.Y][]; 92 93 image = new System.Drawing.Bitmap((int)imageSize.X, (int)imageSize.Y); 94 95 84 96 Thread[] apurit = new Thread[threads]; 85 97 86 this.data = new Color[image.Width * image.Height]; 87 image.GetData(data); 98 this.data = new Color[(int)imageSize.X * (int)imageSize.Y]; 88 99 89 100 for (int y = 0; y < threads; y++) … … 92 103 apurit[y] = new Thread(delegate(object o) 93 104 { 94 int alku = (image.Height / threads) * yy; 95 int loppu = (image.Height / threads) * (yy + 1); 96 if (yy == threads - 1) { loppu = image.Height; } 105 int alku = ((int)imageSize.Y / threads) * yy; 106 int loppu = ((int)imageSize.Y / threads) * (yy + 1); 107 if (yy == threads - 1) { loppu = (int)imageSize.Y; } 108 97 109 Test(alku, loppu); 98 110 }); … … 106 118 } 107 119 108 image.SetData(data); 120 /*//yhdistä threadien omat imaget 121 int totalHeight = 0; 122 for (var g = 0; g < threads; g++) { totalHeight += images[g].Height; } 123 124 image = new System.Drawing.Bitmap((int)imageSize.X, (int)totalHeight); 125 126 */ 127 128 Vector2 refSize = new Vector2(Math.Min(image.Width, 2048), Math.Min(image.Height, 2048)); 129 130 Color[] pixels = new Color[(int)(refSize.X * refSize.Y)]; 131 for (int y = 0; y < refSize.Y; y++) 132 { 133 for (int x = 0; x < refSize.X; x++) 134 { 135 System.Drawing.Color c = image.GetPixel(x, y); 136 pixels[(y * (int)refSize.X) + x] = new Color(c.R, c.G, c.B, c.A); 137 } 138 } 139 140 referenceImage = new Texture2D(GraphicsDevice, (int)refSize.X, (int)refSize.Y); 141 referenceImage.SetData<Color>(pixels); 109 142 } 110 143 … … 112 145 { 113 146 Random random = new Random(); 147 148 System.Drawing.Bitmap thisImage = new System.Drawing.Bitmap((int)imageSize.X, loppu - alku); 149 114 150 for (int y = alku; y < loppu; y++) 115 151 { 116 for (int x = 0; x < image .Width; x++)117 { 118 decimal VectorX = (gridScale[0] / image.Width) * x - (gridScale[0] / 2M) + gridOffset[0];119 decimal VectorY = (gridScale[1] / image.Height) * y - (gridScale[1] / 2M) + gridOffset[1];152 for (int x = 0; x < imageSize.X; x++) 153 { 154 decimal VectorX = (gridScale[0] / (int)imageSize.X) * x - (gridScale[0] / 2M) + gridOffset[0]; 155 decimal VectorY = (gridScale[1] / (int)imageSize.Y) * y - (gridScale[1] / 2M) + gridOffset[1]; 120 156 pointData[x, y] = new decimal[4] { VectorX, VectorY, VectorX, VectorY }; 121 157 for (int iterations = 0; iterations < calcIterations; iterations++) … … 123 159 if (doesPointEscape(this.pointData[x, y])) 124 160 { 125 this.data[x + y * image.Width] = getColor(iterations, calcIterations + 1);161 image.SetPixel(x, y, getColor(iterations, calcIterations + 1)); 126 162 break; 127 163 } … … 144 180 { 145 181 decimal[] nvec = new decimal[4]; 182 decimal branchLevel = 2M; 146 183 nvec[0] = 147 //1M * vec[0] - vec[1] * vec[1] - 1M* vec[1] * vec[0] * vec[0]; // branch148 184 branchLevel * vec[0] - vec[1] * vec[1] - branchLevel * vec[1] * vec[0] * vec[0]; // branch 185 //vec[0] * vec[0] - vec[1] * vec[1] + vec[2]; // mandelbrot 149 186 nvec[1] = 150 //1M * vec[1] - vec[0] * vec[0] - 1M* vec[0] * vec[1] * vec[1]; // branch151 187 branchLevel * vec[1] - vec[0] * vec[0] - branchLevel * vec[0] * vec[1] * vec[1]; // branch 188 //2M * vec[0] * vec[1] + vec[3]; // mandelbrot 152 189 nvec[2] = vec[2]; 153 190 nvec[3] = vec[3]; … … 197 234 switch (commandSplit[0]) 198 235 { 199 case "I": 236 case "I"://set iterations 200 237 calcIterations = Convert.ToInt32(commandSplit[1]); 201 238 break; 202 case "R": 239 case "R"://set resolution 203 240 switch (commandSplit[1]) 204 241 { … … 213 250 calcResolution[1] = Window.ClientBounds.Height; 214 251 break; 252 case "A": 253 calcResolution[0] = Math.Max(calcResolution[0], calcResolution[1]); 254 calcResolution[1] = Math.Max(calcResolution[0], calcResolution[1]); 255 break; 256 case "I": 257 calcResolution[0] = Math.Min(calcResolution[0], calcResolution[1]); 258 calcResolution[1] = Math.Min(calcResolution[0], calcResolution[1]); 259 break; 215 260 default: 216 261 calcResolution[0] = Convert.ToInt32(commandSplit[1]); … … 219 264 } 220 265 break; 221 case "P": 266 case "P"://set position 222 267 switch (commandSplit[1]) 223 268 { … … 238 283 } 239 284 break; 240 case "H": 285 case "H"://hide / show hud 241 286 infoHide = !infoHide; 242 287 break; 243 case "RUN": 288 case "W"://set window size 289 graphics.IsFullScreen = false; 290 switch (commandSplit[1]) 291 { 292 case "X": 293 graphics.PreferredBackBufferWidth = Convert.ToInt32(commandSplit[2]); 294 break; 295 case "Y": 296 graphics.PreferredBackBufferHeight = Convert.ToInt32(commandSplit[2]); 297 break; 298 case "F": 299 graphics.PreferredBackBufferWidth = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width; 300 graphics.PreferredBackBufferHeight = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height; 301 graphics.IsFullScreen = true; 302 break; 303 default: 304 graphics.PreferredBackBufferWidth = Convert.ToInt32(commandSplit[1]); 305 graphics.PreferredBackBufferHeight = Convert.ToInt32(commandSplit[1]); 306 break; 307 } 308 graphics.ApplyChanges(); 309 break; 310 case "S"://Save image 311 string filePath = ""; 312 if (commandSplit.Length == 1) 313 { 314 filePath = DateTime.Now.ToString("MM-dd-yy H;mm;ss") + ".png"; 315 } 316 else 317 { 318 filePath = commandSplit[1] + ".png"; 319 } 320 //Stream stream = File.Create(filePath); 321 image.Save(filePath); 322 //stream.Dispose(); 323 break; 324 case "RUN"://render 244 325 renderImage(); 245 326 break; 246 } 247 } 248 catch (System.Exception) {} 327 case "EXIT"://exit 328 Exit(); 329 break; 330 } 331 } 332 catch (System.Exception e) 333 { 334 errorMessage = e.Message; 335 } 249 336 } 250 337 … … 427 514 /// </summary> 428 515 /// <param name="gameTime">Provides a snapshot of timing values.</param> 429 Color getColor(float index, float size)516 System.Drawing.Color getColor(float index, float size) 430 517 { 431 518 Color[] palette = { new Color(0, 0, 0), new Color(255, 0, 0), new Color(255, 255, 0), new Color(0, 255, 0), new Color(0, 255, 255), new Color(0, 0, 255), new Color(0, 0, 0) }; … … 437 524 Color col2 = palette[(int)Math.Ceiling(realIndex)]; 438 525 float rel = realIndex - (float)Math.Floor(realIndex); 439 return Color.Lerp(col1, col2, rel); 526 return convertColor(Color.Lerp(col1, col2, rel)); 527 } 528 System.Drawing.Color convertColor(Color color) 529 { 530 return System.Drawing.Color.FromArgb(color.R, color.G, color.B); 440 531 } 441 532 protected override void Draw(GameTime gameTime) … … 445 536 446 537 spriteBatch.Begin(); 447 spriteBatch.Draw( image, new Rectangle(0, 0, Window.ClientBounds.Width, Window.ClientBounds.Height), Color.White);538 spriteBatch.Draw(referenceImage, new Rectangle(0, 0, Window.ClientBounds.Width, Window.ClientBounds.Height), Color.White); 448 539 spriteBatch.DrawString(command, commandStr, new Vector2(0, 0), Color.Gray); 449 540 if (!infoHide) 450 spriteBatch.DrawString(command, 451 "i:" + calcIterations + " r:(" + calcResolution[0] + "," + calcResolution[1] + 452 ")\nP:(" + gridOffset[0] + 453 ",\n" + gridOffset[1] + 454 ")\ns:" + gridScale[0] 455 , new Vector2(0, Window.ClientBounds.Height - command.LineSpacing * 4), Color.Red); 541 { 542 spriteBatch.DrawString(command, 543 "i:" + calcIterations + " r:(" + calcResolution[0] + "," + calcResolution[1] + 544 ")\nP:(" + gridOffset[0] + 545 ",\n" + gridOffset[1] + 546 ")\ns:" + gridScale[0] 547 , new Vector2(0, Window.ClientBounds.Height - command.LineSpacing * 4), Color.HotPink); 548 spriteBatch.DrawString(command, errorMessage, new Vector2(Window.ClientBounds.Width - command.MeasureString(errorMessage).X, 0), Color.Red); 549 } 456 550 spriteBatch.End(); 457 551 -
2014/30/MikkoI/frakt/frakt/frakt/frakt.csproj
r5650 r5693 67 67 <Reference Include="mscorlib" /> 68 68 <Reference Include="System" /> 69 <Reference Include="System.Drawing" /> 70 <Reference Include="System.Windows.Forms" /> 69 71 <Reference Include="System.Xml" /> 70 72 <Reference Include="System.Core" /> -
2014/30/MikkoI/rainbowSimulator/frakt.sln
r5650 r5693 2 2 Microsoft Visual Studio Solution File, Format Version 11.00 3 3 # Visual Studio 2010 4 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = " frakt", "frakt\frakt\frakt.csproj", "{F9E4E698-C16A-4607-A0C5-F26305364268}"4 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "rainbowSimulator2014", "frakt\frakt\rainbowSimulator2014.csproj", "{F9E4E698-C16A-4607-A0C5-F26305364268}" 5 5 EndProject 6 Project("{ 96E2B04D-8817-42C6-938A-82C39BA4D311}") = "fraktContent", "frakt\fraktContent\fraktContent.contentproj", "{223295BE-ACF3-44C6-B8A3-41C3A9AB2E31}"6 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "fraktContent", "frakt\fraktContent\fraktContent.contentproj", "{223295BE-ACF3-44C6-B8A3-41C3A9AB2E31}" 7 7 EndProject 8 8 Global -
2014/30/MikkoI/rainbowSimulator/frakt/frakt/Game1.cs
r5650 r5693 11 11 using System.Threading; 12 12 13 namespace frakt13 namespace rainbowSimulator 14 14 { 15 15 /// <summary> 16 16 /// This is the main type for your game 17 17 /// </summary> 18 public class WooooFract: Microsoft.Xna.Framework.Game18 public class rainbowSimulator2014 : Microsoft.Xna.Framework.Game 19 19 { 20 20 GraphicsDeviceManager graphics; … … 32 32 33 33 34 public WooooFract()34 public rainbowSimulator2014() 35 35 { 36 36 graphics = new GraphicsDeviceManager(this); 37 graphics.PreferredBackBufferWidth = 800;38 graphics.PreferredBackBufferHeight = 600;37 graphics.PreferredBackBufferWidth = 400; 38 graphics.PreferredBackBufferHeight = 300; 39 39 Content.RootDirectory = "Content"; 40 40 } … … 110 110 for (int x = 0; x < image.Width; x++) 111 111 { 112 data[x + y * image.Width] = getColor(x + (float)random.NextDouble() * anim / 100 + anim, y + 2);112 data[x + y * image.Width] = getColor(x + anim, y+100); 113 113 } 114 114 } -
2014/30/MikkoI/rainbowSimulator/frakt/frakt/Program.cs
r5650 r5693 1 1 using System; 2 2 3 namespace frakt3 namespace rainbowSimulator 4 4 { 5 5 #if WINDOWS || XBOX … … 11 11 static void Main(string[] args) 12 12 { 13 using ( WooooFract game = new WooooFract())13 using (rainbowSimulator2014 game = new rainbowSimulator2014()) 14 14 { 15 15 game.Run();
Note: See TracChangeset
for help on using the changeset viewer.