Advertisement
Guest User

Calc Smooth Radius

a guest
Jan 28th, 2012
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.94 KB | None | 0 0
  1. int hwZones = 3;   // Left, Top, Right
  2. int hwColours = 3; // R, G, B
  3. int hwChannels = hwZones * hwColours;
  4.  
  5. int hwBytesPerSecond = Convert.ToInt32(comboBaud.Text, 10) / 8;
  6. //                   = 9600/8 = 1200    (divided by 8 (bits))
  7.  
  8. double hwCyclesPerSecond = hwBytesPerSecond / hwChannels;
  9. //                       = 1200/9 = ~133
  10.  
  11. double hwSafeCyclesPerSecond = (int)(hwCyclesPerSecond * 0.85);
  12. //                           =  ~133 - 15%
  13. // (safe 15% allows to perform Aggressive Attack immediately)
  14.  
  15. // Calculate IntelliInterval Speed
  16. global.var_Interval = (int)(1000 / hwSafeCyclesPerSecond);
  17. //                  = (1sec / Cycles)
  18.  
  19. if (global.var_Interval < 1) global.var_Interval = 1;
  20. IntelliInterval.Value = global.var_Interval;
  21.  
  22. int defMovieFrameRate = 30;
  23. double swRealFrames = defMovieFrameRate / 2;
  24. //               = 30 / 2 = 15
  25. //  Display 50% real frames
  26.  
  27. global.var_MaxSmoothRadius = (int)(hwCyclesPerSecond / swRealFrames);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement