Changeset 2666 in orxonox.OLD for orxonox/branches/chris/src
- Timestamp:
- Oct 27, 2004, 7:49:25 PM (20 years ago)
- Location:
- orxonox/branches/chris/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/chris/src/data_tank.cc
r2665 r2666 283 283 { 284 284 // return placeholder 285 return loader->get_placeholder( type); 285 286 } 286 287 else … … 305 306 } 306 307 307 void DataTank::precache( char* resfile, void(*pfunc)(int, float, char*, char*)) 308 { 308 void DataTank::precache( char* resfile, void(*pfunc)(int, float, char*)) 309 { 310 FILE* source; 311 int total, done; 312 char file[256]; 313 char* s; 314 315 source = fopen( resfile, "r"); 316 if( source == NULL) return; 317 318 total = done = 0; 319 320 while( !feof( source)) 321 { 322 fgets( file, 256, source); 323 if( (s = strchr( file, '\n')) != NULL) *s = 0; 324 if( strlen( file) > 1) total++; 325 } 326 327 rewind( source); 328 329 while( !feof( source)) 330 { 331 fgets( file, 256, source); 332 if( (s = strchr( file, '\n')) != NULL) *s = 0; 333 if( strlen( file) > 1) 334 { 335 if( pfunc) pfunc( total, ((float)done)/((float)total), file); 336 get( file); 337 done++; 338 } 339 } 340 341 fclose( source); 309 342 } 310 343 -
orxonox/branches/chris/src/data_tank.h
r2664 r2666 86 86 void unload( char* file); 87 87 int add_filetype( char* postfix, void*(*lfunc)(char*), void(*ffunc)(void*), char* placeholderfile); 88 void precache( char* resfile, void(*pfunc)(int, float, char* , char*));88 void precache( char* resfile, void(*pfunc)(int, float, char*)); 89 89 void save_precache( char* file); 90 90 void save_node( DataTree* act, FILE* out);
Note: See TracChangeset
for help on using the changeset viewer.