.[ ČeskéHry.cz ].

Laboratoř ČeskýchHer.cz - PasteBin

Vložit nový kód

ČeskéHry.cz - KOMUNITA HERNÍCH VÝVOJÁŘŮ

  1. Mega teen leaks young paradise t33n folders
    12 min
  2. Mega teen leaks young paradise t33n folders
    12 min
  3. Mega teen leaks young paradise t33n folders
    12 min
  4. Mega teen leaks young paradise t33n folders
    12 min
  5. Mega teen leaks young paradise t33n folders
    12 min
  6. Mega teen leaks young paradise t33n folders
    13 min
  7. Mega teen leaks young paradise t33n folders
    13 min
  8. Mega teen leaks young paradise t33n folders
    13 min
  9. Mega teen leaks young paradise t33n folders
    13 min
  10. Mega teen leaks young paradise t33n folders
    13 min
Link: http://nopaste.ceske-hry.cz/subdom/nopaste222806
Jazyk: C#
Vloženo: 16.12.2009, 22:36
Stáhnout jako soubor
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading;
  6.  
  7. namespace PixelTest
  8. {
  9. class Program
  10. {
  11. unsafe static void Main(string[] args)
  12. {
  13. DateTime start = DateTime.Now;
  14.  
  15. int width = 800;
  16. int height = 600;
  17.  
  18. Col[,] array = new Col[width, height];
  19.  
  20. WriteInfo("malloc(" + width + ", " + height + ")", start);
  21. start = DateTime.Now;
  22.  
  23. for (int i = 0; i != width; i++)
  24. {
  25. for (int j = 0; j != height; j++)
  26. {
  27. array[i,j] = new Col(1, 2, 3);
  28. }
  29. }
  30.  
  31. WriteInfo("init(" + width + ", " + height + ")", start);
  32.  
  33. Random r = new Random();
  34.  
  35. while (true)
  36. {
  37. start = DateTime.Now;
  38.  
  39. Col* arrayPtr = null;
  40.  
  41. for (int i = 0; i != width; i++)
  42. {
  43. fixed (Col* ptr = &array[i, 0])
  44. {
  45. arrayPtr = ptr;
  46. for (int j = 0; j != height; j++)
  47. {
  48. arrayPtr->a = (arrayPtr->b) * (arrayPtr->c);
  49. arrayPtr->b = (arrayPtr->a) * (arrayPtr->c);
  50. arrayPtr->c = (arrayPtr->a) * (arrayPtr->b);
  51. arrayPtr++;
  52. }
  53. }
  54. }
  55.  
  56. Console.SetCursorPosition(0, 2);
  57. WriteInfo("re-set(" + width + ", " + height + ")", start);
  58. }
  59.  
  60. }
  61.  
  62. static void WriteInfo(string prefix, DateTime start)
  63. {
  64. Console.WriteLine(prefix + ": " + Math.Round((DateTime.Now - start).TotalMilliseconds) + " ms -> " + Math.Round(1000 / (DateTime.Now - start).TotalMilliseconds) + " fps ");
  65. }
  66. }
  67. struct Col
  68. {
  69. public float a;
  70. public float b;
  71. public float c;
  72.  
  73. public Col(float a, float b, float c)
  74. {
  75. this.a = a;
  76. this.b = b;
  77. this.c = c;
  78. }
  79. }
  80. }
  81.