Ignore:
Timestamp:
Apr 29, 2012, 11:55:32 PM (9 years ago)
Author:
sam
Message:

core: tick methods now use seconds, like any sane system.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/tutorial/03_fractal.cpp

    r1300 r1310  
    22// Lol Engine - Fractal tutorial
    33//
    4 // Copyright: (c) 2011 Sam Hocevar <sam@hocevar.net>
     4// Copyright: (c) 2011-2012 Sam Hocevar <sam@hocevar.net>
    55//   This program is free software; you can redistribute it and/or
    66//   modify it under the terms of the Do What The Fuck You Want To
     
    101101        //m_center = f64cmplx(0.001643721971153, 0.822467633298876);
    102102        m_center = f64cmplx(-0.65823419062254, 0.50221777363480);
    103         m_zoom_speed = -0.000025;
     103        m_zoom_speed = -0.025;
    104104#else
    105105        m_center = -0.75;
     
    202202    }
    203203
    204     virtual void TickGame(float deltams)
     204    virtual void TickGame(float seconds)
    205205    {
    206         WorldEntity::TickGame(deltams);
     206        WorldEntity::TickGame(seconds);
    207207
    208208        int prev_frame = m_frame;
     
    235235            if (m_translate != 0.0)
    236236            {
    237                 m_translate *= pow(2.0, -deltams * 0.005);
     237                m_translate *= pow(2.0, -seconds * 5.0);
    238238                if (m_translate.norm() / m_radius < 1e-4)
    239239                    m_translate = 0.0;
     
    243243        if ((buttons[0] || buttons[2]) && m_mousepos.x != -1)
    244244        {
    245             double zoom = buttons[0] ? -0.0005 : 0.0005;
    246             m_zoom_speed += deltams * zoom;
    247             if (m_zoom_speed / zoom > 5)
    248                 m_zoom_speed = 5 * zoom;
     245            double zoom = buttons[0] ? -0.5 : 0.5;
     246            m_zoom_speed += seconds * zoom;
     247            if (m_zoom_speed / zoom > 5e-3f)
     248                m_zoom_speed = 5e-3f * zoom;
    249249        }
    250250        else if (m_zoom_speed)
    251251        {
    252             m_zoom_speed *= pow(2.0, -deltams * 0.005);
     252            m_zoom_speed *= pow(2.0, -seconds * 5.0);
    253253            if (abs(m_zoom_speed) < 1e-5 || m_drag)
    254254                m_zoom_speed = 0.0;
     
    260260            f64cmplx oldcenter = m_center;
    261261            double oldradius = m_radius;
    262             double zoom = pow(2.0, deltams * m_zoom_speed);
     262            double zoom = pow(2.0, seconds * 1e3f * m_zoom_speed);
    263263            if (m_radius * zoom > 8.0)
    264264            {
     
    426426    }
    427427
    428     virtual void TickDraw(float deltams)
     428    virtual void TickDraw(float seconds)
    429429    {
    430         WorldEntity::TickDraw(deltams);
     430        WorldEntity::TickDraw(seconds);
    431431
    432432        static float const vertices[] =
Note: See TracChangeset for help on using the changeset viewer.