Fix redraw when no sprites are present. Squash compiler warnings.

svn path=/trunk/netsurf/; revision=2994
This commit is contained in:
Richard Wilson 2006-10-11 23:23:40 +00:00
parent 2227b7c582
commit ab03c67360
2 changed files with 9 additions and 8 deletions

View File

@ -44,6 +44,8 @@ struct progress_bar {
int cur_height; /**< current calculated height */
};
static char progress_animation_sprite[] = "progress\0";
struct wimp_window_base progress_bar_definition = {
{0, 0, 1, 1},
0,
@ -94,11 +96,11 @@ void ro_gui_progress_bar_init(osspriteop_area *icons) {
progress_icon = NULL;
error = xosspriteop_select_sprite(osspriteop_USER_AREA,
progress_bar_definition.sprite_area,
(osspriteop_id)"progress", &progress_icon);
(osspriteop_id)progress_animation_sprite, &progress_icon);
if (!error) {
xosspriteop_read_sprite_info(osspriteop_USER_AREA,
progress_bar_definition.sprite_area,
(osspriteop_id)"progress",
(osspriteop_id)progress_animation_sprite,
&progress_width, &progress_height, 0, 0);
}
}
@ -461,11 +463,11 @@ void ro_gui_progress_bar_redraw_window(wimp_draw *redraw, struct progress_bar *p
tinct_FILL_HORIZONTALLY);
}
} else {
plot.fill(redraw->box.x0 + pb->visible.x0,
redraw->box.y0 + pb->visible.y0,
redraw->box.x0 + pb->visible.x1,
redraw->box.y0 + pb->visible.y1,
0xff000000);
plot.fill((redraw->box.x0 + pb->visible.x0) >> 1,
-(redraw->box.y0 + pb->visible.y0) >> 1,
(redraw->box.x0 + pb->visible.x1) >> 1,
-(redraw->box.y0 + pb->visible.y1) >> 1,
0x000000ff);
}
error = xwimp_get_rectangle(redraw, &more);
if (error) {

View File

@ -29,5 +29,4 @@ void ro_gui_progress_bar_set_value(struct progress_bar *pb, unsigned int value);
unsigned int ro_gui_progress_bar_get_value(struct progress_bar *pb);
void ro_gui_progress_bar_set_range(struct progress_bar *pb, unsigned int range);
unsigned int ro_gui_progress_bar_get_range(struct progress_bar *pb);
void ro_gui_progress_bar_set_visible(struct progress_bar *pb, bool visible);
#endif