medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 602563bb7d561fbe3400a768b3b50a7543568afe
parent 56d642b36cad084949ad73a445228fa9e321bccf
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Thu Dec 29 14:22:09 +0200

More MSVC warnings

Diffstat:
build.bat | 6+++---
hm.cc | 10+++++-----
immediate.cc | 24++++++++++++------------
3 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/build.bat b/build.bat @@ -20,11 +20,11 @@ @cl lz4hc.cc -c %FLAGS% @cl profiler.cc -c %FLAGS% @cl renderer.cc -c %FLAGS% -@cl sha2.cc -c %FLAGS% -W0 +@cl sha2.cc -c %FLAGS% -wd4244 @cl skybox.cc -c %FLAGS% @cl stats.cc -c %FLAGS% -@cl -Tpstb_image.h -c %FLAGS% -DSTB_IMAGE_IMPLEMENTATION -W0 -@cl -Tpstb_truetype.h -c %FLAGS% -DSTB_TRUETYPE_IMPLEMENTATION -W0 +@cl -Tpstb_image.h -c %FLAGS% -DSTB_IMAGE_IMPLEMENTATION -wd4244 +@cl -Tpstb_truetype.h -c %FLAGS% -DSTB_TRUETYPE_IMPLEMENTATION @cl strlcpy.cc -c %FLAGS% @cl terrain_manager.cc -c %FLAGS% @cl text_renderer.cc -c %FLAGS% diff --git a/hm.cc b/hm.cc @@ -194,8 +194,8 @@ extern "C" GAME_FRAME( game_frame ) { game->angles.x += pitch * dt * 2; game->angles.y += yaw * dt * 2; - game->angles.x += input->mouse_dy * 0.01f; - game->angles.y += input->mouse_dx * 0.01f; + game->angles.x += float( input->mouse_dy * 0.01 ); + game->angles.y += float( input->mouse_dx * 0.01 ); const float dsun = ( input->keys[ KEY_EQUALS ] - input->keys[ KEY_MINUS ] ) * dt; game->test_sun += dsun; @@ -377,7 +377,7 @@ extern "C" GAME_FRAME( game_frame ) { char write_buf[ 1400 ]; WriteStream ws( write_buf ); - write_u64( &ws, -1 ); + write_u64( &ws, u64( -1 ) ); write( &ws, game->pos ); sock_send_udp( sock, ws, addr ); @@ -391,8 +391,8 @@ extern "C" GAME_FRAME( game_frame ) { for( const Player * player : players ) { if( player->sid != sid ) { - v3 mins = player->pos - v3( 0.4, 0.4, 1.8 ); - v3 maxs = player->pos + v3( 0.4, 0.4, 0.1 ); + v3 mins = player->pos - v3( 0.4f, 0.4f, 1.8f ); + v3 maxs = player->pos + v3( 0.4f, 0.4f, 0.1f ); immediate_aabb( &imm, mins, maxs, v4( 1, 1, 0, 1 ) ); } } diff --git a/immediate.cc b/immediate.cc @@ -156,20 +156,20 @@ void immediate_arrow( ) { v3 v[] = { // base of stick - v3( -0.05, -0.05, 0 ), - v3( 0.05, -0.05, 0 ), - v3( -0.05, 0.05, 0 ), - v3( 0.05, 0.05, 0 ), + v3( -0.05f, -0.05f, 0.0f ), + v3( 0.05f, -0.05f, 0.0f ), + v3( -0.05f, 0.05f, 0.0f ), + v3( 0.05f, 0.05f, 0.0f ), // top of stick - v3( -0.05, -0.05, 0.6 ), - v3( 0.05, -0.05, 0.6 ), - v3( -0.05, 0.05, 0.6 ), - v3( 0.05, 0.05, 0.6 ), + v3( -0.05f, -0.05f, 0.6f ), + v3( 0.05f, -0.05f, 0.6f ), + v3( -0.05f, 0.05f, 0.6f ), + v3( 0.05f, 0.05f, 0.6f ), // point - v3( 0, 0, 1 ), - v3( 0, 0, 0.6 ), + v3( 0.0f, 0.0f, 1.0f ), + v3( 0.0f, 0.0f, 0.6f ), }; const size_t CONE_SUBDIVISIONS = 8; @@ -178,8 +178,8 @@ void immediate_arrow( // TODO: do the fast sin/cos thing // TODO: make a helper function to do it that fills in an array of floats for( size_t i = 0; i < ARRAY_COUNT( cone ); i++ ) { - float s = sinf( float( i ) / float( ARRAY_COUNT( cone ) ) * 2.0f * M_PI ); - float c = cosf( float( i ) / float( ARRAY_COUNT( cone ) ) * 2.0f * M_PI ); + float s = sinf( float( i ) / float( ARRAY_COUNT( cone ) ) * 2.0f * float( M_PI ) ); + float c = cosf( float( i ) / float( ARRAY_COUNT( cone ) ) * 2.0f * float( M_PI ) ); cone[ i ] = v3( 0.2f * c, 0.2f * s, 0.6f ); }