nametag rendering
[carveJwlIkooP6JGAAIwe30JlM.git] / gui.h
diff --git a/gui.h b/gui.h
index 18b3dbd5eac91d28b4cd5e8cbf36ecab56710571..5cfe468501b8bcb27fb9359f72d03beaca56d959 100644 (file)
--- a/gui.h
+++ b/gui.h
@@ -113,16 +113,14 @@ void gui_draw(void)
    camera_finalize( &ortho );
 
 
-
-
-
    /* icons */
-   font3d_bind( &gui.font, &ortho );
+   font3d_bind( &gui.font, k_font_shader_default, 0, NULL, &ortho );
+   mesh_bind( &gui.icons_mesh );
+
    m4x3f mmdl;
    m4x3_identity( mmdl );
    shader_model_font_uMdl( mmdl );
 
-   mesh_bind( &gui.icons_mesh );
    shader_model_font_uColour( (v4f){1.0f,1.0f,1.0f,1.0f} );
    glActiveTexture( GL_TEXTURE0 );
    glBindTexture( GL_TEXTURE_2D, gui.icons_texture );
@@ -141,8 +139,6 @@ void gui_draw(void)
 
 
 
-
-
    gui.factive = vg_lerpf( gui.factive, gui.helper_count?1.0f:0.0f,
                            vg.time_frame_delta*2.0f );
 
@@ -181,18 +177,17 @@ void gui_draw(void)
       v3_zero( mmdl[3] );
 
       f32 pad = dy*0x1p-4f*0.125f;
-      f32 w = font3d_string_width( &gui.font,2,gui.location );
+      f32 w = font3d_string_width( 2, gui.location );
 
       mmdl[3][0] = fr*0.5f - w*scale*0.5f;
       mmdl[3][1] = 0.3f*ft+pad*2.0f;
 
-      font3d_bind( &gui.font, &ortho );
+      font3d_bind( &gui.font, k_font_shader_default, 0, NULL, &ortho );
       shader_model_font_uColour( (v4f){1.2f,1.2f,1.2f,o} );
-      font3d_simple_draw( &gui.font, 2, k_font_shader_default,
-                           gui.location, &ortho, mmdl );
+      font3d_simple_draw( 2, gui.location, &ortho, mmdl );
    }
-
-   font3d_bind( &gui.font, &ortho );
+   else
+      font3d_bind( &gui.font, k_font_shader_default, 0, NULL, &ortho );
 
    float dy    = ft/0.79f,
          scale = dy*0x1p-4f*0.75f;
@@ -208,24 +203,14 @@ void gui_draw(void)
    for( u32 i=0; i<gui.helper_count; i++ ){
       struct gui_helper *helper = &gui.helpers[i];
 
-      shader_model_font_uColour( (v4f){1.0f,1.0f,1.0f,1.0f} );
-
-      struct font3d_render render = {
-         .font = &gui.font,
-         .variant_id = 2,
-         .shader = k_font_shader_default
-      };
-      font3d_begin( helper->bindstr, &ortho, mmdl, &render );
-      font3d_draw( &render );
+      font3d_setcolour( (v4f){1.0f,1.0f,1.0f,1.0f} );
+      font3d_simple_draw( 2, helper->bindstr, &ortho, mmdl );
 
       const char *make_smaller = "\x02\xaf\x03 ";
-      render.u8pch = (const u8*)make_smaller;
-      font3d_draw( &render );
-
-      render.u8pch = (u8*)helper->text;
-      font3d_draw( &render );
+      font3d_draw( make_smaller );
+      font3d_draw( helper->text );
       
-      float w = render.offset[0]+1.0f;
+      float w = gui_font3d.offset[0]+1.0f;
       mmdl[3][0] += w*scale;
    }