Redrawing tux text after Magic switchin() in case plugin called update_progress_bar().
This commit is contained in:
parent
1e3aba334e
commit
c54d6b31a7
1 changed files with 24 additions and 1 deletions
|
|
@ -22,7 +22,7 @@
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
(See COPYING.txt)
|
(See COPYING.txt)
|
||||||
|
|
||||||
June 14, 2002 - July 10, 2008
|
June 14, 2002 - July 20, 2008
|
||||||
$Id$
|
$Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -1433,6 +1433,7 @@ static void disable_avail_tools(void);
|
||||||
static void enable_avail_tools(void);
|
static void enable_avail_tools(void);
|
||||||
static void reset_avail_tools(void);
|
static void reset_avail_tools(void);
|
||||||
static int compare_dirent2s(struct dirent2 *f1, struct dirent2 *f2);
|
static int compare_dirent2s(struct dirent2 *f1, struct dirent2 *f2);
|
||||||
|
static void redraw_tux_text(void);
|
||||||
static void draw_tux_text(int which_tux, const char *const str,
|
static void draw_tux_text(int which_tux, const char *const str,
|
||||||
int want_right_to_left);
|
int want_right_to_left);
|
||||||
static void draw_tux_text_ex(int which_tux, const char *const str,
|
static void draw_tux_text_ex(int which_tux, const char *const str,
|
||||||
|
|
@ -10184,6 +10185,16 @@ static void draw_tux_text(int which_tux, const char *const str,
|
||||||
draw_tux_text_ex(which_tux, str, want_right_to_left, 0);
|
draw_tux_text_ex(which_tux, str, want_right_to_left, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int latest_tux;
|
||||||
|
const char * latest_tux_text;
|
||||||
|
int latest_r2l;
|
||||||
|
Uint8 latest_locale_text;
|
||||||
|
|
||||||
|
static void redraw_tux_text(void)
|
||||||
|
{
|
||||||
|
draw_tux_text_ex(latest_tux, latest_tux_text, latest_r2l, latest_locale_text);
|
||||||
|
}
|
||||||
|
|
||||||
static void draw_tux_text_ex(int which_tux, const char *const str,
|
static void draw_tux_text_ex(int which_tux, const char *const str,
|
||||||
int want_right_to_left, Uint8 locale_text)
|
int want_right_to_left, Uint8 locale_text)
|
||||||
{
|
{
|
||||||
|
|
@ -10192,6 +10203,11 @@ static void draw_tux_text_ex(int which_tux, const char *const str,
|
||||||
int w;
|
int w;
|
||||||
SDL_Surface * btn;
|
SDL_Surface * btn;
|
||||||
|
|
||||||
|
latest_tux = which_tux;
|
||||||
|
latest_tux_text = str;
|
||||||
|
latest_r2l = want_right_to_left;
|
||||||
|
latest_locale_text = locale_text;
|
||||||
|
|
||||||
|
|
||||||
/* Remove any text-changing timer if one is running: */
|
/* Remove any text-changing timer if one is running: */
|
||||||
control_drawtext_timer(0, "", 0);
|
control_drawtext_timer(0, "", 0);
|
||||||
|
|
@ -18994,10 +19010,17 @@ void magic_switchout(SDL_Surface * last)
|
||||||
void magic_switchin(SDL_Surface * last)
|
void magic_switchin(SDL_Surface * last)
|
||||||
{
|
{
|
||||||
if (cur_tool == TOOL_MAGIC)
|
if (cur_tool == TOOL_MAGIC)
|
||||||
|
{
|
||||||
magic_funcs[magics[cur_magic].handle_idx].switchin(magic_api_struct,
|
magic_funcs[magics[cur_magic].handle_idx].switchin(magic_api_struct,
|
||||||
magics[cur_magic].idx,
|
magics[cur_magic].idx,
|
||||||
magics[cur_magic].mode,
|
magics[cur_magic].mode,
|
||||||
canvas, last);
|
canvas, last);
|
||||||
|
|
||||||
|
/* In case the Magic tool's switchin() called update_progress_bar(),
|
||||||
|
let's put the old Tux text back: */
|
||||||
|
|
||||||
|
redraw_tux_text();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int magic_modeint(int mode)
|
int magic_modeint(int mode)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue