~cairo-dock-team/ubuntu/oneiric/cairo-dock-plug-ins/2.3.0-2.1

« back to all changes in this revision

Viewing changes to icon-effect/src/applet-firework.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthieu Baerts (matttbe)
  • Date: 2011-04-20 20:46:51 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20110420204651-ftnpzesj6uc7qeul
Tags: 2.3.0~1-0ubuntu1
* New Upstream Version (LP: #723995)
* Upstream short ChangeLog (since 2.3.0~0rc1):
 - Updated translations
 - Updated the integration of the new versions of kwin and compiz
    (Switcher, ShowDesktop, etc.)
 - Removed a lot of useless g_print
 - Updated a few plug-ins to fit with the new version of the API (gldit)
 - Fixed a few bugs
 - Updated MeMenu, MessagingMenu and Status-Notifier to works
    with the latest version of dbusmenu, etc.
* Switch to dpkg-source 3.0 (quilt) format
* debian/cairo-dock-plug-ins.install:
 - Added new files (interfaces for python, ruby, vala and mono)
* debian/control:
 - Added new dependences for new applets (sensors and zeitgeist)
    and new interfaces (python, valac, ruby and mono)
 - Updated the version of cairo-dock build-dependences
* debian/rules:
 - Added a new CMake flag to install python interface in debian/tmp
* Updated debian/watch

Show diffs side-by-side

added added

removed removed

Lines of Context:
119
119
        
120
120
        if (myData.iFireTexture == 0)
121
121
                myData.iFireTexture = cd_icon_effect_load_firework_texture ();
122
 
        double fMaxScale = 1. + g_fAmplitude * pDock->fMagnitudeMax;
 
122
        double fMaxScale = 1. + myIconsParam.fAmplitude * pDock->fMagnitudeMax;
123
123
        
124
124
        pData->pFireworks = g_new0 (CDFirework, myConfig.iNbFireworks);
125
125
        pData->iNbFireworks = myConfig.iNbFireworks;
146
146
 
147
147
static gboolean _update_firework_system (CDFirework *pFirework, CairoParticleSystem *pParticleSystem, double t)
148
148
{
149
 
        double dt = mySystem.iGLAnimationDeltaT * 1e-3;
150
149
        double k = myConfig.fFireworkFriction;
151
150
        double a;
152
151
        // y" + ky' = -g -> Y = -g/k + a*exp (-kt) -> y = y0 - g/k*t + a/k*(1 - exp(-kt))
184
183
 
185
184
static gboolean update (Icon *pIcon, CairoDock *pDock, gboolean bRepeat, CDIconEffectData *pData)
186
185
{
187
 
        double dt = mySystem.iGLAnimationDeltaT * 1e-3;
 
186
        double dt = cairo_dock_get_animation_delta_t (CAIRO_CONTAINER (pDock)) * 1e-3;
188
187
        gboolean bAllParticlesEnded = TRUE;
189
188
        gboolean bParticlesEnded;
190
189
        double t;
212
211
                        bParticlesEnded = _update_firework_system (pFirework, pFirework->pParticleSystem, t);
213
212
                        if (bParticlesEnded && bRepeat)
214
213
                        {
215
 
                                _launch_one_firework (pFirework, pDock, mySystem.iGLAnimationDeltaT);
 
214
                                _launch_one_firework (pFirework, pDock, dt*1e3);
216
215
                                bParticlesEnded = FALSE;
217
216
                        }
218
217
                        bAllParticlesEnded &= bParticlesEnded;
219
218
                }
220
219
        }
221
220
        
222
 
        double fMaxScale = 1. + g_fAmplitude * pDock->fMagnitudeMax;
 
221
        double fMaxScale = 1. + myIconsParam.fAmplitude * pDock->fMagnitudeMax;
223
222
        pData->fAreaWidth = (1. + 2 * (myConfig.fFireworkRadius + .1)) * pIcon->fWidth * fMaxScale + myConfig.iFireworkParticleSize * pDock->container.fRatio;  // rayon de l'explosion avec sa dispersion + demi-largeur des particules, a droite et a gauche.
224
223
        pData->fAreaHeight = pIcon->fHeight * fMaxScale * (.8 + myConfig.fFireworkRadius + .1) + myConfig.iFireParticleSize * pDock->container.fRatio;
225
224
        pData->fBottomGap = 0.;  // les particules disparaissent en touchant le sol.