X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=gui.h;h=5cfe468501b8bcb27fb9359f72d03beaca56d959;hb=b405845ac2cc8eb8e227eb5785f48f5dde9b0f26;hp=18b3dbd5eac91d28b4cd5e8cbf36ecab56710571;hpb=3749ad2919d75b87c73deb2e8fe7e505cbdcf739;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/gui.h b/gui.h index 18b3dbd..5cfe468 100644 --- 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; ibindstr, &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; }