mouse_cursor added

This commit is contained in:
p.kosyh 2010-06-07 13:58:16 +00:00
parent 7438761822
commit ccd4f3d267
3 changed files with 14 additions and 3 deletions

View file

@ -2395,8 +2395,9 @@ int game_from_disk(void)
if (old_menu != -1)
game_menu(old_menu);
}
mouse_cursor(1);
g = p = open_file_dialog();
mouse_cursor(0);
if (!p)
return -1;
strcpy(dir, p);

View file

@ -18,6 +18,15 @@ int mouse_focus(void)
return m_focus;
}
int mouse_cursor(int on)
{
if (on)
SDL_ShowCursor(SDL_ENABLE);
else
SDL_ShowCursor(SDL_ENABLE);
return 0;
}
void push_user_event(void (*p) (void*), void *data)
{
SDL_Event event;
@ -72,11 +81,11 @@ int input(struct inp_event *inp, int wait)
if (event.active.gain) {
m_focus = 1;
if (opt_fs)
SDL_ShowCursor(SDL_DISABLE);
mouse_cursor(0);
} else if (event.active.state & SDL_APPMOUSEFOCUS) {
m_focus = 0;
if (opt_fs)
SDL_ShowCursor(SDL_ENABLE); /* is it hack?*/
mouse_cursor(1); /* is it hack?*/
}
}
if (SDL_PeepEvents(&peek, 1, SDL_PEEKEVENT, SDL_EVENTMASK(SDL_ACTIVEEVENT)) > 0)

View file

@ -26,5 +26,6 @@ void input_clear(void);
void push_user_event(void (*p) (void*), void *data);
int mouse_focus(void);
extern int minimized(void);
extern int mouse_cursor(int on);
#endif