~ubuntu-branches/ubuntu/utopic/xscreensaver/utopic

« back to all changes in this revision

Viewing changes to hacks/glx/noof.c

  • Committer: Bazaar Package Importer
  • Author(s): Ted Gould
  • Date: 2008-08-28 16:15:25 UTC
  • mfrom: (1.1.6 upstream) (2.1.3 lenny)
  • Revision ID: james.westby@ubuntu.com-20080828161525-mxga521aoezxjq8h
Tags: 5.07-0ubuntu1
* Upgrade upstream version
* debian/control: Remove suggest xdaliclock as it is no longer
  included
* Remove 10_jwz-screensaver-randr-patch-3.patch as it has been merged
  upstream.
* Add 24_hacks_xsublim_enable.patch as it seems that xsublim was dropped
  from the build files.  There is nothing in the Changelog about it
  so I believe it was accidental.
* Updating the .desktop files from the XML files using gnome-screensaver's
  utility to do so.  Lots of text updates.  Also:
    * Added: abstractile.desktop
    * Added: cwaves.desktop
    * Added: m6502.desktop
    * Added: skytentacles.desktop
    * Removed: xteevee.desktop
* xscreensaver-gl-extra.files: Added skytentacles
* xscreensaver-data-extra.files: Added abstractile, cwaves and m6502
* xscreensaver-data.files: Remove partial abstractile, m6502 and cwaves

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
#define N_SHAPES 7
28
28
 
 
29
/* For some reason this hack screws up on Cocoa if we try to double-buffer it.
 
30
   It looks fine single-buffered, so let's just do that. */
 
31
static int dbuf_p = 0;
 
32
 
29
33
ENTRYPOINT ModeSpecOpt noof_opts = {0, NULL, 0, NULL, NULL};
30
34
 
31
35
typedef struct {
117
121
  0.22824, 0.21256, 0.19891, 0.18693, 0.17633, 0.16687,
118
122
};
119
123
 
120
 
static void
 
124
static int
121
125
drawleaf(noof_configuration *bp, int l)
122
126
{
123
 
 
 
127
  int polys = 0;
124
128
  int b, blades;
125
129
  float x, y;
126
130
  float wobble;
137
141
    initshapes(bp, l);      /* let it become reborn as something
138
142
                           else */
139
143
    bp->tko++;
140
 
    return;
 
144
    return polys;
141
145
  } {
142
146
    float w1 = sin(bp->geep[l] * 15.3 * M_PI / 180.0);
143
147
    wobble = 3.0 + 2.00 * sin(bp->geep[l] * 0.4 * M_PI / 180.0) + 3.94261 * w1;
174
178
    glVertex2f(x, y);
175
179
    glVertex2f(x, -y);  /* C */
176
180
    glVertex2f(0.3, 0.0);  /* D */
 
181
    polys += 2;
177
182
    glEnd();
178
183
 
179
184
    /**
186
191
    glVertex2f(x, y);
187
192
    glVertex2f(0.3, 0.0);  /* D */
188
193
    glVertex2f(x, -y);  /* C */
 
194
    polys += 3;
189
195
    glEnd();
190
196
    glDisable(GL_BLEND);
191
197
 
192
198
    glPopMatrix();
193
199
  }
 
200
  return polys;
194
201
}
195
202
 
196
203
static void
372
379
  if (!bp->glx_context)
373
380
    return;
374
381
  glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(bp->glx_context));
 
382
  mi->polygon_count = 0;
375
383
 
376
384
  /**
377
385
  if((random() & 0xff) == 0x34){
393
401
  for (i = 0; i < N_SHAPES; i++) {
394
402
    motionUpdate(bp, i);
395
403
    colorUpdate(bp, i);
396
 
    drawleaf(bp, i);
 
404
      mi->polygon_count += drawleaf(bp, i);
397
405
  }
398
406
 
399
407
  if (mi->fps_p) do_fps (mi);
400
408
  glFinish();
401
409
 
402
 
/* For some reason this hack screws up on Cocoa if we try to double-buffer it.
403
 
   It looks fine single-buffered, so let's just do that. */
404
 
/*  glXSwapBuffers(MI_DISPLAY(mi), MI_WINDOW(mi)); */
 
410
  if (dbuf_p)
 
411
    glXSwapBuffers(MI_DISPLAY(mi), MI_WINDOW(mi));
405
412
}
406
413
 
407
414
 
450
457
 
451
458
  bp->glx_context = init_GL(mi);
452
459
 
453
 
  glDrawBuffer(GL_FRONT);
 
460
  glDrawBuffer(dbuf_p ? GL_BACK : GL_FRONT);
454
461
  glClearColor(0.0, 0.0, 0.0, 1.0);
455
462
  glEnable(GL_LINE_SMOOTH);
456
463
  glShadeModel(GL_FLAT);