fov slider input maps menu stuff
[carveJwlIkooP6JGAAIwe30JlM.git] / skaterift.c
index 91e7e012ababc663c4498cf7d1b8cab5b1eeee00..97f6553d7cb438a20d6a8680eb8f1033f63840a1 100644 (file)
@@ -61,6 +61,14 @@ VG_STATIC void vg_preload(void)
       .persistent = 1
    });
 
+   vg_convar_push( (struct vg_convar){
+      .name = "cl_fov",
+      .data = &g_fov_option,
+      .data_type = k_convar_dtype_f32,
+      .opt_f32 = { .clamp = 0 },
+      .persistent = 1
+   });
+
 vg_info(" Copyright  .        . .       -----, ,----- ,---.   .---.  \n" );
 vg_info(" 2021-2022  |\\      /| |           /  |      |    | |    /| \n" );
 vg_info("            | \\    / | +--        /   +----- +---'  |   / | \n" );
@@ -94,7 +102,7 @@ VG_STATIC void vg_load(void)
    world_audio_init();
 
    /* 'systems' are completely loaded now */
-   strcpy( world.world_name, "models/mp_dev.mdl" );
+   strcpy( world.world_name, "maps/mp_mtzero.mdl" );
    world_load();
    vg_console_load_autos();
 }
@@ -153,11 +161,12 @@ VG_STATIC void render_main_game(void)
    m4x4f world_4x4;
    m4x3_expand( camera_mtx_inverse, world_4x4 );
 
-   static float fov = 97.0f;
+   static float fov = 60.0f;
+
+   float fov_target = vg_lerpf( 90.0f, 110.0f, g_fov_option );
 
-   float fov_target = 108.0f;
    if( player.phys.on_board )
-      fov_target = 125.0f;
+      fov_target = vg_lerpf( 97.0f, 135.0f, g_fov_option );
 
    if( cl_menu )
       fov_target = menu_fov_target;
@@ -259,40 +268,9 @@ VG_STATIC void vg_render(void)
 
 VG_STATIC void vg_ui(void)
 {
+   menu_crap_ui();
+
 #if 0
-   if( cl_menu )
-   {
-      ui_rect menu =
-      {
-         vg.window_x / 2 - 150,
-         vg.window_y / 2 - 50,
-         300,
-         130
-      };
-
-      ui_fill_rect( &ui_global_ctx, menu, 0xa0000000 );
-
-      ui_text( &ui_global_ctx, (ui_rect){ menu[0]+menu[2]/2,menu[1]+6, 0, 0 },
-                               steam_username_at_startup, 
-                               1, k_text_align_center );
-      menu[1] += 24;
-      menu[3] -= 30;
-
-      ui_rect_pad( menu, 8 );
-      ui_fill_rect( &ui_global_ctx, menu, 0x90ffffff );
-      ui_rect_pad( menu, 2 );
-      ui_fill_rect( &ui_global_ctx, menu, 0xa0000000 );
-
-      menu[1] += 32;
-      ui_text( &ui_global_ctx, (ui_rect){ menu[0]+menu[2]/2,menu[1], 0, 0 },
-                               "Exit", 2, k_text_align_center );
-
-      if( vg_get_button_down( "jump" ) )
-      {
-         glfwSetWindowShouldClose( vg.window, 1 );
-      }
-   }
-   
    if( lightedit )
    {
       ui_global_ctx.cursor[0] = 10;