use casts rather than ftoi and itof

This commit is contained in:
Bill Currie 2004-02-03 05:59:51 +00:00
parent 389ff5be1c
commit 1542268d40
3 changed files with 7 additions and 9 deletions

View file

@ -7,7 +7,6 @@
#include "InputLine.h"
#include "Rect.h"
#include "string.h"
#include "math.h"
#include "cbuf.h"
#include "options.h"
#include "servlist.h"
@ -21,6 +20,7 @@ entity self;
.float nextthink;
.float frame;
.void () think;
float () random = #7;
string [6] dot_name = {
"gfx/menudot1.lmp",

View file

@ -29,7 +29,6 @@
#include "menu.h"
#include "system.h"
#include "string.h"
#include "math.h"
#include "draw.h"
#include "cvar.h"
#include "key.h"
@ -82,7 +81,7 @@ CB_video_options =
Cbuf_AddText ("toggle vid_fullscreen\n");
break;
case "crosshair":
selected_crosshair = ftoi (cvar ("crosshair"));
selected_crosshair = (integer) cvar ("crosshair");
selected_crosshair++;
if (selected_crosshair >= 3) {
selected_crosshair = 0;
@ -598,11 +597,11 @@ DRAW_player_options =
// Draw nice color boxes
text_box (x + 192, y + PLAYER_CONF_Y_PAD + 45 - 8, 1, 1);
Draw_Fill (x + 200, y + PLAYER_CONF_Y_PAD + 45, 16, 8,
ftoi (cvar ("topcolor")) * 16 + 8);
(integer) cvar ("topcolor") * 16 + 8);
text_box (x + 192, y + PLAYER_CONF_Y_PAD + 60 - 8, 1, 1);
Draw_Fill (x + 200, y + PLAYER_CONF_Y_PAD + 60, 16, 8,
ftoi (cvar ("bottomcolor")) * 16 + 8);
(integer) cvar ("bottomcolor") * 16 + 8);
opt_cursor (x + 62, y + player_config_cursor_tbl[player_config_cursor]);
return 1;

View file

@ -26,7 +26,6 @@
#include "draw.h"
#include "system.h"
#include "math.h"
#include "string.h"
/*
@ -59,7 +58,7 @@ draw_perc_bar =
perc_val = 0;
}
perc = itof (perc_val) / (100 / itof (size));
perc = (float) perc_val / (100 / (float) size);
/* 128, 129, 130 and 131 are special characters for scrollbars */
Draw_Character (x, y, 128); // draw beginning
@ -67,7 +66,7 @@ draw_perc_bar =
Draw_Character (x + ((i + 1) * 8), y, 129); // draw the borders
}
Draw_Character (x + ((i + 1) * 8), y, 130); // draw last char
Draw_Character (x + ((ftoi (perc) + 1) * 8), y, 131); // draw slider
Draw_Character (x + (((integer) perc + 1) * 8), y, 131); // draw slider
};
/*
@ -125,7 +124,7 @@ to_percentage =
if (val < 0) {
val = 0;
}
perc = ftoi ((val / max_v) * 100);
perc = (integer) ((val / max_v) * 100);
return perc;
};