Remove unused parameters and fix font drawing invokation in tooltips.cpp.

This commit is contained in:
Guillaume Melquiond 2004-11-27 10:53:22 +00:00
parent d7b3e389b7
commit 95d4f8ce12
4 changed files with 10 additions and 13 deletions

View file

@ -265,11 +265,8 @@ RESULT enter(display& disp, config& game_data, const config& terrain_data, dialo
}
int mousex, mousey;
const int mouse_flags = SDL_GetMouseState(&mousex,&mousey);
const bool left_button = mouse_flags&SDL_BUTTON_LMASK;
tooltips::process(mousex,mousey,left_button);
SDL_GetMouseState(&mousex,&mousey);
tooltips::process(mousex, mousey);
if(dlg != NULL) {
const RESULT res = dlg->process();

View file

@ -156,8 +156,6 @@ void turn_info::turn_slice()
events::raise_process_event();
events::raise_draw_event();
int mousex, mousey;
const int mouse_flags = SDL_GetMouseState(&mousex,&mousey);
const theme::menu* const m = gui_.menu_pressed();
if(m != NULL) {
const SDL_Rect& menu_loc = m->location(gui_.screen_area());
@ -165,7 +163,9 @@ void turn_info::turn_slice()
return;
}
tooltips::process(mousex,mousey,mouse_flags & SDL_BUTTON_LMASK);
int mousex, mousey;
SDL_GetMouseState(&mousex,&mousey);
tooltips::process(mousex, mousey);
const int scroll_threshold = 5;

View file

@ -137,7 +137,7 @@ void add_tooltip(const SDL_Rect& rect, const std::string& message)
current_tooltip = tips.end();
}
void process(int mousex, int mousey, bool lbutton)
void process(int mousex, int mousey)
{
for(std::vector<tooltip>::const_iterator i = tips.begin(); i != tips.end(); ++i) {
if(mousex > i->rect.x && mousey > i->rect.y &&
@ -157,9 +157,9 @@ void process(int mousex, int mousey, bool lbutton)
SDL_Rect draw_text(display* gui, const SDL_Rect& area, int size,
const SDL_Color& colour, const std::string& text,
int x, int y, surface bg)
int x, int y)
{
return font::draw_text(gui,area,size,colour,text,x,y,bg,true);
return font::draw_text(gui, area, size, colour, text, x, y, true);
}
}

View file

@ -17,14 +17,14 @@ struct manager
void clear_tooltips();
void clear_tooltips(const SDL_Rect& rect);
void add_tooltip(const SDL_Rect& rect, const std::string& message);
void process(int mousex, int mousey, bool lbutton);
void process(int mousex, int mousey);
//a function exactly the same as font::draw_text, but will also register
//a tooltip
SDL_Rect draw_text(display* gui, const SDL_Rect& area, int size,
const SDL_Color& colour, const std::string& text,
int x, int y, surface bg=NULL);
int x, int y);
}