#include "menu.h"
static int cl_ui = 1,
- cl_view_id = 0;
+ cl_view_id = 0,
+ cl_light_edit = 0;
int main( int argc, char *argv[] )
{
.persistent = 0
});
+ vg_convar_push( (struct vg_convar){
+ .name = "ledit",
+ .data = &cl_light_edit,
+ .data_type = k_convar_dtype_i32,
+ .opt_i32 = { .min=0, .max=1, .clamp=1 },
+ .persistent = 0
+ });
+
vg_info(" Copyright . . . -----, ,----- ,---. .---. \n" );
vg_info(" 2021-2022 |\\ /| | / | | | | /| \n" );
vg_info(" | \\ / | +-- / +----- +---' | / | \n" );
/* 'systems' are completely loaded now */
strcpy( world.world_name, "maps/mp_mtzero.mdl" );
-#if 0
strcpy( world.world_name, "maps/mp_gridmap.mdl" );
-#endif
world_load();
vg_console_load_autos();
}
glViewport( 0,0, vg.window_x, vg.window_y );
}
+VG_STATIC void run_light_widget( struct light_widget *lw );
VG_STATIC void vg_ui(void)
{
menu_crap_ui();
-#if 0
- if( lightedit )
+ if( cl_light_edit )
{
- ui_global_ctx.cursor[0] = 10;
- ui_global_ctx.cursor[1] = 10;
- ui_global_ctx.cursor[2] = 200;
- ui_global_ctx.cursor[3] = 20;
+ vg_uictx.cursor[0] = 10;
+ vg_uictx.cursor[1] = 10;
+ vg_uictx.cursor[2] = 200;
+ vg_uictx.cursor[3] = 20;
struct ub_world_lighting *wl = &gpipeline.ub_world_lighting;
struct ui_slider_vector
for( int i=0; i<3; i++ )
run_light_widget( &gpipeline.widgets[i] );
-
- gui_text( ui_global_ctx.cursor, "Ambient", 1, 0 );
- ui_global_ctx.cursor[1] += 16;
- ui_slider_vector( &ui_global_ctx, &s5 );
-
- gui_text( ui_global_ctx.cursor, "Shadows", 1, 0 );
- ui_global_ctx.cursor[1] += 16;
- ui_slider( &ui_global_ctx, &s8 );
- ui_slider( &ui_global_ctx, &s9 );
-
- gui_text( ui_global_ctx.cursor, "Misc", 1, 0 );
- ui_global_ctx.cursor[1] += 16;
+
+ ui_text( vg_uictx.cursor, "Ambient", 1, 0 );
+ vg_uictx.cursor[1] += 16;
+ ui_slider_vector( &s5 );
+
+ ui_text( vg_uictx.cursor, "Shadows", 1, 0 );
+ vg_uictx.cursor[1] += 16;
+ ui_slider( &s8 );
+ ui_slider( &s9 );
+
+ ui_text( vg_uictx.cursor, "Misc", 1, 0 );
+ vg_uictx.cursor[1] += 16;
struct ui_checkbox c1 = {.data = &wl->g_light_preview};
- ui_checkbox( &ui_global_ctx, &c1 );
+ ui_checkbox( &c1 );
render_update_lighting_ub();
}
-#endif
//glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
if( cl_ui )
render_view_framebuffer_ui();
}
-#if 0
VG_STATIC void run_light_widget( struct light_widget *lw )
{
struct ui_checkbox c1 = { .data=&lw->enabled };
- ui_checkbox( &ui_global_ctx, &c1 );
+ ui_checkbox( &c1 );
if( lw->enabled )
{
colour = { .min=0.0f, .max=2.0f, .len=3, .data=lw->colour },
dir = { .min=-VG_PIf, .max=VG_PIf, .len=2, .data=lw->dir };
- ui_slider_vector( &ui_global_ctx, &colour );
- ui_global_ctx.cursor[1] += 4;
- ui_slider_vector( &ui_global_ctx, &dir );
+ ui_slider_vector( &colour );
+ vg_uictx.cursor[1] += 4;
+ ui_slider_vector( &dir );
}
}
-#endif
VG_STATIC void run_debug_info(void)
{