~ubuntu-branches/ubuntu/trusty/xscreensaver/trusty

« back to all changes in this revision

Viewing changes to hacks/glx/voronoi.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2009-11-30 13:33:13 UTC
  • mfrom: (1.1.8 upstream) (2.1.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091130133313-3b5nz2e7hvbb8h3l
Tags: 5.10-3ubuntu1
* Merge with Debian unstable, remaining changes: (LP: #489062)
  - debian/control: add Build-Depends on ubuntu-artwork
  - debian/rules: use /usr/share/backgrounds
  - debian/control: Move xli | xloadimage recommends to suggests
  - debian/split-hacks.config: Use different set of default hacks to Debian
  - debian/source_xscreensaver.py: Add apport hook
  - debian/patches/53_XScreenSaver.ad.in.patch: Use Ubuntu branding

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* voronoi, Copyright (c) 2007 Jamie Zawinski <jwz@jwz.org>
 
1
/* voronoi, Copyright (c) 2007, 2008 Jamie Zawinski <jwz@jwz.org>
2
2
 *
3
3
 * Permission to use, copy, modify, distribute, and sell this software and its
4
4
 * documentation for any purpose is hereby granted without fee, provided that
142
142
  int i;
143
143
  int faces = 64;
144
144
  GLfloat step = M_PI * 2 / faces;
145
 
  GLfloat s2 = step/2;
146
 
  GLfloat th;
147
 
  GLfloat x, y, x0, y0;
148
 
 
149
 
  glBegin(GL_TRIANGLES);
150
 
 
151
 
  th = 0;
152
 
  x = 1;
153
 
  y = 0;
154
 
  x0 = cos (s2);
155
 
  y0 = sin (s2);
156
 
 
 
145
  GLfloat th = 0;
 
146
  GLfloat x = 1;
 
147
  GLfloat y = 0;
 
148
 
 
149
  glBegin(GL_TRIANGLE_FAN);
 
150
  glVertex3f (0, 0, 1);
157
151
  for (i = 0; i < faces; i++)
158
152
    {
159
 
      glVertex3f(0,  0, 1);
160
 
      glVertex3f(x, y, 0);
161
 
 
 
153
      glVertex3f (x, y, 0);
162
154
      th += step;
163
 
      x0 = cos (th + s2);
164
 
      y0 = sin (th + s2);
165
 
      x  = cos (th);
166
 
      y  = sin (th);
167
 
 
168
 
      glVertex3f(x, y, 0);
 
155
      x = cos (th);
 
156
      y = sin (th);
169
157
    }
 
158
  glVertex3f (1, 0, 0);
170
159
  glEnd();
171
160
  return faces;
172
161
}