X-Git-Url: https://harrygodden.com/git/?p=fishladder.git;a=blobdiff_plain;f=fishladder.c;fp=fishladder.c;h=015ddd8901f42b181caf158fc97cacd1d9ddb639;hp=2a2da7520751101d4ff725de383d1bdd0817622a;hb=906479e3c59f0547d48de6a74438201e87418a9e;hpb=ec1dd5de4848534241c8bea3841ef36fe047915b diff --git a/fishladder.c b/fishladder.c index 2a2da75..015ddd8 100644 --- a/fishladder.c +++ b/fishladder.c @@ -423,24 +423,25 @@ static v3f colour_sets[][4] = static struct world_theme { const char *name; - v3f colour_bg; + v3f col_shadow; + vg_tex2d *tex_tiles; } world_themes[] = { { "Wood", - {}, + { 0.89f, 0.8f, 0.7f }, &tex_tiles_wood }, { "Minimal", - {}, + { 0.8f, 0.8f, 0.8f }, &tex_tiles_min }, { "Lab", - {}, + { 0.7f, 0.7f, 0.7f }, &tex_tiles_lab } }; @@ -2664,13 +2665,12 @@ void vg_render(void) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendEquation(GL_FUNC_ADD); - // Bind textures + // rebind textures vg_tex2d_bind( &tex_tile_data, 0 ); - glUniform1i( SHADER_UNIFORM( shader_tile_main, "uTexGlyphs" ), 0 ); - vg_tex2d_bind( theme->tex_tiles, 1 ); - glUniform1i( SHADER_UNIFORM( shader_tile_main, "uTexWood" ), 1 ); - + + glUniform3fv( SHADER_UNIFORM( shader_tile_main, "uShadowing" ), 1, theme->col_shadow ); + render_tiles( colour_default, colour_default ); // MARBLES @@ -2936,8 +2936,8 @@ void vg_render(void) { glUniform4fv( SHADER_UNIFORM( shader_wire, "uColour" ), 1, wire_drag_colour ); glUniform1f( SHADER_UNIFORM( shader_wire, "uCurve" ), 0.4f ); - glUniform3f( SHADER_UNIFORM( shader_wire, "uStart" ), world.drag_from_co[0], world.drag_from_co[1], 0.20f ); - glUniform3f( SHADER_UNIFORM( shader_wire, "uEnd" ), world.drag_to_co[0], world.drag_to_co[1], 0.20f ); + glUniform3f( SHADER_UNIFORM( shader_wire, "uStart" ), world.drag_from_co[0], world.drag_from_co[1], 0.20f*world.st.world_transition ); + glUniform3f( SHADER_UNIFORM( shader_wire, "uEnd" ), world.drag_to_co[0], world.drag_to_co[1], 0.20f*world.st.world_transition ); glDrawElements( GL_TRIANGLES, world.wire.em, GL_UNSIGNED_SHORT, (void*)(0) ); } @@ -2984,14 +2984,12 @@ void vg_render(void) glUniform4fv( SHADER_UNIFORM( shader_wire, "uColour" ), 1, wire_colour ); } else - { glUniform4fv( SHADER_UNIFORM( shader_wire, "uColour" ), 1, j? wire_right_colour: wire_left_colour ); - } glUniform1f( SHADER_UNIFORM( shader_wire, "uCurve" ), other_cell->state & FLAG_TRIGGERED? rp_x2 * 0.4f: 0.4f ); glUniform1f( SHADER_UNIFORM( shader_wire, "uGlow" ), other_cell->state & FLAG_TRIGGERED? rp_xa: 0.0f ); - glUniform3f( SHADER_UNIFORM( shader_wire, "uEnd" ), startpoint[0], startpoint[1], 0.18f ); - glUniform3f( SHADER_UNIFORM( shader_wire, "uStart" ), endpoint[0], endpoint[1], 0.18f ); + glUniform3f( SHADER_UNIFORM( shader_wire, "uEnd" ), startpoint[0], startpoint[1], 0.18f*world.st.world_transition ); + glUniform3f( SHADER_UNIFORM( shader_wire, "uStart" ), endpoint[0], endpoint[1], 0.18f*world.st.world_transition ); glDrawElements( GL_TRIANGLES, world.wire.em, GL_UNSIGNED_SHORT, (void*)(0) ); } } @@ -3053,7 +3051,7 @@ void vg_render(void) glUniform3f( SHADER_UNIFORM( shader_tile_colour, "uOffset" ), pts[i][0], pts[i][1], - 0.08f + 0.08f * world.st.world_transition ); draw_mesh( filled_start, filled_count ); } @@ -3063,7 +3061,8 @@ void vg_render(void) // SUB SPLITTER DIRECTION // ======================================================================================================== - + + /* glUniform4f( SHADER_UNIFORM( shader_tile_colour, "uColour" ), 0.9f, 0.35f, 0.1f, 0.75f ); for( int i = 0; i < world.tile_special_count; i ++ ) @@ -3077,6 +3076,7 @@ void vg_render(void) draw_mesh( cell->state & FLAG_FLIP_FLOP? 5: 4, 1 ); } } + */ // LIGHT FLARES // ======================================================================================================== @@ -3294,6 +3294,7 @@ void vg_ui(void) ui_global_ctx.cursor[2] = 150; gui_new_node(); { + gui_fill_rect( ui_global_ctx.cursor, 0x33ffffff ); ui_global_ctx.cursor[0] += 45; ui_global_ctx.cursor[1] += 6; gui_text( (const char *[]){ "Normal", "Extra1", "Extra2" }[ colour_set_id ], 2 ); @@ -3310,6 +3311,45 @@ void vg_ui(void) gui_end_down(); } gui_end_down(); + + // Theme select + // TODO: remove code dupe + ui_global_ctx.cursor[1] += 16; + + gui_text( "Tile Theme", 2 ); + ui_global_ctx.cursor[1] += 20; + + gui_new_node(); + { + ui_global_ctx.cursor[2] = 25; + if( gui_button( 0 ) == k_button_click ) + { + if( world_theme_id > 0 ) + world_theme_id --; + } + gui_text( "<", 2 ); + gui_end_right(); + + ui_global_ctx.cursor[2] = 150; + gui_new_node(); + { + gui_fill_rect( ui_global_ctx.cursor, 0x33ffffff ); + ui_global_ctx.cursor[0] += 45; + ui_global_ctx.cursor[1] += 6; + gui_text( world_themes[ world_theme_id ].name, 2 ); + } + gui_end_right(); + + ui_global_ctx.cursor[2] = 25; + if( gui_button( 1 ) == k_button_click ) + { + if( world_theme_id < vg_list_size( world_themes )-1 ) + world_theme_id ++; + } + gui_text( ">", 2 ); + gui_end_down(); + } + gui_end_down(); } gui_end(); }