~ubuntu-branches/debian/sid/xscreensaver/sid

« back to all changes in this revision

Viewing changes to hacks/fps.c

  • Committer: Package Import Robot
  • Author(s): Tormod Volden, Tormod Volden, Jose Luis Rivas
  • Date: 2011-10-06 23:12:30 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20111006231230-8wtr3x35zhy02xew
Tags: 5.15-1
[ Tormod Volden ]
* New upstream version 5.15
  - New hacks: hilbert, companioncube and tronbit
  - Turned on LC_CTYPE on Linux (LP: #671923)
* debian/rules: Add build-arch and build-indep targets

[ Jose Luis Rivas ]
* postrm: Kill xscreensaver after removal (Closes: #558024)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* fps, Copyright (c) 2001-2008 Jamie Zawinski <jwz@jwz.org>
 
1
/* fps, Copyright (c) 2001-2011 Jamie Zawinski <jwz@jwz.org>
2
2
 * Draw a frames-per-second display (Xlib and OpenGL).
3
3
 *
4
4
 * Permission to use, copy, modify, distribute, and sell this software and its
81
81
 
82
82
 
83
83
double
84
 
fps_compute (fps_state *st, unsigned long polys)
 
84
fps_compute (fps_state *st, unsigned long polys, double depth)
85
85
{
86
86
  if (! st) return 0;  /* too early? */
87
87
 
149
149
          else
150
150
            sprintf (st->string + strlen(st->string), "%lu%s ", polys, s);
151
151
        }
 
152
 
 
153
      if (depth >= 0.0)
 
154
        {
 
155
          int L = strlen (st->string);
 
156
          char *s = st->string + L;
 
157
          strcat (s, "\nDepth: ");
 
158
          sprintf (s + strlen(s), "%.1f", depth);
 
159
          L = strlen (s);
 
160
          /* Remove trailing ".0" in case depth is not a fraction. */
 
161
          if (s[L-2] == '.' && s[L-1] == '0')
 
162
            s[L-2] = 0;
 
163
        }
152
164
    }
153
165
 
154
166
  return st->last_fps;