Streamlining loading functions for server startup

- Added a couple of timer outputs
- Improved code consistency between loading functions
- Progess bars should look and behave similar on all OS now (sLog.outString() is not needed anymore to replace the progress bar in log files)

--HG--
branch : trunk
This commit is contained in:
leak committed 2010-12-19 17:06:33 +01:00
1 parent 9c35e10444
commit fd694cd232
36 files changed
+2645 -2286

No files matched your search

+6 -26
View File
@@ -21,17 +21,7 @@
#include "ProgressBar.h"
char const* const barGoLink::empty = " ";
#ifdef _WIN32
char const* const barGoLink::full = "\x3D";
#else
char const* const barGoLink::full = "*";
#endif
barGoLink::~barGoLink()
{
printf( "\n" );
fflush(stdout);
}
barGoLink::barGoLink( uint64 row_count )
{
@@ -39,17 +29,9 @@ barGoLink::barGoLink( uint64 row_count )
rec_pos = 0;
indic_len = 50;
num_rec = row_count;
#ifdef _WIN32
printf( "\x3D" );
#else
printf( "[" );
#endif
for (uint64 i = 0; i < indic_len; ++i) printf( empty );
#ifdef _WIN32
printf( "\x3D 0%%\r\x3D" );
#else
printf( "] 0%%\r[" );
#endif
fflush(stdout);
}
@@ -62,22 +44,20 @@ void barGoLink::step( void )
n = rec_no * indic_len / num_rec;
if ( n != rec_pos )
{
#ifdef _WIN32
printf( "\r\x3D" );
#else
printf( "\r[" );
#endif
for (i = 0; i < n; i++ ) printf( full );
for (; i < indic_len; i++ ) printf( empty );
float percent = (((float)n/(float)indic_len)*100);
#ifdef _WIN32
printf( "\x3D %i%% \r\x3D", (int)percent);
#else
printf( "] %i%% \r[", (int)percent);
#endif
fflush(stdout);
rec_pos = n;
}
if( num_rec == rec_no)
{
printf( "\n" );
fflush(stdout);
}
}