Example #1
0
 protected override void Initialize()
 {
     // TODO: Add your initialization logic here
     m_flashComboTimer          = new PTimer(this.TimerManager, delegate() { m_bgColor = blue; });
     m_flashComboTimer.Interval = 0.1f;
     base.Initialize();
 }
Example #2
0
        public PTextBoxAni()
        {
            SetStyle(ControlStyles.SupportsTransparentBackColor |
                     ControlStyles.OptimizedDoubleBuffer |
                     ControlStyles.AllPaintingInWmPaint |
                     ControlStyles.ResizeRedraw |
                     ControlStyles.UserPaint, true);

            PDurationAnimation = 500;
            Font               = new Font("Verdana", 12);
            PBorderLine        = 1;
            PBorderClrInactive = Color.Gray;
            PBorderClrActive   = Color.Red;

            pictBox.Parent = this;
            pictBox.BackgroundImageLayout = ImageLayout.Stretch;

            box.Parent          = this;
            box.BorderStyle     = BorderStyle.None;
            boxShow.Parent      = this;
            boxShow.AutoSize    = false;
            boxShow.BorderStyle = BorderStyle.None;

            pnlActive.Parent   = this;
            pnlInactive.Parent = this;

            _timer = new PTimer(_tick, FPSLimiterKnownValues.LimitSixty);
            _timer.Start();

            box.Enter       += new EventHandler(box_Enter);
            box.Leave       += new EventHandler(box_Leave);
            box.TextChanged += new EventHandler(box_TextChange);
            boxShow.Click   += new EventHandler(boxShow_Click);
        }
Example #3
0
 public PTimer(PTimer other) : this(PapillonPINVOKE.new_PTimer__SWIG_2(PTimer.getCPtr(other)), true)
 {
     if (PapillonPINVOKE.SWIGPendingException.Pending)
     {
         throw PapillonPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Example #4
0
 public Animation(MyGame theGame, int startFrame, int endFrame, float intervalInSeconds)
 {
     m_timer          = new PTimer(theGame.TimerManager, null);
     m_startFrame     = startFrame;
     m_endFrame       = endFrame;
     m_timer.Interval = intervalInSeconds;
 }
Example #5
0
 public Animation(MyGame theGame, int startFrame, int endFrame, float intervalInSeconds)
 {
     m_timer = new PTimer(theGame.TimerManager, null);
     m_startFrame = startFrame;
     m_endFrame = endFrame;
     m_timer.Interval = intervalInSeconds;
 }
Example #6
0
 public static void MeasurePointBegin(PTimer timer)
 {
     if (timer != null) {
         stopWatches[timer.id].Start();
         timer.measureStartPoint = StopwatchElapsedMS(timer);
     } else {
         UnityEngine.Debug.LogError("PerformanceTimer error: Timer is null");
     }
 }
Example #7
0
    public static PTimer CreateTimer()
    {
        Stopwatch newStopwatch = new Stopwatch();
        PTimer newTimer = new PTimer();
        newTimer.id = stopWatches.Count;

        stopWatches.Add (newStopwatch);

        return newTimer;
    }
Example #8
0
    public static void MeasurePointEnd(PTimer timer)
    {
        if (timer != null) {
            timer.measureEndPoint = StopwatchElapsedMS(timer);
            stopWatches[timer.id].Stop();

            timer.measureTime = timer.measureEndPoint - timer.measureStartPoint;
            timer.measureCount++;
            timer.processTimeTotal += timer.measureTime;
            timer.frameTime = Time.deltaTime * 1000;
            timer.frameTimeTotal += timer.frameTime;

            timer.averageTime = timer.processTimeTotal / timer.measureCount;
            timer.averageFrameTime = timer.frameTimeTotal / timer.measureCount;

            if (timer.measureTime > timer.longestTime) timer.longestTime = timer.measureTime;
            if (timer.shortestTime > timer.measureTime) timer.shortestTime = timer.measureTime;
        } else {
            UnityEngine.Debug.LogError("PerformanceTimer error: Timer is null");
        }
    }
Example #9
0
 public static void ResetTimer(PTimer timer)
 {
     if (timer != null) stopWatches[timer.id].Reset();
 }
Example #10
0
 void Awake()
 {
     timer = PerformanceTimer.CreateTimer(); // Create and assign timer
     frame = new NPFrame2("main", new Vector2(64,64));
 }
Example #11
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PTimer obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Example #12
0
 private static double StopwatchElapsedMS(PTimer timer)
 {
     long ticks = stopWatches[timer.id].ElapsedTicks;
     double ns = 1000000000.0 * (double)ticks / Stopwatch.Frequency;
     double ms = ns / 1000000.0;
     return ms;
 }
Example #13
0
 public Camera2D(Vector2 focusPoint)
 {
     m_transform        = new Transform();
     m_centerMatrix     = Matrix.CreateTranslation(focusPoint.X, focusPoint.Y, 0);
     m_cameraShakeTimer = new PTimer(Program.TheGame.TimerManager, StopShake);
 }
Example #14
0
 void Start()
 {
     timer = PerformanceTimer.CreateTimer();
 }
Example #15
0
    void Start()
    {
        timer = PerformanceTimer.CreateTimer();
        //line = GetComponent<LineRenderer>();
        frame = new NPFrame2("DoF", 4);
        cam = GetComponent<Camera>();

        depth = new RenderTexture(Screen.width, Screen.height, 0, RenderTextureFormat.RFloat, RenderTextureReadWrite.Linear);
        depth.Create();

        donePow2 = new RenderTexture(frame.GetNativePOTRes, frame.GetNativePOTRes, 0, frame.GetTextureFormat, RenderTextureReadWrite.Linear);
        donePow2.enableRandomWrite = true;
        donePow2.Create();
    }
Example #16
0
 public void Start()
 {
     // Variable for testing
     timer = PerformanceTimer.CreateTimer(); // Create and assign timer
 }
Example #17
0
    void Start()
    {
        // Variable for testing
        timer = PerformanceTimer.CreateTimer(); // Create and assign timer

        frame = new NPFrame2("Blur", 5);

        donePow2 = new RenderTexture(frame.GetNativePOTRes, frame.GetNativePOTRes, 0, frame.GetTextureFormat, RenderTextureReadWrite.Linear);
        donePow2.enableRandomWrite = true;
        donePow2.Create();
    }
Example #18
0
    void Start()
    {
        timer = PerformanceTimer.CreateTimer();
        frame = new NPFrame2("Bloom", 7);

        //Textures used for the bloom effect, currently more than needed are used - probably.
        // TODO: This could be reduced I believe by using the source image non PoT and generate the bloom texture from that and make that PoT and continue from there.
        done = new RenderTexture(Screen.width, Screen.height, 0, frame.GetTextureFormat, RenderTextureReadWrite.Linear);
        done.enableRandomWrite = true;
        done.Create();

        origin = new RenderTexture(frame.GetNativePOTRes, frame.GetNativePOTRes, 0, frame.GetTextureFormat, RenderTextureReadWrite.Linear);
        origin.enableRandomWrite = true;
        origin.Create();

        bloomTexture =  new RenderTexture(Screen.width, Screen.height, 0, frame.GetTextureFormat, RenderTextureReadWrite.Linear);
        bloomTexture.enableRandomWrite = true;
        bloomTexture.Create();
    }