From fab828695cc03e9e10b533d150fe24346cc63b97 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Sun, 27 May 2007 10:54:33 +0000 Subject: [PATCH] removed alot of warnings --- src/engine/client/snd.cpp | 8 ++++---- src/game/client/game_client.cpp | 19 ++++++++++--------- src/game/client/menu.cpp | 4 ++-- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/engine/client/snd.cpp b/src/engine/client/snd.cpp index dd6baa9ac..fa8ba07c1 100644 --- a/src/engine/client/snd.cpp +++ b/src/engine/client/snd.cpp @@ -83,16 +83,16 @@ public: { if(channels[c].data->channels == 1) { - left += (1.0f-(channels[c].pan+1.0f)*0.5f) * channels[c].vol * channels[c].data->data[channels[c].tick]; - right += (channels[c].pan+1.0f)*0.5f * channels[c].vol * channels[c].data->data[channels[c].tick]; + left += (int)((1.0f-(channels[c].pan+1.0f)*0.5f) * channels[c].vol * channels[c].data->data[channels[c].tick]); + right += (int)((channels[c].pan+1.0f)*0.5f * channels[c].vol * channels[c].data->data[channels[c].tick]); channels[c].tick++; } else { float pl = channels[c].pan<0.0f?-channels[c].pan:1.0f; float pr = channels[c].pan>0.0f?1.0f-channels[c].pan:1.0f; - left += pl*channels[c].vol * channels[c].data->data[channels[c].tick]; - right += pr*channels[c].vol * channels[c].data->data[channels[c].tick + 1]; + left += (int)(pl*channels[c].vol * channels[c].data->data[channels[c].tick]); + right += (int)(pr*channels[c].vol * channels[c].data->data[channels[c].tick + 1]); channels[c].tick += 2; } diff --git a/src/game/client/game_client.cpp b/src/game/client/game_client.cpp index 99a04b067..282e4c06f 100644 --- a/src/game/client/game_client.cpp +++ b/src/game/client/game_client.cpp @@ -163,7 +163,7 @@ void sound_vol_pan(const vec2& p, float *vol, float *pan) *pan = 0.0f; *vol = 1.0f; - if(abs(player_to_ev.x) > stereo_separation_deadzone) + if(fabs(player_to_ev.x) > stereo_separation_deadzone) { *pan = stereo_separation * (player_to_ev.x - sign(player_to_ev.x)*stereo_separation_deadzone); if(*pan < -1.0f) *pan = -1.0f; @@ -186,20 +186,21 @@ static void cell_select_ex(int cx, int cy, float x, float y, float w, float h) gfx_quads_setsubset(x/(float)cx,y/(float)cy,(x+w)/(float)cx,(y+h)/(float)cy); } +/* static void cell_select_ex_flip_x(int cx, int cy, float x, float y, float w, float h) { gfx_quads_setsubset((x+w)/(float)cx,y/(float)cy,x /(float)cx,(y+h)/(float)cy); -} +}*/ static void cell_select_ex_flip_y(int cx, int cy, float x, float y, float w, float h) { gfx_quads_setsubset(x/(float)cx,(y+h)/(float)cy,(x+w)/(float)cx,y/(float)cy); } - +/* static void cell_select(int x, int y, int w, int h) { gfx_quads_setsubset(x/16.0f,y/16.0f,(x+w)/16.0f,(y+h)/16.0f); -} +}*/ inline void cell_select_flip_x(int x, int y, int w, int h) { @@ -309,7 +310,7 @@ public: amount = max(1,amount); for (int j = 0; j < amount; j++) { - float a = j/(float)amount-0.5f; + //float a = j/(float)amount-0.5f; item *i = create_i(); if (i) { @@ -1178,8 +1179,8 @@ void modc_newsnapshot() ev_sound *ev = (ev_sound *)data; vec2 p(ev->x, ev->y); int sound = (ev->sound & SOUND_MASK); - bool bstartloop = (ev->sound & SOUND_LOOPFLAG_STARTLOOP) != 0; - bool bstoploop = (ev->sound & SOUND_LOOPFLAG_STOPLOOP) != 0; + //bool bstartloop = (ev->sound & SOUND_LOOPFLAG_STARTLOOP) != 0; + //bool bstoploop = (ev->sound & SOUND_LOOPFLAG_STOPLOOP) != 0; float vol, pan; sound_vol_pan(p, &vol, &pan); @@ -1469,7 +1470,7 @@ static void render_player(obj_player *prev, obj_player *player) cell_select_ex(numcellsx, numcellsy, modifiertexcoord[MODIFIER_TYPE_NINJA].x, modifiertexcoord[MODIFIER_TYPE_NINJA].y, modifiertexcoord[MODIFIER_TYPE_NINJA].w, modifiertexcoord[MODIFIER_TYPE_NINJA].h); angle = getninjaangle(direction, prev, player);//getmeleeangle(direction, prev, player); - vec2 ninjadir = get_direction(angle * 256.0f); + vec2 ninjadir = get_direction((int)(angle * 256.0f)); // TODO: ugly, fix this gfx_quads_setrotation(angle); vec2 p = position + vec2(0,modifierrenderparams[MODIFIER_TYPE_NINJA].offsety)+ ninjadir * modifierrenderparams[MODIFIER_TYPE_NINJA].offsetx; // if attack is active hold it differently and draw speedlines behind us? @@ -1500,7 +1501,7 @@ static void render_player(obj_player *prev, obj_player *player) //angle = getmeleeangle(direction, prev, player); angle = gethammereangle(direction, prev, player); gfx_quads_setrotation(angle); - dir = get_direction(angle * 256.0f); + dir = get_direction((int)(angle * 256.0f)); // TODO: ugly, fix this } else { diff --git a/src/game/client/menu.cpp b/src/game/client/menu.cpp index 5d0cc4739..a2393f5d3 100644 --- a/src/game/client/menu.cpp +++ b/src/game/client/menu.cpp @@ -157,7 +157,7 @@ int ui_do_edit_box(void *id, float x, float y, float w, float h, char *str, int if (ui_active_item() == id) { - char c = keys::last_char(); + int c = keys::last_char(); int k = keys::last_key(); int len = strlen(str); @@ -343,7 +343,7 @@ void refresh_list(server_list *list) read_int(data, &signature); // check signature - if (signature == 'TWSL') + if(signature == 'TWSL') { read_int(data + 4, &master_server_version); read_int(data + 8, &server_count);