aboutsummaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c
index fa239f90..d58f4db8 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -156,3 +156,21 @@ void mapping_rotate(double x, double y, double z,
*ddy = ny;
*ddz = nz;
}
+
+
+void progress_bar(int val, int total)
+{
+ double frac;
+ int n, i;
+ char s[1024];
+
+ frac = (double)val/total;
+ n = frac*80;
+
+ for ( i=0; i<n; i++ ) s[i] = '=';
+ for ( i=n; i<80; i++ ) s[i] = '.';
+ s[n] = '\0';
+ printf("\r|%s|", s);
+
+ if ( val == total ) printf("\n");
+}