X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_render.c;h=4cac23f6a2418446cdc4ceee2b8ac412bff78747;hb=8f98fa2ae18576b006d7a2bd2d5dc216333ebf63;hp=e1a30886b8de504afacda8052fbef4e9eba4c2ef;hpb=93790b71d3a89724255dc73239e38c08ad4bbac7;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_render.c b/world_render.c index e1a3088..4cac23f 100644 --- a/world_render.c +++ b/world_render.c @@ -145,15 +145,6 @@ static GLuint world_get_texture( world_instance *world, u32 id ){ else return world->textures[ id ]; } -#if 0 -static void bindpoint_diffuse_texture1( world_instance *world, - struct world_surface *mat ){ - glActiveTexture( GL_TEXTURE1 ); - glBindTexture( GL_TEXTURE_2D, - world_get_texture(world,mat->info.tex_diffuse) ); -} -#endif - /* * Passes Rendering * ---------------------------------------------------------------------------- @@ -1210,7 +1201,6 @@ void render_world_override( world_instance *world, v4f uPlayerPos, uSpawnPos; v4_zero( uPlayerPos ); v4_zero( uSpawnPos ); - v3_copy( world->player_co, uPlayerPos ); if( dest_spawn && (v3_dist2(dest_spawn->transform.co,uPlayerPos) > 0.1f) ) @@ -1360,20 +1350,21 @@ static f32 *skybox_prop_location( world_instance *world, i32 index ){ } } -void imgui_world_light_edit( world_instance *world ) +void imgui_world_light_edit( ui_context *ctx, world_instance *world ) { ui_rect panel = { vg.window_x-400, 0, 400, vg.window_y }; - ui_fill( panel, ui_colour( k_ui_bg+1 ) ); - ui_outline( panel, 1, ui_colour( k_ui_bg+7 ), 0 ); + ui_fill( ctx, panel, ui_colour( ctx, k_ui_bg+1 ) ); + ui_outline( ctx, panel, 1, ui_colour( ctx, k_ui_bg+7 ), 0 ); ui_rect_pad( panel, (ui_px[2]){ 8, 8 } ); - vg_ui.wants_mouse = 1; + ui_capture_mouse(ctx, 1); static i32 option_to_edit = 0; - ui_enum( panel, "option", skybox_setting_options, 5, &option_to_edit ); - ui_colourpicker( panel, "colour", + ui_enum( ctx, panel, "option", skybox_setting_options, 5, &option_to_edit ); + ui_colourpicker( ctx, panel, "colour", skybox_prop_location( world, option_to_edit ) ); - if( ui_button( panel, "save tweaker file ('/tmp/tweaker.txt')\n" ) == 1 ){ + if( ui_button( ctx, panel, "save tweaker file ('/tmp/tweaker.txt')\n" ) == 1 ) + { FILE *fp = fopen( "/tmp/tweaker.txt", "w" ); for( i32 i=0; i<5; i ++ ){