diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-07-13 13:40:04 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-07-13 13:40:04 +0000 |
| commit | 125d04e51f4e444a38cf038d3ea095d92d3c6dbb (patch) | |
| tree | 2288bbe4b923ab4d695e9f852c177a12f74ea799 /src/game/client/menu.cpp | |
| parent | 7be0ae1b2929a3c5dfedf542bce886deefa0f862 (diff) | |
| download | zcatch-125d04e51f4e444a38cf038d3ea095d92d3c6dbb.tar.gz zcatch-125d04e51f4e444a38cf038d3ea095d92d3c6dbb.zip | |
large rewrite and code cleanup
Diffstat (limited to 'src/game/client/menu.cpp')
| -rw-r--r-- | src/game/client/menu.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/game/client/menu.cpp b/src/game/client/menu.cpp index 12896585..c8c41e4b 100644 --- a/src/game/client/menu.cpp +++ b/src/game/client/menu.cpp @@ -374,13 +374,14 @@ void draw_single_part_button(void *id, const char *text, int checked, float x, f else tileset = tileset_regular; - draw_part((gui_parts_enum)(int)(int *)extra, tileset, x, y, w, h); + + draw_part((gui_parts_enum)((char*)extra-(char*)0), tileset, x, y, w, h); } void draw_menu_button(void *id, const char *text, int checked, float x, float y, float w, float h, void *extra) { gui_composite_box_enum box_style; - if ((int)extra) + if ((int)((char*)extra-(char*)0)) box_style = screen_info_box; else box_style = screen_list_box; @@ -401,7 +402,7 @@ void draw_teewars_button(void *id, const char *text, int checked, float x, float else tileset = tileset_regular; - if ((int)(int *)extra == 1) + if ((int)((char*)extra-(char*)0) == 1) tileset = tileset_inactive; draw_box(button_big_box, tileset, x, y, w, h); @@ -486,7 +487,7 @@ int ui_do_combo_box(void *id, float x, float y, float w, char *lines, int line_c float line_height = 36.0f; int inside = (ui_active_item() == id) ? ui_mouse_inside(x, y, w, line_count * line_height) : ui_mouse_inside(x, y, w, line_height); - int hover_index = (ui_mouse_y() - y) / line_height; + int hover_index = (int)((ui_mouse_y() - y) / line_height); if (ui_active_item() == id) { |