~ubuntu-branches/ubuntu/intrepid/compiz-fusion-plugins-main/intrepid-proposed

« back to all changes in this revision

Viewing changes to src/animation/dream.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2008-07-28 17:52:13 UTC
  • mfrom: (1.1.29 upstream)
  • Revision ID: james.westby@ubuntu.com-20080728175213-z1ew370577iok42b
Tags: 0.7.7+git20080728-0ubuntu1
* New git snapshot:
  - lots of fixes and optimizations for the animation plugin
  - translation updates

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
    defaultAnimInit(s, w);
53
53
}
54
54
 
55
 
static void
56
 
fxDreamModelStepObject(CompWindow * w,
57
 
                       Model * model, Object * object, float forwardProgress)
 
55
static void inline
 
56
fxDreamModelStepObject (CompWindow * w,
 
57
                        Model * model,
 
58
                        Object * object,
 
59
                        float forwardProgress,
 
60
                        float waveAmpMax)
58
61
{
59
 
    float waveAmpMax = MIN(WIN_H(w), WIN_W(w)) * 0.125f;
60
62
    float waveWidth = 10.0f;
61
63
    float waveSpeed = 7.0f;
62
64
 
71
73
        forwardProgress * waveAmpMax * model->scale.x *
72
74
        sin(object->gridPosition.y * M_PI * waveWidth +
73
75
            waveSpeed * forwardProgress);
74
 
 
75
76
}
76
77
 
77
78
void
95
96
    else
96
97
        forwardProgress = defaultAnimProgress(aw);
97
98
 
 
99
    float waveAmpMax = MIN(WIN_H(w), WIN_W(w)) * 0.125f;
 
100
 
 
101
    Object *object = model->objects;
98
102
    int i;
99
 
    for (i = 0; i < model->numObjects; i++)
 
103
    for (i = 0; i < model->numObjects; i++, object++)
100
104
        fxDreamModelStepObject(w,
101
105
                               model,
102
 
                               &model->objects[i], forwardProgress);
 
106
                               object,
 
107
                               forwardProgress,
 
108
                               waveAmpMax);
103
109
}
104
110
 
105
111
void