
#include "Tscene.h"

void Tscene::cycle()
{
    if (pnlSky.getCycle())
    {
        float hour = pnlSky.getHour();
        hour += pnlSky.getStep();
        if (hour >= 24.0f) hour -= 24.0f;
        light_init(hour);
    }


    float ambient = skyEarth.sun.getAmbient();

    // son de la fontaine / particules jet
    fontaine.getIn(camera.getPos());
        fontaine.update(ambient);

    // mecanismes : action et son
    for (size_t i = 0; i < meca.size(); i++)
    {
        meca[i].anim();
        meca[i].getIn(camera.getPos());
    }

    for (size_t i = 0; i < torche.size(); i++)
    {
        torche[i].update(ambient);
    }

    if (m_msg_tps > 0)
    {
        m_msg_tps--;
        if (m_msg_tps == 0)
        {
            lblInfo1.setFonteColor(clBlack32);
            lblInfo1.setText("");
        }
    }
}

