non-meaningful cleanup
[carveJwlIkooP6JGAAIwe30JlM.git] / world_routes.c
index ca072e62985290569c6a7d780e2ed0b588efea99..b80e68e2777209a849d8039cbef257005df08d00 100644 (file)
@@ -10,7 +10,6 @@
 #include "world_routes.h"
 #include "world_gate.h"
 #include "world_load.h"
-#include "highscores.h"
 #include "network.h"
 
 #include "font.h"
@@ -756,7 +755,11 @@ static void world_routes_update_timer_texts( world_instance *world ){
          text->gate = gate;
          text->route = route;
 
-         if( route->valid_checkpoints >= route->checkpoints_count ){
+         vg_str str;
+         vg_strnull( &str, text->text, sizeof(text->text) );
+
+         if( route->valid_checkpoints >= route->checkpoints_count )
+         {
             double lap_time = world_static.time - route->timing_base,
                    time_centiseconds = lap_time * 100.0;
 
@@ -770,30 +773,32 @@ static void world_routes_update_timer_texts( world_instance *world ){
             seconds     %= 60;
             minutes     %= 60;
 
-            if( minutes > 9 ) minutes = 9;
+            if( minutes > 9 ) 
+               minutes = 9;
             
-            int j=0;
-            if( minutes ){
-               highscore_intr( text->text, minutes, 1, ' ' ); j++;
-               text->text[j++] = ':';
+            if( minutes )
+            {
+               vg_strcati32r( &str, minutes, 1, ' ' );
+               vg_strcatch( &str, ':' );
             }
             
-            if( seconds >= 10 || minutes ){
-               highscore_intr( text->text+j, seconds, 2, '0' ); j+=2;
+            if( seconds >= 10 || minutes )
+            {
+               vg_strcati32r( &str, seconds, 2, '0' );
             }
-            else{
-               highscore_intr( text->text+j, seconds, 1, '0' ); j++;
+            else
+            {
+               vg_strcati32r( &str, seconds, 1, '0' );
             }
 
-            text->text[j++] = '.';
-            highscore_intr( text->text+j, centiseconds, 1, '0' ); j++;
-            text->text[j] = '\0';
+            vg_strcatch( &str, '.' );
+            vg_strcati32r( &str, centiseconds, 1, '0' );
          }
-         else{
-            highscore_intr( text->text, route->valid_checkpoints, 1, ' ' );
-            text->text[1] = '/';
-            highscore_intr( text->text+2, route->checkpoints_count+1, 1, ' ' );
-            text->text[3] = '\0';
+         else
+         {
+            vg_strcati32r( &str, route->valid_checkpoints, 1, ' ' );
+            vg_strcatch( &str, '/' );
+            vg_strcati32r( &str, route->checkpoints_count + 1, 1, ' ' );
          }
    
          gui_font3d.font = &gui.font;