commit a8880f25ec414c498333e72354de3f18018d5b83 parent 27de3c533512098086cf61ebbdfd33d40bd28fd8 Author: Michael Savage <mikejsavage@gmail.com> Date: Sun Jul 16 15:01:23 +0300 MSVC warnings Diffstat:
shadow_map.cc | | | 28 | ++++++++++++++-------------- |
diff --git a/shadow_map.cc b/shadow_map.cc @@ -20,7 +20,7 @@ static UB ub_light_pos_bias; static FB shadow_fb; static Mesh tree_mesh; -static float bias = 0.00005; +static float bias = 0.00005f; static const u32 SHADOW_SIZE = 1024; @@ -42,8 +42,8 @@ static void draw_scene( RenderState render_state, bool draw_light = false ) { immediate_aabb( &imm, v3( 3, -6, 0 ), v3( 5, -4, 2 ), v4( 0, 0, 1, 1 ) ); if( draw_light ) { - immediate_sphere( &imm, light_pos, 0.1, v4( 1, 1, 1, 1 ) ); - immediate_arrow( &imm, light_pos, light_dir, 0.5, v4( 1, 1, 1, 1 ) ); + immediate_sphere( &imm, light_pos, 0.1f, v4( 1, 1, 1, 1 ) ); + immediate_arrow( &imm, light_pos, light_dir, 0.5f, v4( 1, 1, 1, 1 ) ); } v3 tl( -50, 50, 0 ); @@ -84,10 +84,10 @@ GAME_INIT( game_init ) { { float verts[] = { - -1.0, -1.0, 0, - -1.0, -0.7, 0, - -0.8, -1.0, 0, - -0.8, -0.7, 0, + -1.0f, -1.0f, 0.0f, + -1.0f, -0.7f, 0.0f, + -0.8f, -1.0f, 0.0f, + -0.8f, -0.7f, 0.0f, }; MeshConfig config; config.positions = renderer_new_vb( verts, sizeof( verts ) ); @@ -103,12 +103,12 @@ GAME_FRAME( game_frame ) { const float speed = 6.0f; const float angular_speed = 100.0f; - float fb = input->keys[ KEY_W ] - input->keys[ KEY_S ]; - float lr = input->keys[ KEY_D ] - input->keys[ KEY_A ]; - float dz = input->keys[ KEY_SPACE ] - input->keys[ KEY_LEFTSHIFT ]; + float fb = float( input->keys[ KEY_W ] - input->keys[ KEY_S ] ); + float lr = float( input->keys[ KEY_D ] - input->keys[ KEY_A ] ); + float dz = float( input->keys[ KEY_SPACE ] - input->keys[ KEY_LEFTSHIFT ] ); - float dpitch = input->keys[ KEY_DOWNARROW ] - input->keys[ KEY_UPARROW ]; - float dyaw = input->keys[ KEY_LEFTARROW ] - input->keys[ KEY_RIGHTARROW ]; + float dpitch = float( input->keys[ KEY_DOWNARROW ] - input->keys[ KEY_UPARROW ] ); + float dyaw = float( input->keys[ KEY_LEFTARROW ] - input->keys[ KEY_RIGHTARROW ] ); dpitch += input->keys[ KEY_K ] - input->keys[ KEY_I ]; dyaw += input->keys[ KEY_J ] - input->keys[ KEY_L ]; @@ -128,7 +128,7 @@ GAME_FRAME( game_frame ) { const m4 P = m4_perspective( VERTICAL_FOV, get_aspect_ratio(), NEAR_PLANE_DEPTH, FAR_PLANE_DEPTH ); m4 V = m4_view( forward, right, up, game->pos ); - light_pos = v3( cos( current_time ) * 10, sin( current_time ) * 10, 10 ); + light_pos = v3( float( cos( current_time ) * 10 ), float( sin( current_time ) * 10 ), 10 ); renderer_begin_frame(); @@ -166,7 +166,7 @@ GAME_FRAME( game_frame ) { } // draw world - bias += ( input->keys[ KEY_EQUALS ] - input->keys[ KEY_MINUS ] ) * 0.00001; + bias += ( input->keys[ KEY_EQUALS ] - input->keys[ KEY_MINUS ] ) * 0.00001f; bias = max( bias, 0.0f ); { renderer_ub_easy( ub_light_pos_bias, light_pos, bias );